css: Rewrite selectors

Previously we kept a Selector object for every "simple selector" (term
from CSS spec). Now we keep one for every match operation. So given the
selector
  ".a b:focus"
we will have 4 elements:
  - pseudoclass ":focus"
  - element "b"
  - match any desendant (the space)
  - class ".a"
Each of those is represented by a "selector class" which is basically
the collection of vfuncs for this selector.
This commit is contained in:
Benjamin Otte 2012-02-16 15:16:18 +01:00
parent eb013767bb
commit 35a0fb09ac
2 changed files with 540 additions and 456 deletions

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@ a > b {
int-property: 42; int-property: 42;
} }
.b { *.b {
int-property: 42; int-property: 42;
} }
@ -50,7 +50,7 @@ a > b {
int-property: 42; int-property: 42;
} }
:hover { *:hover {
int-property: 42; int-property: 42;
} }
@ -150,7 +150,7 @@ a > :hover {
int-property: 42; int-property: 42;
} }
.b:hover { :hover.b {
int-property: 42; int-property: 42;
} }
@ -174,7 +174,7 @@ a > :hover {
int-property: 42; int-property: 42;
} }
#b { *#b {
int-property: 42; int-property: 42;
} }
@ -218,7 +218,7 @@ a > #b {
int-property: 42; int-property: 42;
} }
#b.a { .a#b {
int-property: 42; int-property: 42;
} }
@ -230,7 +230,7 @@ a > #b {
int-property: 42; int-property: 42;
} }
#b:hover { :hover#b {
int-property: 42; int-property: 42;
} }