Changeset 172833 in webkit
- Timestamp:
- Aug 21, 2014 1:29:43 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r172832 r172833 1 2014-08-21 Yuki Sekiguchi <yuki.sekiguchi@access-company.com> 2 3 REGRESSION: CSS not() selector does not work when it appears after or within @supports 4 https://bugs.webkit.org/show_bug.cgi?id=136063 5 6 Reviewed by Darin Adler. 7 8 Test that @supports doesn't break "not" pseudo class selector. 9 10 * css3/supports-not-selector-cssom-expected.txt: Added. 11 * css3/supports-not-selector-cssom.html: Added. 12 * css3/supports-not-selector-expected.html: Added. 13 * css3/supports-not-selector.html: Added. 14 1 15 2014-08-21 Beth Dakin <bdakin@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r172832 r172833 1 2014-08-21 Yuki Sekiguchi <yuki.sekiguchi@access-company.com> 2 3 REGRESSION: CSS not() selector does not work when it appears after or within @supports 4 https://bugs.webkit.org/show_bug.cgi?id=136063 5 6 Reviewed by Darin Adler. 7 8 CSSParser changes its m_parsingMode to SupportsMode when it finds 9 "@supports" token. However, the mode will be never changed to 10 NormalMode. This changes parsing algorithm for "not" token forever, 11 and it cannot parse not pseudo class selector. 12 13 When we finish parsing @supports rule, we should change to normal 14 mode. 15 16 @media does the same thing. This patch changed CharacterEndMediaQuery 17 to CharacterEndConditionQuery, and we change parsing mode from 18 SupportsMode to NormalMode when the parser finished to parse 19 @supports rule. 20 21 Like "@-webkit-mediaquery", we cannot use '{' to 22 "@-webkit-supports-condition". Changed "@-webkit-supports-condition" 23 parsing rule and parseSupportsCondition() not to use '{'. 24 25 Tests: css3/supports-not-selector-cssom.html 26 css3/supports-not-selector.html 27 28 * css/CSSGrammar.y.in: 29 * css/CSSParser.cpp: 30 (WebCore::CSSParser::parseSupportsCondition): 31 (WebCore::isCSSLetter): 32 (WebCore::CSSParser::realLex): 33 1 34 2014-08-21 Beth Dakin <bdakin@apple.com> 2 35 -
trunk/Source/WebCore/css/CSSGrammar.y.in
r171008 r172833 392 392 #if ENABLE_CSS3_CONDITIONAL_RULES 393 393 394 webkit_supports_condition: WEBKIT_SUPPORTS_CONDITION_SYM '{'maybe_space supports_condition '}' { parser->m_supportsCondition = $4; } ;394 webkit_supports_condition: WEBKIT_SUPPORTS_CONDITION_SYM WHITESPACE maybe_space supports_condition '}' { parser->m_supportsCondition = $4; } ; 395 395 396 396 #endif -
trunk/Source/WebCore/css/CSSParser.cpp
r172642 r172833 472 472 { 473 473 m_supportsCondition = false; 474 setupParser("@-webkit-supports-condition{ ", string, "} "); 474 // can't use { because tokenizer state switches from supports to initial state when it sees { token. 475 // instead insert one " " (which is WHITESPACE in CSSGrammar.y) 476 setupParser("@-webkit-supports-condition ", string, "} "); 475 477 cssyyparse(this); 476 478 return m_supportsCondition; … … 9982 9984 CharacterNull, 9983 9985 CharacterWhiteSpace, 9984 CharacterEnd MediaQuery,9986 CharacterEndConditionQuery, 9985 9987 CharacterEndNthChild, 9986 9988 CharacterQuote, … … 10061 10063 /* 57 - 9 */ CharacterNumber, 10062 10064 /* 58 - : */ CharacterOther, 10063 /* 59 - ; */ CharacterEnd MediaQuery,10065 /* 59 - ; */ CharacterEndConditionQuery, 10064 10066 /* 60 - < */ CharacterLess, 10065 10067 /* 61 - = */ CharacterOther, … … 10125 10127 /* 121 - y */ CharacterIdentifierStart, 10126 10128 /* 122 - z */ CharacterIdentifierStart, 10127 /* 123 - { */ CharacterEnd MediaQuery,10129 /* 123 - { */ CharacterEndConditionQuery, 10128 10130 /* 124 - | */ CharacterVerticalBar, 10129 10131 /* 125 - } */ CharacterOther, … … 11341 11343 break; 11342 11344 11343 case CharacterEndMediaQuery: 11344 if (m_parsingMode == MediaQueryMode) 11345 case CharacterEndConditionQuery: { 11346 bool isParsingCondition = m_parsingMode == MediaQueryMode; 11347 #if ENABLE(CSS3_CONDITIONAL_RULES) 11348 isParsingCondition = isParsingCondition || m_parsingMode == SupportsMode; 11349 #endif 11350 if (isParsingCondition) 11345 11351 m_parsingMode = NormalMode; 11346 11352 break; 11353 } 11347 11354 11348 11355 case CharacterEndNthChild:
Note: See TracChangeset
for help on using the changeset viewer.