diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-27 18:04:21 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-07-27 20:18:02 +0000 |
commit | 997fa05d90e9e1bc02615044fd4f042cb212be65 (patch) | |
tree | 8ac2f6d732cc484788897c82b573d5c31de432a2 /src/gui/text/qcssparser_p.h | |
parent | f2922c80a41c5358f49dabe2325356c51fd787be (diff) |
Handle indirect sibling selector
Adds parsing and handling of the indirect sibling selector, this should
mean we can at least parse all CSS3 selectors even if we do not yet
support all of them.
Also adds tests for previously added CSS3 selectors.
Change-Id: I1ce9afb9466044a38bdec167affc21a87837e4a4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/gui/text/qcssparser_p.h')
-rw-r--r-- | src/gui/text/qcssparser_p.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index c40cb508fa..f5cd5395b2 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -561,7 +561,8 @@ struct BasicSelector NoRelation, MatchNextSelectorIfAncestor, MatchNextSelectorIfParent, - MatchNextSelectorIfPreceeds + MatchNextSelectorIfDirectAdjecent, + MatchNextSelectorIfIndirectAdjecent, }; QString elementName; @@ -690,6 +691,7 @@ enum TokenType { PLUS, GREATER, COMMA, + TILDE, STRING, INVALID, @@ -789,7 +791,7 @@ public: inline bool testImport() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("import")); } inline bool testMedia() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("media")); } inline bool testPage() { return testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("page")); } - inline bool testCombinator() { return test(PLUS) || test(GREATER) || test(S); } + inline bool testCombinator() { return test(PLUS) || test(GREATER) || test(TILDE) || test(S); } inline bool testProperty() { return test(IDENT); } bool testTerm(); inline bool testExpr() { return testTerm(); } |