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

Root nodes for the duration of their CSS transitions #16295

Merged
merged 5 commits into from May 15, 2017

Conversation

@jdm
Copy link
Member

jdm commented Apr 7, 2017

This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14972
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Apr 7, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/matching.rs, components/style/animation.rs
  • @KiChjang: components/script/script_thread.rs, components/script/dom/window.rs, components/script_traits/lib.rs, components/script_traits/lib.rs, components/script_layout_interface/rpc.rs
  • @fitzgen: components/script/script_thread.rs, components/script/dom/window.rs, components/script_traits/lib.rs, components/script_traits/lib.rs, components/script_layout_interface/rpc.rs
  • @emilio: components/layout/animation.rs, components/layout/query.rs, components/style/matching.rs, components/style/animation.rs
@highfive
Copy link

highfive commented Apr 7, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@jdm
Copy link
Member Author

jdm commented Apr 7, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

Trying commit 66d93d2 with merge 8b5c8b8...

bors-servo added a commit that referenced this pull request Apr 7, 2017
Root nodes for the duration of their CSS transitions

This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14972
- [X] There are tests for these changes
@bors-servo
Copy link
Contributor

bors-servo commented Apr 7, 2017

💔 Test failed - android

@jdm
Copy link
Member Author

jdm commented Apr 7, 2017

As I feared, there could be problems with this approach when the animations are triggered from the compositor:

  ▶ CRASH [expected TIMEOUT] /dom/events/EventListener-invoke-legacy.html
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  │ 3.3 (Core Profile) Mesa 12.0.1
  │ assertion failed: rw_data.newly_transitioning_nodes.is_empty() (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(1) }, at /Users/servo/buildbot/slave/mac-rel-wpt1/build/components/layout_thread/lib.rs:1411)
  │ 2017-04-07 01:35:16.662 servo[70066:646481199] Metadata.framework [Error]: couldn't get the client port
  │ stack backtrace:
  │    0:        0x10459e49e - backtrace::backtrace::trace::h47a32bf8c6f00c9b
  │    1:        0x10459ebec - backtrace::capture::Backtrace::new::hb5a725a088a2a2fc
  │    2:        0x102e7d5b8 - servo::main::_$u7b$$u7b$closure$u7d$$u7d$::hab3ba3e402ac1f0b
  │    3:        0x1049ff9c9 - std::panicking::rust_panic_with_hook::h05996066754c6be9
  │    4:        0x102faa4f4 - std::panicking::begin_panic::haab64c72e0aa1aab
  │    5:        0x10300ecdc - layout_thread::LayoutThread::perform_post_style_recalc_layout_passes::h139d5d3cd94b81e4
  │    6:        0x10300d2d5 - layout_thread::LayoutThread::tick_all_animations::h90b400a44eeb0e6f
  │    7:        0x103003306 - layout_thread::LayoutThread::handle_request_helper::h307a64d67c3c4130
  │    8:        0x102f944a0 - profile_traits::mem::ProfilerChan::run_with_memory_reporting::h6184f9f4fcb8e847
  │    9:        0x103001173 - _$LT$layout_thread..LayoutThread$u20$as$u20$layout_traits..LayoutThreadFactory$GT$::create::_$u7b$$u7b$closure$u7d$$u7d$::h8028856a97c8c244
  │   10:        0x102faadfd - std::panicking::try::do_call::ha664f0ed882ba9a8
  │   11:        0x104a0099a - __rust_maybe_catch_panic
  │   12:        0x102fc41e6 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hc02c54adca1db771
  │   13:        0x1049fc4e4 - std::sys::imp::thread::Thread::new::thread_start::h4008e1859fbd98b8
  │   14:     0x7fff8af9f059 - _pthread_body
  │   15:     0x7fff8af9efd6 - _pthread_start
  │ ERROR:servo: assertion failed: rw_data.newly_transitioning_nodes.is_empty()
  │ Pipeline failed in hard-fail mode.  Crashing!
  └ thread panicked while processing panic. aborting.
@bors-servo
Copy link
Contributor

bors-servo commented Apr 9, 2017

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

@jdm jdm force-pushed the jdm:transition-safety branch from 66d93d2 to 204f531 Apr 10, 2017
@jdm jdm force-pushed the jdm:transition-safety branch from 204f531 to 226e433 Apr 10, 2017
@jdm
Copy link
Member Author

jdm commented Apr 10, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 10, 2017

Trying commit 226e433 with merge bef0a38...

bors-servo added a commit that referenced this pull request Apr 10, 2017
Root nodes for the duration of their CSS transitions

This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14972
- [X] There are tests for these changes

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

bors-servo commented Apr 10, 2017

💔 Test failed - linux-rel-wpt

@jdm jdm force-pushed the jdm:transition-safety branch from 226e433 to 212f998 Apr 10, 2017
@jdm
Copy link
Member Author

jdm commented Apr 10, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 10, 2017

Trying commit 212f998 with merge 39f1fc5...

bors-servo added a commit that referenced this pull request Apr 10, 2017
Root nodes for the duration of their CSS transitions

This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14972
- [X] There are tests for these changes

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

bors-servo commented Apr 10, 2017

@jdm
Copy link
Member Author

jdm commented Apr 11, 2017

@nox do you want to review this?

@jdm jdm removed the S-needs-rebase label Apr 11, 2017
@nox
Copy link
Member

nox commented Apr 11, 2017

r? @nox

@jdm
Copy link
Member Author

jdm commented May 15, 2017

@bors-servo: r=nox

@bors-servo
Copy link
Contributor

bors-servo commented May 15, 2017

📌 Commit d26e45b has been approved by nox

jdm added 5 commits Apr 6, 2017
This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.
This avoids the need for multiple layout RPC operations immediately
following return of control to script. This means that layout and
script can continue to operate in parallel at this point, rather
than one potentially waiting on the shared mutex to be unlocked.
@jdm jdm force-pushed the jdm:transition-safety branch from d26e45b to b0bf2b4 May 15, 2017
@jdm
Copy link
Member Author

jdm commented May 15, 2017

@bors-servo: r=nox

@bors-servo
Copy link
Contributor

bors-servo commented May 15, 2017

📌 Commit b0bf2b4 has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented May 15, 2017

Testing commit b0bf2b4 with merge fa251ec...

bors-servo added a commit that referenced this pull request May 15, 2017
Root nodes for the duration of their CSS transitions

This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14972
- [X] There are tests for these changes

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

bors-servo commented May 15, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: nox
Pushing fa251ec to master...

@bors-servo bors-servo merged commit b0bf2b4 into servo:master May 15, 2017
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
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.

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