]> Pileus Git - ~andy/gtk/log
~andy/gtk
13 years agocss: Make property parsing functions take a css parser
Benjamin Otte [Wed, 18 May 2011 16:32:22 +0000 (18:32 +0200)]
css: Make property parsing functions take a css parser

Instead of reading a string and then passing that in, let the parse
functions use the full power of the parser.

13 years agocss: Move binding set parsing to strfuncs
Benjamin Otte [Wed, 18 May 2011 16:03:23 +0000 (18:03 +0200)]
css: Move binding set parsing to strfuncs

13 years agocssstringfuncs: Read colors as symbolic colors always
Benjamin Otte [Wed, 18 May 2011 11:15:05 +0000 (13:15 +0200)]
cssstringfuncs: Read colors as symbolic colors always

... and then try to resolve them, so static colors get resolved in
advance, just like it was before.

13 years agosymboliccolor: Allow props == NULL when resolving
Benjamin Otte [Wed, 18 May 2011 10:58:11 +0000 (12:58 +0200)]
symboliccolor: Allow props == NULL when resolving

If props == NULL in gtk_symbolic_color_resolve(), fail sanely for named
colors. The docs used to say it was not allowed to pass NULL for named
color, but that had problems:
1) You do not know if a color was created that way. This is especially
   hard for generic users (like language bindings).
2) It wasn't even true. Colors using other symbolic colors would also
   fail when trying to resolve their named colors, but the docs didn't
   say so.
And because I want to use the function to resolve static colors early
where possible, I changed things.

13 years agocssprovider: Cache if rulesets have inheritable style properties
Benjamin Otte [Wed, 18 May 2011 03:47:18 +0000 (05:47 +0200)]
cssprovider: Cache if rulesets have inheritable style properties

This provides a huge speedup as we only need to preprocess style
properties when they are indeed inherited. This roughly doubles the
performance of the CSS matcher and brings the time taken by
gtk_css_provider_get_style() from 19% to 7% in my favorite benchmark.

13 years agocssprovider: Keep two hash tables per ruleset
Benjamin Otte [Wed, 18 May 2011 02:36:43 +0000 (04:36 +0200)]
cssprovider: Keep two hash tables per ruleset

One for the style properties, one for the widget style properties.
This way we can make one hash table by pspec which means we don't have
to repeat the pspec lookup.

13 years agocssprovider: Add a new setter for rulesets
Benjamin Otte [Wed, 18 May 2011 02:30:51 +0000 (04:30 +0200)]
cssprovider: Add a new setter for rulesets

We now have set-by-pspec (which is used for normal style properties) and
set-by-name (which is used by widget properties).

13 years agocssprovider: Refactor handling of rulesets
Benjamin Otte [Wed, 18 May 2011 02:20:05 +0000 (04:20 +0200)]
cssprovider: Refactor handling of rulesets

Keep rulesets as an on-stack/heap structure instead of allocating all
instances separately.
Also, pass a ruleset to the ruleset parser, so we can make the ruleset
parser do lots of fancy things that might be useful for performance.

13 years agocssprovider: Refactor code to have a gtk_css_ruleset_matches()
Benjamin Otte [Tue, 17 May 2011 20:11:50 +0000 (22:11 +0200)]
cssprovider: Refactor code to have a gtk_css_ruleset_matches()

13 years agocssprovider: Rename "SelectorStyleInfo" to "Ruleset"
Benjamin Otte [Tue, 17 May 2011 20:04:40 +0000 (22:04 +0200)]
cssprovider: Rename "SelectorStyleInfo" to "Ruleset"

No code changes, just clarification of the name

13 years agocss: Implement inherit properties
Benjamin Otte [Tue, 17 May 2011 13:01:59 +0000 (15:01 +0200)]
css: Implement inherit properties

Huge performance hit (slows down things roughly by a factor of 3), but
necessary for CSS conformance and for implementing "inherit" and
percentages.

13 years agoreftests: Check style property order
Benjamin Otte [Mon, 16 May 2011 21:52:19 +0000 (23:52 +0200)]
reftests: Check style property order

