Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4eef44e643640601ecd1fcca7c83b239c7591006
      
https://github.com/WebKit/WebKit/commit/4eef44e643640601ecd1fcca7c83b239c7591006
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/mathml/MathMLOperatorElement.cpp

  Log Message:
  -----------
  <mo> operator dictionary should only be consulted when the element contains 
only text content
https://bugs.webkit.org/show_bug.cgi?id=310438
rdar://173078723

Reviewed by Frédéric Wang Nélar.

Per the MathML Core spec [1], the algorithm for determining the properties of
an embellished operator only consults the operator dictionary when "the core
operator contains only text content". When an <mo> element has element children
(e.g. <span>), it does not contain only text content, so default properties
should be used instead. Previously, operatorChar() always used textContent()
which recursively collects text from all descendants, causing operators like
<mo><span>(</span></mo> to incorrectly get dictionary properties (lspace=0,
rspace=0, Stretchy) instead of defaults (5/18em spacing, no flags).

firstElementChild() is the right pick here: it is non-null iff there is an
element child, while comment and processing-instruction nodes are transparent
(they are also skipped by textContent()), so an <mo> containing only text and
comments still parses cleanly and consults the dictionary.

[1] 
https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator

* LayoutTests/TestExpectations: Progression
* Source/WebCore/mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::operatorChar):

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



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

Reply via email to