mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Introduce StylingMode and deprecate explicit dirtiness.
MozReview-Commit-ID: 5tF075EJKBa
This commit is contained in:
parent
8bd7978980
commit
05c1f1e016
11 changed files with 204 additions and 116 deletions
|
@ -13,7 +13,7 @@ use std::str::from_utf8_unchecked;
|
|||
use std::sync::{Arc, Mutex};
|
||||
use style::arc_ptr_eq;
|
||||
use style::context::{LocalStyleContextCreationInfo, ReflowGoal, SharedStyleContext};
|
||||
use style::dom::{NodeInfo, TElement, TNode};
|
||||
use style::dom::{NodeInfo, StylingMode, TElement, TNode};
|
||||
use style::error_reporting::StdoutErrorReporter;
|
||||
use style::gecko::data::{NUM_THREADS, PerDocumentStyleData};
|
||||
use style::gecko::selector_impl::{GeckoSelectorImpl, PseudoElement};
|
||||
|
@ -107,8 +107,11 @@ fn restyle_subtree(node: GeckoNode, raw_data: RawServoStyleSetBorrowed) {
|
|||
timer: Timer::new(),
|
||||
};
|
||||
|
||||
// We ensure this is true before calling Servo_RestyleSubtree()
|
||||
debug_assert!(node.is_dirty() || node.has_dirty_descendants());
|
||||
if node.styling_mode() == StylingMode::Stop {
|
||||
error!("Unnecessary call to restyle_subtree");
|
||||
return;
|
||||
}
|
||||
|
||||
if per_doc_data.num_threads == 1 || per_doc_data.work_queue.is_none() {
|
||||
sequential::traverse_dom::<GeckoNode, RecalcStyleOnly>(node, &shared_style_context);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue