[wpt-sync] Sync PR 37651 - [mathml] Refactor parsing of mspace and mpadded attributes
Categories
(Core :: MathML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox111 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 37651 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/37651
Details from upstream follow.
Frédéric Wang <fwang@igalia.com> wrote:
[mathml] Refactor parsing of mspace and mpadded attributes
Currently, the mspace and mpadded elements use different approaches
to parse the width/height/depth/lspace/voffset attributes:
AddPropertyToPresentationAttributeStyle for the value (sometimes
excluding values that ends with a '%' character).AddPropertyToPresentationAttributeStyle for a calc expression
built from the values of the height and depth attributes.Using AddMathLengthToComputedStyle (sometimes accepting percentage)
which relies on CSSParser::ParseLengthPercentage, but these parsing
methods seem incorrect.The initial goal was to use the default value when a percentage is
specified and this is what is currently specified in MathML Core
[1] [2]. However, the current implementation has bugs that make
percentage accepted in some cases [3] or unnecessarily mapping
invalid values to presentational hints.This CL tries to bring more consistency on the parsing side by always
delegating the parsing of the attribute value to
CSSParser::ParseLengthPercentage before mapping it to presentational
hint or internal properties. The parsing parameter
AllowPercentages::kNo is used to ensure percentages are always
treated as invalid. CSSParser::ParseLengthPercentage is also refine to
always trim whitespaces, and check there is no remaining token after
the parsed \<length-percentage>.This refactoring will facilitate specifying Chrome's behavior in
MathML Core regarding interaction with CSS width/height properties,
handling of percentages and use of presentational hints [4].[1] https://w3c.github.io/mathml-core/#space-mspace
[2] https://w3c.github.io/mathml-core/#inner-box-and-requested-parameters
[3] crbug.com/1402998
[4] https://github.com/w3c/mathml-core/issues/75#issuecomment-1359541618Bug: 6606, 1402998
Change-Id: Ibe4e49af4c3f4aeb5c153e10b4ba93d26db20849Reviewed-on: https://chromium-review.googlesource.com/4120274
WPT-Export-Revision: 789122ba7c13ab6a1ad4878956447ea19cdc46a3
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
| Assignee | ||
Comment 2•3 years ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 3 tests
Status Summary
Firefox
OK : 1
PASS: 4
FAIL: 3
Chrome
OK : 1
PASS: 5
FAIL: 2
Safari
OK : 1
PASS: 4
FAIL: 3
Links
Details
New Tests That Don't Pass
- /mathml/presentation-markup/mpadded/mpadded-percentage-002.html [wpt.fyi]
- width='200%' is interpreted as the default value:
FAIL(Chrome:PASS, Safari:FAIL) - height='200%' is interpreted as the default value:
FAIL(Chrome:PASS, Safari:FAIL) - depth='200%' is interpreted as the default value:
FAIL(Chrome:PASS, Safari:FAIL)
- width='200%' is interpreted as the default value:
Comment 4•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ef3dc57c21dc
https://hg.mozilla.org/mozilla-central/rev/ebfd66be1e67
Description
•