[webkit-changes] [WebKit/WebKit] 7d24b9: Include Shadow DOM when saving resources to disk

Sihui noreply at github.com
Thu Oct 26 20:36:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7d24b981300779af37d41b74cadbc212cf709ff6
      https://github.com/WebKit/WebKit/commit/7d24b981300779af37d41b74cadbc212cf709ff6
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2023-10-26 (Thu, 26 Oct 2023)

  Changed paths:
    M Source/WebCore/editing/MarkupAccumulator.cpp
    M Source/WebCore/editing/MarkupAccumulator.h
    M Source/WebCore/editing/markup.cpp
    M Source/WebCore/editing/markup.h
    M Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm

  Log Message:
  -----------
  Include Shadow DOM when saving resources to disk
https://bugs.webkit.org/show_bug.cgi?id=263624
rdar://116883097

Reviewed by Ryosuke Niwa.

Add an option to MarkAccumulator to let it generate markup that includes live shadow DOM tree. To ensure the shadow
DOM tree is correctly interpreted as shadow DOM in generated markup string, we wrap it with a template element string.

API test: WebArchive.SaveResourcesShadowDOM
          WebArchive.SaveResourcesDeclarativeShadowDOM

* Source/WebCore/editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::MarkupAccumulator):
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::replacementElement):
(WebCore::MarkupAccumulator::startAppendingNode):
* Source/WebCore/editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::MarkupAccumulator):
(WebCore::MarkupAccumulator::endAppendingNode):
* Source/WebCore/editing/markup.cpp:
(WebCore::serializeFragment):
* Source/WebCore/editing/markup.h:
(WebCore::serializeFragment):
* Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm:

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




More information about the webkit-changes mailing list