Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8d32cf1ef9b9172286fdfc3b2c5fcaf05761aeb8
      
https://github.com/WebKit/WebKit/commit/8d32cf1ef9b9172286fdfc3b2c5fcaf05761aeb8
  Author: Chris Dumez <[email protected]>
  Date:   2026-04-05 (Sun, 05 Apr 2026)

  Changed paths:
    M Source/WebCore/html/parser/HTMLTreeBuilder.cpp

  Log Message:
  -----------
  Move embed to the void element case in HTMLTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=311510

Reviewed by Anne van Kesteren.

The <embed> element was grouped with applet/marquee/object, which are
non-void elements that push a marker onto the active formatting elements.
Since <embed> is a void element, it was handled via a runtime tagName
check that called insertSelfClosingHTMLElement instead, with redundant
calls to reconstructTheActiveFormattingElements().

Per the WHATWG spec, <embed> belongs in the same case as area/br/img/keygen/wbr:
https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody
(see "A start tag whose tag name is one of: "area", "br", "embed", "img", 
"keygen", "wbr"")

Move it there and simplify the applet/marquee/object case by removing
the now-unnecessary if/else branch and redundant reconstruct calls.

No behavior change — the previous code was correct but inefficient,
as reconstructTheActiveFormattingElements() is idempotent.

* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):

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



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

Reply via email to