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

stylo: avoid traversing non element/text nodes in style and layout #13172

Merged
merged 3 commits into from Sep 22, 2016

Conversation

@bholley
Copy link
Contributor

bholley commented Sep 4, 2016

r? @emilio


This change is Reviewable

@highfive
Copy link

highfive commented Sep 4, 2016

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@emilio
Copy link
Member

emilio commented Sep 4, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 4, 2016

📌 Commit 9f8b2b1 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 4, 2016

Testing commit 9f8b2b1 with merge f6d8fa1...

bors-servo added a commit that referenced this pull request Sep 4, 2016
stylo: Update bindings and avoid traversing non-stylable nodes

r? @emilio

<!-- 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/13172)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 4, 2016

💔 Test failed - mac-rel-wpt

@emilio
Copy link
Member

emilio commented Sep 4, 2016

Well, the stack traces in the builder are, er... not great, but basically, a bit of code in Servo's layout expects all the children layout data to be initialized, let me find a link to the actual problematic line...

@emilio
Copy link
Member

emilio commented Sep 4, 2016

Yeah, basically, this is the problematic line: https://github.com/servo/servo/blob/master/components/layout/construct.rs#L1393. (The unwrap() in flags() is what fails).

IMO the solution should be splitting the layout data and the style data properly, but that's probably too much for this patch, so probably you want different implementations for Servo and Gecko, and the assertion inside an if cfg!(not(feature = "servo")) block.

Also, please put a // FIXME: Split layout and style data so we can stop styling comments and such in the Servo impl.

@bors-servo
Copy link
Contributor

bors-servo commented Sep 9, 2016

The latest upstream changes (presumably #13200) made this pull request unmergeable. Please resolve the merge conflicts.

@bholley bholley changed the title stylo: Update bindings and avoid traversing non-stylable nodes stylo: avoid traversing non element/text nodes in style and layout Sep 21, 2016
@bholley bholley force-pushed the bholley:display_enum branch from 9f8b2b1 to efd7623 Sep 21, 2016
@bholley bholley force-pushed the bholley:display_enum branch from efd7623 to fa7214b Sep 21, 2016
@bholley
Copy link
Contributor Author

bholley commented Sep 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

Trying commit fa7214b with merge 570d97e...

bors-servo added a commit that referenced this pull request Sep 21, 2016
stylo: avoid traversing non element/text nodes in style and layout

r? @emilio

<!-- 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/13172)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

💔 Test failed - mac-rel-css

@bholley bholley force-pushed the bholley:display_enum branch from fa7214b to c5d6c2b Sep 21, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

@bholley
Copy link
Contributor Author

bholley commented Sep 21, 2016

r? @emilio

@bholley bholley removed the S-needs-rebase label Sep 21, 2016
Copy link
Member

emilio left a comment

neat, r=me with the nits :)

Also, a comment in the appropriate places indicating to this iterator would be awesome, since it might be tricky to find otherwise.

impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> {
fn is_element(&self) -> bool {
if let Some(LayoutNodeType::Element(_)) = self.type_id() { true } else { false }
}

This comment has been minimized.

@emilio

emilio Sep 21, 2016

Member

nit: missing newline

fn next(&mut self) -> Option<I> {
loop {
// Filter out nodes that layout should ignore.
let n = self.0.next();

This comment has been minimized.

@emilio

emilio Sep 21, 2016

Member

nit: maybe this would look clearer as:

match self.0.next() {
    None => return None,
    Some(node) if node.needs_layout() => return Some(node),
    _ => {},
}

Though I don't have a strong preference, so feel free to leave as-is.

@bholley bholley force-pushed the bholley:display_enum branch from c5d6c2b to 63124ba Sep 21, 2016
@bholley
Copy link
Contributor Author

bholley commented Sep 21, 2016

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

📌 Commit 63124ba has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

Testing commit 63124ba with merge f773cb8...

bors-servo added a commit that referenced this pull request Sep 21, 2016
stylo: avoid traversing non element/text nodes in style and layout

r? @emilio

<!-- 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/13172)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

💔 Test failed - mac-rel-wpt

@highfive
Copy link

highfive commented Sep 21, 2016

  ▶ FAIL [expected PASS] /_mozilla/css/inline_block_opacity_change.html
  └   → /_mozilla/css/inline_block_opacity_change.html 154f410f8d7d73334aa7e14a37628b88a672d994
/_mozilla/css/inline_block_opacity_change_ref.html 8db155b7d5bde8852308b23a66bdf5ef0f5a4a00
Testing 154f410f8d7d73334aa7e14a37628b88a672d994 == 8db155b7d5bde8852308b23a66bdf5ef0f5a4a00
@emilio
Copy link
Member

emilio commented Sep 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

Previous build results for arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, windows-dev are reusable. Rebuilding only mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

💔 Test failed - mac-rel-wpt

@bholley
Copy link
Contributor Author

bholley commented Sep 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 22, 2016

Testing commit 63124ba with merge 614e9ca...

bors-servo added a commit that referenced this pull request Sep 22, 2016
stylo: avoid traversing non element/text nodes in style and layout

r? @emilio

<!-- 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/13172)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 22, 2016

@bors-servo bors-servo merged commit 63124ba into servo:master Sep 22, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@bholley bholley deleted the bholley:display_enum branch Oct 9, 2016
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

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