Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally. #12757
Conversation
highfive
commented
Aug 6, 2016
highfive
commented
Aug 6, 2016
|
@bors-servo: try |
stylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally. <!-- Please describe your changes on the following line: --> --- <!-- 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 <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @bholley <!-- 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/12757) <!-- Reviewable:end -->
|
|
|
@bors-servo: try |
stylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally. <!-- Please describe your changes on the following line: --> --- <!-- 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 <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @bholley <!-- 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/12757) <!-- Reviewable:end -->
|
|
highfive
commented
Aug 7, 2016
|
|
That's a known intermittent (#12568), cool :) |
| /// performed. | ||
| /// | ||
| /// If it's false, then process_postorder has no effect at all. | ||
| fn should_traverse_back_up(&self) -> bool { true } |
This comment has been minimized.
This comment has been minimized.
| @@ -36,4 +36,7 @@ impl<'lc, 'ln> DomTraversalContext<GeckoNode<'ln>> for RecalcStyleOnly<'lc> { | |||
| } | |||
|
|
|||
| fn process_postorder(&self, _: GeckoNode<'ln>) {} | |||
This comment has been minimized.
This comment has been minimized.
| @@ -149,6 +149,12 @@ pub trait DomTraversalContext<N: TNode> { | |||
| /// Process `node` on the way up, after its children have been processed. | |||
| fn process_postorder(&self, node: N); | |||
This comment has been minimized.
This comment has been minimized.
bholley
Aug 8, 2016
Contributor
Add a comment indicating that this is only called if has_postorder_traversal returns true.
| fn compute(source: Option<&nsStyleContext>, | ||
| new_style: &Arc<ComputedValues>) -> Self { | ||
| type Helpers = ArcHelpers<ServoComputedValues, ComputedValues>; | ||
| let context = match source { | ||
| Some(ctx) => ctx as *const nsStyleContext as *mut nsStyleContext, | ||
| // If there's no style source (that is, no style context), there can |
This comment has been minimized.
This comment has been minimized.
| // If there's no style source (that is, no style context), there can | ||
| // be two reasons for it. | ||
| // | ||
| // The first one, is that this is not an incremental restyle (so we |
This comment has been minimized.
This comment has been minimized.
| // | ||
| // The second one is that this is an incremental restyle, but the | ||
| // node has display: none. In this case, the old computed values | ||
| // should still be present, and we should be able to compare the new |
This comment has been minimized.
This comment has been minimized.
bholley
Aug 8, 2016
Contributor
Emphasize that they're stored on the node by servo, but we don't have a style context.
| // can do nothing on it because the old and the new display values | ||
| // are none. | ||
| // | ||
| // This is done outside of this method in servo itself, so we |
This comment has been minimized.
This comment has been minimized.
| use std::mem; | ||
| GeckoRestyleDamage(unsafe { mem::transmute(0u32) }) | ||
| } | ||
|
|
||
| fn compute(source: Option<&nsStyleContext>, | ||
| new_style: &Arc<ComputedValues>) -> Self { |
This comment has been minimized.
This comment has been minimized.
bholley
Aug 8, 2016
Contributor
Per discussion, let's make this take a Non-Option, and then the caller can make stronger assertions about the reason why the style context doesn't exist (i.e. either non-incremental restyle or the display::none case).
| // the changes, and any change that we could miss would already have | ||
| // been caught by the parent's change. If for some reason I'm wrong on | ||
| // this, we'd have to compare computed values in Gecko too. | ||
| let existing_style = |
This comment has been minimized.
This comment has been minimized.
bholley
Aug 8, 2016
Contributor
Please file a followup bug on bugzilla describing the stuff we talked about, and reference that bug here.
| context.process_preorder(node); | ||
| let should_stop = match context.process_preorder(node) { | ||
| ForceTraversalStop::Force => true, | ||
| ForceTraversalStop::DontForce => false, |
This comment has been minimized.
This comment has been minimized.
bholley
Aug 8, 2016
Contributor
Let's call these Let's call this RestyleResult::{StopTraversal,ContinueTraversal}?
| context.pre_process_child_hook(node, kid); | ||
| if context.should_process(kid) { | ||
| doit::<N, C>(context, kid); | ||
| if !should_stop { |
This comment has been minimized.
This comment has been minimized.
| @@ -201,6 +211,7 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C, | |||
| let mut bf = take_thread_local_bloom_filter(parent_opt, root, context.shared_context()); | |||
|
|
|||
| let nonincremental_layout = opts::get().nonincremental_layout; | |||
| let mut restyle_result = RestyleResult::Continue; | |||
| if nonincremental_layout || node.is_dirty() { | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Aug 10, 2016
•
Contributor
nit: I wonder if this might be clearer as:
if !nonincremental_layout && !node.is_dirty() {
return RestyleResult::Continue
}
Then you can remove a level of indentation below.
This comment has been minimized.
This comment has been minimized.
emilio
Aug 10, 2016
Author
Member
Hmm... I can't see what you mean, you still need to insert the node in the bloom filter, complete animations, etc.
The rest of the comments are addressed or were on outdated commits and no longer apply I think.
This comment has been minimized.
This comment has been minimized.
|
r=me |
|
@bors-servo: r=bholley,pcwalton |
|
|
stylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally. <!-- Please describe your changes on the following line: --> --- <!-- 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 <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @bholley <!-- 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/12757) <!-- Reviewable:end -->
|
|
|
@emilio does the gecko-dev branch need to be updated in correspondence with this commit? |
|
@bholley no, not necessarily |
emilio commentedAug 6, 2016
•
edited by larsbergstrom
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsr? @bholley
This change is