[webkit-changes] [WebKit/WebKit] 606b5e: Get rid of downcast<>() in ComposedTreeAncestorIte...

Chris Dumez noreply at github.com
Tue Feb 27 08:51:24 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 606b5ed559adb503da70b7c010895501879f128a
      https://github.com/WebKit/WebKit/commit/606b5ed559adb503da70b7c010895501879f128a
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2024-02-27 (Tue, 27 Feb 2024)

  Changed paths:
    M Source/WebCore/dom/ComposedTreeAncestorIterator.h

  Log Message:
  -----------
  Get rid of downcast<>() in ComposedTreeAncestorIterator
https://bugs.webkit.org/show_bug.cgi?id=270142

Reviewed by Ryosuke Niwa.

Get rid of downcast<>() in ComposedTreeAncestorIterator for performance reasons.
m_current is now an `Element*` instead of a `Node*`. It also calls
Element::shadowRoot() which is slightly more efficient than Node::shadowRoot().

* Source/WebCore/dom/ComposedTreeAncestorIterator.h:
(WebCore::ComposedTreeAncestorIterator::operator++):
(WebCore::ComposedTreeAncestorIterator::get):
(WebCore::ComposedTreeAncestorIterator::ComposedTreeAncestorIterator):
(WebCore::ComposedTreeAncestorIterator::traverseParent):
(WebCore::ComposedTreeAncestorAdapter::begin):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list