[webkit-changes] [WebKit/WebKit] b1c357: Use dynamicDowncast<T> more in the DOM

Chris Dumez noreply at github.com
Sun Nov 12 13:54:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b1c357dd6e0f3eede4100c8152dc5be930a2b55d
      https://github.com/WebKit/WebKit/commit/b1c357dd6e0f3eede4100c8152dc5be930a2b55d
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-11-12 (Sun, 12 Nov 2023)

  Changed paths:
    M Source/WebCore/dom/ActiveDOMObject.cpp
    M Source/WebCore/dom/ComposedTreeIterator.cpp
    M Source/WebCore/dom/ContainerNode.cpp
    M Source/WebCore/dom/ContainerNodeAlgorithms.cpp
    M Source/WebCore/dom/CustomElementRegistry.cpp
    M Source/WebCore/dom/DataTransfer.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/DocumentTouch.cpp
    M Source/WebCore/dom/Element.cpp

  Log Message:
  -----------
  Use dynamicDowncast<T> more in the DOM
https://bugs.webkit.org/show_bug.cgi?id=264695

Reviewed by Ryosuke Niwa.

Use dynamicDowncast<T> more in the DOM instead of is<T>() + downcast<T>(). It is
less error-prone and often results in more concise code. I am also hoping to
have downcast<>() do a type check on release builds in the future. It is
currently too expensive to do so but it may become affordable if we use
dynamicDowncast<T>() instead when possible.

* Source/WebCore/dom/ActiveDOMObject.cpp:
(WebCore::suitableScriptExecutionContext):
* Source/WebCore/dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::ComposedTreeIterator):
(WebCore::ComposedTreeIterator::initializeContextStack):
(WebCore::ComposedTreeIterator::traverseNextInShadowTree):
* Source/WebCore/dom/ContainerNode.cpp:
(WebCore::makeChildChangeForInsertion):
(WebCore::ContainerNode::cloneChildNodes):
* Source/WebCore/dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument):
(WebCore::notifyNodeInsertedIntoTree):
(WebCore::notifyNodeRemovedFromDocument):
(WebCore::notifyNodeRemovedFromTree):
(WebCore::assertConnectedSubrameCountIsConsistent):
(WebCore::collectFrameOwners):
(WebCore::disconnectSubframes):
* Source/WebCore/dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::upgrade):
* Source/WebCore/dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDragImage):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::doctype const):
(WebCore::Document::childrenChanged):
(WebCore::Document::adoptNode):
(WebCore::selectNewTitleElement):
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
(WebCore::Document::willBeRemovedFromFrame):
(WebCore::Document::setFocusedElement):
(WebCore::Document::focusNavigationStartingNode const):
(WebCore::Document::getCSSCanvasContext):
(WebCore::Document::serviceRequestVideoFrameCallbacks):
(WebCore::Document::absoluteEventRegionForNode):
(WebCore::eventTargetElementForDocument):
(WebCore::Document::updateHoverActiveState):
(WebCore::Document::dir const):
(WebCore::Document::setDir):
(WebCore::Document::keyframesRuleDidChange):
(WebCore::Document::addTopLayerElement):
(WebCore::Document::activeModalDialog const):
(WebCore::Document::handlePopoverLightDismiss):
(WebCore::Document::canvasChanged):
(WebCore::Document::canvasDestroyed):
* Source/WebCore/dom/DocumentTouch.cpp:
(WebCore::DocumentTouch::createTouch):
(WebCore::DocumentTouch::createTouchList): Deleted.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::cloneShadowTreeIfPossible):
(WebCore::Element::synchronizeAllAttributes const):
(WebCore::Element::synchronizeAttribute const):
(WebCore::listBoxElementScrollIntoView):
(WebCore::Element::absoluteEventBounds):
(WebCore::listBoxElementBoundingBox):
(WebCore::Element::removeAttribute):
(WebCore::Element::setOuterHTML):
(WebCore::Element::setInnerHTML):
(WebCore::forEachRenderLayer):
(WebCore::Element::resolveComputedStyle):
(WebCore::Element::childShouldCreateRenderer const):
(WebCore::Element::fastAttributeLookupAllowed const):
(WebCore::Element::updateName):
(WebCore::Element::updateId):
(WebCore::Element::cloneAttributesFromElement):
(WebCore::contextElementForInsertion):

Canonical link: https://commits.webkit.org/270617@main




More information about the webkit-changes mailing list