[webkit-changes] [WebKit/WebKit] 0deb05: Assert that element is in UA shadow tree in userAg...

Tim Nguyen noreply at github.com
Mon Jan 8 11:34:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0deb0517a6976b4a4f2f2e5917400c2836882dd3
      https://github.com/WebKit/WebKit/commit/0deb0517a6976b4a4f2f2e5917400c2836882dd3
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2024-01-08 (Mon, 08 Jan 2024)

  Changed paths:
    M Source/WebCore/css/SelectorChecker.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
    M Source/WebCore/style/ElementRuleCollector.cpp
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebCore/style/StyleSharingResolver.cpp

  Log Message:
  -----------
  Assert that element is in UA shadow tree in userAgentPart methods
https://bugs.webkit.org/show_bug.cgi?id=267213
rdar://120616043

Reviewed by Ryosuke Niwa.

These methods should never be called on elements outside of UA shadow trees. It's a very likely a bug if they are.

Fix/restructure some code so the assertion holds true everywhere.

* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively const):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::userAgentPart const):
(WebCore::Element::setUserAgentPart):
* Source/WebCore/inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
* Source/WebCore/style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingUserAgentPartRules):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
* Source/WebCore/style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement const):

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




More information about the webkit-changes mailing list