Ensure that style properties are read in the correct order, by having a
property twice with vastly different values.

13 years agocss: Refactor code to do property lookups earlier
Benjamin Otte [Mon, 16 May 2011 21:37:29 +0000 (23:37 +0200)]
css: Refactor code to do property lookups earlier

We want to ook up the property in the CSS parser, so we can do fancy
things with it. We currently don't but we want to later.

13 years agostyleproperties: Speed up by not optimizing
Benjamin Otte [Mon, 16 May 2011 20:46:59 +0000 (22:46 +0200)]
styleproperties: Speed up by not optimizing

g_quark_try_string() takes a lock and then does a hashtable lookup. So
just using a string hash table for properties is faster.

13 years agostyleproperties: Speed up style_property_lookup()
Benjamin Otte [Mon, 16 May 2011 20:35:21 +0000 (22:35 +0200)]
styleproperties: Speed up style_property_lookup()

Use the already existing bsearch version instead of iterating the array
manually.

13 years agostyleproperties: Use the pspec as the hash table key
Benjamin Otte [Mon, 16 May 2011 20:22:42 +0000 (22:22 +0200)]
styleproperties: Use the pspec as the hash table key

The code used the quarked name before, but when we already have the
pspec we want to have a lookup that does not involve quarking. And
lookup is equally fast if we only have the name.

13 years agocss: Make _gtk_css_selector_matches() take a path length
Benjamin Otte [Mon, 16 May 2011 18:20:55 +0000 (20:20 +0200)]
css: Make _gtk_css_selector_matches() take a path length

This will be necessary when handling inherit.

13 years agocssprovider: Simplify code
Benjamin Otte [Mon, 16 May 2011 17:54:57 +0000 (19:54 +0200)]
cssprovider: Simplify code

Don't go through an intermediate array when matching styles.

13 years agostyleproperties: Mark "color" and "font" as inherit
Benjamin Otte [Mon, 16 May 2011 17:42:27 +0000 (19:42 +0200)]
styleproperties: Mark "color" and "font" as inherit

Keeping it identical to CSS 2.1 again

13 years agoAPI: Add API to set style properties to be inherit
Benjamin Otte [Mon, 16 May 2011 17:31:47 +0000 (19:31 +0200)]
API: Add API to set style properties to be inherit

The API is not used anywhere yet.

13 years agocssprovider: Speed up gtk_widget_style_get() property lookups
Benjamin Otte [Mon, 16 May 2011 15:55:50 +0000 (17:55 +0200)]
cssprovider: Speed up gtk_widget_style_get() property lookups

Previously we got the list of all matching rules and then iterated it to
find the first one that had the property. Now we look while matching
rules, so we don't lookup rules that we don't need.

13 years agocss: Don't query type for regions
Benjamin Otte [Mon, 16 May 2011 02:31:07 +0000 (04:31 +0200)]
css: Don't query type for regions

Regions are regions and don't match by type.

13 years agoreftests: Add a test ensuring selectors don't match children
Benjamin Otte [Sun, 15 May 2011 11:27:19 +0000 (13:27 +0200)]
reftests: Add a test ensuring selectors don't match children

Previously, the selector "Foo" would not only match Foo widgets, but
also all widgets that are descendants of Foo.

13 years agoreftests: Add a test for descendant CSS selectors match
Benjamin Otte [Sun, 15 May 2011 11:24:10 +0000 (13:24 +0200)]
reftests: Add a test for descendant CSS selectors match

In widget hierarchy like "Foo Bar Bar Baz", we want the selector "Foo >
Bar Baz" to match, because it matches the elements 1, 2 and 4.
Previously, the selector only matches the Bar at position 3 and then
failed because it wasn't preceded by a Foo.

13 years agoreftests: Add a test that checks that * matches regions
Benjamin Otte [Sun, 15 May 2011 11:20:51 +0000 (13:20 +0200)]
reftests: Add a test that checks that * matches regions

