[webkit-changes] [WebKit/WebKit] b731e7: innerHTML and outerHTML escapes <, >, &, and nbsp ...

Ryosuke Niwa noreply at github.com
Wed May 3 09:34:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b731e7a77411047016a7148725177253848a3789
      https://github.com/WebKit/WebKit/commit/b731e7a77411047016a7148725177253848a3789
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-05-03 (Wed, 03 May 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing-html-fragments/tokenizer-modes-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/syntax/serializing-html-fragments/escaping-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt
    M Source/WebCore/editing/MarkupAccumulator.cpp

  Log Message:
  -----------
  innerHTML and outerHTML escapes <, >, &, and nbsp inside `noscript`
https://bugs.webkit.org/show_bug.cgi?id=254692

Reviewed by Chris Dumez.

Don't escape <, >, &, and nbsp inside noscript element when scripting is enabled.

Also use switch statements with ElementNames in elementCannotHaveEndTag and entityMaskForText.

Inspired by https://chromium-review.googlesource.com/c/chromium/src/+/886646.

* LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing-html-fragments/tokenizer-modes-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/syntax/serializing-html-fragments/escaping-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt:
* Source/WebCore/editing/MarkupAccumulator.cpp:
(WebCore::elementCannotHaveEndTag):
(WebCore::isScriptEnabled): Added.
(WebCore::MarkupAccumulator::entityMaskForText const):

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




More information about the webkit-changes mailing list