Changeset 207513 in webkit
- Timestamp:
- Oct 18, 2016 6:06:45 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207511 r207513 1 2016-10-18 Dave Hyatt <hyatt@apple.com> 2 3 [CSS Parser] Enable basic parser testing. 4 https://bugs.webkit.org/show_bug.cgi?id=163639 5 6 Reviewed by Dean Jackson. 7 8 * css/SelectorChecker.cpp: 9 (WebCore::SelectorChecker::matchRecursively): 10 Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this 11 eventually, but it's better to not assert on that for now. 12 13 * css/parser/CSSParserValues.cpp: 14 (WebCore::CSSParserSelector::isHostPseudoSelector): 15 Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert. 16 17 * css/parser/CSSParserValues.h: 18 (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching): 19 Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert. 20 21 * css/parser/CSSPropertyParser.cpp: 22 (WebCore::CSSPropertyParser::addExpandedPropertyForValue): 23 copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties. 24 25 (WebCore::parseSingleShadow): 26 (WebCore::CSSPropertyParser::consumeFont): 27 Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems 28 some of the font properties should be reset as part of this shorthand but aren't. 29 ' 30 * css/parser/CSSPropertyParserHelpers.cpp: 31 (WebCore::CSSPropertyParserHelpers::consumeInteger): 32 Just return a number for now instead of the parser_integer type. 33 34 * css/parser/CSSSelectorParser.cpp: 35 (WebCore::CSSSelectorParser::consumePseudo): 36 Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type. 37 1 38 2016-10-18 Ryosuke Niwa <rniwa@webkit.org> 2 39 -
trunk/Source/WebCore/css/SelectorChecker.cpp
r205660 r207513 458 458 case CSSSelector::ShadowSlot: 459 459 // FIXME-NEWPARSER: Have to implement these. 460 ASSERT_NOT_REACHED();460 // ASSERT_NOT_REACHED(); 461 461 return MatchResult::fails(Match::SelectorFailsCompletely); 462 462 } -
trunk/Source/WebCore/css/parser/CSSParserValues.cpp
r207396 r207513 532 532 bool CSSParserSelector::isHostPseudoSelector() const 533 533 { 534 return pseudoClassType() == CSSSelector::PseudoClassHost;535 } 536 537 } 538 534 return match() == CSSSelector::PseudoClass && pseudoClassType() == CSSSelector::PseudoClassHost; 535 } 536 537 } 538 -
trunk/Source/WebCore/css/parser/CSSParserValues.h
r205790 r207513 257 257 258 258 // FIXME-NEWPARSER: Missing "shadow" 259 bool needsImplicitShadowCombinatorForMatching() const { return pseudoElementType() == CSSSelector::PseudoElementWebKitCustom || pseudoElementType() == CSSSelector::PseudoElementUserAgentCustom || pseudoElementType() == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed || pseudoElementType() == CSSSelector::PseudoElementCue || pseudoElementType() == CSSSelector::PseudoElementSlotted; }259 bool needsImplicitShadowCombinatorForMatching() const { return match() == CSSSelector::PseudoElement && (pseudoElementType() == CSSSelector::PseudoElementWebKitCustom || pseudoElementType() == CSSSelector::PseudoElementUserAgentCustom || pseudoElementType() == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed || pseudoElementType() == CSSSelector::PseudoElementCue || pseudoElementType() == CSSSelector::PseudoElementSlotted); } 260 260 261 261 CSSParserSelector* tagHistory() const { return m_tagHistory.get(); } -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r207507 r207513 229 229 const CSSPropertyID* longhands = shorthand.properties(); 230 230 for (unsigned i = 0; i < shorthandLength; ++i) 231 addProperty(longhands[i], property, WTFMove(value), important);231 addProperty(longhands[i], property, value.copyRef(), important); 232 232 } 233 233 … … 1293 1293 } 1294 1294 } 1295 return CSSShadowValue::create(horizontalOffset.releaseNonNull(), verticalOffset.releaseNonNull(), blurRadius.releaseNonNull(), 1296 spreadDistance.releaseNonNull(), style.releaseNonNull(), color.releaseNonNull()); 1295 1296 // We pass RefPtrs, since they can actually be null. 1297 return CSSShadowValue::create(WTFMove(horizontalOffset), WTFMove(verticalOffset), WTFMove(blurRadius), WTFMove(spreadDistance), WTFMove(style), WTFMove(color)); 1297 1298 } 1298 1299 … … 3472 3473 RefPtr<CSSPrimitiveValue> fontVariantCaps; 3473 3474 RefPtr<CSSPrimitiveValue> fontWeight; 3474 RefPtr<CSSPrimitiveValue> fontStretch;3475 // FIXME-NEWPARSER: Implement. RefPtr<CSSPrimitiveValue> fontStretch; 3475 3476 while (!m_range.atEnd()) { 3476 3477 CSSValueID id = m_range.peek().id(); … … 3491 3492 continue; 3492 3493 } 3493 if (!fontStretch && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStretch, id, m_context.mode)) 3494 /* FIXME-NEWPARSER: Implement 3495 if (!fontStretch && CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStretch, id, m_context.mode)) 3494 3496 fontStretch = consumeIdent(m_range); 3495 else 3496 3497 else*/ 3498 break; 3497 3499 } 3498 3500 … … 3502 3504 addProperty(CSSPropertyFontStyle, CSSPropertyFont, fontStyle ? fontStyle.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important); 3503 3505 addProperty(CSSPropertyFontVariantCaps, CSSPropertyFont, fontVariantCaps ? fontVariantCaps.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important); 3506 /* 3507 // FIXME-NEWPARSER: What do we do with these? They aren't part of our fontShorthand(). 3504 3508 addProperty(CSSPropertyFontVariantLigatures, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important); 3505 3509 addProperty(CSSPropertyFontVariantNumeric, CSSPropertyFont, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important); 3506 3510 */ 3511 3507 3512 addProperty(CSSPropertyFontWeight, CSSPropertyFont, fontWeight ? fontWeight.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important); 3513 /* FIXME-NEWPARSER: Implement. 3508 3514 addProperty(CSSPropertyFontStretch, CSSPropertyFont, fontStretch ? fontStretch.releaseNonNull() : CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important); 3515 */ 3509 3516 3510 3517 // Now a font size _must_ come. -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
r207479 r207513 123 123 if (token.numericValueType() == NumberValueType || token.numericValue() < minimumValue) 124 124 return nullptr; 125 return CSSPrimitiveValue::create(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitTypes::CSS_ PARSER_INTEGER);125 return CSSPrimitiveValue::create(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitTypes::CSS_NUMBER); 126 126 } 127 127 CalcParser calcParser(range); -
trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp
r205869 r207513 438 438 std::unique_ptr<CSSParserSelector> selector; 439 439 StringView value = token.value(); 440 if ( selector->match() == CSSSelector::PseudoClass)440 if (colons == 1) 441 441 selector = std::unique_ptr<CSSParserSelector>(CSSParserSelector::parsePseudoClassSelectorFromStringView(value)); 442 442 else … … 448 448 if (token.type() == IdentToken) { 449 449 range.consume(); 450 if ( selector->pseudoElementType() == CSSSelector::PseudoElementUnknown)450 if ((selector->match() == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementUnknown) || (selector->match() == CSSSelector::PseudoClass && selector->pseudoClassType() == CSSSelector::PseudoClassUnknown)) 451 451 return nullptr; 452 452 return selector;
Note: See TracChangeset
for help on using the changeset viewer.