Filter out non-applying properties when cascading style for ::first-letter/::first-line/::placeholder. r=emilio

Part 3 of the fix for Gecko bug 1382786 <https://bugzilla.mozilla.org/show_bug.cgi?id=1382786>.
This commit is contained in:
Boris Zbarsky 2017-07-21 14:16:06 -04:00
parent 592a96fc06
commit 86b3b6a32f
3 changed files with 41 additions and 0 deletions

View file

@ -13,6 +13,7 @@ use dom::{OpaqueNode, TElement, TNode};
use element_state::ElementState;
use fnv::FnvHashMap;
use invalidation::element::element_wrapper::ElementSnapshot;
use properties::PropertyFlags;
use selector_parser::{AttrValue as SelectorAttrValue, ElementExt, PseudoElementCascadeType, SelectorParser};
use selectors::Element;
use selectors::attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity};
@ -39,6 +40,12 @@ pub enum PseudoElement {
Before,
Selection,
// If/when :first-letter is added, update is_first_letter accordingly.
// If/when ::first-letter, ::first-line, or ::placeholder are added, adjust
// our property_restriction implementation to do property filtering for
// them. Also, make sure the UA sheet has the !important rules some of the
// APPLIES_TO_PLACEHOLDER properties expect!
// Non-eager pseudos.
DetailsSummary,
DetailsContent,
@ -169,6 +176,12 @@ impl PseudoElement {
/// Stub, only Gecko needs this
pub fn pseudo_info(&self) { () }
/// Property flag that properties must have to apply to this pseudo-element.
#[inline]
pub fn property_restriction(&self) -> Option<PropertyFlags> {
None
}
}
/// The type used for storing pseudo-class string arguments.