13 years agoreftests: Unset background-image in CSS of test
Benjamin Otte [Sun, 15 May 2011 11:05:55 +0000 (13:05 +0200)]
reftests: Unset background-image in CSS of test

Otherwise the test screws up when it's set

13 years agoreftests: Add a check for matching regions only once
Benjamin Otte [Sun, 15 May 2011 00:55:22 +0000 (02:55 +0200)]
reftests: Add a check for matching regions only once

13 years agotests: Add a test for enum values
Benjamin Otte [Sat, 14 May 2011 23:22:24 +0000 (01:22 +0200)]
tests: Add a test for enum values

13 years agocss: Raised SYNTAX error when enum value can't be parsed
Benjamin Otte [Sun, 15 May 2011 13:55:13 +0000 (15:55 +0200)]
css: Raised SYNTAX error when enum value can't be parsed

13 years agoreftests: Add a test for matching by class
Benjamin Otte [Sat, 14 May 2011 23:28:17 +0000 (01:28 +0200)]
reftests: Add a test for matching by class

13 years agoreftests: Add a test for matching by name
Benjamin Otte [Sat, 14 May 2011 22:34:43 +0000 (00:34 +0200)]
reftests: Add a test for matching by name

13 years agoreftests: Add a test for matching by subtype
Benjamin Otte [Sat, 14 May 2011 11:36:00 +0000 (13:36 +0200)]
reftests: Add a test for matching by subtype

13 years agoreftests: Add test to check that matching by type works
Benjamin Otte [Sat, 14 May 2011 11:35:19 +0000 (13:35 +0200)]
reftests: Add test to check that matching by type works

13 years agotests: Add a test to ensure we handle unknown pseudo-classes correctly
Benjamin Otte [Sat, 14 May 2011 22:17:04 +0000 (00:17 +0200)]
tests: Add a test to ensure we handle unknown pseudo-classes correctly

1) We want to throw an unknown value
2) We want to skip the whole rule

13 years agotests: Add a test for all selector combination
Benjamin Otte [Sat, 14 May 2011 22:15:25 +0000 (00:15 +0200)]
tests: Add a test for all selector combination

The test contains an error where we complain about a duplicate value for
":hover:hover"

13 years agocss: No more special code for regions
Benjamin Otte [Sat, 14 May 2011 21:54:37 +0000 (23:54 +0200)]
css: No more special code for regions

Just treat regions the same as elements.

13 years agocss: Rewrite selectors
Benjamin Otte [Sat, 14 May 2011 11:27:31 +0000 (13:27 +0200)]
css: Rewrite selectors

Selectors now go into their own C file. The new selectors are modeled a
lot closer to the CSS spec. In particular the specificity computation
matches CSS 2.1 exactly.

For details about the why, see also:
http://mail.gnome.org/archives/gtk-devel-list/2011-May/msg00061.html
https://bugzilla.gnome.org/show_bug.cgi?id=649798

13 years agocssprovider: Remove a bunch of commented-out code
Benjamin Otte [Fri, 13 May 2011 14:21:20 +0000 (16:21 +0200)]
cssprovider: Remove a bunch of commented-out code

The code was only kept for reference while writing the new parser, it's
not necessary anhymore.

13 years agotests: Be more verbose in error messages.
Benjamin Otte [Fri, 15 Apr 2011 14:21:25 +0000 (16:21 +0200)]
tests: Be more verbose in error messages.

Also, it makes it easier to copy/paste diffs from the message log...

13 years agotests: Add test that ensures we properly parse the color red
Benjamin Otte [Thu, 14 Apr 2011 19:13:48 +0000 (21:13 +0200)]
tests: Add test that ensures we properly parse the color red

13 years agotests: Add another parsing test from the css spec
Benjamin Otte [Thu, 14 Apr 2011 15:48:06 +0000 (17:48 +0200)]
tests: Add another parsing test from the css spec

13 years agotests: Add parsing test from the css spec
Benjamin Otte [Thu, 14 Apr 2011 15:44:31 +0000 (17:44 +0200)]
tests: Add parsing test from the css spec

