Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathML: Add tests for children not participating to their parent layout #18293

Merged
merged 3 commits into from
Aug 6, 2019

Conversation

fred-wang
Copy link
Contributor

This commit adds new tests to verify that children with "display: none",
"position: absolute" or "position: fixed" don't affect preferred width
calculation or layout of their parents.

  • mathml/support/mathml-fragments.js: Add function to append a non empty
    child (optionally making the element invalid) and use that function for
    forceNonEmptyElement.

  • mathml/support/layout-comparison.js: Introduce new helpers function to
    extract the children participating to their parent layout. Modify
    compareLayout so that it browser that list of children instead and allow
    comparison in horizontal+LTR mode.

This commit adds new tests to verify that children with "display: none",
"position: absolute" or "position: fixed" don't affect preferred width
calculation or layout of their parents.

- mathml/support/mathml-fragments.js:  Add function to append a non empty
 child (optionally making the element invalid) and use that function for
 forceNonEmptyElement.

- mathml/support/layout-comparison.js: Introduce new helpers function to
  extract the children participating to their parent layout. Modify
  compareLayout so that it browser that list of children instead and allow
  comparison in horizontal+LTR mode.
@wpt-pr-bot
Copy link
Collaborator

There are no reviewers for this pull request besides its author. Please reach out on W3C's irc server (irc.w3.org, port 6665) on channel #testing (web client) to get help with this. Thank you!

@fred-wang
Copy link
Contributor Author

Note: This (unsurprisingly) causes assertion failure in Igalia's Chromium build.

Copy link
Contributor

@rwlbuis rwlbuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think floats are the same category and should be tested as well.

@fred-wang
Copy link
Contributor Author

LGTM. I think floats are the same category and should be tested as well.

Right, I had checked and Chromium has two different functions for out-of-flow and float: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/layout/api/line_layout_item.h?q=OutOfFlowPositioned&dr=CSs&l=140

I'm not sure yet what mathml core should say for floats but will add a TODO

@fred-wang fred-wang merged commit 7a669f4 into master Aug 6, 2019
@fred-wang fred-wang deleted the mathml-none-oof branch August 6, 2019 12:14
@fred-wang
Copy link
Contributor Author

I forgot to say in the commit, but this is related to https://github.com/mathml-refresh/mathml/issues/16

natechapin pushed a commit to natechapin/wpt that referenced this pull request Aug 23, 2019
…ut (web-platform-tests#18293)

* MathML: Add tests for children not participating to their parent layout

This commit adds new tests to verify that children with "display: none",
"position: absolute" or "position: fixed" don't affect preferred width
calculation or layout of their parents.

- mathml/support/mathml-fragments.js:  Add function to append a non empty
 child (optionally making the element invalid) and use that function for
 forceNonEmptyElement.

- mathml/support/layout-comparison.js: Introduce new helpers function to
  extract the children participating to their parent layout. Modify
  compareLayout so that it browser that list of children instead and allow
  comparison in horizontal+LTR mode.

* Add feature detection otherwise these tests pass when MathML is disabled.

* Add TODO for floats.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants