Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b9e630270a1d655f2fdc0cc7121cfe04d961d849
      
https://github.com/WebKit/WebKit/commit/b9e630270a1d655f2fdc0cc7121cfe04d961d849
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-05-23 (Sat, 23 May 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/annotation-xml-fragment-parsing-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/annotation-xml-fragment-parsing.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/innerhtml-and-xml-namespaces-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/innerhtml-and-xml-namespaces.svg
    A 
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/w3c-import.log
    A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/annotation-xml-fragment-parsing-expected.txt
    M Source/WTF/wtf/RefPtr.h
    M Source/WebCore/html/parser/HTMLElementStack.cpp
    M Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

  Log Message:
  -----------
  Fix fragment parsing of xmlns="" inheritance and annotation-xml encoding
https://bugs.webkit.org/show_bug.cgi?id=315418

Reviewed by Ryosuke Niwa.

1. XML fragment parsing didn't distinguish "no namespace info" from an
   explicit xmlns="" (libxml2 reports a null URI for both), and didn't
   walk the parsed-fragment ancestors (or cross template-content
   boundaries) to honor an inherited default namespace. Also allows us
   to drop the SVGElement / localName == "svg" workarounds.

2. HTMLElementStack::isHTMLIntegrationPoint read encoding from the
   stack item's saved attributes, which are empty for fragment-context
   items built via HTMLStackItem(Element&). So <annotation-xml
   encoding="application/xhtml+xml"> as fragment context never matched.
   Read it off the element via attributeWithoutSynchronization. (This
   is the only element where this matters so this is better than making
   HTMLStackItem itself more involved.)

3. RefPtr's dynamicDowncast propagates const via match_constness_t for
   the value type but used plain Target for the trait defaults, making
   RefPtr<const T> not work. (Which we need to work as host() returns a
   const T.)

Tests: 
imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/annotation-xml-fragment-parsing.html
       
imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/the-innerhtml-property/innerhtml-and-xml-namespaces.svg

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to