[webkit-changes] [WebKit/WebKit] 5199ed: HTML parser: execute self-closing SVG script element

Anne van Kesteren noreply at github.com
Mon Jan 29 15:58:33 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5199ed9a65daf9800e381287819a5e496b8782b9
      https://github.com/WebKit/WebKit/commit/5199ed9a65daf9800e381287819a5e496b8782b9
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/support/svg-script-self-closing.js
    M LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/support/w3c-import.log
    M LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/unclosed-svg-script-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/unclosed-svg-script.html
    M Source/WebCore/html/parser/AtomHTMLToken.h
    M Source/WebCore/html/parser/HTMLTreeBuilder.cpp

  Log Message:
  -----------
  HTML parser: execute self-closing SVG script element
https://bugs.webkit.org/show_bug.cgi?id=268168

Reviewed by Ryosuke Niwa and Chris Dumez.

The code is largely structured like the HTML Standard, except we
currently do not fake an end tag as needed for m_scriptToProcess to be
properly assigned to.

As foreign content supports self-closing start tags we also have to
pretend the start tag is a non-self-closing one. This results in some
slight code smell, but it seems acceptable enough.

Gecko does this correctly already.

Aligns WPT with this commit:
https://github.com/web-platform-tests/wpt/commit/eef173b5b9ee626ff9e144c80f8082af2f086e4c

* LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/support/svg-script-self-closing.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/support/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/unclosed-svg-script-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/unclosed-svg-script.html:
* Source/WebCore/html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::setSelfClosingToFalse):
* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processTokenInForeignContent):

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




More information about the webkit-changes mailing list