mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Bug 1322945 - Change skip_root to unstyled_children_only and use StyleNewChildren in more places. r=heycam
I noticed that our current behavior in ContentRangeInserted is incorrect. Unlike ContentInserted (where this code lived originally), ContentRangeInserted takes a start and end element. I'm not sure if we ever take that path for new content that needs style, but it seemed sketchy. And generally, it seems nice to just always style new content the same way (though we still need to style NAC by the subtree root, since it hasn't been attached to the parent yet). For situations where there is indeed only one unstyled child, the traversal overhead should be neglible, since we special-case the single-element in parallel.rs to avoid calling into rayon. Being more explicit about what we want here also makes us more robust against the other handful of callpaths that can take us into nsCSSFrameConstructor::{ContentRangeInserted,ContentAppended}. Currently we can call StyleNewSubtree on an already-styled element via RecreateFramesForContent, which triggers an assertion in the servo traversal. MozReview-Commit-ID: DqCGh90deHH
This commit is contained in:
parent
75e4c16bc7
commit
3a56954069
8 changed files with 37 additions and 28 deletions
|
@ -2493,7 +2493,7 @@ pub mod root {
|
|||
}
|
||||
#[repr(i32)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum SkipRootBehavior { Skip = 0, DontSkip = 1, }
|
||||
pub enum TraversalRootBehavior { Normal = 0, UnstyledChildrenOnly = 1, }
|
||||
pub mod a11y {
|
||||
#[allow(unused_imports)]
|
||||
use self::super::super::super::root;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue