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 upHTMLElement::Offset{Parent,Left,Right} should call is_the_html_body_element. #13659
Conversation
highfive
commented
Oct 9, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 9, 2016
|
Anyone have suggestions where a regression test for this should live? |
|
@bors-servo try |
HTMLElement::Offset{Parent,Left,Right} should call is_the_html_body_element.
Fixes #10520.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13659)
<!-- Reviewable:end -->
|
|
HTMLElement::Offset{Parent,Left,Right} should call is_the_html_body_element.
Fixes #10520.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13659)
<!-- Reviewable:end -->
|
|
|
|
|
Possibly depends on w3c/csswg-drafts#584 |
|
w3c/csswg-drafts#584 has been addressed (somewhat) This is now dependent on #13708 in order for the regression test to work |
| @@ -272,9 +272,13 @@ impl HTMLElementMethods for HTMLElement { | |||
|
|
|||
| // https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent | |||
| fn GetOffsetParent(&self) -> Option<Root<Element>> { | |||
| if self.is::<HTMLBodyElement>() || self.is::<HTMLHtmlElement>() { | |||
| if self.is::<HTMLHtmlElement>() { | |||
This comment has been minimized.
This comment has been minimized.
nox
Nov 30, 2016
•
Member
This is incorrect, an html element can be the child of whatever. The test really needs to be about the root element.
This comment has been minimized.
This comment has been minimized.
frewsxcv
Dec 1, 2016
Author
Member
Yep, sounds right. I'm going to assume I just call https://doc.servo.org/script/dom/element/struct.Element.html#method.root_element and check if it's the same as self
This comment has been minimized.
This comment has been minimized.
nox
Dec 1, 2016
Member
Should be better to compare self to its document's root element, rather than go up the whole hierarchy.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I don't really know what the next steps are here for this. Commit these changes with a failing test? |
|
@bors-servo: try |
HTMLElement::Offset{Parent,Left,Right} should call is_the_html_body_element.
Fixes #10520.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13659)
<!-- Reviewable:end -->
|
|
|
|
In theory the test shouldn't be failing anymore if the code compiles. |
|
Disclaimer: I'm not going to be able to get to this anytime soon if someone else wants to take over |
What test..? |
|
I guess the regression test needs to be written again. |
|
Let's close this since nobody's actively working on it. |
frewsxcv commentedOct 9, 2016
•
edited by larsbergstrom
Fixes #10520.
This change is