mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Assert we never style a root element from another document.
Right now when calling getComputedStyle with an element from another document, we return the style using the pres context of that document, not of the document of the window getComputedStyle was called on, so this holds. But it will stop holding if we ever change this, so assert it doesn't happen. Bug: 1374062 Reviewed-By: Manishearth MozReview-Commit-ID: 3g8yQWWdsen
This commit is contained in:
parent
1b2fd3fe85
commit
6fefe522a3
14 changed files with 52 additions and 30 deletions
|
@ -274,6 +274,7 @@ trait PrivateMatchMethods: TElement {
|
|||
if self.is_native_anonymous() || cascade_target == CascadeTarget::EagerPseudo {
|
||||
cascade_flags.insert(PROHIBIT_DISPLAY_CONTENTS);
|
||||
} else if self.is_root() {
|
||||
debug_assert!(self.owner_doc_matches_for_testing(shared_context.stylist.device()));
|
||||
cascade_flags.insert(IS_ROOT_ELEMENT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue