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

css inset should work on Layout 2020 #29810

Merged
merged 3 commits into from Jun 26, 2023
Merged

Conversation

MendyBerger
Copy link
Contributor

top, bottom, left, right, are already implemented in layout-2020, so adding the shorthand can be enabled.


  • There are tests for these changes OR
  • These changes do not require tests because ___

I'm don't know if I need tests for this, how do I determine that?

@mrobinson mrobinson changed the title css inset should work on servo-2020 css inset should work on Layout 2020 May 29, 2023
@mrobinson
Copy link
Member

@bors-servo try=wpt-2020

@bors-servo
Copy link
Contributor

⌛ Trying commit 3614bf4 with merge fd5bc61...

bors-servo added a commit that referenced this pull request May 29, 2023
css `inset` should work on Layout 2020

<!-- Please describe your changes on the following line: -->
`top`, `bottom`, `left`, `right`, are already implemented in layout-2020, so adding the shorthand can be enabled.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #29705 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

I'm don't know if I need tests for this, how do I determine that?

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
State: approved= try=True

@mrobinson
Copy link
Member

It's very odd that this didn't change any test results. 🤔

@jdm
Copy link
Member

jdm commented May 29, 2023

There are two other inset shorthands in that file. Should they be updated as well?

@MendyBerger
Copy link
Contributor Author

@jdm don't think they're implemented in layout-2020, but not sure

@Loirooriol
Copy link
Contributor

@MendyBerger The logical inset-* longhands are enabled in layout 2020, so there should be no problem enabling the shorthands, since they just expand into the longhands. Also, the logical longhands just share a computed value with the physical ones, so this is basically a style thing, layout shouldn't need anything special.

@mrobinson Enabling the 3 shorthands should improve css/css-logical/logical-box-inset.html, but it's currently skipped :(

@MendyBerger
Copy link
Contributor Author

Thanks @Loirooriol, I've updated the PR.

Just out of curiosity, how did you know that it's implemented? Doing a global search didn't return any results, so I first assumed it's not implemented. But then a manual test confirmed that you're right.

@Loirooriol
Copy link
Contributor

I saw engines="gecko servo-2013 servo-2020" in

// inset-* logical properties, map to "top" / "left" / "bottom" / "right"
% for side in LOGICAL_SIDES:
${helpers.predefined_type(
"inset-%s" % side,
"LengthPercentageOrAuto",
"computed::LengthPercentageOrAuto::auto()",
engines="gecko servo-2013 servo-2020",
spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side,
animation_value_type="ComputedValue",
logical=True,
logical_group="inset",
)}
% endfor

and tried a testcase.

Copy link
Contributor

@Loirooriol Loirooriol left a comment

Choose a reason for hiding this comment

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

Please update the test expectations, css-logical is no longer skipped.

These are improving:

  • /css/css-logical/logical-box-inset.html
  • /css/css-logical/parsing/inset-block-inline-valid.html
  • /css/css-logical/parsing/inset-block-inline-shorthand.html
  • /css/css-logical/parsing/inset-shorthand.html
  • /css/css-logical/parsing/inset-valid.html