13 years agotests: Make the parser fail without assertions
Benjamin Otte [Thu, 14 Apr 2011 11:48:06 +0000 (13:48 +0200)]
tests: Make the parser fail without assertions

Use the new g_test_fail() function. This way, the testsuite usually
doesn't crash, but actually finishes.

13 years agocss: Rewrite the parser
Benjamin Otte [Thu, 14 Apr 2011 02:47:18 +0000 (04:47 +0200)]
css: Rewrite the parser

Instead of relying on GScanner and its idea of syntax, code up a parser
that obeys the CSS spec.
This also has the great side effect of reporting correct line numbers
and positions.

Also included is a reorganization of the returned error values. Instead
of error values describing what type of syntax error was returned, the
code just returns SYNTAX_ERROR. Other messages exist for when actual
values don't work or when errors shouldn't be fatal due to backwards
compatibility.

13 years agotests: Add a test for importing nonexistant files
Benjamin Otte [Tue, 12 Apr 2011 02:35:22 +0000 (04:35 +0200)]
tests: Add a test for importing nonexistant files

13 years agotests: Add tests for cyclic imports
Benjamin Otte [Tue, 12 Apr 2011 02:34:02 +0000 (04:34 +0200)]
tests: Add tests for cyclic imports

13 years agotests: Add test for recursively importing an identical file
Benjamin Otte [Tue, 12 Apr 2011 02:28:30 +0000 (04:28 +0200)]
tests: Add test for recursively importing an identical file

13 years agocssprovider: Don't hardcode strings anymore
Benjamin Otte [Tue, 12 Apr 2011 02:26:36 +0000 (04:26 +0200)]
cssprovider: Don't hardcode strings anymore

13 years agocssprovider: Add support for strings
Benjamin Otte [Tue, 12 Apr 2011 02:26:10 +0000 (04:26 +0200)]
cssprovider: Add support for strings

13 years agocssprovider: Parse strings as identifiers when parsing property values
Benjamin Otte [Tue, 12 Apr 2011 01:22:22 +0000 (03:22 +0200)]
cssprovider: Parse strings as identifiers when parsing property values

13 years agocssprovider: Add recursion checks for @import
Benjamin Otte [Tue, 12 Apr 2011 00:50:25 +0000 (02:50 +0200)]
cssprovider: Add recursion checks for @import

This is pretty important, because otherwise recursions cause crashes.
And if you accidentally change your theme to one that crashes on load,
all your gonna SEGV and then on reboot, gdm tries to load the theme...

13 years agocssprovider: Allow storing the parent stylesheet
Benjamin Otte [Tue, 12 Apr 2011 00:06:08 +0000 (02:06 +0200)]
cssprovider: Allow storing the parent stylesheet

13 years agocssprovider: Don't fail if an import doesn't work
Benjamin Otte [Mon, 11 Apr 2011 23:50:07 +0000 (01:50 +0200)]
cssprovider: Don't fail if an import doesn't work

13 years agocssprovider: Reimplement gtk_css_provider_load_from_path()
Benjamin Otte [Mon, 11 Apr 2011 23:22:16 +0000 (01:22 +0200)]
cssprovider: Reimplement gtk_css_provider_load_from_path()

Call gtk_css_provider_load_from_file() instead of the internal function.
This has two advantages:
1) It simplifies the code a lot
2) It gets rid of GMappedFile usage. GMappedFile does not work
   everywhere, so this is finally portable.

13 years agocssprovider: Make @import use the new load_internal() func
Benjamin Otte [Mon, 11 Apr 2011 23:10:13 +0000 (01:10 +0200)]
cssprovider: Make @import use the new load_internal() func

13 years agocssprovider: Make load_internal() load the contents
Benjamin Otte [Mon, 11 Apr 2011 18:08:57 +0000 (20:08 +0200)]
cssprovider: Make load_internal() load the contents

This way, we achieve two things:
1) We can unify file loading to one location
2) We can emit the error from file loading using the parsing-error
   signal. This is very useful for @import handling in particular.

13 years agocssprovider: Introduce gtk_css_provider_take_error_full()
Benjamin Otte [Mon, 11 Apr 2011 18:06:39 +0000 (20:06 +0200)]
cssprovider: Introduce gtk_css_provider_take_error_full()

Emits the error without the need for a scanner. Also simplifies
gtk_css_provider_take_error() because we now can assert an available
scanner at all times.

13 years agocssprovider: More error handling into load_internal()
Benjamin Otte [Mon, 11 Apr 2011 17:57:42 +0000 (19:57 +0200)]
cssprovider: More error handling into load_internal()

Now the parsing functions starting at parse_stylesheet() don't have to
care about errors anymore.

13 years agocssprovider: Add a load_internal function that all loads chain to
Benjamin Otte [Mon, 11 Apr 2011 17:55:34 +0000 (19:55 +0200)]
cssprovider: Add a load_internal function that all loads chain to

13 years agotests: Order files by name before adding them as tests
Benjamin Otte [Mon, 11 Apr 2011 15:57:50 +0000 (17:57 +0200)]
tests: Order files by name before adding them as tests

Ensures that the order of tests is not dependant on your hard disk.

13 years agocssprovider: Keep base url in the scanner
Benjamin Otte [Mon, 11 Apr 2011 15:30:01 +0000 (17:30 +0200)]
cssprovider: Keep base url in the scanner

And provide a nice function to query it. Simplifies a bunch of code.

13 years agocssprovider: Move properties to scanner constructor
Benjamin Otte [Mon, 11 Apr 2011 14:48:00 +0000 (16:48 +0200)]
cssprovider: Move properties to scanner constructor

So we can set them in one place.

13 years agocssprovider: Don't store scanner in the struct
Benjamin Otte [Mon, 11 Apr 2011 01:14:23 +0000 (03:14 +0200)]
cssprovider: Don't store scanner in the struct

Instead, create scanners whenever we actually parse stuff.

13 years agocssprovider: Get rid of gtk_css_provider_reset_parser()
Benjamin Otte [Mon, 11 Apr 2011 00:37:24 +0000 (02:37 +0200)]
cssprovider: Get rid of gtk_css_provider_reset_parser()

Instead call gtk_css_scanner_reset(). There is nothing else we could
need to do.

13 years agocssprovider: Keep track of passed in error differently
Benjamin Otte [Mon, 11 Apr 2011 00:32:26 +0000 (02:32 +0200)]
cssprovider: Keep track of passed in error differently

Instead of having an error member in the CSS provider's private struct,
connect a signal handler when an error is passed in. This has two
advantages:
1) It makes the code clearer as we don't have to keep track of an error
   member anywhere.
2) It causes a non-emission of the g_warning() when an error was passed
   in, because it only triggers when no signal handlers are connected.
   So we get identical behavior to GTK 3.0 where warnings where only
   emitted when no error was passed in.

13 years agocssprovider: Do error handling differently
Benjamin Otte [Mon, 11 Apr 2011 00:18:21 +0000 (02:18 +0200)]
cssprovider: Do error handling differently

Instead of aborting a parse whenever we encounter an error, parse to the
end. But if a GError was passed in, reset the provider completely as if
nothing had been parsed.

13 years agocssprovider: Emit a g_warning() when a css file is erroneous
Benjamin Otte [Sun, 10 Apr 2011 23:51:49 +0000 (01:51 +0200)]
cssprovider: Emit a g_warning() when a css file is erroneous

... and no other error handler is active. See the source code comment
for the reasoning.

13 years agocssprovider: No need to restore after @import parsing
Benjamin Otte [Sun, 10 Apr 2011 23:33:26 +0000 (01:33 +0200)]
cssprovider: No need to restore after @import parsing

With the recent changes, this just resets the error, and we don't the
error reset from subfile parsing.

13 years agocssprovider: Store current properties and selectors in scanner
Benjamin Otte [Sun, 10 Apr 2011 23:28:00 +0000 (01:28 +0200)]
cssprovider: Store current properties and selectors in scanner

