We're passing integers without validating their size, and newer GCC are
very cross about it, with warnings like:
warning: argument 1 range [18446744071562067968, 18446744073709551615]
exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
We should check we're not overflowing the allocation size, by limiting
the range of values we can use.
First of all, we need to use `gsize` instead of a random `int`, since we're
allocating data.
Additionally, we need to check that the multiplication that computes the
size of the allocation doesn't overflow the maximum value of a `gsize`.
They should be fixeed before 4.0 but the fixes are more involved. And we
want to start running the existing tests on CI, because they break
regularly and we want to catch that.
* :nth-child(first) => :first-child
* :nth-child(last) => :last-child
* Add semicolons at end of declarations
* Remove spaces between color functions (shade, alpha, ...) and args
That test was cool in 2011, but hasn't been updated or used since then
because its features are now part of widget-factory and the inspector.
So let's remove it.
Instead of just checking that the line of the error message is correct,
assert that start and end position are on the correct character offset.
Also fix all the tests to conform to this.
Make the test use an actual integer property that accepts negative
numbers (opacity) instead of one that wants units (margin-top) or
can't deal with negative numbers (everything else).
Emit all errors via the parser, don't try to have a custom error
handling machinery.
The only exception is the initial file load error - we need to do that
one directly, because there is no parser.
This commit is still way too big, but I couldn't make it smaller.
It transitions the old CSS parser to the new parser. CSS parsing is now
tokenized, everything else is probably still buggy.
This function is a (private) function to parse a GdkRGBA accoridng to
the CSS specs. We should probably use it for gdk_rgba_parse(), but that
would change the syntax we accept there...
This also introduces a dependency of libgdk on libgtkcss.
So far, no users for this function exist.
We can't try to get an integer because ultimately integer getters
support the same shenanigans that numbers and percentages do with calc()
and whatnot.
As part of that, adapt the syntax from
-gtk-scaled( [<image>, <int>?]# )
to
-gtk-scaled( [<image> <int>?]# )
because the commas should be used to separate distinct elements.
Note that almost nobody specifies the scale anyway.