Changeset 175432 in webkit
- Timestamp:
- Oct 31, 2014, 4:10:04 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/crash-on-incomplete-webkit-any-expected.txt (added)
-
LayoutTests/fast/css/crash-on-incomplete-webkit-any.html (added)
-
LayoutTests/fast/css/pseudo-escaped-parenthesis-expected.txt (added)
-
LayoutTests/fast/css/pseudo-escaped-parenthesis.html (added)
-
LayoutTests/fast/selectors/invalid-functional-pseudo-class-expected.txt (added)
-
LayoutTests/fast/selectors/invalid-functional-pseudo-class.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSParserValues.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r175421 r175432 1 2014-10-31 Benjamin Poulain <bpoulain@apple.com> 2 3 Pseudo classes with an escaped parenthesis generate invalid rules 4 https://bugs.webkit.org/show_bug.cgi?id=138266 5 6 Reviewed by Antti Koivisto. 7 8 * fast/selectors/invalid-functional-pseudo-class-expected.txt: Added. 9 * fast/selectors/invalid-functional-pseudo-class.html: Added. 10 New test for all the functional pseudo classes. 11 12 * fast/css/crash-on-incomplete-webkit-any-expected.txt: Added. 13 * fast/css/crash-on-incomplete-webkit-any.html: Added. 14 * fast/css/pseudo-escaped-parenthesis-expected.txt: Added. 15 * fast/css/pseudo-escaped-parenthesis.html: Added. 16 Those tests come from blink. Rune solved the same problem a year ago on blink 17 in https://chromiumcodereview.appspot.com/23710067 18 The patch is quite different because blink uses an ancient code base, but the tests 19 can still be useful so I included them here. 20 1 21 2014-10-31 Said Abou-Hallawa <sabouhallawa@apple.com> 2 22 -
trunk/Source/WebCore/ChangeLog
r175427 r175432 1 2014-10-31 Benjamin Poulain <bpoulain@apple.com> 2 3 Pseudo classes with an escaped parenthesis generate invalid rules 4 https://bugs.webkit.org/show_bug.cgi?id=138266 5 6 Reviewed by Antti Koivisto. 7 8 Since the functional pseudo classes are part of the list of PseudoClassAndCompatibilityElement, 9 they could be created by the rule 10 pseudo: 11 ':' IDENT 12 if the parenthesis is escaped. For example, with ":not\\(", the IDENT would be 13 "not(", CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector would 14 find a pseudo class type of PseudoClassNot, and the action would create an invalid 15 CSSSelector for a :not() without nested selector. 16 17 This patch fixes the issue by detecting the function case in 18 CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(). 19 20 An other solution would be to split PseudoClassAndCompatibilityElement into simple pseudo class 21 and functional pseudo classes. We may do that some day but at the moment it is a lot of work with 22 a little benefit. 23 24 Tests: fast/css/crash-on-incomplete-webkit-any.html 25 fast/css/pseudo-escaped-parenthesis.html 26 fast/selectors/invalid-functional-pseudo-class.html 27 28 * css/CSSParserValues.cpp: 29 (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): 30 1 31 2014-10-31 Chris Dumez <cdumez@apple.com> 2 32 -
trunk/Source/WebCore/css/CSSParserValues.cpp
r174535 r175432 209 209 CSSParserSelector* CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString) 210 210 { 211 if (pseudoTypeString.length() && pseudoTypeString[pseudoTypeString.length() - 1] == '(') 212 return nullptr; 213 211 214 PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoTypeString); 212 215 if (pseudoType.pseudoClass != CSSSelector::PseudoClassUnknown) {
Note:
See TracChangeset
for help on using the changeset viewer.