Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a71418f5ddcf0373817f0dec2ec9429761c0f280
      
https://github.com/WebKit/WebKit/commit/a71418f5ddcf0373817f0dec2ec9429761c0f280
  Author: Chris Dumez <[email protected]>
  Date:   2026-05-13 (Wed, 13 May 2026)

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

  Log Message:
  -----------
  HTMLElementStack::hasTemplateInHTMLScope() can return m_templateElementCount 
directly
https://bugs.webkit.org/show_bug.cgi?id=314633

Reviewed by Anne van Kesteren.

hasTemplateInHTMLScope() walked the open elements stack to check
for a <template> element. Because the root node (<html> or a
document fragment) is pushed first and never popped, and <template>
can only be pushed above it, any <template> on the stack is always
above the root. The inScopeCommon<isRootNode> walk only terminates
at a <template> (true) or the root (false), so it can never return
false when m_templateElementCount is non-zero.

We can therefore return m_templateElementCount directly and avoid
the stack walk entirely.

* Source/WebCore/html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::hasTemplateInHTMLScope const):

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



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

Reply via email to