Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2237b25

Browse files
committedOct 4, 2019
Bug 1575596 - MathML Lengths: Do not accept numbers ending with a dot. r=emilio
See w3c/mathml#23 and https://groups.google.com/forum/#!topic/mozilla.dev.platform/wIjm9JjVHNg This commit introduces a new preference option mathml.legacy_number_syntax.disabled to disable legacy MathML numbers (e.g. "1234.") that are not supported by CSS. This feature is now disabled by default. * test_bug553917.html is updated to check that such legacy values now cause an error message to be logged into the console when the feature is disabled. * Legacy MathML features are now disabled for WPT mathml test in a global __dir__.ini file. Removing legacy numbers allow to pass mathml/relations/css-styling/lengths-2.html Differential Revision: https://phabricator.services.mozilla.com/D42907 UltraBlame original commit: 8637163553058a09e835ee6d8e53a09735b1b1ec
1 parent 19d7fbb commit 2237b25

File tree

11 files changed

+195
-132
lines changed

11 files changed

+195
-132
lines changed
 

‎dom/mathml/nsMathMLElement.cpp

+47
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,53 @@ c
15781578
)
15791579
;
15801580
}
1581+
if
1582+
(
1583+
StaticPrefs
1584+
:
1585+
:
1586+
mathml_legacy_number_syntax_disabled
1587+
(
1588+
)
1589+
&
1590+
&
1591+
gotDot
1592+
&
1593+
&
1594+
str
1595+
[
1596+
i
1597+
-
1598+
1
1599+
]
1600+
=
1601+
=
1602+
'
1603+
.
1604+
'
1605+
)
1606+
{
1607+
if
1608+
(
1609+
!
1610+
(
1611+
aFlags
1612+
&
1613+
PARSE_SUPPRESS_WARNINGS
1614+
)
1615+
)
1616+
{
1617+
ReportLengthParseError
1618+
(
1619+
aString
1620+
aDocument
1621+
)
1622+
;
1623+
}
1624+
return
1625+
false
1626+
;
1627+
}
15811628
nsresult
15821629
errorCode
15831630
;

‎layout/mathml/tests/test_bug553917.html

+58
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,23 @@
217217
'
218218
)
219219
;
220+
const
221+
allow_legacy_numbers
222+
=
223+
!
224+
SpecialPowers
225+
.
226+
getBoolPref
227+
(
228+
'
229+
mathml
230+
.
231+
legacy_number_syntax
232+
.
233+
disabled
234+
'
235+
)
236+
;
220237
var
221238
g_errorInfo
222239
=
@@ -1062,6 +1079,23 @@
10621079
math
10631080
>
10641081
<
1082+
mspace
1083+
width
1084+
=
1085+
"
1086+
12345
1087+
.
1088+
"
1089+
/
1090+
>
1091+
<
1092+
/
1093+
math
1094+
>
1095+
<
1096+
math
1097+
>
1098+
<
10651099
mo
10661100
minsize
10671101
=
@@ -1105,6 +1139,7 @@
11051139
allow_mathspace_names
11061140
allow_mathspace_names
11071141
allow_mathspace_names
1142+
allow_legacy_numbers
11081143
allow_nonzero_unitless_lengths
11091144
]
11101145
args
@@ -1212,6 +1247,12 @@
12121247
]
12131248
[
12141249
"
1250+
12345
1251+
.
1252+
"
1253+
]
1254+
[
1255+
"
12151256
17
12161257
"
12171258
]
@@ -2427,6 +2468,23 @@
24272468
math
24282469
>
24292470
<
2471+
mspace
2472+
width
2473+
=
2474+
"
2475+
12345
2476+
.
2477+
"
2478+
/
2479+
>
2480+
<
2481+
/
2482+
math
2483+
>
2484+
<
2485+
math
2486+
>
2487+
<
24302488
mmultiscripts
24312489
>
24322490
<

‎layout/reftests/mathml/reftest.list

+9
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ pref
132132
(
133133
mathml
134134
.
135+
legacy_number_syntax
136+
.
137+
disabled
138+
false
139+
)
140+
pref
141+
(
142+
mathml
143+
.
135144
nonzero_unitless_lengths
136145
.
137146
disabled

‎modules/libpref/init/StaticPrefList.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -29670,6 +29670,48 @@ Whether
2967029670
to
2967129671
disable
2967229672
legacy
29673+
MathML
29674+
number
29675+
values
29676+
that
29677+
are
29678+
not
29679+
valid
29680+
CSS
29681+
numbers
29682+
#
29683+
(
29684+
e
29685+
.
29686+
g
29687+
.
29688+
"
29689+
1234
29690+
.
29691+
"
29692+
)
29693+
-
29694+
name
29695+
:
29696+
mathml
29697+
.
29698+
legacy_number_syntax
29699+
.
29700+
disabled
29701+
type
29702+
:
29703+
bool
29704+
value
29705+
:
29706+
true
29707+
mirror
29708+
:
29709+
always
29710+
#
29711+
Whether
29712+
to
29713+
disable
29714+
legacy
2967329715
names
2967429716
"
2967529717
small
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
prefs
2+
:
3+
[
4+
mathml
5+
.
6+
legacy_number_syntax
7+
.
8+
disabled
9+
:
10+
true
11+
mathml
12+
.
13+
mathsize_names
14+
.
15+
disabled
16+
:
17+
true
18+
mathml
19+
.
20+
mathspace_names
21+
.
22+
disabled
23+
:
24+
true
25+
mathml
26+
.
27+
mfrac_linethickness_names
28+
.
29+
disabled
30+
:
31+
true
32+
mathml
33+
.
34+
nonzero_unitless_lengths
35+
.
36+
disabled
37+
:
38+
true
39+
]

‎testing/web-platform/meta/mathml/presentation-markup/fractions/frac-linethickness-001.html.ini

-27
This file was deleted.

‎testing/web-platform/meta/mathml/presentation-markup/fractions/frac-linethickness-002.html.ini

-11
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ linethickness
77
.
88
html
99
]
10-
prefs
11-
:
12-
[
13-
mathml
14-
.
15-
mathspace_names
16-
.
17-
disabled
18-
:
19-
true
20-
]
2110
[
2211
Negative
2312
]

‎testing/web-platform/meta/mathml/relations/css-styling/lengths-1.html.ini

-18
This file was deleted.

‎testing/web-platform/meta/mathml/relations/css-styling/lengths-2.html.ini

-32
This file was deleted.

‎testing/web-platform/meta/mathml/relations/css-styling/mathsize-attribute-css-keywords.html.ini

-22
This file was deleted.

‎testing/web-platform/meta/mathml/relations/css-styling/mathsize-attribute-legacy-values.html.ini

-22
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.