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

HTMLElement::Offset{Parent,Left,Right} should call is_the_html_body_element. #13659

Closed
wants to merge 2 commits into from

Conversation

frewsxcv
Copy link
Contributor

@frewsxcv frewsxcv commented Oct 9, 2016

Fixes #10520.


This change is Reviewable

@highfive
Copy link

highfive commented Oct 9, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmlelement.rs

@highfive
Copy link

highfive commented Oct 9, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 9, 2016
@frewsxcv
Copy link
Contributor Author

frewsxcv commented Oct 9, 2016

Anyone have suggestions where a regression test for this should live?

@frewsxcv
Copy link
Contributor Author

frewsxcv commented Oct 9, 2016

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 8e1415e with merge 4c1b0f3...

bors-servo pushed a commit that referenced this pull request Oct 9, 2016
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 -->
@bors-servo
Copy link
Contributor

⛄ The build was interrupted to prioritize another pull request.

@bors-servo
Copy link
Contributor

⌛ Trying commit 8e1415e with merge 43ed621...

bors-servo pushed a commit that referenced this pull request Oct 9, 2016
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 -->
@bors-servo
Copy link
Contributor

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 10, 2016

tests/wpt/web-platform-tests/cssom-view

@frewsxcv
Copy link
Contributor Author

Possibly depends on w3c/csswg-drafts#584

@frewsxcv frewsxcv added S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 10, 2016
@frewsxcv
Copy link
Contributor Author

w3c/csswg-drafts#584 has been addressed (somewhat)

This is now dependent on #13708 in order for the regression test to work

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 4, 2016
@@ -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>() {
Copy link
Contributor

@nox nox Nov 30, 2016

Choose a reason for hiding this comment

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

This is incorrect, an html element can be the child of whatever. The test really needs to be about the root element.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be better to compare self to its document's root element, rather than go up the whole hierarchy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or even, that self's parent is a Document.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@frewsxcv
Copy link
Contributor Author

frewsxcv commented Dec 4, 2016

I don't really know what the next steps are here for this. Commit these changes with a failing test?

@jdm
Copy link
Member

jdm commented Jan 19, 2017

@bors-servo: try

@bors-servo
Copy link
Contributor

⌛ Trying commit b109546 with merge 1c5f28e...

bors-servo pushed a commit that referenced this pull request Jan 19, 2017
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 -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-dev

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jan 19, 2017
@jdm
Copy link
Member

jdm commented Jan 19, 2017

error: no method named `is_root` found for type `&dom::element::Element` in the current scope
   --> /home/servo/buildbot/slave/linux-dev/build/components/script/dom/htmlelement.rs:278:69
    |
278 |         if self.is::<HTMLHtmlElement>() || self.upcast::<Element>().is_root() {
    |                                                                     ^^^^^^^

@jdm
Copy link
Member

jdm commented Jan 19, 2017

In theory the test shouldn't be failing anymore if the code compiles.

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. S-tests-failed The changes caused existing tests to fail. labels Jan 19, 2017
@frewsxcv
Copy link
Contributor Author

Disclaimer: I'm not going to be able to get to this anytime soon if someone else wants to take over

@jdm jdm added the S-needs-new-owner The PR has been abandoned by the original author. label Jan 20, 2017
@nox
Copy link
Contributor

nox commented Jan 21, 2017

In theory the test shouldn't be failing anymore if the code compiles.

What test..?

@jdm
Copy link
Member

jdm commented Jan 22, 2017

I guess the regression test needs to be written again.

@jdm
Copy link
Member

jdm commented Jan 27, 2017

Let's close this since nobody's actively working on it.

@jdm jdm closed this Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-new-owner The PR has been abandoned by the original author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants