Bug 562688 part 15. Remove the eELEMENT bit. r=jst

This commit is contained in:
Boris Zbarsky 2010-04-30 09:12:06 -04:00
Родитель 0ff844ef61
Коммит b398d9af92
11 изменённых файлов: 26 добавлений и 33 удалений

Просмотреть файл

@ -307,27 +307,25 @@ public:
eDOCUMENT = 1 << 1, eDOCUMENT = 1 << 1,
/** nsIAttribute nodes */ /** nsIAttribute nodes */
eATTRIBUTE = 1 << 2, eATTRIBUTE = 1 << 2,
/** elements */
eELEMENT = 1 << 3,
/** text nodes */ /** text nodes */
eTEXT = 1 << 4, eTEXT = 1 << 3,
/** xml processing instructions */ /** xml processing instructions */
ePROCESSING_INSTRUCTION = 1 << 5, ePROCESSING_INSTRUCTION = 1 << 4,
/** comment nodes */ /** comment nodes */
eCOMMENT = 1 << 6, eCOMMENT = 1 << 5,
/** form control elements */ /** form control elements */
eHTML_FORM_CONTROL = 1 << 7, eHTML_FORM_CONTROL = 1 << 6,
/** svg elements */ /** svg elements */
eSVG = 1 << 8, eSVG = 1 << 7,
/** document fragments */ /** document fragments */
eDOCUMENT_FRAGMENT = 1 << 9, eDOCUMENT_FRAGMENT = 1 << 8,
/** data nodes (comments, PIs, text). Nodes of this type always /** data nodes (comments, PIs, text). Nodes of this type always
returns a non-null value for nsIContent::GetText() */ returns a non-null value for nsIContent::GetText() */
eDATA_NODE = 1 << 10, eDATA_NODE = 1 << 19,
/** nsHTMLMediaElement */ /** nsHTMLMediaElement */
eMEDIA = 1 << 11, eMEDIA = 1 << 10,
/** animation elements */ /** animation elements */
eANIMATION = 1 << 12 eANIMATION = 1 << 11
}; };
/** /**

Просмотреть файл

@ -3242,7 +3242,7 @@ nsGenericElement::GetBindingParent() const
PRBool PRBool
nsGenericElement::IsNodeOfType(PRUint32 aFlags) const nsGenericElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT)); return !(aFlags & ~eCONTENT);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -5196,7 +5196,7 @@ TryMatchingElementsInSubtree(nsINode* aRoot,
continue; continue;
} }
/* See whether we match */ /* See whether we match */
new (data) RuleProcessorData(aPresContext, kid, nsnull); new (data) RuleProcessorData(aPresContext, kid->AsElement(), nsnull);
NS_ASSERTION(!data->mParentData, "Shouldn't happen"); NS_ASSERTION(!data->mParentData, "Shouldn't happen");
NS_ASSERTION(!data->mPreviousSiblingData, "Shouldn't happen"); NS_ASSERTION(!data->mPreviousSiblingData, "Shouldn't happen");
data->mParentData = aParentData; data->mParentData = aParentData;
@ -5333,17 +5333,18 @@ nsNSElementTearoff::MozMatchesSelector(const nsAString& aSelector, PRBool* aRetu
/* static */ /* static */
PRBool PRBool
nsGenericElement::doMatchesSelector(nsIContent* aNode, const nsAString& aSelector) nsGenericElement::doMatchesSelector(Element* aElement,
const nsAString& aSelector)
{ {
nsAutoPtr<nsCSSSelectorList> selectorList; nsAutoPtr<nsCSSSelectorList> selectorList;
nsPresContext* presContext; nsPresContext* presContext;
PRBool matches = PR_FALSE; PRBool matches = PR_FALSE;
if (NS_SUCCEEDED(ParseSelectorList(aNode, aSelector, if (NS_SUCCEEDED(ParseSelectorList(aElement, aSelector,
getter_Transfers(selectorList), getter_Transfers(selectorList),
&presContext))) &presContext)))
{ {
RuleProcessorData data(presContext, aNode, nsnull); RuleProcessorData data(presContext, aElement, nsnull);
matches = nsCSSRuleProcessor::SelectorListMatches(data, selectorList); matches = nsCSSRuleProcessor::SelectorListMatches(data, selectorList);
} }

Просмотреть файл

@ -653,7 +653,8 @@ public:
static nsresult doQuerySelectorAll(nsINode* aRoot, static nsresult doQuerySelectorAll(nsINode* aRoot,
const nsAString& aSelector, const nsAString& aSelector,
nsIDOMNodeList **aReturn); nsIDOMNodeList **aReturn);
static PRBool doMatchesSelector(nsIContent* aNode, const nsAString& aSelector); static PRBool doMatchesSelector(mozilla::dom::Element* aElement,
const nsAString& aSelector);
/** /**
* Default event prehandling for content objects. Handles event retargeting. * Default event prehandling for content objects. Handles event retargeting.

Просмотреть файл

@ -1145,12 +1145,6 @@ nsGenericHTMLElement::GetBaseTarget(nsAString& aBaseTarget) const
} }
} }
PRBool
nsGenericHTMLElement::IsNodeOfType(PRUint32 aFlags) const
{
return !(aFlags & ~(eCONTENT | eELEMENT));
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -2240,7 +2234,7 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(nsGenericHTMLFormElement,
PRBool PRBool
nsGenericHTMLFormElement::IsNodeOfType(PRUint32 aFlags) const nsGenericHTMLFormElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT | eHTML_FORM_CONTROL)); return !(aFlags & ~(eCONTENT | eHTML_FORM_CONTROL));
} }
void void

Просмотреть файл

@ -175,7 +175,6 @@ public:
PRBool aNotify); PRBool aNotify);
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
PRBool aNotify); PRBool aNotify);
virtual PRBool IsNodeOfType(PRUint32 aFlags) const;
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull, PRBool aWithMouse = PR_FALSE) virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull, PRBool aWithMouse = PR_FALSE)
{ {
PRBool isFocusable = PR_FALSE; PRBool isFocusable = PR_FALSE;

Просмотреть файл

@ -2049,7 +2049,7 @@ nsresult nsHTMLMediaElement::Observe(nsISupports* aSubject,
PRBool PRBool
nsHTMLMediaElement::IsNodeOfType(PRUint32 aFlags) const nsHTMLMediaElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT | eMEDIA)); return !(aFlags & ~(eCONTENT | eMEDIA));
} }
void nsHTMLMediaElement::NotifyAddedSource() void nsHTMLMediaElement::NotifyAddedSource()

Просмотреть файл

@ -407,7 +407,7 @@ nsMathMLElement::IntrinsicState() const
PRBool PRBool
nsMathMLElement::IsNodeOfType(PRUint32 aFlags) const nsMathMLElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT)); return !(aFlags & ~eCONTENT);
} }
void void

Просмотреть файл

@ -408,7 +408,7 @@ nsSVGAnimationElement::UnsetAttr(PRInt32 aNamespaceID,
PRBool PRBool
nsSVGAnimationElement::IsNodeOfType(PRUint32 aFlags) const nsSVGAnimationElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT | eSVG | eANIMATION)); return !(aFlags & ~(eCONTENT | eSVG | eANIMATION));
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

Просмотреть файл

@ -708,7 +708,7 @@ nsSVGElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
PRBool PRBool
nsSVGElement::IsNodeOfType(PRUint32 aFlags) const nsSVGElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT | eSVG)); return !(aFlags & ~(eCONTENT | eSVG));
} }
already_AddRefed<nsIURI> already_AddRefed<nsIURI>

Просмотреть файл

@ -1277,11 +1277,11 @@ nsBindingManager::WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc,
{ {
*aCutOffInheritance = PR_FALSE; *aCutOffInheritance = PR_FALSE;
NS_ASSERTION(aData->mContent, "How did that happen?"); NS_ASSERTION(aData->mElement, "How did that happen?");
// Walk the binding scope chain, starting with the binding attached to our // Walk the binding scope chain, starting with the binding attached to our
// content, up till we run out of scopes or we get cut off. // content, up till we run out of scopes or we get cut off.
nsIContent *content = aData->mContent; nsIContent *content = aData->mElement;
do { do {
nsXBLBinding *binding = GetBinding(content); nsXBLBinding *binding = GetBinding(content);
@ -1290,7 +1290,7 @@ nsBindingManager::WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc,
binding->WalkRules(aFunc, aData); binding->WalkRules(aFunc, aData);
// If we're not looking at our original content, allow the binding to cut // If we're not looking at our original content, allow the binding to cut
// off style inheritance // off style inheritance
if (content != aData->mContent) { if (content != aData->mElement) {
if (!binding->InheritsStyle()) { if (!binding->InheritsStyle()) {
// Go no further; we're not inheriting style from anything above here // Go no further; we're not inheriting style from anything above here
break; break;

Просмотреть файл

@ -2135,7 +2135,7 @@ nsXULElement::GetBindingParent() const
PRBool PRBool
nsXULElement::IsNodeOfType(PRUint32 aFlags) const nsXULElement::IsNodeOfType(PRUint32 aFlags) const
{ {
return !(aFlags & ~(eCONTENT | eELEMENT)); return !(aFlags & ~eCONTENT);
} }
static void static void