Changeset 207458 in webkit
- Timestamp:
- Oct 18, 2016, 5:28:55 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 72 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207457 r207458 1 2016-10-18 Antti Koivisto <antti@apple.com> 2 3 Rename setNeedsStyleRecalc to invalidateStyle 4 https://bugs.webkit.org/show_bug.cgi?id=163542 5 6 Reviewed by Darin Adler. 7 8 Also rename StyleChangeType enum and some related functions for clarity. For example 9 10 element.setNeedsStyleRecalc(SyntheticStyleChange); 11 12 becomes 13 14 element.invalidateStyleAndLayerComposition(); 15 16 * WebCore.xcodeproj/project.pbxproj: 17 * css/StyleInvalidationAnalysis.cpp: 18 (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded): 19 * dom/Document.cpp: 20 (WebCore::Document::recalcStyle): 21 (WebCore::Document::updateViewportUnitsOnResize): 22 (WebCore::Document::setCSSTarget): 23 (WebCore::unwrapFullScreenRenderer): 24 (WebCore::Document::setAnimatingFullScreen): 25 * dom/Element.cpp: 26 (WebCore::Element::setActive): 27 (WebCore::Element::setFocus): 28 (WebCore::Element::setHovered): 29 (WebCore::Element::attributeChanged): 30 (WebCore::Element::invalidateStyle): 31 (WebCore::Element::invalidateStyleAndLayerComposition): 32 (WebCore::Element::invalidateStyleForSubtree): 33 (WebCore::Element::invalidateStyleAndRenderersForSubtree): 34 35 Move public invalidation functions to Element tightening typing. 36 Use separate functions instead of enum values. 37 This way the call sites look nicer and only useful combinations are exposed. 38 39 (WebCore::Element::addShadowRoot): 40 (WebCore::checkForEmptyStyleChange): 41 (WebCore::checkForSiblingStyleChanges): 42 (WebCore::Element::needsStyleInvalidation): 43 (WebCore::Element::setContainsFullScreenElement): 44 * dom/Element.h: 45 (WebCore::Element::setHasFocusWithin): 46 * dom/Node.cpp: 47 (WebCore::computeEditabilityFromComputedStyle): 48 (WebCore::Node::adjustStyleValidity): 49 50 Update validity and mode separately. There was a potential bug here where 51 SyntheticStyleChange could overwrite FullStyleChange (no known repro). 52 53 (WebCore::Node::updateAncestorsForStyleRecalc): 54 (WebCore::Node::invalidateStyle): 55 (WebCore::Node::insertedInto): 56 (WebCore::Node::setNeedsStyleRecalc): Deleted. 57 * dom/Node.h: 58 (WebCore::Node::needsStyleRecalc): 59 (WebCore::Node::styleValidity): 60 (WebCore::Node::styleResolutionShouldRecompositeLayer): 61 (WebCore::Node::setHasValidStyle): 62 (WebCore::Node::styleChangeType): Deleted. 63 (WebCore::Node::clearNeedsStyleRecalc): Deleted. 64 (WebCore::Node::setStyleChange): Deleted. 65 * dom/RadioButtonGroups.cpp: 66 (WebCore::RadioButtonGroup::remove): 67 (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons): 68 * dom/ShadowRoot.cpp: 69 (WebCore::ShadowRoot::setResetStyleInheritance): 70 * dom/SlotAssignment.cpp: 71 (WebCore::SlotAssignment::addSlotElementByName): 72 (WebCore::SlotAssignment::removeSlotElementByName): 73 (WebCore::SlotAssignment::didChangeSlot): 74 * dom/StyledElement.cpp: 75 (WebCore::StyledElement::attributeChanged): 76 (WebCore::StyledElement::styleAttributeChanged): 77 (WebCore::StyledElement::invalidateStyleAttribute): 78 * dom/Text.cpp: 79 (WebCore::Text::updateRendererAfterContentChange): 80 * dom/VisitedLinkState.cpp: 81 (WebCore::VisitedLinkState::invalidateStyleForAllLinks): 82 (WebCore::VisitedLinkState::invalidateStyleForLink): 83 * editing/FrameSelection.cpp: 84 (WebCore::FrameSelection::focusedOrActiveStateChanged): 85 * html/BaseDateAndTimeInputType.cpp: 86 (WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged): 87 * html/FileInputType.cpp: 88 (WebCore::FileInputType::setValue): 89 * html/HTMLAnchorElement.cpp: 90 (WebCore::HTMLAnchorElement::parseAttribute): 91 * html/HTMLBodyElement.cpp: 92 (WebCore::HTMLBodyElement::parseAttribute): 93 * html/HTMLCanvasElement.cpp: 94 (WebCore::HTMLCanvasElement::getContext): 95 (WebCore::HTMLCanvasElement::createImageBuffer): 96 * html/HTMLElement.cpp: 97 (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged): 98 (WebCore::HTMLElement::calculateAndAdjustDirectionality): 99 * html/HTMLFieldSetElement.cpp: 100 (WebCore::HTMLFieldSetElement::addInvalidDescendant): 101 (WebCore::HTMLFieldSetElement::removeInvalidDescendant): 102 * html/HTMLFormControlElement.cpp: 103 (WebCore::HTMLFormControlElement::disabledStateChanged): 104 (WebCore::HTMLFormControlElement::readOnlyAttributeChanged): 105 (WebCore::HTMLFormControlElement::requiredAttributeChanged): 106 (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck): 107 (WebCore::HTMLFormControlElement::updateValidity): 108 * html/HTMLFormElement.cpp: 109 (WebCore::HTMLFormElement::registerFormElement): 110 (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl): 111 (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded): 112 (WebCore::HTMLFormElement::resetDefaultButton): 113 * html/HTMLFrameElementBase.cpp: 114 (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): 115 * html/HTMLFrameOwnerElement.cpp: 116 (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition): 117 (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted. 118 * html/HTMLFrameOwnerElement.h: 119 * html/HTMLFrameSetElement.cpp: 120 (WebCore::HTMLFrameSetElement::parseAttribute): 121 (WebCore::HTMLFrameSetElement::willRecalcStyle): 122 * html/HTMLInputElement.cpp: 123 (WebCore::HTMLInputElement::runPostTypeUpdateTasks): 124 (WebCore::HTMLInputElement::parseAttribute): 125 (WebCore::HTMLInputElement::setChecked): 126 (WebCore::HTMLInputElement::setIndeterminate): 127 (WebCore::HTMLInputElement::setAutoFilled): 128 (WebCore::HTMLInputElement::maxLengthAttributeChanged): 129 (WebCore::HTMLInputElement::minLengthAttributeChanged): 130 * html/HTMLLinkElement.cpp: 131 (WebCore::HTMLLinkElement::parseAttribute): 132 * html/HTMLMediaElement.cpp: 133 (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged): 134 (WebCore::HTMLMediaElement::setVideoFullscreenLayer): 135 * html/HTMLObjectElement.cpp: 136 (WebCore::HTMLObjectElement::parseAttribute): 137 (WebCore::HTMLObjectElement::childrenChanged): 138 (WebCore::HTMLObjectElement::renderFallbackContent): 139 * html/HTMLOptGroupElement.cpp: 140 (WebCore::HTMLOptGroupElement::parseAttribute): 141 * html/HTMLOptionElement.cpp: 142 (WebCore::HTMLOptionElement::parseAttribute): 143 (WebCore::HTMLOptionElement::setSelectedState): 144 * html/HTMLPlugInElement.cpp: 145 (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): 146 * html/HTMLPlugInImageElement.cpp: 147 (WebCore::HTMLPlugInImageElement::setDisplayState): 148 (WebCore::HTMLPlugInImageElement::willRecalcStyle): 149 (WebCore::HTMLPlugInImageElement::finishParsingChildren): 150 (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension): 151 (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired): 152 (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn): 153 * html/HTMLProgressElement.cpp: 154 (WebCore::HTMLProgressElement::didElementStateChange): 155 * html/HTMLSelectElement.cpp: 156 (WebCore::HTMLSelectElement::parseAttribute): 157 (WebCore::HTMLSelectElement::setRecalcListItems): 158 (WebCore::HTMLSelectElement::parseMultipleAttribute): 159 (WebCore::HTMLSelectElement::reset): 160 * html/HTMLTableElement.cpp: 161 (WebCore::isTableCellAncestor): 162 (WebCore::setTableCellsChanged): 163 (WebCore::HTMLTableElement::parseAttribute): 164 * html/HTMLTextAreaElement.cpp: 165 (WebCore::HTMLTextAreaElement::setValueCommon): 166 * html/HTMLTextFormControlElement.cpp: 167 (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility): 168 * html/InputType.cpp: 169 (WebCore::InputType::setValue): 170 * html/NumberInputType.cpp: 171 (WebCore::NumberInputType::minOrMaxAttributeChanged): 172 * html/TextFieldInputType.cpp: 173 (WebCore::TextFieldInputType::subtreeHasChanged): 174 * mathml/MathMLElement.cpp: 175 (WebCore::MathMLElement::parseAttribute): 176 * mathml/MathMLSelectElement.cpp: 177 (WebCore::MathMLSelectElement::updateSelectedChild): 178 * page/animation/AnimationBase.cpp: 179 (WebCore::AnimationBase::setNeedsStyleRecalc): 180 * page/animation/AnimationController.cpp: 181 (WebCore::AnimationControllerPrivate::clear): 182 (WebCore::AnimationControllerPrivate::updateAnimations): 183 (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): 184 (WebCore::AnimationControllerPrivate::pauseAnimationAtTime): 185 (WebCore::AnimationControllerPrivate::pauseTransitionAtTime): 186 (WebCore::AnimationController::cancelAnimations): 187 * rendering/RenderImage.cpp: 188 (WebCore::RenderImage::imageChanged): 189 * rendering/RenderLayer.cpp: 190 (WebCore::RenderLayer::calculateClipRects): 191 * rendering/RenderLayerCompositor.cpp: 192 (WebCore::RenderLayerCompositor::attachRootLayer): 193 (WebCore::RenderLayerCompositor::detachRootLayer): 194 (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): 195 * rendering/RenderObject.cpp: 196 (WebCore::RenderObject::updateDragState): 197 * rendering/svg/SVGResourcesCache.cpp: 198 (WebCore::SVGResourcesCache::clientStyleChanged): 199 * style/AttributeChangeInvalidation.cpp: 200 (WebCore::Style::AttributeChangeInvalidation::invalidateStyle): 201 * style/ClassChangeInvalidation.cpp: 202 (WebCore::Style::ClassChangeInvalidation::invalidateStyle): 203 * style/IdChangeInvalidation.cpp: 204 (WebCore::Style::IdChangeInvalidation::invalidateStyle): 205 * style/RenderTreeUpdater.cpp: 206 (WebCore::RenderTreeUpdater::updateElementRenderer): 207 * style/StyleScope.cpp: 208 (WebCore::Style::Scope::updateActiveStyleSheets): 209 * style/StyleTreeResolver.cpp: 210 (WebCore::Style::resetStyleForNonRenderedDescendants): 211 (WebCore::Style::TreeResolver::resolveElement): 212 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 213 (WebCore::Style::TreeResolver::popParent): 214 (WebCore::Style::clearNeedsStyleResolution): 215 (WebCore::Style::TreeResolver::resolveComposedTree): 216 * style/StyleUpdate.h: 217 * style/StyleValidity.h: Added. 218 219 StyleChangeType enum splits into Style::Validity and Style::InvalidationMode. 220 Move to a file of its own. 221 222 * svg/SVGAElement.cpp: 223 (WebCore::SVGAElement::svgAttributeChanged): 224 * svg/SVGAnimateElementBase.cpp: 225 (WebCore::applyCSSPropertyToTarget): 226 (WebCore::removeCSSPropertyFromTarget): 227 * svg/SVGElement.cpp: 228 (WebCore::SVGElement::willRecalcStyle): 229 * svg/SVGElement.h: 230 (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle): 231 * svg/SVGTests.cpp: 232 (WebCore::SVGTests::handleAttributeChange): 233 * svg/SVGUseElement.cpp: 234 (WebCore::SVGUseElement::invalidateShadowTree): 235 * testing/Internals.cpp: 236 (WebCore::styleValidityToToString): 237 (WebCore::Internals::styleChangeType): 238 (WebCore::styleChangeTypeToString): Deleted. 239 1 240 2016-10-17 Sergio Villar Senin <svillar@igalia.com> 2 241 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r207438 r207458 6253 6253 E47E276516036ED200EE2AFB /* ExtensionStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6254 6254 E47E276816036EDC00EE2AFB /* ExtensionStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */; }; 6255 E48137B91DB3B526005C59BF /* StyleValidity.h in Headers */ = {isa = PBXBuildFile; fileRef = E48137B81DB3B526005C59BF /* StyleValidity.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6255 6256 E48944A2180B57D800F165D8 /* SimpleLineLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */; }; 6256 6257 E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E48944A1180B57D800F165D8 /* SimpleLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 14016 14017 E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionStyleSheets.h; sourceTree = "<group>"; }; 14017 14018 E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionStyleSheets.cpp; sourceTree = "<group>"; }; 14019 E48137B81DB3B526005C59BF /* StyleValidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleValidity.h; sourceTree = "<group>"; }; 14018 14020 E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayout.cpp; sourceTree = "<group>"; }; 14019 14021 E48944A1180B57D800F165D8 /* SimpleLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayout.h; sourceTree = "<group>"; }; … … 22697 22699 E42E76D91C7AF76C00E3614D /* StyleUpdate.cpp */, 22698 22700 E42E76DB1C7AF77600E3614D /* StyleUpdate.h */, 22701 E48137B81DB3B526005C59BF /* StyleValidity.h */, 22699 22702 ); 22700 22703 path = style; … … 25566 25569 A80E7B150A19D606007FB8C5 /* JSHTMLHeadElement.h in Headers */, 25567 25570 1AE2AA2F0A1CDAB400B42B25 /* JSHTMLHeadingElement.h in Headers */, 25571 E48137B91DB3B526005C59BF /* StyleValidity.h in Headers */, 25572 1A299FE81D7F5FA600A60093 /* RenderThemeCocoa.h in Headers */, 25568 25573 1AE2AA310A1CDAB400B42B25 /* JSHTMLHRElement.h in Headers */, 25569 25574 1A85B1900A1B18A200D8C87C /* JSHTMLHtmlElement.h in Headers */, -
trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp
r206990 r207458 101 101 // FIXME: This could do actual rule matching too. 102 102 if (element.shadowRoot()) 103 element. setNeedsStyleRecalc();103 element.invalidateStyleForSubtree(); 104 104 } 105 105 106 switch (element.style ChangeType()) {107 case NoStyleChange: {106 switch (element.styleValidity()) { 107 case Style::Validity::Valid: { 108 108 ElementRuleCollector ruleCollector(element, m_ruleSet, filter); 109 109 ruleCollector.setMode(SelectorChecker::Mode::CollectingRulesIgnoringVirtualPseudoElements); … … 111 111 112 112 if (ruleCollector.hasMatchedRules()) 113 element. setNeedsStyleRecalc(InlineStyleChange);113 element.invalidateStyle(); 114 114 return CheckDescendants::Yes; 115 115 } 116 case InlineStyleChange:116 case Style::Validity::ElementInvalid: 117 117 return CheckDescendants::Yes; 118 case FullStyleChange: 119 case SyntheticStyleChange: 120 case ReconstructRenderTree: 118 case Style::Validity::SubtreeInvalid: 119 case Style::Validity::SubtreeAndRenderersInvalid: 121 120 return CheckDescendants::No; 122 121 } -
trunk/Source/WebCore/dom/Document.cpp
r207442 r207458 1854 1854 m_lastStyleUpdateSizeForTesting = styleUpdate ? styleUpdate->size() : 0; 1855 1855 1856 clearNeedsStyleRecalc();1856 setHasValidStyle(); 1857 1857 clearChildNeedsStyleRecalc(); 1858 1858 unscheduleStyleRecalc(); … … 3501 3501 auto* renderer = element->renderer(); 3502 3502 if (renderer && renderer->style().hasViewportUnits()) 3503 element-> setNeedsStyleRecalc(InlineStyleChange);3503 element->invalidateStyle(); 3504 3504 } 3505 3505 } … … 3819 3819 { 3820 3820 if (m_cssTarget) 3821 m_cssTarget-> setNeedsStyleRecalc();3821 m_cssTarget->invalidateStyleForSubtree(); 3822 3822 m_cssTarget = n; 3823 3823 if (n) 3824 n-> setNeedsStyleRecalc();3824 n->invalidateStyleForSubtree(); 3825 3825 } 3826 3826 … … 5836 5836 fullScreenRenderer->unwrapRenderer(requiresRenderTreeRebuild); 5837 5837 5838 if (requiresRenderTreeRebuild && fullScreenElement && fullScreenElement->parent Node())5839 fullScreenElement->parent Node()->setNeedsStyleRecalc(ReconstructRenderTree);5838 if (requiresRenderTreeRebuild && fullScreenElement && fullScreenElement->parentElement()) 5839 fullScreenElement->parentElement()->invalidateStyleAndRenderersForSubtree(); 5840 5840 } 5841 5841 … … 6028 6028 6029 6029 if (m_fullScreenElement && m_fullScreenElement->isDescendantOf(this)) { 6030 m_fullScreenElement-> setNeedsStyleRecalc();6030 m_fullScreenElement->invalidateStyleForSubtree(); 6031 6031 scheduleForcedStyleRecalc(); 6032 6032 } -
trunk/Source/WebCore/dom/Element.cpp
r206951 r207458 568 568 bool reactsToPress = (renderStyle && renderStyle->affectedByActive()) || styleAffectedByActive(); 569 569 if (reactsToPress) 570 setNeedsStyleRecalc();570 invalidateStyleForSubtree(); 571 571 572 572 if (!renderer()) … … 613 613 614 614 document().userActionElements().setFocused(this, flag); 615 setNeedsStyleRecalc();615 invalidateStyleForSubtree(); 616 616 617 617 for (Element* element = this; element; element = element->parentOrShadowHostElement()) … … 633 633 // stuck in its hovered style). 634 634 if (!flag) 635 setNeedsStyleRecalc();635 invalidateStyleForSubtree(); 636 636 637 637 return; … … 639 639 640 640 if (renderer()->style().affectedByHover() || childrenAffectedByHover()) 641 setNeedsStyleRecalc();641 invalidateStyleForSubtree(); 642 642 643 643 if (renderer()->style().hasAppearance()) … … 1323 1323 else if (name == HTMLNames::pseudoAttr) { 1324 1324 if (needsStyleInvalidation() && isInShadowTree()) 1325 setNeedsStyleRecalc(FullStyleChange);1325 invalidateStyleForSubtree(); 1326 1326 } 1327 1327 else if (name == HTMLNames::slotAttr) { … … 1439 1439 { 1440 1440 return styleResolver().styleForElement(*this, parentStyle); 1441 } 1442 1443 void Element::invalidateStyle() 1444 { 1445 Node::invalidateStyle(Style::Validity::ElementInvalid); 1446 } 1447 1448 void Element::invalidateStyleAndLayerComposition() 1449 { 1450 Node::invalidateStyle(Style::Validity::ElementInvalid, Style::InvalidationMode::RecompositeLayer); 1451 } 1452 1453 void Element::invalidateStyleForSubtree() 1454 { 1455 Node::invalidateStyle(Style::Validity::SubtreeInvalid); 1456 } 1457 1458 void Element::invalidateStyleAndRenderersForSubtree() 1459 { 1460 Node::invalidateStyle(Style::Validity::SubtreeAndRenderersInvalid); 1441 1461 } 1442 1462 … … 1755 1775 target->finishedInsertingSubtree(); 1756 1776 1757 setNeedsStyleRecalc(ReconstructRenderTree);1777 invalidateStyleAndRenderersForSubtree(); 1758 1778 1759 1779 InspectorInstrumentation::didPushShadowRoot(*this, shadowRoot); … … 1937 1957 auto* style = element.renderStyle(); 1938 1958 if (!style || (!style->emptyState() || element.hasChildNodes())) 1939 element. setNeedsStyleRecalc();1959 element.invalidateStyleForSubtree(); 1940 1960 } 1941 1961 } … … 1948 1968 checkForEmptyStyleChange(parent); 1949 1969 1950 if (parent.style ChangeType() >= FullStyleChange)1970 if (parent.styleValidity() >= Style::Validity::SubtreeInvalid) 1951 1971 return; 1952 1972 … … 1963 1983 auto* style = elementAfterChange->renderStyle(); 1964 1984 if (!style || style->firstChildState()) 1965 elementAfterChange-> setNeedsStyleRecalc();1985 elementAfterChange->invalidateStyleForSubtree(); 1966 1986 } 1967 1987 … … 1970 1990 auto* style = newFirstElement->renderStyle(); 1971 1991 if (!style || !style->firstChildState()) 1972 newFirstElement-> setNeedsStyleRecalc();1992 newFirstElement->invalidateStyleForSubtree(); 1973 1993 } 1974 1994 } … … 1983 2003 auto* style = elementBeforeChange->renderStyle(); 1984 2004 if (!style || style->lastChildState()) 1985 elementBeforeChange-> setNeedsStyleRecalc();2005 elementBeforeChange->invalidateStyleForSubtree(); 1986 2006 } 1987 2007 … … 1991 2011 auto* style = newLastElement->renderStyle(); 1992 2012 if (!style || !style->lastChildState()) 1993 newLastElement-> setNeedsStyleRecalc();2013 newLastElement->invalidateStyleForSubtree(); 1994 2014 } 1995 2015 } … … 1997 2017 if (elementAfterChange) { 1998 2018 if (elementAfterChange->styleIsAffectedByPreviousSibling()) 1999 elementAfterChange-> setNeedsStyleRecalc();2019 elementAfterChange->invalidateStyleForSubtree(); 2000 2020 else if (elementAfterChange->affectsNextSiblingElementStyle()) { 2001 2021 Element* elementToInvalidate = elementAfterChange; … … 2005 2025 2006 2026 if (elementToInvalidate) 2007 elementToInvalidate-> setNeedsStyleRecalc();2027 elementToInvalidate->invalidateStyleForSubtree(); 2008 2028 } 2009 2029 } … … 2016 2036 // here. recalcStyle will then force a walk of the children when it sees that this has happened. 2017 2037 if (parent.childrenAffectedByBackwardPositionalRules() && elementBeforeChange) 2018 parent. setNeedsStyleRecalc();2038 parent.invalidateStyleForSubtree(); 2019 2039 } 2020 2040 … … 2705 2725 if (!inRenderedDocument()) 2706 2726 return false; 2707 if (style ChangeType() >= FullStyleChange)2727 if (styleValidity() >= Style::Validity::SubtreeInvalid) 2708 2728 return false; 2709 2729 if (document().hasPendingForcedStyleRecalc()) … … 3072 3092 { 3073 3093 ensureElementRareData().setContainsFullScreenElement(flag); 3074 setNeedsStyleRecalc(SyntheticStyleChange);3094 invalidateStyleAndLayerComposition(); 3075 3095 } 3076 3096 -
trunk/Source/WebCore/dom/Element.h
r206877 r207458 544 544 ElementStyle resolveStyle(const RenderStyle* parentStyle); 545 545 546 // Invalidates the style of a single element. Style is resolved lazily. 547 // Descendant elements are resolved as needed, for example if an inherited property changes. 548 // This should be called whenever an element changes in a manner that can affect its style. 549 void invalidateStyle(); 550 551 // As above but also call RenderElement::setStyle with StyleDifferenceRecompositeLayer flag for 552 // the element even when the style doesn't change. This is mostly needed by the animation code. 553 WEBCORE_EXPORT void invalidateStyleAndLayerComposition(); 554 555 // Invalidate the element and all its descendants. This is used when there is some sort of change 556 // in the tree that may affect the style of any of the descendants and we don't know how to optimize 557 // the case to limit the scope. This is expensive and should be avoided. 558 void invalidateStyleForSubtree(); 559 560 // Invalidates renderers for the element and all its descendants causing them to be torn down 561 // and rebuild during style resolution. Style is also recomputed. This is used in code dealing with 562 // custom (not style based) renderers. This is expensive and should be avoided. 563 // Elements newly added to the tree are also in this state. 564 void invalidateStyleAndRenderersForSubtree(); 565 546 566 bool hasDisplayContents() const; 547 567 void setHasDisplayContents(bool); … … 809 829 setFlag(flag, HasFocusWithin); 810 830 if (styleAffectedByFocusWithin()) 811 setNeedsStyleRecalc();831 invalidateStyleForSubtree(); 812 832 } 813 833 -
trunk/Source/WebCore/dom/Node.cpp
r207381 r207458 667 667 { 668 668 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but 669 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion669 // ContainerNode::setFocus() calls invalidateStyleForSubtree(), so the assertion 670 670 // would fire in the middle of Document::setFocusedElement(). 671 671 … … 751 751 } 752 752 753 void Node::adjustStyleValidity(Style::Validity validity, Style::InvalidationMode mode) 754 { 755 if (validity > styleValidity()) { 756 m_nodeFlags &= ~StyleValidityMask; 757 m_nodeFlags |= static_cast<unsigned>(validity) << StyleValidityShift; 758 } 759 if (mode == Style::InvalidationMode::RecompositeLayer) 760 setFlag(StyleResolutionShouldRecompositeLayerFlag); 761 } 762 753 763 inline void Node::updateAncestorsForStyleRecalc() 754 764 { … … 759 769 it->setDirectChildNeedsStyleRecalc(); 760 770 761 if (it->childrenAffectedByPropertyBasedBackwardPositionalRules()) { 762 if (it->styleChangeType() < FullStyleChange) 763 it->setStyleChange(FullStyleChange); 764 } 771 if (it->childrenAffectedByPropertyBasedBackwardPositionalRules()) 772 it->adjustStyleValidity(Style::Validity::SubtreeInvalid, Style::InvalidationMode::Normal); 765 773 766 774 for (; it != end; ++it) { … … 783 791 } 784 792 785 void Node:: setNeedsStyleRecalc(StyleChangeType changeType)786 { 787 ASSERT( changeType != NoStyleChange);793 void Node::invalidateStyle(Style::Validity validity, Style::InvalidationMode mode) 794 { 795 ASSERT(validity != Style::Validity::Valid); 788 796 if (!inRenderedDocument()) 789 797 return; … … 793 801 return; 794 802 795 StyleChangeType existingChangeType = styleChangeType(); 796 if (changeType > existingChangeType) 797 setStyleChange(changeType); 798 799 if (existingChangeType == NoStyleChange || changeType == ReconstructRenderTree) 803 // FIXME: Why the second condition? 804 bool markAncestors = styleValidity() == Style::Validity::Valid || validity == Style::Validity::SubtreeAndRenderersInvalid; 805 806 adjustStyleValidity(validity, mode); 807 808 if (markAncestors) 800 809 updateAncestorsForStyleRecalc(); 801 810 } … … 1197 1206 setFlag(IsInShadowTreeFlag); 1198 1207 1199 setNeedsStyleRecalc(ReconstructRenderTree);1208 invalidateStyle(Style::Validity::SubtreeAndRenderersInvalid); 1200 1209 1201 1210 return InsertionDone; -
trunk/Source/WebCore/dom/Node.h
r207381 r207458 30 30 #include "MutationObserver.h" 31 31 #include "RenderStyleConstants.h" 32 #include "StyleValidity.h" 32 33 #include "TreeScope.h" 33 34 #include <wtf/Forward.h> … … 62 63 class UIRequestEvent; 63 64 64 const int nodeStyleChangeShift = 14;65 66 65 using NodeOrString = std::experimental::variant<RefPtr<Node>, String>; 67 68 // SyntheticStyleChange means that we need to go through the entire style change logic even though69 // no style property has actually changed. It is used to restructure the tree when, for instance,70 // RenderLayers are created or destroyed due to animation changes.71 enum StyleChangeType {72 NoStyleChange = 0,73 InlineStyleChange = 1 << nodeStyleChangeShift,74 FullStyleChange = 2 << nodeStyleChangeShift,75 SyntheticStyleChange = 3 << nodeStyleChangeShift,76 ReconstructRenderTree = 4 << nodeStyleChangeShift,77 };78 66 79 67 class NodeRareDataBase { … … 322 310 323 311 bool inRenderedDocument() const; 324 bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; } 325 StyleChangeType styleChangeType() const { return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); } 312 bool needsStyleRecalc() const { return styleValidity() != Style::Validity::Valid; } 313 Style::Validity styleValidity() const; 314 bool styleResolutionShouldRecompositeLayer() const; 326 315 bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFlag); } 327 316 bool styleIsAffectedByPreviousSibling() const { return getFlag(StyleIsAffectedByPreviousSibling); } … … 331 320 void clearChildNeedsStyleRecalc() { m_nodeFlags &= ~(ChildNeedsStyleRecalcFlag | DirectChildNeedsStyleRecalcFlag); } 332 321 333 WEBCORE_EXPORT void setNeedsStyleRecalc(StyleChangeType = FullStyleChange); 334 void clearNeedsStyleRecalc() { m_nodeFlags &= ~StyleChangeMask; } 322 void setHasValidStyle(); 335 323 336 324 bool isLink() const { return getFlag(IsLinkFlag); } … … 598 586 // be stored in the same memory word as the Node bits above. 599 587 IsParsingChildrenFinishedFlag = 1 << 13, // Element 600 601 StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1) | 1 << (nodeStyleChangeShift + 2), 588 StyleValidityShift = 14, 589 StyleValidityMask = 3 << StyleValidityShift, 590 StyleResolutionShouldRecompositeLayerFlag = 1 << 16, 602 591 IsEditingTextOrUndefinedCustomElementFlag = 1 << 17, 603 592 HasFocusWithin = 1 << 18, … … 660 649 void setTreeScope(TreeScope& scope) { m_treeScope = &scope; } 661 650 662 void setStyleChange(StyleChangeType changeType) { m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; }651 void invalidateStyle(Style::Validity, Style::InvalidationMode = Style::InvalidationMode::Normal); 663 652 void updateAncestorsForStyleRecalc(); 664 653 … … 682 671 Vector<std::unique_ptr<MutationObserverRegistration>>* mutationObserverRegistry(); 683 672 HashSet<MutationObserverRegistration*>* transientMutationObserverRegistry(); 673 674 void adjustStyleValidity(Style::Validity, Style::InvalidationMode); 684 675 685 676 int m_refCount; … … 774 765 } 775 766 767 inline Style::Validity Node::styleValidity() const 768 { 769 return static_cast<Style::Validity>((m_nodeFlags & StyleValidityMask) >> StyleValidityShift); 770 } 771 772 inline bool Node::styleResolutionShouldRecompositeLayer() const 773 { 774 return getFlag(StyleResolutionShouldRecompositeLayerFlag); 775 } 776 777 inline void Node::setHasValidStyle() 778 { 779 m_nodeFlags &= ~StyleValidityMask; 780 clearFlag(StyleResolutionShouldRecompositeLayerFlag); 781 } 782 776 783 } // namespace WebCore 777 784 -
trunk/Source/WebCore/dom/RadioButtonGroups.cpp
r204203 r207458 154 154 } 155 155 if (m_checkedButton) { 156 button-> setNeedsStyleRecalc();156 button->invalidateStyleForSubtree(); 157 157 if (m_checkedButton == button) { 158 158 m_checkedButton = nullptr; … … 177 177 for (auto& button : m_members) { 178 178 ASSERT(button->isRadioButton()); 179 button-> setNeedsStyleRecalc();179 button->invalidateStyleForSubtree(); 180 180 } 181 181 } -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r206951 r207458 119 119 void ShadowRoot::setResetStyleInheritance(bool value) 120 120 { 121 if (isOrphan()) 122 return; 123 124 if (value != m_resetStyleInheritance) { 125 m_resetStyleInheritance = value; 126 if (host()) 127 setNeedsStyleRecalc(); 128 } 121 // If this was ever changed after initialization, child styles would need to be invalidated here. 122 m_resetStyleInheritance = value; 129 123 } 130 124 -
trunk/Source/WebCore/dom/SlotAssignment.cpp
r204543 r207458 78 78 79 79 // FIXME: We should be able to do a targeted reconstruction. 80 shadowRoot.host()-> setNeedsStyleRecalc(ReconstructRenderTree);80 shadowRoot.host()->invalidateStyleAndRenderersForSubtree(); 81 81 82 82 const AtomicString& slotName = slotNameFromAttributeValue(name); … … 110 110 111 111 if (auto* host = shadowRoot.host()) // FIXME: We should be able to do a targeted reconstruction. 112 host-> setNeedsStyleRecalc(ReconstructRenderTree);112 host->invalidateStyleAndRenderersForSubtree(); 113 113 114 114 auto it = m_slots.find(slotNameFromAttributeValue(name)); … … 155 155 156 156 if (changeType == ChangeType::DirectChild) { 157 shadowRoot.host()-> setNeedsStyleRecalc(ReconstructRenderTree);157 shadowRoot.host()->invalidateStyleAndRenderersForSubtree(); 158 158 m_slotAssignmentsIsValid = false; 159 159 } -
trunk/Source/WebCore/dom/StyledElement.cpp
r206753 r207458 160 160 else if (isPresentationAttribute(name)) { 161 161 elementData()->setPresentationAttributeStyleIsDirty(true); 162 setNeedsStyleRecalc(InlineStyleChange);162 invalidateStyle(); 163 163 } 164 164 … … 217 217 elementData()->setStyleAttributeIsDirty(false); 218 218 219 setNeedsStyleRecalc(InlineStyleChange);219 invalidateStyle(); 220 220 InspectorInstrumentation::didInvalidateStyleAttr(document(), *this); 221 221 } … … 227 227 228 228 elementData()->setStyleAttributeIsDirty(true); 229 setNeedsStyleRecalc(InlineStyleChange);229 invalidateStyle(); 230 230 } 231 231 -
trunk/Source/WebCore/dom/Text.cpp
r204311 r207458 222 222 { 223 223 ASSERT(parentNode()); 224 if (style ChangeType() == ReconstructRenderTree)224 if (styleValidity() >= Style::Validity::SubtreeAndRenderersInvalid) 225 225 return; 226 226 … … 234 234 renderer->setTextWithOffset(data(), offsetOfReplacedData, lengthOfReplacedData); 235 235 } 236 237 236 238 237 #if ENABLE(TREE_DEBUGGING) -
trunk/Source/WebCore/dom/VisitedLinkState.cpp
r203324 r207458 64 64 for (auto& element : descendantsOfType<Element>(m_document)) { 65 65 if (element.isLink()) 66 element. setNeedsStyleRecalc();66 element.invalidateStyleForSubtree(); 67 67 } 68 68 } … … 83 83 for (auto& element : descendantsOfType<Element>(m_document)) { 84 84 if (linkHashForElement(m_document, element) == linkHash) 85 element. setNeedsStyleRecalc();85 element.invalidateStyleForSubtree(); 86 86 } 87 87 } -
trunk/Source/WebCore/editing/FrameSelection.cpp
r206538 r207458 1984 1984 // update style and theme state that depended on those. 1985 1985 if (Element* element = document->focusedElement()) { 1986 element-> setNeedsStyleRecalc();1986 element->invalidateStyleForSubtree(); 1987 1987 if (RenderObject* renderer = element->renderer()) 1988 1988 if (renderer && renderer->style().hasAppearance()) -
trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp
r205249 r207458 96 96 void BaseDateAndTimeInputType::minOrMaxAttributeChanged() 97 97 { 98 element(). setNeedsStyleRecalc();98 element().invalidateStyleForSubtree(); 99 99 } 100 100 -
trunk/Source/WebCore/html/FileInputType.cpp
r205912 r207458 242 242 m_fileList->clear(); 243 243 m_icon = nullptr; 244 element(). setNeedsStyleRecalc();244 element().invalidateStyleForSubtree(); 245 245 } 246 246 -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r206659 r207458 238 238 setIsLink(!value.isNull() && !shouldProhibitLinks(this)); 239 239 if (wasLink != isLink()) 240 setNeedsStyleRecalc();240 invalidateStyleForSubtree(); 241 241 if (isLink()) { 242 242 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); -
trunk/Source/WebCore/html/HTMLBodyElement.cpp
r207361 r207458 170 170 } 171 171 172 setNeedsStyleRecalc();172 invalidateStyleForSubtree(); 173 173 return; 174 174 } -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r205554 r207458 236 236 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS) 237 237 // Need to make sure a RenderLayer and compositing layer get created for the Canvas 238 setNeedsStyleRecalc(SyntheticStyleChange);238 invalidateStyleAndLayerComposition(); 239 239 #endif 240 240 } … … 251 251 if (m_context) { 252 252 // Need to make sure a RenderLayer and compositing layer get created for the Canvas 253 setNeedsStyleRecalc(SyntheticStyleChange);253 invalidateStyleAndLayerComposition(); 254 254 } 255 255 } … … 663 663 if (m_context && m_context->is2d()) 664 664 // Recalculate compositing requirements if acceleration state changed. 665 const_cast<HTMLCanvasElement*>(this)-> setNeedsStyleRecalc(SyntheticStyleChange);665 const_cast<HTMLCanvasElement*>(this)->invalidateStyleAndLayerComposition(); 666 666 #endif 667 667 } -
trunk/Source/WebCore/html/HTMLElement.cpp
r207442 r207458 898 898 for (auto& elementToAdjust : elementLineage(this)) { 899 899 if (elementAffectsDirectionality(elementToAdjust)) { 900 elementToAdjust. setNeedsStyleRecalc();900 elementToAdjust.invalidateStyleForSubtree(); 901 901 return; 902 902 } … … 910 910 setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode); 911 911 if (renderer() && renderer()->style().direction() != textDirection) 912 setNeedsStyleRecalc();912 invalidateStyleForSubtree(); 913 913 } 914 914 -
trunk/Source/WebCore/html/HTMLFieldSetElement.cpp
r203337 r207458 215 215 216 216 if (m_invalidDescendants.isEmpty()) 217 setNeedsStyleRecalc();217 invalidateStyleForSubtree(); 218 218 m_invalidDescendants.add(&invalidFormControlElement); 219 219 } … … 226 226 m_invalidDescendants.remove(&formControlElement); 227 227 if (m_invalidDescendants.isEmpty()) 228 setNeedsStyleRecalc();228 invalidateStyleForSubtree(); 229 229 } 230 230 -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r207380 r207458 175 175 { 176 176 setNeedsWillValidateCheck(); 177 setNeedsStyleRecalc();177 invalidateStyleForSubtree(); 178 178 if (renderer() && renderer()->style().hasAppearance()) 179 179 renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState); … … 183 183 { 184 184 setNeedsWillValidateCheck(); 185 setNeedsStyleRecalc();185 invalidateStyleForSubtree(); 186 186 } 187 187 … … 191 191 // Style recalculation is needed because style selectors may include 192 192 // :required and :optional pseudo-classes. 193 setNeedsStyleRecalc();193 invalidateStyleForSubtree(); 194 194 } 195 195 … … 446 446 447 447 updateValidity(); 448 setNeedsStyleRecalc();448 invalidateStyleForSubtree(); 449 449 450 450 if (!m_willValidate && !wasValid) { … … 556 556 if (willValidate && m_isValid != wasValid) { 557 557 // Update style for pseudo classes such as :valid :invalid. 558 setNeedsStyleRecalc();558 invalidateStyleForSubtree(); 559 559 560 560 if (!m_isValid) { -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r207380 r207458 592 592 if (control.isSuccessfulSubmitButton()) { 593 593 if (!m_defaultButton) 594 control. setNeedsStyleRecalc();594 control.invalidateStyleForSubtree(); 595 595 else 596 596 resetDefaultButton(); … … 620 620 621 621 if (m_invalidAssociatedFormControls.isEmpty()) 622 setNeedsStyleRecalc();622 invalidateStyleForSubtree(); 623 623 m_invalidAssociatedFormControls.add(&formControlElement); 624 624 } … … 628 628 if (m_invalidAssociatedFormControls.remove(&formControlElement)) { 629 629 if (m_invalidAssociatedFormControls.isEmpty()) 630 setNeedsStyleRecalc();630 invalidateStyleForSubtree(); 631 631 } 632 632 } … … 738 738 if (m_defaultButton != oldDefault) { 739 739 if (oldDefault) 740 oldDefault-> setNeedsStyleRecalc();740 oldDefault->invalidateStyleForSubtree(); 741 741 if (m_defaultButton) 742 m_defaultButton-> setNeedsStyleRecalc();742 m_defaultButton->invalidateStyleForSubtree(); 743 743 } 744 744 } -
trunk/Source/WebCore/html/HTMLFrameElementBase.cpp
r205685 r207458 154 154 155 155 if (!renderer()) 156 setNeedsStyleRecalc(ReconstructRenderTree);156 invalidateStyleAndRenderersForSubtree(); 157 157 setNameAndOpenURL(); 158 158 } -
trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp
r205249 r207458 123 123 } 124 124 125 void HTMLFrameOwnerElement::schedule SetNeedsStyleRecalc(StyleChangeType changeType)125 void HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition() 126 126 { 127 127 if (Style::postResolutionCallbacksAreSuspended()) { 128 128 RefPtr<HTMLFrameOwnerElement> element = this; 129 Style::queuePostResolutionCallback([element , changeType]{130 element-> setNeedsStyleRecalc(changeType);129 Style::queuePostResolutionCallback([element] { 130 element->invalidateStyleAndLayerComposition(); 131 131 }); 132 132 } else 133 setNeedsStyleRecalc(changeType);133 invalidateStyleAndLayerComposition(); 134 134 } 135 135 -
trunk/Source/WebCore/html/HTMLFrameOwnerElement.h
r205249 r207458 56 56 SandboxFlags sandboxFlags() const { return m_sandboxFlags; } 57 57 58 void schedule SetNeedsStyleRecalc(StyleChangeType = FullStyleChange);58 void scheduleinvalidateStyleAndLayerComposition(); 59 59 60 60 protected: -
trunk/Source/WebCore/html/HTMLFrameSetElement.cpp
r205249 r207458 87 87 m_rowLengths = newLengthArray(value.string(), m_totalRows); 88 88 // FIXME: Would be nice to optimize the case where m_rowLengths did not change. 89 setNeedsStyleRecalc();89 invalidateStyleForSubtree(); 90 90 } 91 91 return; … … 98 98 m_colLengths = newLengthArray(value.string(), m_totalCols); 99 99 // FIXME: Would be nice to optimize the case where m_colLengths did not change. 100 setNeedsStyleRecalc();100 invalidateStyleForSubtree(); 101 101 } 102 102 return; … … 203 203 bool HTMLFrameSetElement::willRecalcStyle(Style::Change) 204 204 { 205 if (needsStyleRecalc() && renderer()) {205 if (needsStyleRecalc() && renderer()) 206 206 renderer()->setNeedsLayout(); 207 clearNeedsStyleRecalc();208 }209 207 return true; 210 208 } -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r207010 r207458 550 550 551 551 if (renderer()) 552 setNeedsStyleRecalc(ReconstructRenderTree);552 invalidateStyleAndRenderersForSubtree(); 553 553 554 554 if (document().focusedElement() == this) … … 696 696 if (!hasDirtyValue()) { 697 697 updatePlaceholderVisibility(); 698 setNeedsStyleRecalc();698 invalidateStyleForSubtree(); 699 699 } 700 700 setFormControlValueMatchesRenderer(false); … … 703 703 } else if (name == checkedAttr) { 704 704 if (m_inputType->isCheckable()) 705 setNeedsStyleRecalc();705 invalidateStyleForSubtree(); 706 706 707 707 // Another radio button in the same group might be checked by state … … 732 732 m_inputType->maxResultsAttributeChanged(); 733 733 } else if (name == autosaveAttr) { 734 setNeedsStyleRecalc();734 invalidateStyleForSubtree(); 735 735 } else if (name == incrementalAttr) { 736 setNeedsStyleRecalc();736 invalidateStyleForSubtree(); 737 737 } else if (name == minAttr) { 738 738 m_inputType->minOrMaxAttributeChanged(); … … 896 896 m_reflectsCheckedAttribute = false; 897 897 m_isChecked = nowChecked; 898 setNeedsStyleRecalc();898 invalidateStyleForSubtree(); 899 899 900 900 if (RadioButtonGroups* buttons = radioButtonGroups()) … … 922 922 } 923 923 924 setNeedsStyleRecalc();924 invalidateStyleForSubtree(); 925 925 } 926 926 … … 932 932 m_isIndeterminate = newValue; 933 933 934 setNeedsStyleRecalc();934 invalidateStyleForSubtree(); 935 935 936 936 if (renderer() && renderer()->style().hasAppearance()) … … 1331 1331 1332 1332 m_isAutoFilled = autoFilled; 1333 setNeedsStyleRecalc();1333 invalidateStyleForSubtree(); 1334 1334 } 1335 1335 … … 1787 1787 1788 1788 // FIXME: Do we really need to do this if the effective maxLength has not changed? 1789 setNeedsStyleRecalc();1789 invalidateStyleForSubtree(); 1790 1790 updateValidity(); 1791 1791 } … … 1803 1803 1804 1804 // FIXME: Do we really need to do this if the effective minLength has not changed? 1805 setNeedsStyleRecalc();1805 invalidateStyleForSubtree(); 1806 1806 updateValidity(); 1807 1807 } -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r207053 r207458 158 158 setIsLink(!value.isNull() && !shouldProhibitLinks(this)); 159 159 if (wasLink != isLink()) 160 setNeedsStyleRecalc();160 invalidateStyleForSubtree(); 161 161 process(); 162 162 return; -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r207368 r207458 4577 4577 4578 4578 // Kick off a fake recalcStyle that will update the compositing tree. 4579 setNeedsStyleRecalc(SyntheticStyleChange);4579 invalidateStyleAndLayerComposition(); 4580 4580 } 4581 4581 … … 5591 5591 5592 5592 m_player->setVideoFullscreenLayer(platformLayer, completionHandler); 5593 setNeedsStyleRecalc(SyntheticStyleChange);5593 invalidateStyleAndLayerComposition(); 5594 5594 #if ENABLE(VIDEO_TRACK) 5595 5595 updateTextTrackDisplay(); -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r205690 r207458 136 136 137 137 clearUseFallbackContent(); 138 setNeedsStyleRecalc(ReconstructRenderTree);138 invalidateStyleAndRenderersForSubtree(); 139 139 } 140 140 … … 356 356 if (inDocument() && !useFallbackContent()) { 357 357 setNeedsWidgetUpdate(true); 358 setNeedsStyleRecalc();358 invalidateStyleForSubtree(); 359 359 } 360 360 HTMLPlugInImageElement::childrenChanged(change); … … 379 379 return; 380 380 381 setNeedsStyleRecalc(ReconstructRenderTree);381 invalidateStyleAndRenderersForSubtree(); 382 382 383 383 // Before we give up and use fallback content, check to see if this is a MIME type issue. -
trunk/Source/WebCore/html/HTMLOptGroupElement.cpp
r204186 r207458 82 82 83 83 if (name == disabledAttr) 84 setNeedsStyleRecalc();84 invalidateStyleForSubtree(); 85 85 } 86 86 -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r205104 r207458 175 175 m_disabled = !value.isNull(); 176 176 if (oldDisabled != m_disabled) { 177 setNeedsStyleRecalc();177 invalidateStyleForSubtree(); 178 178 if (renderer() && renderer()->style().hasAppearance()) 179 179 renderer()->theme().stateChanged(*renderer(), ControlStates::EnabledState); 180 180 } 181 181 } else if (name == selectedAttr) { 182 setNeedsStyleRecalc();182 invalidateStyleForSubtree(); 183 183 184 184 // FIXME: This doesn't match what the HTML specification says. … … 230 230 231 231 m_isSelected = selected; 232 setNeedsStyleRecalc();232 invalidateStyleForSubtree(); 233 233 234 234 if (HTMLSelectElement* select = ownerSelectElement()) -
trunk/Source/WebCore/html/HTMLPlugInElement.cpp
r205271 r207458 301 301 if (m_pluginReplacement->installReplacement(*root)) { 302 302 setDisplayState(DisplayingPluginReplacement); 303 setNeedsStyleRecalc(ReconstructRenderTree);303 invalidateStyleAndRenderersForSubtree(); 304 304 } 305 305 } -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r206254 r207458 140 140 m_isRestartedPlugin = true; 141 141 m_snapshotDecision = NeverSnapshot; 142 setNeedsStyleRecalc(SyntheticStyleChange);142 invalidateStyleAndLayerComposition(); 143 143 if (displayState() == DisplayingSnapshot) 144 144 m_removeSnapshotTimer.startOneShot(removeSnapshotTimerDelay); … … 240 240 { 241 241 // Make sure style recalcs scheduled by a child shadow tree don't trigger reconstruction and cause flicker. 242 if (change == Style::NoChange && style ChangeType() == NoStyleChange)242 if (change == Style::NoChange && styleValidity() == Style::Validity::Valid) 243 243 return true; 244 244 … … 246 246 // It is only done because loading and load event dispatching is tied to render tree construction. 247 247 if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType() && (displayState() != DisplayingSnapshot)) 248 setNeedsStyleRecalc(ReconstructRenderTree);248 invalidateStyleAndRenderersForSubtree(); 249 249 return true; 250 250 } … … 307 307 setNeedsWidgetUpdate(true); 308 308 if (inDocument()) 309 setNeedsStyleRecalc();309 invalidateStyleForSubtree(); 310 310 } 311 311 … … 333 333 void HTMLPlugInImageElement::resumeFromDocumentSuspension() 334 334 { 335 setNeedsStyleRecalc(ReconstructRenderTree);335 invalidateStyleAndRenderersForSubtree(); 336 336 337 337 HTMLPlugInElement::resumeFromDocumentSuspension(); … … 438 438 m_snapshotImage = nullptr; 439 439 m_isRestartedPlugin = false; 440 setNeedsStyleRecalc(SyntheticStyleChange);440 invalidateStyleAndLayerComposition(); 441 441 if (renderer()) 442 442 renderer()->repaint(); … … 516 516 517 517 setDisplayState(Restarting); 518 setNeedsStyleRecalc(ReconstructRenderTree);518 invalidateStyleAndRenderersForSubtree(); 519 519 } 520 520 -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r203337 r207458 142 142 render->updateFromElement(); 143 143 if (wasDeterminate != isDeterminate()) 144 setNeedsStyleRecalc();144 invalidateStyleForSubtree(); 145 145 } 146 146 } -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r207276 r207458 304 304 updateValidity(); 305 305 if (m_size != oldSize) { 306 setNeedsStyleRecalc(ReconstructRenderTree);306 invalidateStyleAndRenderersForSubtree(); 307 307 setRecalcListItems(); 308 308 updateValidity(); … … 745 745 m_activeSelectionAnchorIndex = -1; 746 746 setOptionsChangedOnRenderer(); 747 setNeedsStyleRecalc();747 invalidateStyleForSubtree(); 748 748 if (!inDocument()) { 749 749 if (HTMLCollection* collection = cachedHTMLCollection(SelectOptions)) … … 1023 1023 updateValidity(); 1024 1024 if (oldUsesMenuList != usesMenuList()) 1025 setNeedsStyleRecalc(ReconstructRenderTree);1025 invalidateStyleAndRenderersForSubtree(); 1026 1026 } 1027 1027 … … 1072 1072 1073 1073 setOptionsChangedOnRenderer(); 1074 setNeedsStyleRecalc();1074 invalidateStyleForSubtree(); 1075 1075 updateValidity(); 1076 1076 } -
trunk/Source/WebCore/html/HTMLTableElement.cpp
r206744 r207458 30 30 #include "CSSValueKeywords.h" 31 31 #include "CSSValuePool.h" 32 #include "ElementChildIterator.h" 32 33 #include "ExceptionCode.h" 33 34 #include "ExceptionCodePlaceholder.h" … … 266 267 } 267 268 268 static inline bool isTableCellAncestor(Node* n) 269 { 270 return n->hasTagName(theadTag) || n->hasTagName(tbodyTag) || 271 n->hasTagName(tfootTag) || n->hasTagName(trTag) || 272 n->hasTagName(thTag); 273 } 274 275 static bool setTableCellsChanged(Node* n) 276 { 277 ASSERT(n); 269 static inline bool isTableCellAncestor(const Element& element) 270 { 271 return element.hasTagName(theadTag) 272 || element.hasTagName(tbodyTag) 273 || element.hasTagName(tfootTag) 274 || element.hasTagName(trTag) 275 || element.hasTagName(thTag); 276 } 277 278 static bool setTableCellsChanged(Element& element) 279 { 278 280 bool cellChanged = false; 279 281 280 if ( n->hasTagName(tdTag))282 if (element.hasTagName(tdTag)) 281 283 cellChanged = true; 282 else if (isTableCellAncestor( n)) {283 for ( Node* child = n->firstChild(); child; child = child->nextSibling())284 else if (isTableCellAncestor(element)) { 285 for (auto& child : childrenOfType<Element>(element)) 284 286 cellChanged |= setTableCellsChanged(child); 285 287 } 286 288 287 289 if (cellChanged) 288 n->setNeedsStyleRecalc();290 element.invalidateStyleForSubtree(); 289 291 290 292 return cellChanged; … … 423 425 m_sharedCellStyle = nullptr; 424 426 bool cellChanged = false; 425 for ( Node* child = firstChild(); child; child = child->nextSibling())427 for (auto& child : childrenOfType<Element>(*this)) 426 428 cellChanged |= setTableCellsChanged(child); 427 429 if (cellChanged) 428 setNeedsStyleRecalc();430 invalidateStyleForSubtree(); 429 431 } 430 432 } -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r206026 r207458 398 398 setLastChangeWasNotUserEdit(); 399 399 updatePlaceholderVisibility(); 400 setNeedsStyleRecalc();400 invalidateStyleForSubtree(); 401 401 setFormControlValueMatchesRenderer(true); 402 402 -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r205524 r207458 167 167 return; 168 168 169 setNeedsStyleRecalc();169 invalidateStyleForSubtree(); 170 170 } 171 171 -
trunk/Source/WebCore/html/InputType.cpp
r205912 r207458 684 684 { 685 685 element().setValueInternal(sanitizedValue, eventBehavior); 686 element(). setNeedsStyleRecalc();686 element().invalidateStyleForSubtree(); 687 687 if (!valueChanged) 688 688 return; -
trunk/Source/WebCore/html/NumberInputType.cpp
r205249 r207458 301 301 InputType::minOrMaxAttributeChanged(); 302 302 HTMLInputElement& element = this->element(); 303 element. setNeedsStyleRecalc();303 element.invalidateStyleForSubtree(); 304 304 if (RenderObject* renderer = element.renderer()) 305 305 renderer->setNeedsLayoutAndPrefWidthsRecalc(); -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r206357 r207458 551 551 element().updatePlaceholderVisibility(); 552 552 // Recalc for :invalid change. 553 element(). setNeedsStyleRecalc();553 element().invalidateStyleForSubtree(); 554 554 555 555 didSetValueByUserEdit(); -
trunk/Source/WebCore/mathml/MathMLElement.cpp
r205249 r207458 76 76 setIsLink(!value.isNull() && !shouldProhibitLinks(this)); 77 77 if (wasLink != isLink()) 78 setNeedsStyleRecalc();78 invalidateStyleForSubtree(); 79 79 } else if (name == rowspanAttr) { 80 80 if (is<RenderTableCell>(renderer()) && hasTagName(mtdTag)) -
trunk/Source/WebCore/mathml/MathMLSelectElement.cpp
r205249 r207458 207 207 208 208 m_selectedChild = newSelectedChild; 209 setNeedsStyleRecalc();209 invalidateStyleForSubtree(); 210 210 } 211 211 -
trunk/Source/WebCore/page/animation/AnimationBase.cpp
r205818 r207458 92 92 ASSERT(!element || element->document().pageCacheState() == Document::NotInPageCache); 93 93 if (element) 94 element-> setNeedsStyleRecalc(SyntheticStyleChange);94 element->invalidateStyleAndLayerComposition(); 95 95 } 96 96 -
trunk/Source/WebCore/page/animation/AnimationController.cpp
r205818 r207458 113 113 114 114 // Return false if we didn't do anything OR we are suspended (so we don't try to 115 // do a setNeedsStyleRecalc() when suspended).115 // do a invalidateStyleForSubtree() when suspended). 116 116 RefPtr<CompositeAnimation> animation = m_compositeAnimations.take(&renderer); 117 117 ASSERT(animation); … … 139 139 ASSERT(element); 140 140 ASSERT(element->document().pageCacheState() == Document::NotInPageCache); 141 element-> setNeedsStyleRecalc(SyntheticStyleChange);141 element->invalidateStyleAndLayerComposition(); 142 142 calledSetChanged = true; 143 143 } … … 212 212 213 213 for (auto& change : m_elementChangesToDispatch) 214 change-> setNeedsStyleRecalc(SyntheticStyleChange);214 change->invalidateStyleAndLayerComposition(); 215 215 216 216 m_elementChangesToDispatch.clear(); … … 359 359 CompositeAnimation& compositeAnimation = ensureCompositeAnimation(*renderer); 360 360 if (compositeAnimation.pauseAnimationAtTime(name, t)) { 361 renderer->element()-> setNeedsStyleRecalc(SyntheticStyleChange);361 renderer->element()->invalidateStyleAndLayerComposition(); 362 362 startUpdateStyleIfNeededDispatcher(); 363 363 return true; … … 374 374 CompositeAnimation& compositeAnimation = ensureCompositeAnimation(*renderer); 375 375 if (compositeAnimation.pauseTransitionAtTime(cssPropertyID(property), t)) { 376 renderer->element()-> setNeedsStyleRecalc(SyntheticStyleChange);376 renderer->element()->invalidateStyleAndLayerComposition(); 377 377 startUpdateStyleIfNeededDispatcher(); 378 378 return true; … … 591 591 ASSERT(!element || element->document().pageCacheState() == Document::NotInPageCache); 592 592 if (element) 593 element-> setNeedsStyleRecalc(SyntheticStyleChange);593 element->invalidateStyleAndLayerComposition(); 594 594 } 595 595 -
trunk/Source/WebCore/rendering/RenderImage.cpp
r206903 r207458 257 257 if (element()) { 258 258 m_needsToSetSizeForAltText = true; 259 element()-> setNeedsStyleRecalc(SyntheticStyleChange);259 element()->invalidateStyleAndLayerComposition(); 260 260 } 261 261 return; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r207357 r207458 6986 6986 // We use the enclosing element so that we recalculate style for the ancestor of an anonymous object. 6987 6987 if (Element* element = enclosingElement()) 6988 element-> setNeedsStyleRecalc(SyntheticStyleChange);6988 element->invalidateStyleAndLayerComposition(); 6989 6989 renderer().repaint(); 6990 6990 } -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r205927 r207458 3550 3550 // The layer will get hooked up via RenderLayerBacking::updateConfiguration() 3551 3551 // for the frame's renderer in the parent document. 3552 m_renderView.document().ownerElement()->schedule SetNeedsStyleRecalc(SyntheticStyleChange);3552 m_renderView.document().ownerElement()->scheduleinvalidateStyleAndLayerComposition(); 3553 3553 break; 3554 3554 } … … 3579 3579 3580 3580 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement()) 3581 ownerElement->schedule SetNeedsStyleRecalc(SyntheticStyleChange);3581 ownerElement->scheduleinvalidateStyleAndLayerComposition(); 3582 3582 break; 3583 3583 } … … 3638 3638 // we need to schedule a style recalc in our parent document. 3639 3639 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement()) 3640 ownerElement->schedule SetNeedsStyleRecalc(SyntheticStyleChange);3640 ownerElement->scheduleinvalidateStyleAndLayerComposition(); 3641 3641 } 3642 3642 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r206395 r207458 1489 1489 bool valueChanged = (dragOn != isDragging()); 1490 1490 setIsDragging(dragOn); 1491 if (valueChanged && node() && (style().affectedByDrag() || (is<Element>(*node()) && downcast<Element>(*node()).childrenAffectedByDrag())))1492 node()->setNeedsStyleRecalc();1493 1491 1494 1492 if (!is<RenderElement>(*this)) 1495 1493 return; 1496 1497 for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(*this))) 1494 auto& renderElement = downcast<RenderElement>(*this); 1495 1496 if (valueChanged && renderElement.element() && (style().affectedByDrag() || renderElement.element()->childrenAffectedByDrag())) 1497 renderElement.element()->invalidateStyleForSubtree(); 1498 1499 for (auto& child : childrenOfType<RenderObject>(renderElement)) 1498 1500 child.updateDragState(dragOn); 1499 1501 } -
trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp
r194496 r207458 122 122 123 123 if (renderer.element() && !renderer.element()->isSVGElement()) 124 renderer.element()-> setNeedsStyleRecalc(SyntheticStyleChange);124 renderer.element()->invalidateStyleAndLayerComposition(); 125 125 } 126 126 -
trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp
r206951 r207458 66 66 67 67 if (!isHTML) { 68 m_element. setNeedsStyleRecalc(FullStyleChange);68 m_element.invalidateStyleForSubtree(); 69 69 return; 70 70 } 71 71 72 72 if (m_element.shadowRoot() && ruleSets.authorStyle().hasShadowPseudoElementRules()) { 73 m_element. setNeedsStyleRecalc(FullStyleChange);73 m_element.invalidateStyleForSubtree(); 74 74 return; 75 75 } 76 76 77 m_element. setNeedsStyleRecalc(InlineStyleChange);77 m_element.invalidateStyle(); 78 78 79 79 if (!childrenOfType<Element>(m_element).first()) -
trunk/Source/WebCore/style/ClassChangeInvalidation.cpp
r206951 r207458 117 117 118 118 if (shadowRoot && ruleSets.authorStyle().hasShadowPseudoElementRules()) { 119 m_element. setNeedsStyleRecalc(FullStyleChange);119 m_element.invalidateStyleForSubtree(); 120 120 return; 121 121 } 122 122 123 m_element. setNeedsStyleRecalc(InlineStyleChange);123 m_element.invalidateStyle(); 124 124 125 125 if (!childrenOfType<Element>(m_element).first()) -
trunk/Source/WebCore/style/IdChangeInvalidation.cpp
r206951 r207458 62 62 63 63 if (m_element.shadowRoot() && ruleSets.authorStyle().hasShadowPseudoElementRules()) { 64 m_element. setNeedsStyleRecalc(FullStyleChange);64 m_element.invalidateStyleForSubtree(); 65 65 return; 66 66 } 67 67 68 m_element. setNeedsStyleRecalc(InlineStyleChange);68 m_element.invalidateStyle(); 69 69 70 70 // This could be easily optimized for fine-grained descendant invalidation similar to ClassChangeInvalidation. … … 72 72 bool mayAffectDescendantStyle = ruleSets.features().idsMatchingAncestorsInRules.contains(changedId.impl()); 73 73 if (mayAffectDescendantStyle) 74 m_element. setNeedsStyleRecalc(FullStyleChange);74 m_element.invalidateStyleForSubtree(); 75 75 else 76 m_element. setNeedsStyleRecalc(InlineStyleChange);76 m_element.invalidateStyle(); 77 77 } 78 78 -
trunk/Source/WebCore/style/RenderTreeUpdater.cpp
r203985 r207458 290 290 auto& renderer = *element.renderer(); 291 291 292 if (update. isSynthetic) {292 if (update.recompositeLayer) { 293 293 renderer.setStyle(WTFMove(*update.style), StyleDifferenceRecompositeLayer); 294 294 return; -
trunk/Source/WebCore/style/StyleScope.cpp
r207280 r207458 393 393 if (m_shadowRoot) { 394 394 for (auto& shadowChild : childrenOfType<Element>(*m_shadowRoot)) 395 shadowChild. setNeedsStyleRecalc();395 shadowChild.invalidateStyleForSubtree(); 396 396 } else 397 397 m_document.scheduleForcedStyleRecalc(); -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r207372 r207458 169 169 if (child.needsStyleRecalc() || affectedByPreviousSibling) { 170 170 child.resetComputedStyle(); 171 child. clearNeedsStyleRecalc();171 child.setHasValidStyle(); 172 172 } 173 173 … … 201 201 return { }; 202 202 203 bool shouldReconstructRenderTree = element.style ChangeType() == ReconstructRenderTree|| parent().change == Detach;203 bool shouldReconstructRenderTree = element.styleValidity() >= Validity::SubtreeAndRenderersInvalid || parent().change == Detach; 204 204 auto* rendererToUpdate = shouldReconstructRenderTree ? nullptr : element.renderer(); 205 205 206 206 auto update = createAnimatedElementUpdate(WTFMove(newStyle), rendererToUpdate, m_document); 207 207 208 if (element.style ChangeType() == SyntheticStyleChange)209 update. isSynthetic= true;208 if (element.styleResolutionShouldRecompositeLayer()) 209 update.recompositeLayer = true; 210 210 211 211 auto* existingStyle = element.renderStyle(); … … 234 234 } 235 235 236 if (update.change != Detach && (parent().change == Force || element.style ChangeType() == FullStyleChange))236 if (update.change != Detach && (parent().change == Force || element.styleValidity() >= Validity::SubtreeInvalid)) 237 237 update.change = Force; 238 238 … … 246 246 std::unique_ptr<RenderStyle> animatedStyle; 247 247 if (rendererToUpdate && document.frame()->animation().updateAnimations(*rendererToUpdate, *newStyle, animatedStyle)) 248 update. isSynthetic= true;248 update.recompositeLayer = true; 249 249 250 250 if (animatedStyle) { … … 283 283 auto& parentElement = *parent().element; 284 284 285 parentElement. clearNeedsStyleRecalc();285 parentElement.setHasValidStyle(); 286 286 parentElement.clearChildNeedsStyleRecalc(); 287 287 … … 333 333 static void clearNeedsStyleResolution(Element& element) 334 334 { 335 element. clearNeedsStyleRecalc();335 element.setHasValidStyle(); 336 336 if (auto* before = element.beforePseudoElement()) 337 before-> clearNeedsStyleRecalc();337 before->setHasValidStyle(); 338 338 if (auto* after = element.afterPseudoElement()) 339 after-> clearNeedsStyleRecalc();339 after->setHasValidStyle(); 340 340 } 341 341 … … 363 363 if (is<Text>(node)) { 364 364 auto& text = downcast<Text>(node); 365 if (text.style ChangeType() == ReconstructRenderTree&& parent.change != Detach)365 if (text.styleValidity() >= Validity::SubtreeAndRenderersInvalid && parent.change != Detach) 366 366 m_update->addText(text, parent.element); 367 367 368 text. clearNeedsStyleRecalc();368 text.setHasValidStyle(); 369 369 it.traverseNextSkippingChildren(); 370 370 continue; -
trunk/Source/WebCore/style/StyleUpdate.h
r207372 r207458 49 49 std::unique_ptr<RenderStyle> style; 50 50 Change change { NoChange }; 51 bool isSynthetic{ false };51 bool recompositeLayer { false }; 52 52 }; 53 53 -
trunk/Source/WebCore/svg/SVGAElement.cpp
r205249 r207458 99 99 if (wasLink != isLink()) { 100 100 InstanceInvalidationGuard guard(*this); 101 setNeedsStyleRecalc();101 invalidateStyleForSubtree(); 102 102 } 103 103 } -
trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp
r206753 r207458 240 240 return; 241 241 242 targetElement. setNeedsStyleRecalc(SyntheticStyleChange);242 targetElement.invalidateStyleAndLayerComposition(); 243 243 } 244 244 … … 247 247 ASSERT(!targetElement.m_deletionHasBegun); 248 248 targetElement.ensureAnimatedSMILStyleProperties().removeProperty(id); 249 targetElement. setNeedsStyleRecalc(SyntheticStyleChange);249 targetElement.invalidateStyleAndLayerComposition(); 250 250 } 251 251 -
trunk/Source/WebCore/svg/SVGElement.cpp
r205411 r207458 302 302 bool SVGElement::willRecalcStyle(Style::Change change) 303 303 { 304 if (!m_svgRareData || style ChangeType() == SyntheticStyleChange)304 if (!m_svgRareData || styleResolutionShouldRecompositeLayer()) 305 305 return true; 306 306 // If the style changes because of a regular property change (not induced by SMIL animations themselves) -
trunk/Source/WebCore/svg/SVGElement.h
r205411 r207458 91 91 ensureUniqueElementData().setPresentationAttributeStyleIsDirty(true); 92 92 // Trigger style recalculation for "elements as resource" (e.g. referenced by feImage). 93 setNeedsStyleRecalc(InlineStyleChange);93 invalidateStyle(); 94 94 } 95 95 -
trunk/Source/WebCore/svg/SVGTests.cpp
r205468 r207458 194 194 if (!targetElement->inDocument()) 195 195 return true; 196 targetElement-> setNeedsStyleRecalc(ReconstructRenderTree);196 targetElement->invalidateStyleAndRenderersForSubtree(); 197 197 return true; 198 198 } -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r206903 r207458 515 515 return; 516 516 m_shadowTreeNeedsUpdate = true; 517 setNeedsStyleRecalc(ReconstructRenderTree);517 invalidateStyleAndRenderersForSubtree(); 518 518 invalidateDependentShadowTrees(); 519 519 } -
trunk/Source/WebCore/testing/Internals.cpp
r207372 r207458 487 487 } 488 488 489 static String style ChangeTypeToString(StyleChangeType type)490 { 491 switch ( type) {492 case NoStyleChange:489 static String styleValidityToToString(Style::Validity validity) 490 { 491 switch (validity) { 492 case Style::Validity::Valid: 493 493 return "NoStyleChange"; 494 case InlineStyleChange:494 case Style::Validity::ElementInvalid: 495 495 return "InlineStyleChange"; 496 case FullStyleChange:496 case Style::Validity::SubtreeInvalid: 497 497 return "FullStyleChange"; 498 case SyntheticStyleChange: 499 return "SyntheticStyleChange"; 500 case ReconstructRenderTree: 498 case Style::Validity::SubtreeAndRenderersInvalid: 501 499 return "ReconstructRenderTree"; 502 500 } … … 507 505 String Internals::styleChangeType(Node& node) 508 506 { 509 return style ChangeTypeToString(node.styleChangeType());507 return styleValidityToToString(node.styleValidity()); 510 508 } 511 509 -
trunk/Source/WebKit/mac/ChangeLog
r207439 r207458 1 2016-10-17 Antti Koivisto <antti@apple.com> 2 3 Rename setNeedsStyleRecalc to invalidateStyle 4 https://bugs.webkit.org/show_bug.cgi?id=163542 5 6 Reviewed by Darin Adler. 7 8 * Plugins/Hosted/WebHostedNetscapePluginView.mm: 9 (-[WebHostedNetscapePluginView createPluginLayer]): 10 * Plugins/WebNetscapePluginView.mm: 11 (-[WebNetscapePluginView createPlugin]): 12 1 13 2016-10-17 Jeremy Jones <jeremyj@apple.com> 2 14 -
trunk/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
r201689 r207458 169 169 // for iframes that contain composited plugins at bad times. https://bugs.webkit.org/show_bug.cgi?id=39033 170 170 core([self webFrame])->view()->enterCompositingMode(); 171 [self element]-> setNeedsStyleRecalc(SyntheticStyleChange);171 [self element]->invalidateStyleAndLayerComposition(); 172 172 } else 173 173 self.wantsLayer = YES; -
trunk/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
r204702 r207458 1100 1100 [_pluginLayer.get() addSublayer:realPluginLayer.get()]; 1101 1101 1102 // Eagerly enter compositing mode, since we know we'll need it. This avoids firing setNeedsStyleRecalc()1102 // Eagerly enter compositing mode, since we know we'll need it. This avoids firing invalidateStyle() 1103 1103 // for iframes that contain composited plugins at bad times. https://bugs.webkit.org/show_bug.cgi?id=39033 1104 1104 core([self webFrame])->view()->enterCompositingMode(); 1105 [self element]-> setNeedsStyleRecalc(SyntheticStyleChange);1105 [self element]->invalidateStyleAndLayerComposition(); 1106 1106 } else 1107 1107 [self setWantsLayer:YES]; -
trunk/Source/WebKit2/ChangeLog
r207454 r207458 1 2016-10-17 Antti Koivisto <antti@apple.com> 2 3 Rename setNeedsStyleRecalc to invalidateStyle 4 https://bugs.webkit.org/show_bug.cgi?id=163542 5 6 Reviewed by Darin Adler. 7 8 * WebProcess/Plugins/PluginView.cpp: 9 (WebKit::PluginView::didInitializePlugin): 10 (WebKit::PluginView::pluginProcessCrashed): 11 1 12 2016-10-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 13 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r205682 r207458 664 664 if (m_plugin->pluginLayer() && frame()) { 665 665 frame()->view()->enterCompositingMode(); 666 m_pluginElement-> setNeedsStyleRecalc(SyntheticStyleChange);666 m_pluginElement->invalidateStyleAndLayerComposition(); 667 667 } 668 668 if (frame() && !frame()->settings().maximumPlugInSnapshotAttempts()) { … … 674 674 if (m_plugin->pluginLayer() && frame()) { 675 675 frame()->view()->enterCompositingMode(); 676 m_pluginElement-> setNeedsStyleRecalc(SyntheticStyleChange);676 m_pluginElement->invalidateStyleAndLayerComposition(); 677 677 } 678 678 if (m_pluginElement->displayState() == HTMLPlugInElement::RestartingWithPendingMouseClick) … … 1571 1571 return; 1572 1572 1573 m_pluginElement-> setNeedsStyleRecalc(SyntheticStyleChange);1573 m_pluginElement->invalidateStyleAndLayerComposition(); 1574 1574 1575 1575 downcast<RenderEmbeddedObject>(*renderer).setPluginUnavailabilityReason(RenderEmbeddedObject::PluginCrashed);
Note:
See TracChangeset
for help on using the changeset viewer.