And this crashes :(

  • /css/css-logical/animation-002.html

It's hitting

_ => panic!("entered the wrong cascade_property() implementation"),

Maybe there is some problem with pending-substitution values:

<!DOCTYPE html>
<style>
:root {--200px: 200px; --300px: 300px}
@keyframes anim{
  from { inset-block: var(--200px) }
  to { inset-block: var(--300px) }
}
</style>
<div style="animation: anim 10s -5s paused linear; width: 0px; height: 0px;"></div>

Can you investigate if there is an easy fix? Or otherwise go back to just enabling inset I guess, since it doesn't seem to have this problem.

@MendyBerger
Copy link
Contributor Author

Note: the block/inline issue isn't specific to inset, it happens to any block/inline, e.g. margin-block or padding-inline.

The problem seems to be that cascade_property() doesn't select the correct branch of the match, since the block/inline isn't being replaced properly. I'm assuming that to_phys() or something similar isn't called in a place that it should be.

Any thoughts appreciated. This is tough but I'll continue to investigate.

@MendyBerger
Copy link
Contributor Author

MendyBerger commented Jun 19, 2023

@Loirooriol does it make sense to merge like this even with this issue since it's not specific to inset-inline/block? It also happens to padding-inline/block and margin-inline/block.
I've spent upwards of 20 hours investigating this issue but still can't pin down where things are going wrong... I'd be willing to continue if someone can help me out here, but otherwise I don't think I can justify spending so much time on this anymore :(

@MendyBerger
Copy link
Contributor Author

I've opened a separate issue for the inline/block crash issue #29891

@Loirooriol
Copy link
Contributor

Adding more crashes isn't great, but since it's already crashing for the other logical shorthands then I guess landing is fine.

@Loirooriol
Copy link
Contributor

@bors-servo try=wpt-2020

So I guess let's just run the bot and then please update test expectations.

@bors-servo
Copy link
Contributor

⌛ Trying commit 0beac77 with merge 710f70f...

bors-servo added a commit that referenced this pull request Jun 20, 2023
css `inset` should work on Layout 2020

<!-- Please describe your changes on the following line: -->
`top`, `bottom`, `left`, `right`, are already implemented in layout-2020, so adding the shorthand can be enabled.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #29705 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

I'm don't know if I need tests for this, how do I determine that?

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@github-actions
Copy link

Test results for linux-wpt-layout-2020 from try job (#5324125609):

Flaky unexpected result (1)
  • OK /_mozilla/css/stylesheet_media_queries.html (#17159)
    • FAIL [expected PASS] subtest: Media queries within stylesheets assert_equals: expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
Stable unexpected results that are known to be intermittent (1)
  • OK [expected TIMEOUT] /css/css-flexbox/abspos/position-absolute-013.html (#28405)
Stable unexpected results (7)
  • CRASH [expected OK] /css/css-logical/animation-002.html
  • OK /css/css-logical/logical-box-inset.html
    • PASS [expected FAIL] subtest: Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '.
  • OK /css/css-logical/parsing/inset-block-inline-shorthand.html
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "10px" should set inset-block-end
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "10px" should set inset-block-start
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "10px" should not set unrelated longhands
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "20% auto" should set inset-block-end
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "20% auto" should set inset-block-start
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "20% auto" should not set unrelated longhands
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "30%" should set inset-inline-end
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "30%" should set inset-inline-start
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "30%" should not set unrelated longhands
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "auto 40px" should set inset-inline-end
    • And 2 more unexpected results...
  • OK /css/css-logical/parsing/inset-block-inline-valid.html
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "-10px" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "calc(10px - 0.5em) -20%" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "auto auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "-20%" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "calc(10px - 0.5em)" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "-10px auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-inline'] = "auto calc(10px + 0.5em)" should set the property value
  • OK /css/css-logical/parsing/inset-shorthand.html
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px 4px" should set bottom
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px 4px" should set left
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px 4px" should set right
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px 4px" should set top
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px 4px" should not set unrelated longhands
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px" should set bottom
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px" should set left
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px" should set right
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px" should set top
    • PASS [expected FAIL] subtest: e.style['inset'] = "1px 2px 3px" should not set unrelated longhands
    • And 10 more unexpected results...
  • OK /css/css-logical/parsing/inset-valid.html
    • PASS [expected FAIL] subtest: e.style['inset'] = "auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "-10px" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "calc(-0.5em + 10px) -20%" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "auto auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "10px calc(-0.5em + 10px) -30px" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "auto auto auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "10px calc(-0.5em + 10px) auto -30px" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset'] = "auto auto auto auto" should set the property value
  • OK /css/css-position/parsing/inset-valid.html
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "0" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "10%" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "1rem" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "-10px" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "-20%" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "calc(2em + 3ex)" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "auto auto" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "100px 100px" should set the property value
    • PASS [expected FAIL] subtest: e.style['inset-block'] = "10% -5px" should set the property value
    • And 12 more unexpected results...

@bors-servo
Copy link
Contributor

💔 Test failed - checks-github

@Loirooriol
Copy link
Contributor

@bors-servo try=wpt-2020

@bors-servo
Copy link
Contributor

⌛ Trying commit 458df8c with merge 6975959...

bors-servo added a commit that referenced this pull request Jun 26, 2023
css `inset` should work on Layout 2020

<!-- Please describe your changes on the following line: -->
`top`, `bottom`, `left`, `right`, are already implemented in layout-2020, so adding the shorthand can be enabled.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #29705 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

I'm don't know if I need tests for this, how do I determine that?

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@github-actions
Copy link

Test results for linux-wpt-layout-2020 from try job (#5382519710):

Flaky unexpected result (2)
  • OK /_mozilla/css/stylesheet_media_queries.html (#17159)
    • FAIL [expected PASS] subtest: Media queries within stylesheets assert_equals: expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue. assert_true: expected true got false
Stable unexpected results that are known to be intermittent (3)
  • PASS [expected FAIL] /_mozilla/css/dirty_viewport.html (#13731)
  • PASS [expected FAIL] /_mozilla/css/pseudo_content_with_layers.html (#13479)
  • PASS [expected FAIL] /_mozilla/mozilla/iframe/resize_after_load.html (#13573)

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
State: approved= try=True

@Loirooriol
Copy link
Contributor

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 458df8c has been approved by Loirooriol

@bors-servo
Copy link
Contributor

⌛ Testing commit 458df8c with merge cc71bfd...

@github-actions
Copy link

Test results for linux-wpt-layout-2013 from try job (#5382906740):

Flaky unexpected result (15)
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue. assert_true: expected true got false
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • ERROR [expected TIMEOUT] /html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html (#28541)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='' assert_unreached: load should not be fired Reached unreachable code
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank' assert_unreached: load should not be fired Reached unreachable code
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • FAIL [expected PASS] subtest: Same-origin navigation started from unload handler must be ignored assert_equals: expected "?pass" but got "?fail"
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-2.sub.html (#29738)
    • TIMEOUT [expected FAIL] subtest: grandparent cancels a pending navigation in a cross-origin grandchild Test timed out
  • OK /html/browsers/history/the-history-interface/traverse_the_history_1.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals from the same task
  • TIMEOUT [expected OK] /html/browsers/origin/cross-origin-objects/cross-origin-objects.html (#28569)
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: Basic test (formdata event)
    • PASS [expected FAIL] subtest: text/plain: \n in name (normal form)
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Fulfillment handler on pending-then-fulfilled promise Test timed out
    • TIMEOUT [expected FAIL] subtest: Rejection handler on pending-then-rejected promise Test timed out
  • TIMEOUT /resource-timing/response-status-code.html (#29309)
    • TIMEOUT [expected FAIL] subtest: This test validates the response status of resources. 88 Test timed out
    • NOTRUN [expected TIMEOUT] subtest: This test validates the response status of resources. 89
Stable unexpected results that are known to be intermittent (6)

@github-actions
Copy link

Test results for linux-wpt-layout-2020 from try job (#5382906740):

Stable unexpected results that are known to be intermittent (2)
  • PASS [expected FAIL] /_mozilla/css/pseudo_content_with_layers.html (#13479)
  • PASS [expected FAIL] /_mozilla/mozilla/iframe/resize_after_load.html (#13573)

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: Loirooriol
Pushing cc71bfd to master...

@bors-servo bors-servo merged commit cc71bfd into servo:master Jun 26, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

‘transition-property’ should expand shorthands
5 participants