style: Add a style attribute restyle hint.

This commit is contained in:
Emilio Cobos Álvarez 2017-01-26 23:01:06 +01:00
parent 9cdf78d53d
commit 7a9cdbb857
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 15 additions and 6 deletions

View file

@ -179,7 +179,7 @@ impl PendingRestyle {
}
}
// https://dom.spec.whatwg.org/#document
/// https://dom.spec.whatwg.org/#document
#[dom_struct]
pub struct Document {
node: Node,

View file

@ -30,14 +30,23 @@ bitflags! {
/// expensive, and so we use RestyleHints to short-circuit work we know is
/// unnecessary.
pub flags RestyleHint: u32 {
#[doc = "Rerun selector matching on the element."]
/// Rerun selector matching on the element.
const RESTYLE_SELF = 0x01,
#[doc = "Rerun selector matching on all of the element's descendants."]
// NB: In Gecko, we have RESTYLE_SUBTREE which is inclusive of self, but heycam isn't aware
// of a good reason for that.
/// Rerun selector matching on all of the element's descendants.
///
/// NB: In Gecko, we have RESTYLE_SUBTREE which is inclusive of self,
/// but heycam isn't aware of a good reason for that.
const RESTYLE_DESCENDANTS = 0x02,
#[doc = "Rerun selector matching on all later siblings of the element and all of their descendants."]
/// Rerun selector matching on all later siblings of the element and all
/// of their descendants.
const RESTYLE_LATER_SIBLINGS = 0x08,
/// Don't re-run selector-matching on the element, only the style
/// attribute has changed, and this change didn't have any other
/// dependencies.
const RESTYLE_STYLE_ATTRIBUTE = 0x10,
}
}