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 upAdd support for getComputedStyle() to layout_2020 #26477
Conversation
highfive
commented
May 9, 2020
|
Heads up! This PR modifies the following files:
|
highfive
commented
May 9, 2020
9bd53a7
to
de34be8
|
|
||
| if !node.is_connected() { | ||
| // TODO: Node should be matched against the style rules of this window. | ||
| // Firefox is currently the only browser to implement this. |
This comment has been minimized.
This comment has been minimized.
emilio
May 9, 2020
Member
This is no longer true, and spec was changed to reflect this. So we can remove this.
This comment has been minimized.
This comment has been minimized.
| // we can calculate the used value without looking at layout data structures. | ||
| // Some properties resovled values compute are their computed values. | ||
| // See: https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle | ||
| fn try_to_get_resolved_style(&self, node: &Node, property: &PropertyId) -> Option<String> { |
This comment has been minimized.
This comment has been minimized.
emilio
May 9, 2020
Member
This doesn't look good if there are pending style changes. What prevents you from using an outdated style in that case?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
emilio
May 9, 2020
Member
Why is this optimization valuable then, though? Is the idea that it avoids going through the layout thread if there are no pending changes? If so it should be documented.
| } | ||
|
|
||
| let positioned = style.get_box().position != Position::Static; | ||
| match longhand_id { |
This comment has been minimized.
This comment has been minimized.
emilio
May 9, 2020
Member
It's a bit unfortunate to have this list of properties duplicated in multiple places :/
de34be8
to
e5abe7d
|
Thank you both for the reviews. I think the second commit here (adding a fast path for |
|
@bors-servo r+ |
|
|
Add support for getComputedStyle() to layout_2020 These changes add support for `getComputedStyle()` to layout_2020. --- <!-- 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] There are tests for these changes <!-- 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. -->
|
|
|
From the layout-2020 test results:
|
e5abe7d
to
39a9322
|
@bors-servo r+ |
|
|
Add support for getComputedStyle() to layout_2020 These changes add support for `getComputedStyle()` to layout_2020. --- <!-- 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] There are tests for these changes <!-- 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. -->
|
|
| @@ -1,4 +1,2 @@ | |||
| [localeCompare.html] | |||
| bug: https://github.com/servo/servo/issues/25802 | |||
| [localeCompare should return the same as other browsers, even though it's implementation-dependent] | |||
| expected: FAIL | |||
This comment has been minimized.
This comment has been minimized.
This implementation is more-or-less on par with the one from layout_2013 and in some cases better. There are still some cases where we don't return the correct "resolved value," but this is enough to test animations and transitions.
39a9322
to
9c7b1ae
|
@bors-servo r=jdm |
|
|
Add support for getComputedStyle() to layout_2020 These changes add support for `getComputedStyle()` to layout_2020. --- <!-- 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] There are tests for these changes <!-- 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 retry |
|
|
mrobinson commentedMay 9, 2020
•
edited
These changes add support for
getComputedStyle()to layout_2020../mach build -ddoes not report any errors./mach test-tidydoes not report any errors