Rename setNeedsStyleRecalc to invalidateStyle
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 12:28:55 +0000 (12:28 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 12:28:55 +0000 (12:28 +0000)
commit4503bfc8eddaafc75107f08bdfb07c4cea03b16e
treeda203b58179fdcf0dd8586586ce4f5e3b94e0b7b
parentb3b750211863fa3aff9be913a022d6d138190c56
Rename setNeedsStyleRecalc to invalidateStyle
https://bugs.webkit.org/show_bug.cgi?id=163542

Reviewed by Darin Adler.

Source/WebCore:

Also rename StyleChangeType enum and some related functions for clarity. For example

    element.setNeedsStyleRecalc(SyntheticStyleChange);

becomes

    element.invalidateStyleAndLayerComposition();

* WebCore.xcodeproj/project.pbxproj:
* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::updateViewportUnitsOnResize):
(WebCore::Document::setCSSTarget):
(WebCore::unwrapFullScreenRenderer):
(WebCore::Document::setAnimatingFullScreen):
* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setFocus):
(WebCore::Element::setHovered):
(WebCore::Element::attributeChanged):
(WebCore::Element::invalidateStyle):
(WebCore::Element::invalidateStyleAndLayerComposition):
(WebCore::Element::invalidateStyleForSubtree):
(WebCore::Element::invalidateStyleAndRenderersForSubtree):

    Move public invalidation functions to Element tightening typing.
    Use separate functions instead of enum values.
    This way the call sites look nicer and only useful combinations are exposed.

(WebCore::Element::addShadowRoot):
(WebCore::checkForEmptyStyleChange):
(WebCore::checkForSiblingStyleChanges):
(WebCore::Element::needsStyleInvalidation):
(WebCore::Element::setContainsFullScreenElement):
* dom/Element.h:
(WebCore::Element::setHasFocusWithin):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::adjustStyleValidity):

    Update validity and mode separately. There was a potential bug here where
    SyntheticStyleChange could overwrite FullStyleChange (no known repro).

(WebCore::Node::updateAncestorsForStyleRecalc):
(WebCore::Node::invalidateStyle):
(WebCore::Node::insertedInto):
(WebCore::Node::setNeedsStyleRecalc): Deleted.
* dom/Node.h:
(WebCore::Node::needsStyleRecalc):
(WebCore::Node::styleValidity):
(WebCore::Node::styleResolutionShouldRecompositeLayer):
(WebCore::Node::setHasValidStyle):
(WebCore::Node::styleChangeType): Deleted.
(WebCore::Node::clearNeedsStyleRecalc): Deleted.
(WebCore::Node::setStyleChange): Deleted.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::remove):
(WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setResetStyleInheritance):
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::addSlotElementByName):
(WebCore::SlotAssignment::removeSlotElementByName):
(WebCore::SlotAssignment::didChangeSlot):
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::invalidateStyleAttribute):
* dom/Text.cpp:
(WebCore::Text::updateRendererAfterContentChange):
* dom/VisitedLinkState.cpp:
(WebCore::VisitedLinkState::invalidateStyleForAllLinks):
(WebCore::VisitedLinkState::invalidateStyleForLink):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::focusedOrActiveStateChanged):
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
* html/FileInputType.cpp:
(WebCore::FileInputType::setValue):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
(WebCore::HTMLElement::calculateAndAdjustDirectionality):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::addInvalidDescendant):
(WebCore::HTMLFieldSetElement::removeInvalidDescendant):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::disabledStateChanged):
(WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
(WebCore::HTMLFormControlElement::requiredAttributeChanged):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::updateValidity):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerFormElement):
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::resetDefaultButton):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::parseAttribute):
(WebCore::HTMLFrameSetElement::willRecalcStyle):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::runPostTypeUpdateTasks):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::setIndeterminate):
(WebCore::HTMLInputElement::setAutoFilled):
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
(WebCore::HTMLObjectElement::childrenChanged):
(WebCore::HTMLObjectElement::renderFallbackContent):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::parseAttribute):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::setSelectedState):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::setDisplayState):
(WebCore::HTMLPlugInImageElement::willRecalcStyle):
(WebCore::HTMLPlugInImageElement::finishParsingChildren):
(WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
(WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
(WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::didElementStateChange):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::setRecalcListItems):
(WebCore::HTMLSelectElement::parseMultipleAttribute):
(WebCore::HTMLSelectElement::reset):
* html/HTMLTableElement.cpp:
(WebCore::isTableCellAncestor):
(WebCore::setTableCellsChanged):
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
* html/InputType.cpp:
(WebCore::InputType::setValue):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::minOrMaxAttributeChanged):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::subtreeHasChanged):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::updateSelectedChild):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::clear):
(WebCore::AnimationControllerPrivate::updateAnimations):
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::AnimationController::cancelAnimations):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::updateDragState):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::popParent):
(WebCore::Style::clearNeedsStyleResolution):
(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleUpdate.h:
* style/StyleValidity.h: Added.

    StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
    Move to a file of its own.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
* svg/SVGElement.cpp:
(WebCore::SVGElement::willRecalcStyle):
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::invalidateShadowTree):
* testing/Internals.cpp:
(WebCore::styleValidityToToString):
(WebCore::Internals::styleChangeType):
(WebCore::styleChangeTypeToString): Deleted.

Source/WebKit/mac:

* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView createPluginLayer]):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView createPlugin]):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin):
(WebKit::PluginView::pluginProcessCrashed):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
73 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/StyleInvalidationAnalysis.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/RadioButtonGroups.cpp
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/SlotAssignment.cpp
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/VisitedLinkState.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/html/BaseDateAndTimeInputType.cpp
Source/WebCore/html/FileInputType.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.h
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/InputType.cpp
Source/WebCore/html/NumberInputType.cpp
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLSelectElement.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.cpp
Source/WebCore/style/AttributeChangeInvalidation.cpp
Source/WebCore/style/ClassChangeInvalidation.cpp
Source/WebCore/style/IdChangeInvalidation.cpp
Source/WebCore/style/RenderTreeUpdater.cpp
Source/WebCore/style/StyleScope.cpp
Source/WebCore/style/StyleTreeResolver.cpp
Source/WebCore/style/StyleUpdate.h
Source/WebCore/style/StyleValidity.h [new file with mode: 0644]
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAnimateElementBase.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGTests.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/testing/Internals.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp