[webkit-changes] [WebKit/WebKit] ecbf46: Serialize CSSSupportsRule with URL replacement

Sihui noreply at github.com
Thu Jan 4 16:22:13 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ecbf469afa265318eb7dc8f518c128ebeabdd49a
      https://github.com/WebKit/WebKit/commit/ecbf469afa265318eb7dc8f518c128ebeabdd49a
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-01-04 (Thu, 04 Jan 2024)

  Changed paths:
    M Source/WebCore/css/CSSGroupingRule.cpp
    M Source/WebCore/css/CSSGroupingRule.h
    M Source/WebCore/css/CSSSupportsRule.cpp
    M Source/WebCore/css/CSSSupportsRule.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm

  Log Message:
  -----------
  Serialize CSSSupportsRule with URL replacement
https://bugs.webkit.org/show_bug.cgi?id=267088
rdar://119494689

Reviewed by Ryosuke Niwa.

We need to replace URLs in CSSGroupingRule when saving style content to disk, just like what we did for CSSStyleRule.

API Test: WebArchive.SaveResourcesCSSSupportsRule

* Source/WebCore/css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::appendCSSTextForItemsInternal const):
(WebCore::CSSGroupingRule::appendCSSTextForItems const):
(WebCore::CSSGroupingRule::cssTextForRules const):
(WebCore::CSSGroupingRule::appendCSSTextWithReplacementURLsForItems const):
(WebCore::CSSGroupingRule::cssTextForRulesWithReplacementURLs const):
(WebCore::CSSGroupingRule::cssTextForDeclsAndRules const): Deleted. Replaced with cssTextForRules since declarations
parameter is unused.
* Source/WebCore/css/CSSGroupingRule.h:
* Source/WebCore/css/CSSSupportsRule.cpp:
(WebCore::CSSSupportsRule::cssTextWithReplacementURLs const): Overriding virtual function cssTextWithReplacementURLs of
CSSRule, which is invoked in CSSStyleSheet::cssTextWithReplacementURLs.
This is invoked via virtual function
.
* Source/WebCore/css/CSSSupportsRule.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm:

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




More information about the webkit-changes mailing list