Граф коммитов

1901 Коммитов

Автор SHA1 Сообщение Дата
Andi-Bogdan Postelnicu d7e8a09c21 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 15.0.5 (taskcluster-MKK8dHUpQkGfPLA793lizg)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D168658
2023-02-13 15:02:07 +00:00
Frederic Wang f2e17c3b46 Bug 1586574 - apply horizontal writing mode to mathml elements. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D48279
2022-12-16 17:07:56 +00:00
Norisz Fay eb18b4a132 Backed out changeset 112934bd11d2 (bug 1586574) for causing reftest failures on 1748277.html 2022-12-16 13:35:27 +02:00
Frederic Wang 7573c4fcdc Bug 1586574 - apply horizontal writing mode to mathml elements. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D48279
2022-12-16 08:44:34 +00:00
Stanca Serban c2acdd43f8 Backed out changeset 06a17fd75d84 (bug 1586574) for causing wpt failures in ignored-properties-001.html. CLOSED TREE 2022-12-15 13:09:51 +02:00
Frederic Wang 43a06a1f37 Bug 1586574 - apply horizontal writing mode to mathml elements. r=emilio CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D48279
2022-12-15 09:11:48 +00:00
Stanca Serban fb105d2048 Backed out changeset 32522f6f6750 (bug 1586574) for causing wpt unexpected passes on reset-and-logicial-property.html. CLOSED TREE 2022-12-15 11:45:38 +02:00
Frederic Wang 241ec05d64 Bug 1586574 - apply horizontal writing mode to mathml elements. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D48279
2022-12-15 08:23:15 +00:00
Martin Robinson abb5044ca7 Bug 1803377 - Rename the values of the `IntrinsicDirty` enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Frederic Wang 02f63e4dd3 Bug 1802336 - Align none/mprescripts on MathML Core. r=emilio
See https://w3c.github.io/mathml-core/#prescripts-and-tensor-indices-mmultiscripts

- none/mprescripts are laid out as an mrow.
- none is not involved at all in "invalidity".

Differential Revision: https://phabricator.services.mozilla.com/D163001
2022-11-25 13:30:13 +00:00
Ting-Yu Lin 514d412f9b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Ting-Yu Lin c565d29604 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-12 04:38:53 +00:00
Noemi Erli 7c40c0e983 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin 192956df1b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Ting-Yu Lin 75940b1777 Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
2022-11-11 23:44:16 +00:00
Frederic Wang cf81eabf53 Bug 1800112 - default-properties-on-the-math-root.html fails. r=emilio
This commit adds missing UA rules on the <math> root as specified
in https://w3c.github.io/mathml-core/#the-top-level-math-element

Differential Revision: https://phabricator.services.mozilla.com/D161815
2022-11-11 09:39:15 +00:00
Ting-Yu Lin 040feb02dd Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Ting-Yu Lin c99b45fa14 Bug 1798373 Part 6 - Change nsContainerFrame::AppendFrames() to take rvalue reference of nsFrameList. r=emilio
Change nsBlockFrame::AppendFrames() helper, too.

Differential Revision: https://phabricator.services.mozilla.com/D160842
2022-11-01 21:15:54 +00:00
Ting-Yu Lin 4787078c5c Bug 1798373 Part 5 - Change nsContainerFrame::SetInitialChildList() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160841
2022-11-01 21:15:54 +00:00
Ting-Yu Lin adf4fab73c Bug 1798373 Part 2 - Change nsFrameList::AppendFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160838
2022-11-01 21:15:52 +00:00
Ting-Yu Lin 569c5f244b Bug 1798373 Part 1 - Change nsFrameList::InsertFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160837
2022-11-01 21:15:52 +00:00
sskcvqikf c53abb7b6e Bug 1797012 - Change NS_STYLE_MATH_STYLE_* macros to enum StyleMathStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160016
2022-10-24 17:47:34 +00:00
Marian-Vasile Laza e80c0a7ce7 Backed out changeset f39d284f4db7 (bug 1797012) for causing wpt failures on frac-1.html. CLOSED TREE 2022-10-24 15:46:12 +03:00
sskcvqikf 15eb00a7bf Bug 1797012 - Change NS_STYLE_MATH_STYLE_* macros to enum StyleMathStyle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160016
2022-10-24 09:29:05 +00:00
Frederic Wang 36b880a97d Bug 1795630 - Export MathML crashtests to WPT. r=emilio
This commit moves crash tests from dom/mathml and layout/mathml into
testing/web-platform/tests/mathml/crashtests/mozilla, trying to do only
minimal changes (i.e. use 'test-wait' instead of 'reftest-wait' and
fix whitespace errors). lint errors are ignored for usage of
setTimeout as well as the invalid XML file testing bug 289180.

Regarding 400157.xhtml, it uses special powers to trigger a
zoom changes. It could probably be tweaked to convert to a mochitest or
rely on a different dynamic change. However, this was testing a crash for
the `<mfenced>` element in nsMathMLmfencedFrame whose code has been
completely removed, so it's now hard to reproduce the original crash.
Also that makes the test no longer very useful, so we just remove it.

Differential Revision: https://phabricator.services.mozilla.com/D159491
2022-10-18 04:21:41 +00:00
Cristian Tuns daaaf0a3af Backed out changeset f792a9947d0f (bug 1795630) for causing lint failures CLOSED TREE 2022-10-17 14:32:24 -04:00
Frederic Wang 5cbb8bbec5 Bug 1795630 - Export MathML crashtests to WPT. r=emilio
This commit moves crash tests from dom/mathml and layout/mathml into
testing/web-platform/tests/mathml/crashtests/mozilla, trying to do only
minimal changes (i.e. use 'test-wait' instead of 'reftest-wait').

The exception is 400157.xhtml which uses special powers to trigger a
zoom changes. It could probably be tweaked to convert to a mochitest or
rely on a different dynamic change. However, this was testing a crash for
the `<mfenced>` element in nsMathMLmfencedFrame whose code has been
completely removed, so it's now hard to reproduce the original crash.
Also that makes the test no longer very useful, so we just remove it.

Differential Revision: https://phabricator.services.mozilla.com/D159491
2022-10-17 17:16:33 +00:00
Frederic Wang 4766c8a994 Bug 1793387 - disable lquote/rquote attributes on the <ms> element. r=emilio
This commit introduces a MathML preference for the legacy implementation
of the lquote/rquote attributes, and disable it by default. This feature
is not implemented in Chromium or WebKit, not part of MathML Core and
Firefox's implementation has issues (e.g. bugs 787215 and 1108608).

Differential Revision: https://phabricator.services.mozilla.com/D158479
2022-10-08 11:37:32 +00:00
Frederic Wang 097a3d7648 Bug 1793452 - Remove flags PARSE_ALLOW_UNITLESS and CONVERT_UNITLESS_TO_PERCENT. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D158547
2022-10-07 12:57:08 +00:00
Frederic Wang 246c6b03a7 Bug 1246657 - The Operator Dictionary lack entries for U+1EEF0 and U+1EEF1. r=emilio
This commit ensures that the following operators use category I from
MathML Core's operator dictionary [1] [2]:

  U+1EEF0 ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL
  U+1EEF1 ARABIC MATHEMATICAL OPERATOR HAH WITH DAL

which corresponds to zero lspace/rspace and stretchy. There should
already be exhaustive WPT tests operator-dictionary-* to check
these and other properties, but they may be shadowed by existing
failures or Firefox bugs, so add some more specific reftests for
spacing and stretching. However, nsMathMLmoFrame and nsMathMLChar
don't handle non-BMP characters very well, so only the first one
currently passes.

Also tweak updateOperatorDictionary.pl to ignore these special
operators.

[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator
[2] https://w3c.github.io/mathml-core/#operator-dictionary-categories-values

Differential Revision: https://phabricator.services.mozilla.com/D157788
2022-09-23 08:08:43 +00:00
Frederic Wang a26af613a4 Bug 1790009, part 3 - Implement special handling for operators using U+0338 and U+20D2. r=emilio
MathML Core specifies that operators containing a UTF-16 strings of
length 2 ending with U+0338 COMBINING LONG SOLIDUS OVERLAY or U+20D2
COMBINING LONG VERTICAL LINE OVERLAY should just use the properties of
the first character. This commit implements that behavior. It removes
obsolete entries that are superseded by this rule and modifies
updateOperatorDictionary.pl to ensure that no such entries are present.

Existing WPT test operator-dictionary-combining.html is already passing
after bug 1789583 because the operators tested use the default spacing.
So extend it to try operators with different spacing.

[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator

Differential Revision: https://phabricator.services.mozilla.com/D157707
2022-09-22 12:04:08 +00:00
Frederic Wang 99b9446a07 Bug 1790009, part 2 - Operator dictionary: Only accept UTF-16 strings of 1 or 2 characters. r=emilio
MathML Core specifies that operators containing a UTF-16 strings whose
length is not 1 or 2 should use the default properties [1]. This
commit removes the obsolete strings of length 3 from our operator
dictionary and tweak updateOperatorDictionary.pl to ensure it only
accepts strings of 1 or 2 characters. This also adds an early return
in LookupOperator to immediately fallback to default properties.

[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator

Differential Revision: https://phabricator.services.mozilla.com/D157706
2022-09-22 12:04:07 +00:00
Frederic Wang a099935c6f Bug 1790009, part 1: Refactor nsMathMLOperators::LookupOperator(s). r=emilio
nsMathMLOperators::LookupOperators(s) methods are currently use in three
places:

(1) In nsMathMLmoFrame::ProcessTextData(), where we need to check the
    flags for each form of the operator and take the bitwise-or of all
    of them, ignoring lspace/rspace.

(2) In nsMathMLOperators::GetStretchyDirection::ProcessTextData(), where
    we need to check the direction for each form of the operator (in any
    order) and return the first found, ignoring lspace/rspace.

(3) In nsMathMLmoFrame::ProcessOperatorData, where need to check the
    specified form, and try fallback forms in the order prefix, postfix,
    infix. When an entry is found, the code also clears the form bits of
    mFlags and bitwise-or the found flags.

This commit modifies nsMathMLOperators::LookupOperator to only check
one form at once and can be used to easily implement (1) and (2). This
removes the need for nsMathMLOperators::LookupOperators.

A new method nsMathMLOperators::LookupOperatorWithFallback is introduced
to preserve the fallback prefix/postfix/infix check that is needed for
(3). Undocumented bitwise logic is moved out of that method.

Differential Revision: https://phabricator.services.mozilla.com/D157705
2022-09-22 12:04:07 +00:00
Butkovits Atila 0421d864fc Backed out 3 changesets (bug 1790009) for causing mochitest failures at browser_misused_characters_in_strings.js. CLOSED TREE
Backed out changeset 73ff5b4bf98c (bug 1790009)
Backed out changeset 236e1d9535ed (bug 1790009)
Backed out changeset 90ee5367d506 (bug 1790009)
2022-09-21 15:06:25 +03:00
Frederic Wang 7e2948f114 Bug 1790009, part 3 - Implement special handling for operators using U+0338 and U+20D2. r=emilio
MathML Core specifies that operators containing a UTF-16 strings of
length 2 ending with U+0338 COMBINING LONG SOLIDUS OVERLAY or U+20D2
COMBINING LONG VERTICAL LINE OVERLAY should just use the properties of
the first character. This commit implements that behavior. It removes
obsolete entries that are superseded by this rule and modifies
updateOperatorDictionary.pl to ensure that no such entries are present.

Existing WPT test operator-dictionary-combining.html is already passing
after bug 1789583 because the operators tested use the default spacing.
So extend it to try operators with different spacing.

[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator

Differential Revision: https://phabricator.services.mozilla.com/D157707
2022-09-21 06:28:05 +00:00
Frederic Wang 218ba23a4d Bug 1790009, part 2 - Operator dictionary: Only accept UTF-16 strings of 1 or 2 characters. r=emilio
MathML Core specifies that operators containing a UTF-16 strings whose
length is not 1 or 2 should use the default properties [1]. This
commit removes the obsolete strings of length 3 from our operator
dictionary and tweak updateOperatorDictionary.pl to ensure it only
accepts strings of 1 or 2 characters. This also adds an early return
in LookupOperator to immediately fallback to default properties.

[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator

Differential Revision: https://phabricator.services.mozilla.com/D157706
2022-09-21 06:28:05 +00:00
Frederic Wang 5a87e3e26d Bug 1790009, part 1: Refactor nsMathMLOperators::LookupOperator(s). r=emilio
nsMathMLOperators::LookupOperators(s) methods are currently use in three
places:

(1) In nsMathMLmoFrame::ProcessTextData(), where we need to check the
    flags for each form of the operator and take the bitwise-or of all
    of them, ignoring lspace/rspace.

(2) In nsMathMLOperators::GetStretchyDirection::ProcessTextData(), where
    we need to check the direction for each form of the operator (in any
    order) and return the first found, ignoring lspace/rspace.

(3) In nsMathMLmoFrame::ProcessOperatorData, where need to check the
    specified form, and try fallback forms in the order prefix, postfix,
    infix. When an entry is found, the code also clears the form bits of
    mFlags and bitwise-or the found flags.

This commit modifies nsMathMLOperators::LookupOperator to only check
one form at once and can be used to easily implement (1) and (2). This
removes the need for nsMathMLOperators::LookupOperators.

A new method nsMathMLOperators::LookupOperatorWithFallback is introduced
to preserve the fallback prefix/postfix/infix check that is needed for
(3). Undocumented bitwise logic is moved out of that method.

Differential Revision: https://phabricator.services.mozilla.com/D157705
2022-09-21 06:28:05 +00:00
Emilio Cobos Álvarez d9a694f78f Bug 1791281 - Simplify our setup for font metric queries from style. r=jfkthame
While looking at moving the flag around I realized that the only reason
we have FontMetricsProvider and co is because we didn't have access to
the per-document font-prefs cache. That's trivial to fix tho, so do
that and simplify the setup for font queries even more.

Differential Revision: https://phabricator.services.mozilla.com/D157589
2022-09-20 19:30:45 +00:00
Frederic Wang 62d1893ea4 Bug 1791245 - More cleanup for the <mfenced> element. r=emilio
The <mfenced> element [1] is not part of MathML Core [2] or MathML AAM
[3] and was removed in bug 1603773. It should be treated as
an unknown MathML element, that is like an `<mrow>`.

This commit performs some follow-up code cleanup:

* Remove a11y mapping, instead map it like an mrow.

* Remove obsolete deprecation message.

* Don't include mfenced in the sanitizer's default element allow list.
  The spec [4] does not mention an explicit list.

* Preference mathml.mfenced_element.disabled was removed, so no need
  to force it when running tests.

* Tweak some code comments.

[1] https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced
[2] https://w3c.github.io/mathml-core/#mathml-elements-and-attributes
[3] https://w3c.github.io/mathml-aam/
[4] https://wicg.github.io/sanitizer-api

Differential Revision: https://phabricator.services.mozilla.com/D157580
2022-09-20 03:53:50 +00:00
Frederic Wang 6a3f8e9625 Bug 1790797 - updateOperatorDictionary.pl does not need to handle minsize, priority or linebreakstyle properties. r=emilio
This is not used at all in our code and are not present in MathML Core's
dictionary. Let's remove them from the Perl script that manage update
of the dictionary.

Differential Revision: https://phabricator.services.mozilla.com/D157318
2022-09-16 05:18:14 +00:00
Frederic Wang 3d41beeef6 Bug 1790789 - Remove "integral" property from the MathML operator dictionary. r=emilio
"integral" is an internal operator property that Gecko uses when
selecting larger variants for integrals, for fonts that don't provide
a good value for DisplayOperatorMinHeight. The code points of operators
having the integral property are located in two contiguous blocks, so
this commit replaces existing implementation with a direct check. There
is no behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D157316
2022-09-16 05:18:13 +00:00
criss 49eaaa607e Backed out 2 changesets (bug 1667090, bug 1788605) for causing Xpcshell failures on test_css-properties-db.js. CLOSED TREE
Backed out changeset cee98ae67ea4 (bug 1788605)
Backed out changeset 404e0b4bcd0f (bug 1667090)
2022-09-15 12:13:28 +03:00
Frederic Wang fe1762c548 Bug 1667090 - Implement CSS font-size: math and math-depth properties. r=emilio
The font-size math keyword is implemented. It behaves as a font-size: 1em
with the extra fixup due to math-level change (and other legacy MathML
attributes). After that change, the CSS for math-level / font-size: math
is behaving as per the specification, so the math-depth is turned in
nightly.

The adjusting function for font-size: math is modified so that it's
executed only if both font-size: math (otherwise the spec says no scale
should apply) and math-depth (otherwise the scale is 1 and function exists
early anyway) are set on the element. Also checking if the current node
has a scriptsizemultiplier rule applied to use MathML3's scaling is
incorrect. Instead this is changed to check if a non-default
scriptsizemultiplier is set.

Differential Revision: https://phabricator.services.mozilla.com/D91744
2022-09-15 08:14:49 +00:00
Frederic Wang 74cd3287f0 Bug 1790756 - Remove "mirrorable" property from the MathML operator dictionary. r=emilio
Currently, our internal operator dictionary contains a "mirrorable"
property which is used to render stretched or large operators
(such as fences or integrals) in RTL mode, by applying a scale transform.
This is done via the nsMathMLChar class, which is only used for
operators that have a "largeop" or "direction" property in the operator
dictionary [1] [2]. Additionally, this "mirrorable" property was added
with the help of a Perl script, relying on "mirrored" property from
Unicode [3].

This commit removes this property from our internal operator dictionary
and switches to direct retrieval of the Unicode property via
mozilla::intl::UnicodeProperties::IsMirrored. There are four "mirrorable"
characters from our dictionary that are not in [1] (namely
LEFT/RIGHT SINGLE/DOUBLE QUOTATION MARK) but because they don't have
"largeop" or "direction" properties, they don't use nsMathMLChar
anyway. Similarly, they are new characters that are "mirrored" in
Unicode but were not "mirrorable" (LESS-THAN SIGN, LEFT-POINTING DOUBLE
ANGLE QUOTATION MARK, ...) but they won't use nsMathMLChar either.
So there should be no behavior change.

[1] https://searchfox.org/mozilla-central/rev/9769b513e38ee4f5df9d5d1eff55ff7cdc8cbf81/layout/mathml/nsMathMLmoFrame.cpp#58
[2] https://searchfox.org/mozilla-central/rev/9769b513e38ee4f5df9d5d1eff55ff7cdc8cbf81/layout/mathml/nsMathMLmoFrame.cpp#165
[3] https://www.compart.com/en/unicode/mirrored

Differential Revision: https://phabricator.services.mozilla.com/D157303
2022-09-15 05:37:55 +00:00
Frederic Wang 2683beff29 Bug 1790572 - Minor code refactoring in nsMathMLOperators::LookupOperator(s). r=emilio
- Remove unused boolean return value from
  nsMathMLOperators::LookupOperator.

- Move NS_ASSERTION to validate parameters at the top of
  nsMathMLOperators::LookupOperator.

- The operator form is an integer corresponding to the last two bits of
  nsOperatorFlags, so represent it as uint8_t when passed as a
  parameter of nsMathMLOperators::LookupOperator, as well as in the
  single caller nsMathMLmoFrame::ProcessTextData and in GetOperatorData
  in order to avoid confusion.
  This removes the use of NS_MATHML_OPERATOR_GET_FORM for casting.
  Note that the function already has an NS_ASSERTION to check the
  validity of the parameter.

- Use modern for loop syntax to try the infix, postfix and prefix
  forms in nsMathMLOperators::LookupOperator/LookupOperators instead of
  duplicating code for each GetOperatorData call. Also make more
  explicit the subtle use of lazy evaluation to skip one
  GetOperatorData call from nsMathMLOperators::LookupOperator.

Differential Revision: https://phabricator.services.mozilla.com/D157196
2022-09-14 07:18:05 +00:00
Frederic Wang c78b6f634e Bug 1789583: Preliminary update of the MathML Operator Dictionary. r=emilio
This is a first step towards aligning our dictionary with MathML Core.
non-BMP Arabic characters are not integrated yet and obsolete entries
are preserved. Here is the details of how the update was
semi-automatically performed:

1. Changed the URL of `unicode.xml` that is used by WPT and MathML Core.
   Also tweaked the `./updateOperatorDictionary.pl` to handle the fact
   that the accent property is no longer part of the MathML Core
   dictionary, so that we still preserve our internal values for now.

2. Called `./updateOperatorDictionary.pl download` to fetch `unicode.xml`
   and generate `dictionary.xml`.

3. Called `./updateOperatorDictionary.pl compare` to generate
   `differences.txt` and `new_dictionary.txt`. The following summary is
   provided by the script:

   - 197 obsolete entries (22 of them are related to stretching)
   - 682 unchanged entries
   - 247 conflicting entries (90 of them are related to stretching)
   - 248 new entries (120 of them are related to stretching)

4. Copied `new_dictionary.txt` into `mathfonts.properties`, keeping
   the obsolete entries at the end and removing the
   U+1EEF0 ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL
   and U+1EEF1 ARABIC MATHEMATICAL OPERATOR HAH WITH DAL
   (non-BMP entries don't seem to be handled well by the Perl script).

5.  Ran `./updateOperatorDictionary.pl compare` again:

   - 197 obsolete entries (22 of them are related to stretching)
   - 1173 unchanged entries
   - 2 conflicting entries (0 of them are related to stretching)
   - 2 new entries (1 of them are related to stretching)

   The 2 new entries are the non-BMP Arabic characters mentioned
   above. The 2 remaining conflicting entries are U+2215 DIVISION
   SLASH and U+221A SQUARE ROOT which lose their "mirrorable" property
   during conversion via the stylesheet `operatorDictionary.xsl` because
   they don't have any other operator properties. Let's keep them as
   "mirrorable", this notion is not part of the current version of MathML
   Core anyway.

6. Ran `./updateOperatorDictionary.pl check` and got errors
   "operator has a stretchy form, but all forms have not the same
   direction" for operators U+2295, U+2296, U+2297, U+2299. Add
   missing `direction:vertical` to them. After running again, no
   errors are found.

7. Ran WPT tests and found new assertion failure in largeop code saying
   that "Stretching should be in the vertical direction" in
   operator-dictionary-largeop-004.html (for U+2A1D) and
   operator-dictionary-largeop-006.html (for U+2A1E). Also removed
   expectation for new passing tests.

8. Adjusted the script to check that largeop operator have
   direction:vertical and fixed the new errors found by the script
   Verified the WPT largeop tests pass again.

9. Fix another bug that caused the mirrorable property to be duplicated
   in the output (this does not change parsing behavior in
   nsMathMLOperators.cpp though).

10. Ran `./updateOperatorDictionary.pl clean` to remove temporay files.

Differential Revision: https://phabricator.services.mozilla.com/D156654
2022-09-10 13:15:48 +00:00
Noemi Erli 7b02d6b1f4 Backed out changeset 6353ed04e5a6 (bug 1789583) for causing failures in mirror-op-3.html CLOSED TREE 2022-09-10 10:10:34 +03:00
Frederic Wang 9dee81d920 Bug 1789583: Preliminary update of the MathML Operator Dictionary. r=emilio
This is a first step towards aligning our dictionary with MathML Core.
non-BMP Arabic characters are not integrated yet and obsolete entries
are preserved. Here is the details of how the update was
semi-automatically performed:

1. Changed the URL of `unicode.xml` that is used by WPT and MathML Core.
   Also tweaked the `./updateOperatorDictionary.pl` to handle the fact
   that the accent property is no longer part of the MathML Core
   dictionary, so that we still preserve our internal values for now.

2. Called `./updateOperatorDictionary.pl download` to fetch `unicode.xml`
   and generate `dictionary.xml`.

3. Called `./updateOperatorDictionary.pl compare` to generate
   `differences.txt` and `new_dictionary.txt`. The following summary is
   provided by the script:

   - 197 obsolete entries (22 of them are related to stretching)
   - 682 unchanged entries
   - 247 conflicting entries (90 of them are related to stretching)
   - 248 new entries (120 of them are related to stretching)

4. Copied `new_dictionary.txt` into `mathfonts.properties`, keeping
   the obsolete entries at the end and removing the
   U+1EEF0 ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL
   and U+1EEF1 ARABIC MATHEMATICAL OPERATOR HAH WITH DAL
   (non-BMP entries don't seem to be handled well by the Perl script).

5.  Ran `./updateOperatorDictionary.pl compare` again:

   - 197 obsolete entries (22 of them are related to stretching)
   - 1173 unchanged entries
   - 2 conflicting entries (0 of them are related to stretching)
   - 2 new entries (1 of them are related to stretching)

   The 2 new entries are the non-BMP Arabic characters mentioned
   above. The 2 remaining conflicting entries are U+2215 DIVISION
   SLASH and U+221A SQUARE ROOT which lose their "mirrorable" property
   during conversion via the stylesheet `operatorDictionary.xsl` because
   they don't have any other operator properties. Let's keep them as
   "mirrorable", this notion is not part of the current version of MathML
   Core anyway.

6. Ran `./updateOperatorDictionary.pl check` and got errors
   "operator has a stretchy form, but all forms have not the same
   direction" for operators U+2295, U+2296, U+2297, U+2299. Add
   missing `direction:vertical` to them. After running again, no
   errors are found.

7. Ran WPT tests and found new assertion failure in largeop code saying
   that "Stretching should be in the vertical direction" in
   operator-dictionary-largeop-004.html (for U+2A1D) and
   operator-dictionary-largeop-006.html (for U+2A1E). Also removed
   expectation for new passing tests.

8. Adjusted the script to check that largeop operator have
   direction:vertical and fixed the new errors found by the script
   Verified the WPT largeop tests pass again.

9. Fix another bug that caused the mirrorable property to be duplicated
   in the output (this does not change parsing behavior in
   nsMathMLOperators.cpp though).

10. Ran `./updateOperatorDictionary.pl clean` to remove temporay files.

Differential Revision: https://phabricator.services.mozilla.com/D156654
2022-09-10 05:28:19 +00:00
Frederic Wang 3321104084 Bug 1789572: Remove manual test layout/mathml/tests/stretchy-and-large-operators.html. r=emilio
This is better covered by automated WPT tests
mathml/presentation-markup/operators/operator-dictionary-*

Differential Revision: https://phabricator.services.mozilla.com/D156647
2022-09-07 11:33:37 +00:00
Frederic Wang 7cea454450 Bug 1789349: Disable test test_bug706406.html. r=emilio
This is testing the legacy <maction> element, a feature currently
disabled by default and intended to be removed in the future. The test
tries to enable it, but that does not always work. So let's disable the
test for now, it will be removed in the future.

Differential Revision: https://phabricator.services.mozilla.com/D156528
2022-09-06 11:03:41 +00:00