diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-05 01:19:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-05 01:19:23 -0800 |
commit | c2515f9c9822b6011fc6f8ad7127bccc3a1e6122 (patch) | |
tree | 09b634ce8866a98e5bcb1e136e2a65e79be41ffe | |
parent | b05c27cb58e8d625f4f436b6e9e1f0c29e908f21 (diff) | |
parent | 78c812866aac018f4d5a42ebe440a01aef3aeab8 (diff) | |
download | servo-c2515f9c9822b6011fc6f8ad7127bccc3a1e6122.tar.gz servo-c2515f9c9822b6011fc6f8ad7127bccc3a1e6122.zip |
Auto merge of #14459 - heycam:seq-dom-depth, r=emilio
Fix current_dom_depth in sequential traversal. (fixes #14414)
<!-- Please describe your changes on the following line: -->
Since we pass around a reference to the one `PerLevelTraversalData` object in sequential traversal, we must update it after we process children. Alternatively, we could switch to what the parallel traversal is doing and clone the object when passing it down.
r? @emilio
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14414 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/14459)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/sequential.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/style/sequential.rs b/components/style/sequential.rs index 4b92c52f80d..0e5253b2073 100644 --- a/components/style/sequential.rs +++ b/components/style/sequential.rs @@ -24,8 +24,9 @@ pub fn traverse_dom<N, C>(root: N, C::traverse_children(el, |kid| doit::<N, C>(context, kid, data)); - // NB: Data is unused now, but we can always decrement the count - // here if we need it for the post-order one :) + if let Some(ref mut depth) = data.current_dom_depth { + *depth -= 1; + } } if context.needs_postorder_traversal() { |