Skip to content

[MathML Core] Update prefixs +/−/±/∓, prefix ∇ and infix ⋉ spacing in Operator Dictionary and fix dynamic case#64613

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Ahmad-S792:eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case
May 11, 2026
Merged

[MathML Core] Update prefixs +/−/±/∓, prefix ∇ and infix ⋉ spacing in Operator Dictionary and fix dynamic case#64613
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Ahmad-S792:eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case

Conversation

@Ahmad-S792
Copy link
Copy Markdown
Contributor

@Ahmad-S792 Ahmad-S792 commented May 9, 2026

caf4d10

[MathML Core] Update prefixs +/−/±/∓, prefix ∇ and infix ⋉ spacing in Operator Dictionary and fix dynamic case
https://bugs.webkit.org/show_bug.cgi?id=314477
rdar://176652211

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

This patch syncs outdated below entries with the MathML Core operator dictionary [1]:

    U+002B + Prefix: (0,1) -> (0,0)
    U+00B1 ± Prefix: (0,1) -> (0,0)
    U+2212 − Prefix: (0,1) -> (0,0)
    U+2213 ∓ Prefix: (0,1) -> (0,0)
    U+2207 ∇ Prefix: (2,1) -> (0,0)
    U+22C9 ⋉ Infix:  (4,4) -> (3,3)

MathMLRowElement::childrenChanged already invalidates each child operator's
cached dictionary property via setOperatorFormDirty(), but the old
implementation only cleared the cache; the operator's renderer was never
marked dirty, so the next layout saw "no layout needed" and painted the
stale pre-mutation spacing. Move setOperatorFormDirty() out-of-line and
mirror the attributeChanged(form) path: reset the operator-flag dirty bits
and call updateFromElement() + setNeedsLayoutAndPreferredWidthsUpdate() on
the renderer so the sibling-triggered form switch actually takes effect.

[1] https://www.w3.org/TR/mathml-core/#operator-dictionary-human

* LayoutTests/TestExpectations: Progressions
* Source/WebCore/mathml/MathMLOperatorDictionary.cpp:
* Source/WebCore/mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::setOperatorFormDirty):
* Source/WebCore/mathml/MathMLOperatorElement.h:

> Duplicate of `mo-form.html` from WPT:
* LayoutTests/mathml/presentation/mo-form-expected.html: Removed.
* LayoutTests/mathml/presentation/mo-form.html: Removed.

> Updated local test to new behavior (WPT coverage not for these scenarios):
* LayoutTests/mathml/presentation/dir-mo-expected.html:
* LayoutTests/mathml/presentation/mo-lspace-rspace-expected.html:

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

baddbf3

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 🧪 api-mac ✅ 🧪 api-wpe ❌ 🛠 vision-apple
🧪 ios-wk2-wpt 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 🧪 gtk-wk2
✅ 🛠 vision 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@Ahmad-S792 Ahmad-S792 self-assigned this May 9, 2026
@Ahmad-S792 Ahmad-S792 added the MathML For bugs specific to MathML. label May 9, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 9, 2026
@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

iOS Safer C++ Build #20016 (a250825)

❌ Found 1 failing file with 4 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@webkit-ews-buildbot
Copy link
Copy Markdown
Collaborator

macOS Safer C++ Build #101671 (a250825)

❌ Found 1 failing file with 4 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
(cc @rniwa)

@Ahmad-S792 Ahmad-S792 removed the merging-blocked Applied to prevent a change from being merged label May 10, 2026
@Ahmad-S792 Ahmad-S792 force-pushed the eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case branch from a250825 to c562bf3 Compare May 10, 2026 06:44
@Ahmad-S792 Ahmad-S792 marked this pull request as ready for review May 10, 2026 08:15
@Ahmad-S792 Ahmad-S792 requested a review from fred-wang May 10, 2026 08:15
@Ahmad-S792 Ahmad-S792 force-pushed the eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case branch from c562bf3 to 64f43aa Compare May 11, 2026 09:33
@Ahmad-S792 Ahmad-S792 force-pushed the eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case branch from 64f43aa to baddbf3 Compare May 11, 2026 09:35
@Ahmad-S792 Ahmad-S792 added the merge-queue Applied to send a pull request to merge-queue label May 11, 2026
… Operator Dictionary and fix dynamic case

https://bugs.webkit.org/show_bug.cgi?id=314477
rdar://176652211

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

This patch syncs outdated below entries with the MathML Core operator dictionary [1]:

    U+002B + Prefix: (0,1) -> (0,0)
    U+00B1 ± Prefix: (0,1) -> (0,0)
    U+2212 − Prefix: (0,1) -> (0,0)
    U+2213 ∓ Prefix: (0,1) -> (0,0)
    U+2207 ∇ Prefix: (2,1) -> (0,0)
    U+22C9 ⋉ Infix:  (4,4) -> (3,3)

MathMLRowElement::childrenChanged already invalidates each child operator's
cached dictionary property via setOperatorFormDirty(), but the old
implementation only cleared the cache; the operator's renderer was never
marked dirty, so the next layout saw "no layout needed" and painted the
stale pre-mutation spacing. Move setOperatorFormDirty() out-of-line and
mirror the attributeChanged(form) path: reset the operator-flag dirty bits
and call updateFromElement() + setNeedsLayoutAndPreferredWidthsUpdate() on
the renderer so the sibling-triggered form switch actually takes effect.

[1] https://www.w3.org/TR/mathml-core/#operator-dictionary-human

* LayoutTests/TestExpectations: Progressions
* Source/WebCore/mathml/MathMLOperatorDictionary.cpp:
* Source/WebCore/mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::setOperatorFormDirty):
* Source/WebCore/mathml/MathMLOperatorElement.h:

> Duplicate of `mo-form.html` from WPT:
* LayoutTests/mathml/presentation/mo-form-expected.html: Removed.
* LayoutTests/mathml/presentation/mo-form.html: Removed.

> Updated local test to new behavior (WPT coverage not for these scenarios):
* LayoutTests/mathml/presentation/dir-mo-expected.html:
* LayoutTests/mathml/presentation/mo-lspace-rspace-expected.html:

Canonical link: https://commits.webkit.org/312999@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case branch from baddbf3 to caf4d10 Compare May 11, 2026 10:28
@webkit-commit-queue
Copy link
Copy Markdown
Collaborator

Committed 312999@main (caf4d10): https://commits.webkit.org/312999@main

Reviewed commits have been landed. Closing PR #64613 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit caf4d10 into WebKit:main May 11, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 11, 2026
@Ahmad-S792 Ahmad-S792 deleted the eng/MathML-Core-Update-prefixs-prefix-and-infix-spacing-in-Operator-Dictionary-and-fix-dynamic-case branch May 11, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MathML For bugs specific to MathML.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants