Skip to content

Commit

Permalink
Bug 1548529 - Remove values "thin", "thick", "medium" values of mfrac…
Browse files Browse the repository at this point in the history
…linethickness. r=emilio

See w3c/mathml#4
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/G91-vBeC3Rw

This commit introduces a new preference option
mathml.mfrac_linethickness_names.disabled to disable linethickness names. For
now, these names are only disabled in Nightly builds. Announcements and actual
disabling of this and other MathML features will be considered later.

* test_bug553917.html is updated to check that these values now cause an error
  message to be logged into the console.
* mstyle-1.xhtml is updated to use a numeric linethickness since the point of
  the test is just to check that the attribute is not supported on mstyle, not
  about the actual attribute value.
* Other fractions tests relying on linethickness names are executed with the
  proper preference adjustment.
* mathml/presentation-markup/fractions/frac-linethickness-001.html is now
  closer to its expectation ; however the test still fails because nonzero
  unitless values are not removed yet. See
  w3c/mathml#24

Differential Revision: https://phabricator.services.mozilla.com/D42323

UltraBlame original commit: 0692436a2b33c134bf50654ce466e4bd5ddb05cf
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent de6a938 commit 081bea2
Show file tree
Hide file tree
Showing 6 changed files with 534 additions and 1 deletion.
45 changes: 45 additions & 0 deletions layout/mathml/nsMathMLmfracFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ h
#
include
"
mozilla
/
StaticPrefs_mathml
.
h
"
#
include
"
nsLayoutUtils
.
h
Expand Down Expand Up @@ -369,6 +378,37 @@ IsEmpty
{
if
(
StaticPrefs
:
:
mathml_mfrac_linethickness_names_disabled
(
)
)
{
lineThickness
=
defaultThickness
;
ParseNumericValue
(
aThicknessAttribute
&
lineThickness
nsMathMLElement
:
:
PARSE_ALLOW_UNITLESS
aPresContext
aComputedStyle
aFontSizeInflation
)
;
}
else
{
if
(
aThicknessAttribute
.
EqualsLiteral
Expand Down Expand Up @@ -407,13 +447,15 @@ defaultThickness
-
onePixel
)
{
lineThickness
=
defaultThickness
-
onePixel
;
}
}
else
if
(
Expand Down Expand Up @@ -464,13 +506,15 @@ defaultThickness
+
onePixel
)
{
lineThickness
=
defaultThickness
+
onePixel
;
}
}
else
{
lineThickness
Expand All @@ -493,6 +537,7 @@ aFontSizeInflation
;
}
}
}
if
(
lineThickness
Expand Down
228 changes: 228 additions & 0 deletions layout/mathml/tests/test_bug553917.html
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,111 @@
/
math
>
<
math
>
<
mfrac
linethickness
=
"
thin
"
>
<
mn
>
1
<
/
mn
>
<
mn
>
2
<
/
mn
>
<
/
mfrac
>
<
/
math
>
<
math
>
<
mfrac
linethickness
=
"
medium
"
>
<
mn
>
1
<
/
mn
>
<
mn
>
2
<
/
mn
>
<
/
mfrac
>
<
/
math
>
<
math
>
<
mfrac
linethickness
=
"
thick
"
>
<
mn
>
1
<
/
mn
>
<
mn
>
2
<
/
mn
>
<
/
mfrac
>
<
/
math
>
*
/
LengthParsingError
Expand All @@ -730,6 +835,9 @@
false
false
false
false
false
false
]
args
:
Expand Down Expand Up @@ -769,6 +877,21 @@
BADdepth
"
]
[
"
thin
"
]
[
"
medium
"
]
[
"
thick
"
]
]
}
/
Expand Down Expand Up @@ -1706,6 +1829,111 @@
math
>
<
mfrac
linethickness
=
"
thin
"
>
<
mn
>
1
<
/
mn
>
<
mn
>
2
<
/
mn
>
<
/
mfrac
>
<
/
math
>
<
math
>
<
mfrac
linethickness
=
"
medium
"
>
<
mn
>
1
<
/
mn
>
<
mn
>
2
<
/
mn
>
<
/
mfrac
>
<
/
math
>
<
math
>
<
mfrac
linethickness
=
"
thick
"
>
<
mn
>
1
<
/
mn
>
<
mn
>
2
<
/
mn
>
<
/
mfrac
>
<
/
math
>
<
math
>
<
mmultiscripts
>
<
Expand Down
2 changes: 1 addition & 1 deletion layout/reftests/mathml/mstyle-1.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ true
linethickness
=
"
thick
10px
"
>
<
Expand Down
Loading

0 comments on commit 081bea2

Please sign in to comment.