They don't belong in the css provider

13 years agocssprovider: Use scanner variable instead of priv->scanner
Benjamin Otte [Sun, 10 Apr 2011 23:25:27 +0000 (01:25 +0200)]
cssprovider: Use scanner variable instead of priv->scanner

13 years agocssprovider: Pass scanner argument explicitly to error functions
Benjamin Otte [Sun, 10 Apr 2011 13:22:07 +0000 (15:22 +0200)]
cssprovider: Pass scanner argument explicitly to error functions

13 years agocssprovider: Update the scope modifying functions
Benjamin Otte [Sun, 10 Apr 2011 02:51:55 +0000 (04:51 +0200)]
cssprovider: Update the scope modifying functions

Make them take the scanner as an argument, as that's what gets changed,
not the CssProvider.

13 years agocssprovider: track state in the scanner
Benjamin Otte [Sun, 10 Apr 2011 01:51:43 +0000 (03:51 +0200)]
cssprovider: track state in the scanner

This way, we don't have to do magic copies when we create a new scanner
for a subfile.

13 years agocssprovider: Add a private structure to the scanner
Benjamin Otte [Sun, 10 Apr 2011 01:39:52 +0000 (03:39 +0200)]
cssprovider: Add a private structure to the scanner

So far, it's unused

13 years agocssprovider: Add a custom gtk_css_scanner_destroy() function
Benjamin Otte [Sun, 10 Apr 2011 01:35:19 +0000 (03:35 +0200)]
cssprovider: Add a custom gtk_css_scanner_destroy() function

So far, it does nothing

13 years agocssprovider: Pass the scanner explicitly to parse_stylesheet()
Benjamin Otte [Sun, 10 Apr 2011 01:16:04 +0000 (03:16 +0200)]
cssprovider: Pass the scanner explicitly to parse_stylesheet()

This is the first step in decoupling the scanner from the provider.

13 years agocssprovider: No need to set user data anymore
Benjamin Otte [Sun, 10 Apr 2011 00:20:17 +0000 (02:20 +0200)]
cssprovider: No need to set user data anymore

13 years agotests: Make css-parser test take files as argument
Benjamin Otte [Sat, 9 Apr 2011 23:53:43 +0000 (01:53 +0200)]
tests: Make css-parser test take files as argument

Takes the css files to be tested as argument and runs with it.

13 years agotests: Add a test for border parsing
Benjamin Otte [Sat, 9 Apr 2011 23:53:31 +0000 (01:53 +0200)]
tests: Add a test for border parsing

13 years agotests: Add new test checking weird behavior for declarations
Benjamin Otte [Sat, 9 Apr 2011 23:52:58 +0000 (01:52 +0200)]
tests: Add new test checking weird behavior for declarations

13 years agocssprovider: Clean up declaration parser to conform to more tests
Benjamin Otte [Sat, 9 Apr 2011 23:48:55 +0000 (01:48 +0200)]
cssprovider: Clean up declaration parser to conform to more tests

The tests will follow with the next commits

13 years agocssprovider: Rework declaration parsing loop
Benjamin Otte [Sat, 9 Apr 2011 16:18:02 +0000 (18:18 +0200)]
cssprovider: Rework declaration parsing loop

The new loop can cope better with invalid identifiers and manages to
resume parsing properly.

13 years agotests: Add CSS integer parsing tests
Benjamin Otte [Sat, 9 Apr 2011 11:49:41 +0000 (13:49 +0200)]
tests: Add CSS integer parsing tests

13 years agotests: Add test for booleans to CSS tests
Benjamin Otte [Sat, 9 Apr 2011 11:48:45 +0000 (13:48 +0200)]
tests: Add test for booleans to CSS tests

13 years agocssprovider: Don't fail with invalid syntax when parsing a value
Benjamin Otte [Fri, 8 Apr 2011 15:17:27 +0000 (17:17 +0200)]
cssprovider: Don't fail with invalid syntax when parsing a value

Instead, raise a PROPERTY_VALUE error, find the next semicolon or
closing bracket and resume parsing.

13 years agotests: (Try to) print the actual enum value in the errors file
Benjamin Otte [Fri, 8 Apr 2011 14:59:17 +0000 (16:59 +0200)]
tests: (Try to) print the actual enum value in the errors file

Instead of gtk-some-error-quark 5, print
GTK_SOME_ERROR_SOMETHING_FAILED.

13 years agotest: Add a bunch of default properties to the CSS parser
Benjamin Otte [Fri, 8 Apr 2011 14:42:04 +0000 (16:42 +0200)]
test: Add a bunch of default properties to the CSS parser

One of each type, so that we can test the parsing of them.

13 years agocss: Overhaul value parsing
Benjamin Otte [Fri, 8 Apr 2011 14:08:28 +0000 (16:08 +0200)]
css: Overhaul value parsing

Value parsing only sometimes emitted errors. Sometimes it didn't emit
errors but ignored the value, sometimes it took a default, sometimes it
converted it to something it deemed suitable.

While refactoring, I moved the whole GValue <=> char * conversion
routines to a separate file, to make navigating the core css provider
easier.

13 years agocssprovider: Remove now useless variables
Benjamin Otte [Fri, 8 Apr 2011 00:57:33 +0000 (02:57 +0200)]
cssprovider: Remove now useless variables

13 years agocssprovider: Remove scanner_report_warning() function
Benjamin Otte [Fri, 8 Apr 2011 00:41:15 +0000 (02:41 +0200)]
cssprovider: Remove scanner_report_warning() function

That function does superbad stuff just to print out something on stderr.
Don't do superbad stuff.

13 years agotests: Make CSS parser pass NULL as error.
Benjamin Otte [Fri, 8 Apr 2011 14:12:35 +0000 (16:12 +0200)]
tests: Make CSS parser pass NULL as error.

We are trapping errors via signals now.

13 years agotests: Check errors in css test
Benjamin Otte [Thu, 7 Apr 2011 23:32:13 +0000 (01:32 +0200)]
tests: Check errors in css test

13 years agotests: Change the way the code does diffs
Benjamin Otte [Thu, 7 Apr 2011 22:50:32 +0000 (00:50 +0200)]
tests: Change the way the code does diffs

Use a temp file for intermediate storage and properly unlink that
tempfile after the diff is done.

13 years agocssprovider: use INVALID_SYNTAX for unexpected token error
Benjamin Otte [Thu, 7 Apr 2011 22:18:38 +0000 (00:18 +0200)]
cssprovider: use INVALID_SYNTAX for unexpected token error

13 years agocssprovider: Change declaration parsing for error reporting
Benjamin Otte [Thu, 7 Apr 2011 22:08:10 +0000 (00:08 +0200)]
cssprovider: Change declaration parsing for error reporting

Previously, we only checked for errors after parsing the full
declaration. Now we detect errors with the property before even
attempting to parse its value.
The benefit here is that the error reporting reports the correct line
and position numbers.

13 years agoAPI: cssprovider: Add more error codes
Benjamin Otte [Thu, 7 Apr 2011 22:07:55 +0000 (00:07 +0200)]
API: cssprovider: Add more error codes

13 years agoAPI: cssprovider: Make error a signal
Benjamin Otte [Thu, 7 Apr 2011 15:26:47 +0000 (17:26 +0200)]
API: cssprovider: Make error a signal

13 years agocssprovider: Handle errors completely via new error functions
Benjamin Otte [Thu, 7 Apr 2011 12:03:08 +0000 (14:03 +0200)]
cssprovider: Handle errors completely via new error functions

13 years agocssprovider: Provide better API to set errors
Benjamin Otte [Thu, 7 Apr 2011 11:37:03 +0000 (13:37 +0200)]
cssprovider: Provide better API to set errors

13 years agocssprovider: Have a private error variable
Benjamin Otte [Thu, 7 Apr 2011 10:38:53 +0000 (12:38 +0200)]
cssprovider: Have a private error variable