Changeset 191252 in webkit
- Timestamp:
- Oct 17, 2015 4:13:43 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 16 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r191251 r191252 1 2015-10-17 David Hyatt <hyatt@apple.com> 2 3 Implement the CSS4 'revert' keyword. 4 https://bugs.webkit.org/show_bug.cgi?id=149702 5 6 Reviewed by Simon Fraser. 7 8 * fast/css/all-keyword-revert-expected.html: Added. 9 * fast/css/all-keyword-revert.html: Added. 10 * fast/css/revert-color-expected.html: Added. 11 * fast/css/revert-color.html: Added. 12 * fast/css/revert-margins-expected.html: Added. 13 * fast/css/revert-margins.html: Added. 14 * fast/css/variables/all-keyword-revert-expected.html: Added. 15 * fast/css/variables/all-keyword-revert.html: Added. 16 * fast/css/variables/revert-inheritance-expected.html: Added. 17 * fast/css/variables/revert-inheritance.html: Added. 18 * fast/css/variables/revert-no-inheritance-expected.html: Added. 19 * fast/css/variables/revert-no-inheritance.html: Added. 20 * fast/css/variables/revert-variable-reference-expected.html: Added. 21 * fast/css/variables/revert-variable-reference.html: Added. 22 1 23 2015-10-17 Myles C. Maxfield <mmaxfield@apple.com> 2 24 -
trunk/Source/WebCore/CMakeLists.txt
r191247 r191252 1339 1339 css/CSSPropertySourceData.cpp 1340 1340 css/CSSReflectValue.cpp 1341 css/CSSRevertValue.cpp 1341 1342 css/CSSRule.cpp 1342 1343 css/CSSRuleList.cpp -
trunk/Source/WebCore/ChangeLog
r191251 r191252 1 2015-10-17 David Hyatt <hyatt@apple.com> 2 3 Implement the CSS4 'revert' keyword. 4 https://bugs.webkit.org/show_bug.cgi?id=149702 5 6 Reviewed by Simon Fraser. 7 8 Added new tests in fast/css and fast/css/variables. 9 10 * CMakeLists.txt: 11 * WebCore.xcodeproj/project.pbxproj: 12 Add CSSRevertValue to the project and makefiles. 13 14 * css/CSSParser.cpp: 15 (WebCore::parseKeywordValue): 16 Make sure to handle "revert" in the keyword parsing path (along with inherit/initial/unset). 17 18 (WebCore::CSSParser::parseValue): 19 (WebCore::CSSParser::parseCustomPropertyDeclaration): 20 At the parser level, "revert" is just like inherit/initial/unset and gets its own special 21 singleton value, CSSRevertValue. 22 23 * css/CSSRevertValue.cpp: Added. 24 (WebCore::CSSRevertValue::customCSSText): 25 * css/CSSRevertValue.h: Added. 26 (WebCore::CSSRevertValue::create): 27 (WebCore::CSSRevertValue::equals): 28 (WebCore::CSSRevertValue::CSSRevertValue): 29 This value is identical to the inherit/initial/unset values, i.e., its own special value 30 that can be used to indicate a revert when doing style resolution. 31 32 * css/CSSValue.cpp: 33 (WebCore::CSSValue::cssValueType): 34 (WebCore::CSSValue::equals): 35 (WebCore::CSSValue::cssText): 36 (WebCore::CSSValue::destroy): 37 * css/CSSValue.h: 38 (WebCore::CSSValue::isInheritedValue): 39 (WebCore::CSSValue::isInitialValue): 40 (WebCore::CSSValue::isUnsetValue): 41 (WebCore::CSSValue::isRevertValue): 42 Add the RevertClass to CSSValue and make sure it is handled in all the appropriate methods. 43 44 * css/CSSValueKeywords.in: 45 Add the "revert" keyword to the list of allowed CSS keywords. 46 47 * css/CSSValuePool.cpp: 48 (WebCore::CSSValuePool::CSSValuePool): 49 * css/CSSValuePool.h: 50 (WebCore::CSSValuePool::createRevertValue): 51 Add support for a CSSRevertValue singleton, just like inherit/unset/initial. 52 53 * css/FontLoader.cpp: 54 (WebCore::FontLoader::resolveFontStyle): 55 Add "unset" and "revert" as special keywords to be ignored. This code seems to be turned off, 56 but patching it anyway. 57 58 * css/SelectorChecker.h: 59 Add a MatchDefault value of 0 to the LinkMatchMask. This enables it to be used as an index 60 to the correct value in Property (in the style resolution code). 61 62 * css/StyleResolver.cpp: 63 (WebCore::StyleResolver::State::initForStyleResolve): 64 Delete any lingering old CascadedProperty rollbacks for UA/user rules. 65 66 (WebCore::StyleResolver::styleForKeyframe): 67 (WebCore::StyleResolver::styleForPage): 68 (WebCore::StyleResolver::applyMatchedProperties): 69 Pass along the MatchResult as an additional parameter, since we need it to lazily compute 70 the cascade rollbacks if the "revert" keyword is encountered. 71 72 (WebCore::StyleResolver::cascadedPropertiesForRollback): 73 This method will lazily create and return a new CascadedProperties pointer that is cached 74 in the StyleResolver's state. This will contain only UA rules (for user reverts) and UA/user 75 rules (for author reverts). These will only be computed at most once for a given element 76 when doing a reversion, and they will be computed lazily, i.e., only if a revert is 77 requested. 78 79 (WebCore::StyleResolver::applyProperty): 80 Pass along the LinkMatchMask and the MatchResult to applyProperty. This way we know specifically 81 which link type we were computing if we have to revert (so that we roll back and look at the 82 same index in the reverted version). The MatchResult is passed along because it is needed 83 to build the CascadedProperties rollbacks. 84 85 The basic idea is that if a revert is encountered, the level that the rule came from is 86 checked. If it is UA level, just treat as "unset." If it is author or user level, get 87 the correct CascadedProperties rollback and repeat the applyProperty using the property 88 found in the rollback. If the property is not present in the cascade rollback, then the 89 revert becomes an unset. 90 91 (WebCore::StyleResolver::CascadedProperties::hasCustomProperty): 92 (WebCore::StyleResolver::CascadedProperties::customProperty): 93 Helpers used by applyProperty to check on custom properties, since they can revert too 94 just like a regular property can. 95 96 (WebCore::StyleResolver::CascadedProperties::setPropertyInternal): 97 (WebCore::StyleResolver::CascadedProperties::set): 98 (WebCore::StyleResolver::CascadedProperties::setDeferred): 99 Passing along the CascadeLevel (UA, User, Author) so that it can be stored in the Property. 100 This way when we do property application, we always know where the rule came from so 101 that the reversion can be handled properly. 102 103 (WebCore::StyleResolver::CascadedProperties::addStyleProperties): 104 (WebCore::cascadeLevelForIndex): 105 (WebCore::StyleResolver::CascadedProperties::addMatches): 106 When style properties are added, also figure out the CascadeLevel and pass it along to be 107 stored in the Property. We use the MatchResult's ranges to know where a property comes from. 108 109 (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties): 110 (WebCore::StyleResolver::CascadedProperties::Property::apply): 111 (WebCore::StyleResolver::applyCascadedProperties): 112 Pass along the MatchResult so we know how to build the rollback. 113 114 * css/StyleResolver.h: 115 (WebCore::StyleResolver::State::cascadeLevel): 116 (WebCore::StyleResolver::State::setCascadeLevel): 117 (WebCore::StyleResolver::State::authorRollback): 118 (WebCore::StyleResolver::State::userRollback): 119 (WebCore::StyleResolver::State::setAuthorRollback): 120 (WebCore::StyleResolver::State::setUserRollback): 121 (WebCore::StyleResolver::state): 122 (WebCore::StyleResolver::cascadeLevel): 123 (WebCore::StyleResolver::setCascadeLevel): 124 Move CascadedProperties into the header. Add CascadeLevel to Property. Add the level and 125 rollbacks to the resolver's state. 126 1 127 2015-10-17 Myles C. Maxfield <mmaxfield@apple.com> 2 128 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r191247 r191252 5500 5500 BC7D8FEF1BD03B6400FFE540 /* CSSUnsetValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FED1BD03B6400FFE540 /* CSSUnsetValue.cpp */; }; 5501 5501 BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FEE1BD03B6400FFE540 /* CSSUnsetValue.h */; }; 5502 BC7D8FF31BD1A47900FFE540 /* CSSRevertValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */; settings = {ASSET_TAGS = (); }; }; 5503 BC7D8FF41BD1A47900FFE540 /* CSSRevertValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */; settings = {ASSET_TAGS = (); }; }; 5502 5504 BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7F44A70B9E324E00A9D081 /* ImageObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5503 5505 BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */; }; … … 13220 13222 BC7D8FED1BD03B6400FFE540 /* CSSUnsetValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSUnsetValue.cpp; sourceTree = "<group>"; }; 13221 13223 BC7D8FEE1BD03B6400FFE540 /* CSSUnsetValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSUnsetValue.h; sourceTree = "<group>"; }; 13224 BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSRevertValue.cpp; sourceTree = "<group>"; }; 13225 BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSRevertValue.h; sourceTree = "<group>"; }; 13222 13226 BC7F44A70B9E324E00A9D081 /* ImageObserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageObserver.h; sourceTree = "<group>"; }; 13223 13227 BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiveNodeList.cpp; sourceTree = "<group>"; }; … … 23082 23086 BC5A12DD0DC0414800C9AFAD /* CSSReflectValue.cpp */, 23083 23087 BC5A12DE0DC0414800C9AFAD /* CSSReflectValue.h */, 23088 BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */, 23089 BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */, 23084 23090 A80E6CDC0A1989CA007FB8C5 /* CSSRule.cpp */, 23085 23091 A80E6CE30A1989CA007FB8C5 /* CSSRule.h */, … … 24702 24708 E19AC3EF1824DC7900349426 /* CryptoAlgorithmSHA224.h in Headers */, 24703 24709 E19AC3F11824DC7900349426 /* CryptoAlgorithmSHA256.h in Headers */, 24704 836CB1F81BD1E41800AF1591 /* JSHTMLTableDataCellElement.h in Headers */,24705 24710 E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */, 24706 24711 E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */, … … 24774 24779 9362640B0DE1137D009D5A00 /* CSSReflectionDirection.h in Headers */, 24775 24780 BC5A12E00DC0414800C9AFAD /* CSSReflectValue.h in Headers */, 24781 BC7D8FF41BD1A47900FFE540 /* CSSRevertValue.h in Headers */, 24776 24782 A80E6D0D0A1989CA007FB8C5 /* CSSRule.h in Headers */, 24777 24783 A80E6CF20A1989CA007FB8C5 /* CSSRuleList.h in Headers */, … … 25590 25596 A871DB2A0A150BD600B12A68 /* HTMLTableCellElement.h in Headers */, 25591 25597 A871DB2F0A150BD600B12A68 /* HTMLTableColElement.h in Headers */, 25598 836BAD221BD1CA670037356A /* HTMLTableDataCellElement.h in Headers */, 25592 25599 A871DB270A150BD600B12A68 /* HTMLTableElement.h in Headers */, 25600 836BAD211BD1CA670037356A /* HTMLTableHeaderCellElement.h in Headers */, 25593 25601 A871DB2C0A150BD600B12A68 /* HTMLTablePartElement.h in Headers */, 25594 25602 A871DB310A150BD600B12A68 /* HTMLTableRowElement.h in Headers */, … … 25993 26001 BC06EDE40BFD6D0D00856E9D /* JSHTMLTableCellElement.h in Headers */, 25994 26002 BC06ED9E0BFD660600856E9D /* JSHTMLTableColElement.h in Headers */, 26003 836CB1F81BD1E41800AF1591 /* JSHTMLTableDataCellElement.h in Headers */, 25995 26004 BC06EE050BFD71AA00856E9D /* JSHTMLTableElement.h in Headers */, 26005 836CB1F61BD1E41800AF1591 /* JSHTMLTableHeaderCellElement.h in Headers */, 25996 26006 BC06EDA00BFD660600856E9D /* JSHTMLTableRowElement.h in Headers */, 25997 26007 BC06ED070BFD5BAE00856E9D /* JSHTMLTableSectionElement.h in Headers */, … … 26262 26272 B2FA3DEE0AB75A6F000E5AC4 /* JSSVGRectElement.h in Headers */, 26263 26273 B2FA3DF10AB75A6F000E5AC4 /* JSSVGRenderingIntent.h in Headers */, 26264 836CB1F61BD1E41800AF1591 /* JSHTMLTableHeaderCellElement.h in Headers */,26265 26274 B2FA3DF30AB75A6F000E5AC4 /* JSSVGScriptElement.h in Headers */, 26266 26275 B2FA3DF50AB75A6F000E5AC4 /* JSSVGSetElement.h in Headers */, … … 27266 27275 9DAC7C571AF2CB6400437C44 /* StyleContentAlignmentData.h in Headers */, 27267 27276 BC779E171BB227CA00CAA8BF /* StyleCustomPropertyData.h in Headers */, 27268 836BAD211BD1CA670037356A /* HTMLTableHeaderCellElement.h in Headers */,27269 27277 BC5EB67F0E81D4A700B25965 /* StyleDashboardRegion.h in Headers */, 27270 27278 A8C4A7FD09D563270003AC8D /* StyledElement.h in Headers */, … … 27325 27333 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */, 27326 27334 71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */, 27327 836BAD221BD1CA670037356A /* HTMLTableDataCellElement.h in Headers */,27328 27335 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */, 27329 27336 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */, … … 28600 28607 82E3D8DE122EA0D1003AE5BC /* CSSPropertySourceData.cpp in Sources */, 28601 28608 BC5A12DF0DC0414800C9AFAD /* CSSReflectValue.cpp in Sources */, 28609 BC7D8FF31BD1A47900FFE540 /* CSSRevertValue.cpp in Sources */, 28602 28610 A80E6D060A1989CA007FB8C5 /* CSSRule.cpp in Sources */, 28603 28611 A80E6D090A1989CA007FB8C5 /* CSSRuleList.cpp in Sources */, … … 29618 29626 BC06EDE30BFD6D0D00856E9D /* JSHTMLTableCellElement.cpp in Sources */, 29619 29627 BC06ED9D0BFD660600856E9D /* JSHTMLTableColElement.cpp in Sources */, 29628 836CB1F91BD1E41800AF1591 /* JSHTMLTableDataCellElement.cpp in Sources */, 29620 29629 BC06EE040BFD71AA00856E9D /* JSHTMLTableElement.cpp in Sources */, 29630 836CB1F71BD1E41800AF1591 /* JSHTMLTableHeaderCellElement.cpp in Sources */, 29621 29631 BC06ED9F0BFD660600856E9D /* JSHTMLTableRowElement.cpp in Sources */, 29622 29632 BC06ED060BFD5BAE00856E9D /* JSHTMLTableSectionElement.cpp in Sources */, … … 30521 30531 E44614510CD68A3500FADA75 /* RenderVideo.cpp in Sources */, 30522 30532 BCEA4867097D93020094C9E4 /* RenderView.cpp in Sources */, 30523 836CB1F71BD1E41800AF1591 /* JSHTMLTableHeaderCellElement.cpp in Sources */,30524 30533 BE20507D18A458BF0080647E /* RenderVTTCue.cpp in Sources */, 30525 30534 A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */, … … 31297 31306 BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */, 31298 31307 A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */, 31299 836CB1F91BD1E41800AF1591 /* JSHTMLTableDataCellElement.cpp in Sources */,31300 31308 E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */, 31301 31309 1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */, -
trunk/Source/WebCore/bindings/objc/DOMCSS.mm
r191151 r191252 126 126 case WebCore::CSSValue::CSS_INITIAL: 127 127 case WebCore::CSSValue::CSS_UNSET: 128 case WebCore::CSSValue::CSS_REVERT: 128 129 return [DOMCSSValue class]; 129 130 case WebCore::CSSValue::CSS_CUSTOM: -
trunk/Source/WebCore/css/CSSParser.cpp
r191178 r191252 58 58 #include "CSSPropertySourceData.h" 59 59 #include "CSSReflectValue.h" 60 #include "CSSRevertValue.h" 60 61 #include "CSSSelector.h" 61 62 #include "CSSShadowValue.h" … … 1198 1199 // All properties accept the values of "initial" and "inherit". 1199 1200 String lowerCaseString = string.lower(); 1200 if (lowerCaseString != "initial" && lowerCaseString != "inherit" && lowerCaseString != "unset" )1201 if (lowerCaseString != "initial" && lowerCaseString != "inherit" && lowerCaseString != "unset" && lowerCaseString != "revert") 1201 1202 return CSSParser::ParseResult::Error; 1202 1203 1203 // Parse initial/inherit/unset shorthands using the CSSParser.1204 // Parse initial/inherit/unset/revert shorthands using the CSSParser. 1204 1205 if (shorthandForProperty(propertyId).length()) 1205 1206 return CSSParser::ParseResult::Error; … … 1220 1221 else if (valueID == CSSValueUnset) 1221 1222 value = CSSValuePool::singleton().createUnsetValue(); 1223 else if (valueID == CSSValueRevert) 1224 value = CSSValuePool::singleton().createRevertValue(); 1222 1225 else if (isValidKeywordPropertyAndValue(propertyId, valueID, parserContext, styleSheetContents)) 1223 1226 value = CSSValuePool::singleton().createIdentifierValue(valueID); … … 1965 1968 return false; 1966 1969 addExpandedPropertyForValue(propId, cssValuePool.createUnsetValue(), important); 1970 return true; 1971 } else if (id == CSSValueRevert) { 1972 if (num != 1) 1973 return false; 1974 addExpandedPropertyForValue(propId, cssValuePool.createRevertValue(), important); 1967 1975 return true; 1968 1976 } … … 4214 4222 else if (id == CSSValueUnset) 4215 4223 value = cssValuePool.createUnsetValue(); 4224 else if (id == CSSValueRevert) 4225 value = cssValuePool.createRevertValue(); 4216 4226 else { 4217 4227 RefPtr<CSSValueList> valueList = CSSValueList::createFromParserValueList(*m_valueList); -
trunk/Source/WebCore/css/CSSValue.cpp
r191201 r191252 115 115 if (isUnsetValue()) 116 116 return CSS_UNSET; 117 if (isRevertValue()) 118 return CSS_REVERT; 117 119 return CSS_CUSTOM; 118 120 } … … 204 206 case UnsetClass: 205 207 return compareCSSValues<CSSUnsetValue>(*this, other); 208 case RevertClass: 209 return compareCSSValues<CSSRevertValue>(*this, other); 206 210 #if ENABLE(CSS_GRID_LAYOUT) 207 211 case GridLineNamesClass: … … 306 310 case UnsetClass: 307 311 return downcast<CSSUnsetValue>(*this).customCSSText(); 312 case RevertClass: 313 return downcast<CSSRevertValue>(*this).customCSSText(); 308 314 #if ENABLE(CSS_GRID_LAYOUT) 309 315 case GridLineNamesClass: … … 418 424 delete downcast<CSSUnsetValue>(this); 419 425 return; 426 case RevertClass: 427 delete downcast<CSSRevertValue>(this); 428 return; 420 429 #if ENABLE(CSS_GRID_LAYOUT) 421 430 case GridLineNamesClass: -
trunk/Source/WebCore/css/CSSValue.h
r191151 r191252 48 48 CSS_CUSTOM = 3, 49 49 CSS_INITIAL = 4, 50 CSS_UNSET = 5 50 CSS_UNSET = 5, 51 CSS_REVERT = 6 51 52 }; 52 53 … … 95 96 bool isInitialValue() const { return m_classType == InitialClass; } 96 97 bool isUnsetValue() const { return m_classType == UnsetClass; } 98 bool isRevertValue() const { return m_classType == RevertClass; } 97 99 bool treatAsInitialValue(CSSPropertyID) const; 98 100 bool treatAsInheritedValue(CSSPropertyID) const; … … 170 172 InitialClass, 171 173 UnsetClass, 174 RevertClass, 172 175 173 176 ReflectClass, -
trunk/Source/WebCore/css/CSSValueKeywords.in
r191151 r191252 5 5 initial 6 6 unset 7 revert 7 8 8 9 // -
trunk/Source/WebCore/css/CSSValuePool.cpp
r191151 r191252 46 46 , m_explicitInitialValue(CSSInitialValue::createExplicit()) 47 47 , m_unsetValue(CSSUnsetValue::create()) 48 , m_revertValue(CSSRevertValue::create()) 48 49 , m_colorTransparent(CSSPrimitiveValue::createColor(Color::transparent)) 49 50 , m_colorWhite(CSSPrimitiveValue::createColor(Color::white)) -
trunk/Source/WebCore/css/CSSValuePool.h
r191151 r191252 32 32 #include "CSSPrimitiveValue.h" 33 33 #include "CSSPropertyNames.h" 34 #include "CSSRevertValue.h" 34 35 #include "CSSUnsetValue.h" 35 36 #include "CSSValueKeywords.h" … … 57 58 Ref<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue.copyRef(); } 58 59 Ref<CSSUnsetValue> createUnsetValue() { return m_unsetValue.copyRef(); } 60 Ref<CSSRevertValue> createRevertValue() { return m_revertValue.copyRef(); } 59 61 Ref<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier); 60 62 Ref<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier); … … 75 77 Ref<CSSInitialValue> m_explicitInitialValue; 76 78 Ref<CSSUnsetValue> m_unsetValue; 79 Ref<CSSRevertValue> m_revertValue; 77 80 78 81 RefPtr<CSSPrimitiveValue> m_identifierValueCache[numCSSValueKeywords]; -
trunk/Source/WebCore/css/FontLoader.cpp
r187706 r191252 301 301 302 302 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); 303 if (fontValue == "inherit" || fontValue == "initial" )303 if (fontValue == "inherit" || fontValue == "initial" || fontValue == "unset" || fontValue == "revert") 304 304 return false; 305 305 -
trunk/Source/WebCore/css/SelectorChecker.h
r182129 r191252 103 103 static bool checkExactAttribute(const Element*, const CSSSelector*, const QualifiedName& selectorAttributeName, const AtomicStringImpl* value); 104 104 105 enum LinkMatchMask { Match Link = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited };105 enum LinkMatchMask { MatchDefault = 0, MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited }; 106 106 static unsigned determineLinkMatchType(const CSSSelector*); 107 107 -
trunk/Source/WebCore/css/StyleResolver.cpp
r191151 r191252 174 174 static const CSSPropertyID firstLowPriorityProperty = static_cast<CSSPropertyID>(lastHighPriorityProperty + 1); 175 175 176 class StyleResolver::CascadedProperties {177 public:178 CascadedProperties(TextDirection, WritingMode);179 180 struct Property {181 void apply(StyleResolver&);182 183 CSSPropertyID id;184 CSSValue* cssValue[3];185 };186 187 bool hasProperty(CSSPropertyID id) const;188 Property& property(CSSPropertyID);189 void addMatches(const MatchResult&, bool important, int startIndex, int endIndex, bool inheritedOnly = false);190 191 void set(CSSPropertyID, CSSValue&, unsigned linkMatchType);192 void setDeferred(CSSPropertyID, CSSValue&, unsigned linkMatchType);193 194 void applyDeferredProperties(StyleResolver&);195 196 HashMap<AtomicString, Property>& customProperties() { return m_customProperties; }197 198 private:199 void addStyleProperties(const StyleProperties&, StyleRule&, bool isImportant, bool inheritedOnly, PropertyWhitelistType, unsigned linkMatchType);200 static void setPropertyInternal(Property&, CSSPropertyID, CSSValue&, unsigned linkMatchType);201 202 Property m_properties[numCSSProperties + 2];203 std::bitset<numCSSProperties + 2> m_propertyIsPresent;204 205 Vector<Property, 8> m_deferredProperties;206 HashMap<AtomicString, Property> m_customProperties;207 208 TextDirection m_direction;209 WritingMode m_writingMode;210 };211 212 176 static void extractDirectionAndWritingMode(const RenderStyle&, const StyleResolver::MatchResult&, TextDirection&, WritingMode&); 213 177 … … 441 405 m_pendingImageProperties.clear(); 442 406 m_fontDirty = false; 407 408 m_authorRollback = nullptr; 409 m_userRollback = nullptr; 443 410 444 411 updateConversionData(); … … 855 822 856 823 // Resolve custom properties first. 857 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom );858 859 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty );824 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom, &result); 825 826 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty, &result); 860 827 861 828 // If our font got dirtied, update it now. … … 863 830 864 831 // Now do rest of the properties. 865 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty );832 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty, &result); 866 833 867 834 // If our font got dirtied by one of the non-essential font props, update it a second time. 868 835 updateFont(); 869 836 870 cascade.applyDeferredProperties(*this );837 cascade.applyDeferredProperties(*this, &result); 871 838 872 839 // Start loading resources referenced by this style. … … 1023 990 1024 991 // Resolve custom properties first. 1025 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom );1026 1027 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty );992 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom, &result); 993 994 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty, &result); 1028 995 1029 996 // If our font got dirtied, update it now. 1030 997 updateFont(); 1031 998 1032 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty );1033 1034 cascade.applyDeferredProperties(*this );999 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty, &result); 1000 1001 cascade.applyDeferredProperties(*this, &result); 1035 1002 1036 1003 // Start loading resources referenced by this style. … … 1698 1665 cascade.addMatches(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); 1699 1666 1700 applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition );1667 applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition, &matchResult); 1701 1668 adjustStyleForInterCharacterRuby(); 1702 1669 1703 1670 // Resolve custom variables first. 1704 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom );1671 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom, &matchResult); 1705 1672 1706 1673 // Start by applying properties that other properties may depend on. 1707 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty );1674 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty, &matchResult); 1708 1675 1709 1676 updateFont(); 1710 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty );1677 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty, &matchResult); 1711 1678 1712 1679 state.cacheBorderAndBackground(); … … 1720 1687 1721 1688 // Resolve custom properties first. 1722 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom );1723 1724 applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition );1689 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom, &matchResult); 1690 1691 applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition, &matchResult); 1725 1692 1726 1693 // Adjust the font size to be smaller if ruby-position is inter-character. … … 1728 1695 1729 1696 // Start by applying properties that other properties may depend on. 1730 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty );1697 applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty, &matchResult); 1731 1698 1732 1699 // If the effective zoom value changes, we can't use the matched properties cache. Start over. … … 1742 1709 1743 1710 // Apply properties that no other properties depend on. 1744 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty );1711 applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty, &matchResult); 1745 1712 1746 1713 // Finally, some properties must be applied in the order they were parsed. 1747 1714 // There are some CSS properties that affect the same RenderStyle values, 1748 1715 // so to preserve behavior, we queue them up during cascade and flush here. 1749 cascade.applyDeferredProperties(*this );1716 cascade.applyDeferredProperties(*this, &matchResult); 1750 1717 1751 1718 // Start loading resources referenced by this style. … … 1877 1844 } 1878 1845 1879 void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) 1846 StyleResolver::CascadedProperties* StyleResolver::cascadedPropertiesForRollback(const MatchResult& matchResult) 1847 { 1848 ASSERT(cascadeLevel() != UserAgentLevel); 1849 1850 TextDirection direction; 1851 WritingMode writingMode; 1852 extractDirectionAndWritingMode(*state().style(), matchResult, direction, writingMode); 1853 1854 if (cascadeLevel() == AuthorLevel) { 1855 CascadedProperties* authorRollback = state().authorRollback(); 1856 if (authorRollback) 1857 return authorRollback; 1858 1859 auto newAuthorRollback(std::make_unique<CascadedProperties>(direction, writingMode)); 1860 1861 // This special rollback cascade contains UA rules and user rules but no author rules. 1862 newAuthorRollback->addMatches(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, false); 1863 newAuthorRollback->addMatches(matchResult, false, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, false); 1864 newAuthorRollback->addMatches(matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, false); 1865 newAuthorRollback->addMatches(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, false); 1866 1867 state().setAuthorRollback(newAuthorRollback); 1868 return state().authorRollback(); 1869 } 1870 1871 if (cascadeLevel() == UserLevel) { 1872 CascadedProperties* userRollback = state().userRollback(); 1873 if (userRollback) 1874 return userRollback; 1875 1876 auto newUserRollback(std::make_unique<CascadedProperties>(direction, writingMode)); 1877 1878 // This special rollback cascade contains only UA rules. 1879 newUserRollback->addMatches(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, false); 1880 newUserRollback->addMatches(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, false); 1881 1882 state().setUserRollback(newUserRollback); 1883 return state().userRollback(); 1884 } 1885 1886 return nullptr; 1887 } 1888 1889 void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value, SelectorChecker::LinkMatchMask linkMatchMask, const MatchResult* matchResult) 1880 1890 { 1881 1891 ASSERT_WITH_MESSAGE(!isShorthandCSSProperty(id), "Shorthand property id = %d wasn't expanded at parsing time", id); … … 1897 1907 CSSPropertyID newId = CSSProperty::resolveDirectionAwareProperty(id, state.style()->direction(), state.style()->writingMode()); 1898 1908 ASSERT(newId != id); 1899 return applyProperty(newId, valueToApply.get() );1909 return applyProperty(newId, valueToApply.get(), linkMatchMask, matchResult); 1900 1910 } 1901 1911 1902 1912 CSSValue* valueToCheckForInheritInitial = valueToApply.get(); 1913 CSSCustomPropertyValue* customPropertyValue = nullptr; 1914 1903 1915 if (id == CSSPropertyCustom) { 1904 CSSCustomPropertyValue* customProperty= &downcast<CSSCustomPropertyValue>(*valueToApply);1905 valueToCheckForInheritInitial = customProperty ->value().get();1916 customPropertyValue = &downcast<CSSCustomPropertyValue>(*valueToApply); 1917 valueToCheckForInheritInitial = customPropertyValue->value().get(); 1906 1918 } 1907 1919 … … 1909 1921 bool isInitial = valueToCheckForInheritInitial->isInitialValue() || (!state.parentStyle() && valueToCheckForInheritInitial->isInheritedValue()); 1910 1922 1911 if (valueToCheckForInheritInitial->isUnsetValue()) { 1923 bool isUnset = valueToCheckForInheritInitial->isUnsetValue(); 1924 bool isRevert = valueToCheckForInheritInitial->isRevertValue(); 1925 1926 if (isRevert) { 1927 if (cascadeLevel() == UserAgentLevel || !matchResult) 1928 isUnset = true; 1929 else { 1930 // Fetch the correct rollback object from the state, building it if necessary. 1931 // This requires having the original MatchResult available. 1932 auto* rollback = cascadedPropertiesForRollback(*matchResult); 1933 ASSERT(rollback); 1934 1935 // With the cascade built, we need to obtain the property and apply it. If the property is 1936 // not present, then we behave like "unset." Otherwise we apply the property instead of 1937 // our own. 1938 if (customPropertyValue) { 1939 if (rollback->hasCustomProperty(customPropertyValue->name())) { 1940 auto property = rollback->customProperty(customPropertyValue->name()); 1941 if (property.cssValue[linkMatchMask]) 1942 applyProperty(property.id, property.cssValue[linkMatchMask], linkMatchMask, matchResult); 1943 return; 1944 } 1945 } else if (rollback->hasProperty(id)) { 1946 auto& property = rollback->property(id); 1947 if (property.cssValue[linkMatchMask]) 1948 applyProperty(property.id, property.cssValue[linkMatchMask], linkMatchMask, matchResult); 1949 return; 1950 } 1951 1952 isUnset = true; 1953 } 1954 } 1955 1956 if (isUnset) { 1912 1957 if (CSSProperty::isInheritedProperty(id)) 1913 1958 isInherit = true; … … 1915 1960 isInitial = true; 1916 1961 } 1917 1962 1918 1963 ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial -> !isInherit 1919 1964 … … 2569 2614 } 2570 2615 2571 void StyleResolver::CascadedProperties::setPropertyInternal(Property& property, CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType) 2616 inline bool StyleResolver::CascadedProperties::hasCustomProperty(const String& name) const 2617 { 2618 return m_customProperties.contains(name); 2619 } 2620 2621 inline StyleResolver::CascadedProperties::Property StyleResolver::CascadedProperties::customProperty(const String& name) const 2622 { 2623 return m_customProperties.get(name); 2624 } 2625 2626 void StyleResolver::CascadedProperties::setPropertyInternal(Property& property, CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType, CascadeLevel cascadeLevel) 2572 2627 { 2573 2628 ASSERT(linkMatchType <= SelectorChecker::MatchAll); 2574 2629 property.id = id; 2630 property.level = cascadeLevel; 2575 2631 if (linkMatchType == SelectorChecker::MatchAll) { 2576 2632 property.cssValue[0] = &cssValue; … … 2581 2637 } 2582 2638 2583 void StyleResolver::CascadedProperties::set(CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType )2639 void StyleResolver::CascadedProperties::set(CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType, CascadeLevel cascadeLevel) 2584 2640 { 2585 2641 if (CSSProperty::isDirectionAwareProperty(id)) … … 2598 2654 property.id = id; 2599 2655 memset(property.cssValue, 0, sizeof(property.cssValue)); 2600 setPropertyInternal(property, id, cssValue, linkMatchType );2656 setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel); 2601 2657 customProperties().set(customValue.name(), property); 2602 2658 } else { 2603 2659 Property property = customProperties().get(customValue.name()); 2604 setPropertyInternal(property, id, cssValue, linkMatchType );2660 setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel); 2605 2661 customProperties().set(customValue.name(), property); 2606 2662 } … … 2611 2667 memset(property.cssValue, 0, sizeof(property.cssValue)); 2612 2668 m_propertyIsPresent.set(id); 2613 setPropertyInternal(property, id, cssValue, linkMatchType );2614 } 2615 2616 void StyleResolver::CascadedProperties::setDeferred(CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType )2669 setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel); 2670 } 2671 2672 void StyleResolver::CascadedProperties::setDeferred(CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType, CascadeLevel cascadeLevel) 2617 2673 { 2618 2674 ASSERT(!CSSProperty::isDirectionAwareProperty(id)); … … 2621 2677 Property property; 2622 2678 memset(property.cssValue, 0, sizeof(property.cssValue)); 2623 setPropertyInternal(property, id, cssValue, linkMatchType );2679 setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel); 2624 2680 m_deferredProperties.append(property); 2625 2681 } 2626 2682 2627 void StyleResolver::CascadedProperties::addStyleProperties(const StyleProperties& properties, StyleRule&, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhitelistType, unsigned linkMatchType )2683 void StyleResolver::CascadedProperties::addStyleProperties(const StyleProperties& properties, StyleRule&, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhitelistType, unsigned linkMatchType, CascadeLevel cascadeLevel) 2628 2684 { 2629 2685 for (unsigned i = 0, count = properties.propertyCount(); i < count; ++i) { … … 2647 2703 2648 2704 if (shouldApplyPropertyInParseOrder(propertyID)) 2649 setDeferred(propertyID, *current.value(), linkMatchType );2705 setDeferred(propertyID, *current.value(), linkMatchType, cascadeLevel); 2650 2706 else 2651 set(propertyID, *current.value(), linkMatchType); 2652 } 2707 set(propertyID, *current.value(), linkMatchType, cascadeLevel); 2708 } 2709 } 2710 2711 static CascadeLevel cascadeLevelForIndex(const StyleResolver::MatchResult& matchResult, int index) 2712 { 2713 if (index >= matchResult.ranges.firstUARule && index <= matchResult.ranges.lastUARule) 2714 return UserAgentLevel; 2715 if (index >= matchResult.ranges.firstUserRule && index <= matchResult.ranges.lastUserRule) 2716 return UserLevel; 2717 return AuthorLevel; 2653 2718 } 2654 2719 … … 2660 2725 for (int i = startIndex; i <= endIndex; ++i) { 2661 2726 const MatchedProperties& matchedProperties = matchResult.matchedProperties()[i]; 2662 addStyleProperties(*matchedProperties.properties, *matchResult.matchedRules[i], important, inheritedOnly, static_cast<PropertyWhitelistType>(matchedProperties.whitelistType), matchedProperties.linkMatchType); 2663 } 2664 } 2665 2666 void StyleResolver::CascadedProperties::applyDeferredProperties(StyleResolver& resolver) 2727 addStyleProperties(*matchedProperties.properties, *matchResult.matchedRules[i], important, inheritedOnly, static_cast<PropertyWhitelistType>(matchedProperties.whitelistType), matchedProperties.linkMatchType, 2728 cascadeLevelForIndex(matchResult, i)); 2729 } 2730 } 2731 2732 void StyleResolver::CascadedProperties::applyDeferredProperties(StyleResolver& resolver, const MatchResult* matchResult) 2667 2733 { 2668 2734 for (auto& property : m_deferredProperties) 2669 property.apply(resolver );2670 } 2671 2672 void StyleResolver::CascadedProperties::Property::apply(StyleResolver& resolver )2735 property.apply(resolver, matchResult); 2736 } 2737 2738 void StyleResolver::CascadedProperties::Property::apply(StyleResolver& resolver, const MatchResult* matchResult) 2673 2739 { 2674 2740 State& state = resolver.state(); 2675 2676 if (cssValue[0]) { 2741 state.setCascadeLevel(level); 2742 2743 if (cssValue[SelectorChecker::MatchDefault]) { 2677 2744 state.setApplyPropertyToRegularStyle(true); 2678 2745 state.setApplyPropertyToVisitedLinkStyle(false); 2679 resolver.applyProperty(id, cssValue[ 0]);2746 resolver.applyProperty(id, cssValue[SelectorChecker::MatchDefault], SelectorChecker::MatchDefault, matchResult); 2680 2747 } 2681 2748 … … 2686 2753 state.setApplyPropertyToRegularStyle(true); 2687 2754 state.setApplyPropertyToVisitedLinkStyle(false); 2688 resolver.applyProperty(id, cssValue[SelectorChecker::MatchLink] );2755 resolver.applyProperty(id, cssValue[SelectorChecker::MatchLink], SelectorChecker::MatchLink, matchResult); 2689 2756 } 2690 2757 … … 2692 2759 state.setApplyPropertyToRegularStyle(false); 2693 2760 state.setApplyPropertyToVisitedLinkStyle(true); 2694 resolver.applyProperty(id, cssValue[SelectorChecker::MatchVisited] );2761 resolver.applyProperty(id, cssValue[SelectorChecker::MatchVisited], SelectorChecker::MatchVisited, matchResult); 2695 2762 } 2696 2763 … … 2699 2766 } 2700 2767 2701 void StyleResolver::applyCascadedProperties(CascadedProperties& cascade, int firstProperty, int lastProperty )2768 void StyleResolver::applyCascadedProperties(CascadedProperties& cascade, int firstProperty, int lastProperty, const MatchResult* matchResult) 2702 2769 { 2703 2770 for (int id = firstProperty; id <= lastProperty; ++id) { … … 2708 2775 HashMap<AtomicString, CascadedProperties::Property>::iterator end = cascade.customProperties().end(); 2709 2776 for (HashMap<AtomicString, CascadedProperties::Property>::iterator it = cascade.customProperties().begin(); it != end; ++it) 2710 it->value.apply(*this );2777 it->value.apply(*this, matchResult); 2711 2778 continue; 2712 2779 } 2713 2780 auto& property = cascade.property(propertyID); 2714 2781 ASSERT(!shouldApplyPropertyInParseOrder(propertyID)); 2715 property.apply(*this );2782 property.apply(*this, matchResult); 2716 2783 } 2717 2784 -
trunk/Source/WebCore/css/StyleResolver.h
r191128 r191252 39 39 #include "StyleInheritedData.h" 40 40 #include "ViewportStyleResolver.h" 41 #include <bitset> 41 42 #include <memory> 42 43 #include <wtf/HashMap.h> … … 121 122 }; 122 123 124 enum CascadeLevel { 125 UserAgentLevel, 126 AuthorLevel, 127 UserLevel 128 }; 129 123 130 class PseudoStyleRequest { 124 131 public: … … 195 202 196 203 public: 204 struct MatchResult; 205 197 206 void applyPropertyToStyle(CSSPropertyID, CSSValue*, RenderStyle*); 198 207 … … 285 294 Vector<MatchedProperties, 64> m_matchedProperties; 286 295 }; 296 297 class CascadedProperties { 298 public: 299 CascadedProperties(TextDirection, WritingMode); 300 301 struct Property { 302 void apply(StyleResolver&, const MatchResult*); 303 304 CSSPropertyID id; 305 CascadeLevel level; 306 CSSValue* cssValue[3]; 307 }; 308 309 bool hasProperty(CSSPropertyID) const; 310 Property& property(CSSPropertyID); 311 void addMatches(const MatchResult&, bool important, int startIndex, int endIndex, bool inheritedOnly = false); 312 313 void set(CSSPropertyID, CSSValue&, unsigned linkMatchType, CascadeLevel); 314 void setDeferred(CSSPropertyID, CSSValue&, unsigned linkMatchType, CascadeLevel); 315 316 void applyDeferredProperties(StyleResolver&, const MatchResult*); 317 318 HashMap<AtomicString, Property>& customProperties() { return m_customProperties; } 319 bool hasCustomProperty(const String&) const; 320 Property customProperty(const String&) const; 321 322 private: 323 void addStyleProperties(const StyleProperties&, StyleRule&, bool isImportant, bool inheritedOnly, PropertyWhitelistType, unsigned linkMatchType, CascadeLevel); 324 static void setPropertyInternal(Property&, CSSPropertyID, CSSValue&, unsigned linkMatchType, CascadeLevel); 325 326 Property m_properties[numCSSProperties + 2]; 327 std::bitset<numCSSProperties + 2> m_propertyIsPresent; 328 329 Vector<Property, 8> m_deferredProperties; 330 HashMap<AtomicString, Property> m_customProperties; 331 332 TextDirection m_direction; 333 WritingMode m_writingMode; 334 }; 287 335 288 336 private: … … 306 354 void applyMatchedProperties(const MatchResult&, const Element*, ShouldUseMatchedPropertiesCache = UseMatchedPropertiesCache); 307 355 308 class CascadedProperties; 309 310 void applyCascadedProperties(CascadedProperties&, int firstProperty, int lastProperty); 356 void applyCascadedProperties(CascadedProperties&, int firstProperty, int lastProperty, const MatchResult*); 311 357 void cascadeMatches(CascadedProperties&, const MatchResult&, bool important, int startIndex, int endIndex, bool inheritedOnly); 312 358 … … 377 423 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisitedLinkStyle; } 378 424 PendingImagePropertyMap& pendingImageProperties() { return m_pendingImageProperties; } 379 425 380 426 Vector<RefPtr<ReferenceFilterOperation>>& filtersWithPendingSVGDocuments() { return m_filtersWithPendingSVGDocuments; } 381 427 … … 403 449 CSSToLengthConversionData cssToLengthConversionData() const { return m_cssToLengthConversionData; } 404 450 451 CascadeLevel cascadeLevel() const { return m_cascadeLevel; } 452 void setCascadeLevel(CascadeLevel level) { m_cascadeLevel = level; } 453 454 CascadedProperties* authorRollback() const { return m_authorRollback.get(); } 455 CascadedProperties* userRollback() const { return m_userRollback.get(); } 456 457 void setAuthorRollback(std::unique_ptr<CascadedProperties>& rollback) { m_authorRollback = WTF::move(rollback); } 458 void setUserRollback(std::unique_ptr<CascadedProperties>& rollback) { m_userRollback = WTF::move(rollback); } 459 405 460 private: 406 461 void updateConversionData(); … … 435 490 436 491 CSSToLengthConversionData m_cssToLengthConversionData; 492 493 CascadeLevel m_cascadeLevel { UserAgentLevel }; 494 std::unique_ptr<CascadedProperties> m_authorRollback; 495 std::unique_ptr<CascadedProperties> m_userRollback; 437 496 }; 438 497 … … 451 510 bool applyPropertyToRegularStyle() const { return m_state.applyPropertyToRegularStyle(); } 452 511 bool applyPropertyToVisitedLinkStyle() const { return m_state.applyPropertyToVisitedLinkStyle(); } 512 513 CascadeLevel cascadeLevel() const { return m_state.cascadeLevel(); } 514 void setCascadeLevel(CascadeLevel level) { m_state.setCascadeLevel(level); } 515 516 CascadedProperties* cascadedPropertiesForRollback(const MatchResult&); 453 517 454 518 CSSToStyleMap* styleMap() { return &m_styleMap; } … … 469 533 bool canShareStyleWithControl(StyledElement*) const; 470 534 471 void applyProperty(CSSPropertyID, CSSValue* );535 void applyProperty(CSSPropertyID, CSSValue*, SelectorChecker::LinkMatchMask = SelectorChecker::MatchDefault, const MatchResult* = nullptr); 472 536 RefPtr<CSSValue> resolvedVariableValue(CSSPropertyID, const CSSVariableDependentValue&); 473 537
Note: See TracChangeset
for help on using the changeset viewer.