Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow retrieving width/height for non-positioned elements #8202
Conversation
highfive
commented
Oct 26, 2015
|
Ah the reason for the difference is http://mxr.mozilla.org/mozilla-central/source/testing/web-platform/tests/common/canvas-tests.css#72 which causes the canvas to end up with a border of 2px, so http://mxr.mozilla.org/servo/source/components/layout/query.rs#229 thinks we have a width/height of 4px each. @pcwalton any ideas what the right thing to do here is? |
|
|
|
@dzbarsky From https://drafts.csswg.org/cssom/#resolved-values : "If the property applies to the element or pseudo-element and the resolved value of the display property is not none, the resolved value is the used value. Otherwise the resolved value is the computed value." |
|
I know, that's why I made this change. Note that it only says things should be positioned for left/right/top/bottom. Is there something I'm missing? (Note that I wrote that code originally, but I hadn't read the spec carefully enough) |
|
Oh, sorry, I got confused for a moment by the "display: none" bit. It looks like PositionRetrievingFragmentBorderBoxIterator returns the width as if we were in |
|
Ah, found it: you want the |
|
Ah, thanks for the pointer. That did the trick! Let's see how many tests pass now... |
|
@bors-servo try |
|
|
|
@bors-servo try |
Allow retrieving width/height for non-positioned elements This was causing a bunch of tests in tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes* to fail. They were returning "auto" instead of the correct size. They still fail because the returned size is off by a few pixels, not sure why yet. But this is more correct and may fix other failing tests. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8202) <!-- Reviewable:end -->
|
|
|
@pcwalton r? (feel free to redirect, but I figured you were a good victim) |
|
|
| match layout_data.data.flow_construction_result { | ||
| ConstructionResult::Flow(ref flow_ref, _) => | ||
| flow::base(flow_ref.deref()).stacking_relative_position, | ||
| // TODO search parents until we find node with a flow ref. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
first gCS failure was an incorrect test, the 2nd one is a legit failure. But I think we can address that in a followup, this bug is much likelier to affect pages than gCS for elements not in a document. |
|
Looks like that didn't work before this PR either, I just fixed the test to test the right thing so it fails now. |
|
@bors-servo r=pcwalton |
|
|
Allow retrieving width/height for non-positioned elements This was causing a bunch of tests in tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes* to fail. They were returning "auto" instead of the correct size. They still fail because the returned size is off by a few pixels, not sure why yet. But this is more correct and may fix other failing tests. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8202) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
|
|
|
|
|
@bors-servo: retry |
Allow retrieving width/height for non-positioned elements This was causing a bunch of tests in tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes* to fail. They were returning "auto" instead of the correct size. They still fail because the returned size is off by a few pixels, not sure why yet. But this is more correct and may fix other failing tests. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8202) <!-- Reviewable:end -->
|
|
dzbarsky commentedOct 26, 2015
This was causing a bunch of tests in tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes* to fail. They were returning "auto" instead of the correct size. They still fail because the returned size is off by a few pixels, not sure why yet. But this is more correct and may fix other failing tests.