[webkit-changes] [WebKit/WebKit] 265261: Connect body to the document before invoking tryFa...

Ryosuke Niwa noreply at github.com
Sat Feb 10 14:23:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2652615cd5bdb8e30000c71c384336f0250bbc39
      https://github.com/WebKit/WebKit/commit/2652615cd5bdb8e30000c71c384336f0250bbc39
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2024-02-10 (Sat, 10 Feb 2024)

  Changed paths:
    A LayoutTests/fast/dom/dom-parser-head-body-order-expected.txt
    A LayoutTests/fast/dom/dom-parser-head-body-order.html
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp

  Log Message:
  -----------
  Connect body to the document before invoking tryFastParsingHTMLFragment
https://bugs.webkit.org/show_bug.cgi?id=269047

Reviewed by Anne van Kesteren and Yusuke Suzuki.

Connect the body element to the document before invoking tryFastParsingHTMLFragment
in Document::setMarkupUnsafe to avoid the secondary insertedIntoAncestor call.

We need to disable coalescing of childrenChanged in this case because we need to call
didFinishInsertingNode on some of the newly connected nodes.

Also added a regression test for a bug that was not caught during the development.

* LayoutTests/fast/dom/dom-parser-head-body-order-expected.txt: Added.
* LayoutTests/fast/dom/dom-parser-head-body-order.html: Added.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setMarkupUnsafe):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::parseChildren):
(WebCore::HTMLFastPathParser::parseContainerElement):
(WebCore::HTMLFastPathParser::parseVoidElement):

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




More information about the webkit-changes mailing list