mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Existing callers call IsCSS2PseudoElement on non-pseudo-elements (in particular, anon boxes), so we need to make that not assert and be deterministic. (Bug 521044) r=bzbarsky
This commit is contained in:
parent
134bc3c1d1
commit
c07ac412dc
@ -42,6 +42,7 @@
|
||||
#include "nsAtomListUtils.h"
|
||||
#include "nsStaticAtom.h"
|
||||
#include "nsMemory.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
|
||||
// define storage for all atoms
|
||||
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
||||
@ -80,6 +81,25 @@ PRBool nsCSSPseudoElements::IsPseudoElement(nsIAtom *aAtom)
|
||||
NS_ARRAY_LENGTH(CSSPseudoElements_info));
|
||||
}
|
||||
|
||||
/* static */ PRBool
|
||||
nsCSSPseudoElements::IsCSS2PseudoElement(nsIAtom *aAtom)
|
||||
{
|
||||
// We don't implement this using PseudoElementHasFlags because callers
|
||||
// want to pass things that could be anon boxes.
|
||||
NS_ASSERTION(nsCSSPseudoElements::IsPseudoElement(aAtom) ||
|
||||
nsCSSAnonBoxes::IsAnonBox(aAtom),
|
||||
"must be pseudo element or anon box");
|
||||
PRBool result = aAtom == nsCSSPseudoElements::after ||
|
||||
aAtom == nsCSSPseudoElements::before ||
|
||||
aAtom == nsCSSPseudoElements::firstLetter ||
|
||||
aAtom == nsCSSPseudoElements::firstLine;
|
||||
NS_ASSERTION(nsCSSAnonBoxes::IsAnonBox(aAtom) ||
|
||||
result ==
|
||||
PseudoElementHasFlags(aAtom, CSS_PSEUDO_ELEMENT_IS_CSS2),
|
||||
"result doesn't match flags");
|
||||
return result;
|
||||
}
|
||||
|
||||
/* static */ PRUint32
|
||||
nsCSSPseudoElements::FlagsForPseudoElement(nsIAtom *aAtom)
|
||||
{
|
||||
|
@ -68,9 +68,7 @@ public:
|
||||
|
||||
static PRBool IsPseudoElement(nsIAtom *aAtom);
|
||||
|
||||
static PRBool IsCSS2PseudoElement(nsIAtom *aAtom) {
|
||||
return PseudoElementHasFlags(aAtom, CSS_PSEUDO_ELEMENT_IS_CSS2);
|
||||
}
|
||||
static PRBool IsCSS2PseudoElement(nsIAtom *aAtom);
|
||||
|
||||
static PRBool PseudoElementContainsElements(nsIAtom *aAtom) {
|
||||
return PseudoElementHasFlags(aAtom, CSS_PSEUDO_ELEMENT_CONTAINS_ELEMENTS);
|
||||
|
Loading…
Reference in New Issue
Block a user