This reverts commit ba44e7a228.
The change was meant to revert to old GTK3 behavior but it actually
broke new GTK4 behavior that is in use where max-width-chars is used to
determine an ideal size, but where we don't want to limit the width to
that size.
So what happens is the reintroduction of GTK3-style lots of whitepsace
bugs, and we really don't want those.
We also don't want to break backwards compat if we can avoid it.
So let's revert this.
The reftest that was made for this purpose has been adapted.
Fixes#4399
If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.
This was broken since 0886ade182
A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.
Fixes#4373
Have square images in the following sizes:
* 20
* 100
* 150
* 200
* 300
and place them in a can-shrink Picture allocated at the sizes:
* 200x100
* 100x200
and set align to center/center.
That's 10 combinations and they should all do the right thing.
We were only applying <binding> elements when the
object is constructed, which can be triggered by
various things (e.g. a <style> element). Defer
this until we reach </object>, so we can be sure
that we pick up all the bindings.
Testcase included.
Fixes: #4147
The GtkBuilder parser constructs the object e.g.
when handling a <binding> element. There may be
more <property> elements after it, which we were
just not applying. Fix that by always applying
property when we see </object>. To do that, we
need to track the applied status per property.
Test included.
Fixes: #4208
Color values must be divisible by 15 to be convertible into U8 and U16
values with the same result. 0x80 is not one of these values, so switch
it to 0x99.
This also switches the rendering code from using gsk_render_node_draw()
to gsk_renderer_render_texture().
Some tests are broken with the GL renderer, so this patch forces the
Cairo renderer until they get fixed.
The test used to test that GtkBox ordered it's children left-to-right in
CSS, no matter the text direction or pack-type.
But there is neither a pack-type anymore nor does GTK4 do that.
So that test has been broken for yers, it just didn't render anything
wrong.
If the alpha channel is zero, it doesn't matter what the values of the
red, green and blue channels are: the pixel is still fully transparent.
On most architectures, fully transparent pixels end up all-zeroes
(fully transparent black), matching what's in the reference PNG file;
but on mips*el the blend-difference and blend-normal tests get all-ones
(fully transparent white) and a test failure.
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4227
Signed-off-by: Simon McVittie <smcv@debian.org>
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
This was comparing the included image-missing icon
with the one in the current icontheme on the test
system. Works fine as long as we don't change
the icons (which we just did). To avoid this, set
the icontheme to hicolor for this test, which does
not have the image-missing icon, so we end up getting
the builtin icon for both ui files.
It seems to make assumptions about text positioning that
are not holding with subpixel positioning. I'm not 100%
sure how that leads to exactly the artifacts that are seen
here, but I am just disabling the test until that is fully
understood.
It makes assumptions about text positioning that are
not holding with subpixel positioning. There is no
guarantee that the next word in a multi-word text
starts on an even pixel boundary, as it does when
you break the text into multiple, separately rendered
blocks.
This is the only non-whitespace difference between the copies in
testsuite/reftests/ and testsuite/gsk/.
Signed-off-by: Simon McVittie <smcv@debian.org>
This function was not doing the right thing.
Once we are doing the right thing and not compare
shadows as unequal, some reftests that inhibit
snapshots for a few frames now hang forever, since
we are no more redrawing unnecessarily. Fix that
with an explicit queue_draw.
It tested that a widget shown after the window was mapped deals with
window resizing appropriately when doing the follow-up allocation. Now,
doing this only allocates both at the same time, as allocation happens
during the frame dispatch.
To do the equivalent now, one would have to write code that shows the
label after the first frame was drawn, and that's not possible via a
reftest, so lets remove it.
Use a single environment variable for everything:
- select the ATContext implementation
- select the test ATContext
- disable ATContext entirely
We use the same pattern as GSK_RENDERER, GTK_DEBUG, etc.
The documentation needs to be updated to include the environment
variable.