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
Member

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!
@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 9, 2016

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

@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 9, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Oct 9, 2016

Trying commit 8e1415e with merge 4c1b0f3...

bors-servo added 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

bors-servo commented Oct 9, 2016

The build was interrupted to prioritize another pull request.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 9, 2016

Trying commit 8e1415e with merge 43ed621...

bors-servo added 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

bors-servo commented Oct 9, 2016

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 10, 2016

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

@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 10, 2016

Possibly depends on w3c/csswg-drafts#584

@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 12, 2016

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

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

@frewsxcv frewsxcv force-pushed the frewsxcv:the-html-body-element branch from 8e1415e to ee9a5b7 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>() {

This comment has been minimized.

Copy link
@nox

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.

Copy link
@frewsxcv

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.

Copy link
@nox

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.

Copy link
@nox

nox Dec 1, 2016

Member

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

This comment has been minimized.

Copy link
@frewsxcv

frewsxcv Dec 1, 2016

Author Member

👍

@frewsxcv
Copy link
Member 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
Copy link
Contributor

bors-servo commented Jan 19, 2017

Trying commit b109546 with merge 1c5f28e...

bors-servo added 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

bors-servo commented Jan 19, 2017

💔 Test failed - linux-dev

@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.

@frewsxcv
Copy link
Member Author

frewsxcv commented Jan 20, 2017

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

@nox
Copy link
Member

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.