Skip to content

stylo: Traverse anonymous children when styling - #12911

Merged
bors-servo merged 4 commits into
servo:masterfrom
bholley:traverse_anonymous_children
Aug 26, 2016
Merged

bors-servo merged 4 commits into
servo:masterfrom
bholley:traverse_anonymous_children

Conversation

@bholley

@bholley bholley commented Aug 17, 2016 •

Copy link
Copy Markdown
Contributor

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/script_layout_interface/wrapper_traits.rs, components/script/layout_wrapper.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 17, 2016
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style and script code, but no tests are modified. Please consider adding a test!

@bholley

bholley commented Aug 17, 2016

Copy link
Copy Markdown
Contributor Author

r? @emilio

@highfive highfive assigned emilio and unassigned glennw Aug 17, 2016
@bholley

bholley commented Aug 17, 2016

Copy link
Copy Markdown
Contributor Author

(Though let's wait to land this until the gecko-side changes are ready)

@bholley

bholley commented Aug 17, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit b6d6827 with merge 899c6e2...

bors-servo pushed a commit that referenced this pull request Aug 17, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 17, 2016
@bholley

bholley commented Aug 17, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 25d0289 with merge 75001e0...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Aug 17, 2016
@highfive

Copy link
Copy Markdown
  ▶ FAIL [expected PASS] /css-transforms-1_dev/html/perspective-origin-006.htm
  └   → /css-transforms-1_dev/html/perspective-origin-006.htm d2f9f49eb190646b004d0ea13de938dfa265561d
/css-transforms-1_dev/html/reference/ref-filled-green-100px-square.htm d4aa213e3e31e41d0d8e84aec79e94f860f27178
Testing d2f9f49eb190646b004d0ea13de938dfa265561d == d4aa213e3e31e41d0d8e84aec79e94f860f27178

@bholley

bholley commented Aug 17, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 25d0289 with merge 81ac69e...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Aug 18, 2016
@bholley

bholley commented Aug 18, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 25d0289 with merge 78ed2eb...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

Comment thread ports/geckolib/wrapper.rs Outdated

impl<'a> Drop for GeckoChildrenIterator<'a> {
fn drop(&mut self) {
match *self {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: if let.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread ports/geckolib/wrapper.rs
curr
},
GeckoChildrenIterator::GeckoIterator(it) => unsafe {
Gecko_GetNextStyleChild(it).as_ref().map(|n| GeckoNode::from_ref(n))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can eta-reduce this closure ;-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can't:

Compiling geckoservo v0.0.1 (file:///files/mozilla/stylo/bb/servo/ports/geckolib)
wrapper.rs:376:54: 376:57 error: the trait bound unsafe fn(&gecko_bindings::bindings::nsINode) -> wrapper::GeckoNode<'_> {wrapper::GeckoNode<'_>::from_ref}: std::ops::FnOnce<(&gecko_bindings::bindings::nsINode,)> is not satisfied [E0277]
wrapper.rs:376 Gecko_GetNextStyleChild(it).as_ref().map(GeckoNode::from_ref)
^~~
wrapper.rs:376:54: 376:57 help: run rustc --explain E0277 to see a detailed explanation
error: aborting due to previous error
error: Could not compile geckoservo.

To learn more, run the command again with --verbose.

@emilio

emilio commented Aug 18, 2016

Copy link
Copy Markdown
Member

r=me with those nits, awesome you also trimmed down the TNode trait :)

These impose additional requirements on the traversal code that we want to
avoid for Gecko (for now).
This will allow us to specialize ChildrenIterator in the Gecko case to do
something more interesting in some cases.
The semantics of this method with respect to anonymous children are unclear.
Thankfully it's unused, so we can remove it.
@bholley
bholley force-pushed the traverse_anonymous_children branch from 25d0289 to 122df8c Compare August 26, 2016 16:56
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Aug 26, 2016
@bholley

bholley commented Aug 26, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 122df8c has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Aug 26, 2016
@bholley

bholley commented Aug 26, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo p=1

Need this to rev the branch.

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 122df8c with merge 8e39313...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 26, 2016
@highfive

Copy link
Copy Markdown
  ▶ TIMEOUT [expected PASS] /_mozilla/css/iframe/hide_layers2.html

@bholley

bholley commented Aug 26, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

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

@bholley

bholley commented Aug 26, 2016

Copy link
Copy Markdown
Contributor Author

#8769

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo
bors-servo merged commit 122df8c into servo:master Aug 26, 2016
@bholley
bholley deleted the traverse_anonymous_children branch August 26, 2016 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-tests-failed The changes caused existing tests to fail.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants