[webkit-changes] [WebKit/WebKit] 5411d5: Simplify treeScope handling logic in CSSStyleSheet...

Chris Dumez noreply at github.com
Wed Mar 15 22:10:49 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5411d5fd0a7ab07fe04c33e6258101b2ab287d84
      https://github.com/WebKit/WebKit/commit/5411d5fd0a7ab07fe04c33e6258101b2ab287d84
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-03-15 (Wed, 15 Mar 2023)

  Changed paths:
    M Source/WebCore/css/CSSStyleSheet.cpp
    M Source/WebCore/css/CSSStyleSheet.h
    M Source/WebCore/css/CSSStyleSheetObservableArray.cpp
    M Source/WebCore/css/CSSStyleSheetObservableArray.h
    M Source/WebCore/dom/TreeScope.cpp

  Log Message:
  -----------
  Simplify treeScope handling logic in CSSStyleSheetObservableArray
https://bugs.webkit.org/show_bug.cgi?id=253976

Reviewed by Ryosuke Niwa.

Simplify treeScope handling logic in CSSStyleSheetObservableArray.
Use ContainerNode as common base type for Document and ShadowRoot to avoid
function overloading and std::variant use.

* Source/WebCore/css/CSSStyleSheet.cpp:
(WebCore::styleScopeFor):
(WebCore::CSSStyleSheet::forEachStyleScope):
(WebCore::CSSStyleSheet::addAdoptingTreeScope):
(WebCore::CSSStyleSheet::removeAdoptingTreeScope):
* Source/WebCore/css/CSSStyleSheet.h:
* Source/WebCore/css/CSSStyleSheetObservableArray.cpp:
(WebCore::CSSStyleSheetObservableArray::create):
(WebCore::CSSStyleSheetObservableArray::CSSStyleSheetObservableArray):
(WebCore::CSSStyleSheetObservableArray::treeScope const):
(WebCore::CSSStyleSheetObservableArray::didAddSheet):
(WebCore::CSSStyleSheetObservableArray::willRemoveSheet):
* Source/WebCore/css/CSSStyleSheetObservableArray.h:
* Source/WebCore/dom/TreeScope.cpp:
(WebCore::TreeScope::ensureAdoptedStyleSheets):

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




More information about the webkit-changes mailing list