[webkit-changes] [WebKit/WebKit] 38ce5b: XMLSerializer.serializeToString() should support A...

Ahmad Saleem noreply at github.com
Fri Oct 28 22:47:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 38ce5b803b349852d5800b8027e123ca8248e30f
      https://github.com/WebKit/WebKit/commit/38ce5b803b349852d5800b8027e123ca8248e30f
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2022-10-28 (Fri, 28 Oct 2022)

  Changed paths:
    M LayoutTests/fast/dom/XMLSerializer-expected.txt
    M LayoutTests/fast/dom/XMLSerializer.html
    M Source/WebCore/editing/MarkupAccumulator.cpp

  Log Message:
  -----------
  XMLSerializer.serializeToString() should support Attr node as parameter

XMLSerializer.serializeToString() should support Attr node as parameter
https://bugs.webkit.org/show_bug.cgi?id=247096

Reviewed by Ryosuke Niwa.

This is to align Webkit with Blink / Chrome.

Inspired from - https://chromium.googlesource.com/chromium/src.git/+/271184ec08ca181a7d93eed532f3ce9efb9c0bcc

The specification [1] doesn't define the behavior for Attr because the
specification assumes Attr is not a Node. However, passing an Attr is possible
now and we should not have an assertion failure.

This patch is aimed to serializeToString() matching to Web Specification.
It means serializing the attribute value.

[1] https://w3c.github.io/DOM-Parsing/#dfn-concept-serialize-xml

* Source/WebCore/editing/MarkupAccumulator.cpp: Added "Attr.h" header
(MarkAccumulator::appendNonElementNode): Add result value for "Attribute Node"
* LayoutTests/fast/dom/XMLSerializer.html: Updated to use "testharness" and Attr test as well
* LayoutTests/fast/dom/XMLSerializer-expected.txt: Added Test Case Expectations

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




More information about the webkit-changes mailing list