Changeset 285801 in webkit
- Timestamp:
- Nov 15, 2021, 3:12:32 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/revert-layer-stack-overflow-2-expected.txt (added)
-
LayoutTests/fast/css/revert-layer-stack-overflow-2.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/style/StyleBuilder.cpp (modified) (2 diffs)
-
Source/WebCore/style/StyleBuilder.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285797 r285801 1 2021-11-15 Antti Koivisto <antti@apple.com> 2 3 Stack overflow with revert-layer 4 https://bugs.webkit.org/show_bug.cgi?id=233119 5 rdar://85342210 6 7 Reviewed by Antoine Quint. 8 9 * fast/css/revert-layer-stack-overflow-2-expected.txt: Added. 10 * fast/css/revert-layer-stack-overflow-2.html: Added. 11 1 12 2021-11-14 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r285800 r285801 1 2021-11-15 Antti Koivisto <antti@apple.com> 2 3 Stack overflow with revert-layer 4 https://bugs.webkit.org/show_bug.cgi?id=233119 5 rdar://85342210 6 7 Reviewed by Antoine Quint. 8 9 We would decrement the cascade layer priority by one after finding 'revert-layer' value and then try 10 to apply again. If both the default layer and a cascade layer contained 'revert-layer' we would 11 enter a very deep recursion as the default layer priority is 64k and the cascade layer priorities 12 start from zero. 13 14 Test: fast/css/revert-layer-stack-overflow-2.html 15 16 * style/StyleBuilder.cpp: 17 (WebCore::Style::Builder::applyRollbackCascadeProperty): 18 19 Fix by getting the new cascade layer priority from the actual property rather than the cascade 20 minimum value. 21 22 Factor into a function. 23 24 (WebCore::Style::Builder::applyProperty): 25 * style/StyleBuilder.h: 26 1 27 2021-11-15 Patrick Griffis <pgriffis@igalia.com> 2 28 -
trunk/Source/WebCore/style/StyleBuilder.cpp
r285713 r285801 256 256 } 257 257 258 void Builder::applyRollbackCascadeProperty(const PropertyCascade::Property& property, SelectorChecker::LinkMatchMask linkMatchMask) 259 { 260 auto* value = property.cssValue[linkMatchMask]; 261 if (!value) 262 return; 263 264 SetForScope levelScope(m_state.m_cascadeLevel, property.level); 265 SetForScope scopeScope(m_state.m_styleScopeOrdinal, property.styleScopeOrdinal); 266 SetForScope layerScope(m_state.m_cascadeLayerPriority, property.cascadeLayerPriority); 267 268 applyProperty(property.id, *value, linkMatchMask); 269 } 270 258 271 void Builder::applyProperty(CSSPropertyID id, CSSValue& value, SelectorChecker::LinkMatchMask linkMatchMask) 259 272 { … … 297 310 // With the rollback cascade built, we need to obtain the property and apply it. If the property is 298 311 // not present, then we behave like "unset." Otherwise we apply the property instead of our own. 299 SetForScope cascadeLevelScope(m_state.m_cascadeLevel, rollbackCascade->maximumCascadeLevel());300 SetForScope cascadeLayerPriorityScope(m_state.m_cascadeLayerPriority, rollbackCascade->maximumCascadeLayerPriority());301 312 if (customPropertyValue) { 302 313 if (customPropertyRegistered && customPropertyRegistered->inherits && rollbackCascade->hasCustomProperty(customPropertyValue->name())) { 303 314 auto property = rollbackCascade->customProperty(customPropertyValue->name()); 304 if (property.cssValue[linkMatchMask]) 305 applyProperty(property.id, *property.cssValue[linkMatchMask], linkMatchMask); 315 applyRollbackCascadeProperty(property, linkMatchMask); 306 316 return; 307 317 } 308 318 } else if (rollbackCascade->hasProperty(id)) { 309 319 auto& property = rollbackCascade->property(id); 310 if (property.cssValue[linkMatchMask]) 311 applyProperty(property.id, *property.cssValue[linkMatchMask], linkMatchMask); 320 applyRollbackCascadeProperty(property, linkMatchMask); 312 321 return; 313 322 } -
trunk/Source/WebCore/style/StyleBuilder.h
r285624 r285801 57 57 void applyPropertiesImpl(int firstProperty, int lastProperty); 58 58 void applyCascadeProperty(const PropertyCascade::Property&); 59 void applyRollbackCascadeProperty(const PropertyCascade::Property&, SelectorChecker::LinkMatchMask); 59 60 void applyProperty(CSSPropertyID, CSSValue&, SelectorChecker::LinkMatchMask); 60 61
Note:
See TracChangeset
for help on using the changeset viewer.