зеркало из https://github.com/mozilla/pjs.git
Bug 562688 part 7. Eliminate eELEMENT users in the rest of content/. r=jst
This commit is contained in:
Родитель
7373d3d485
Коммит
9ec425175f
|
@ -427,7 +427,7 @@ nsXMLEventsManager::ContentRemoved(nsIDocument* aDocument,
|
|||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer)
|
||||
{
|
||||
if (!aChild || !aChild->IsNodeOfType(nsINode::eELEMENT))
|
||||
if (!aChild || !aChild->IsElement())
|
||||
return;
|
||||
//Note, we can't use IDs here, the observer may not always have an ID.
|
||||
//And to remember: the same observer can be referenced by many
|
||||
|
|
|
@ -179,7 +179,7 @@ const nsString * const nsSVGFeatures::kIgnoreSystemLanguage = (nsString *) 0x01;
|
|||
nsSVGFeatures::PassesConditionalProcessingTests(nsIContent *aContent,
|
||||
const nsString *aAcceptLangs)
|
||||
{
|
||||
if (!aContent->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (!aContent->IsElement()) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1691,7 +1691,8 @@ nsBindingManager::Traverse(nsIContent *aContent,
|
|||
cb.NoteXPCOMChild(value);
|
||||
}
|
||||
|
||||
if (!aContent->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
// XXXbz how exactly would NODE_MAY_BE_IN_BINDING_MNGR end up on non-elements?
|
||||
if (!aContent->IsElement()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ nsXMLContentSink::DidBuildModel(PRBool aTerminated)
|
|||
nsCOMPtr<nsIDOMProcessingInstruction> pi = do_QueryInterface(child);
|
||||
CheckXSLTParamPI(pi, mXSLTProcessor, mDocument);
|
||||
}
|
||||
else if (child->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
else if (child->IsElement()) {
|
||||
// Only honor PIs in the prolog
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -382,7 +382,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode)
|
|||
}
|
||||
|
||||
if (aNode.isContent()) {
|
||||
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (aNode.mNode->IsElement()) {
|
||||
nsIAtom* localName = aNode.Content()->Tag();
|
||||
NS_ADDREF(localName);
|
||||
|
||||
|
@ -434,7 +434,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
|
|||
}
|
||||
|
||||
if (aNode.isContent()) {
|
||||
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (aNode.mNode->IsElement()) {
|
||||
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
|
||||
nodeInfo->GetLocalName(aLocalName);
|
||||
return;
|
||||
|
@ -474,7 +474,7 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
|
|||
}
|
||||
|
||||
if (aNode.isContent()) {
|
||||
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (aNode.mNode->IsElement()) {
|
||||
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
|
||||
nodeInfo->GetQualifiedName(aName);
|
||||
|
||||
|
@ -569,7 +569,7 @@ txXPathNodeUtils::appendNodeValue(const txXPathNode& aNode, nsAString& aResult)
|
|||
}
|
||||
|
||||
if (aNode.isDocument() ||
|
||||
aNode.mNode->IsNodeOfType(nsINode::eELEMENT) ||
|
||||
aNode.mNode->IsElement() ||
|
||||
aNode.mNode->IsNodeOfType(nsINode::eDOCUMENT_FRAGMENT)) {
|
||||
nsContentUtils::AppendNodeTextContent(aNode.mNode, PR_TRUE, aResult);
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ txXPathNodeUtils::localNameEquals(const txXPathNode& aNode,
|
|||
return localName == aLocalName;
|
||||
#else
|
||||
if (aNode.isContent() &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
aNode.Content()->IsElement()) {
|
||||
return aNode.Content()->NodeInfo()->Equals(aLocalName);
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ txXPathNodeUtils::isElement(const txXPathNode& aNode)
|
|||
return aNode.mInner->getNodeType() == Node::ELEMENT_NODE;
|
||||
#else
|
||||
return aNode.isContent() &&
|
||||
aNode.Content()->IsNodeOfType(nsINode::eELEMENT);
|
||||
aNode.Content()->IsElement();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,9 @@
|
|||
#include "nsIURL.h"
|
||||
#include "nsCrossSiteListenerProxy.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "Element.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
|
||||
|
||||
|
@ -570,8 +573,8 @@ handleNode(nsINode* aNode, txStylesheetCompiler* aCompiler)
|
|||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (aNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
nsIContent* element = static_cast<nsIContent*>(aNode);
|
||||
if (aNode->IsElement()) {
|
||||
Element* element = aNode->AsElement();
|
||||
|
||||
PRUint32 attsCount = element->GetAttrCount();
|
||||
nsAutoArrayPtr<txStylesheetAttr> atts;
|
||||
|
|
|
@ -295,10 +295,8 @@ txMozillaXMLOutput::endElement()
|
|||
nsresult rv = closePrevious(PR_TRUE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
NS_ASSERTION(mCurrentNode->IsNodeOfType(nsINode::eELEMENT),
|
||||
"borked mCurrentNode");
|
||||
NS_ENSURE_TRUE(mCurrentNode->IsNodeOfType(nsINode::eELEMENT),
|
||||
NS_ERROR_UNEXPECTED);
|
||||
NS_ASSERTION(mCurrentNode->IsElement(), "borked mCurrentNode");
|
||||
NS_ENSURE_TRUE(mCurrentNode->IsElement(), NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsIContent* element = static_cast<nsIContent*>
|
||||
(static_cast<nsINode*>
|
||||
|
@ -643,7 +641,7 @@ txMozillaXMLOutput::createTxWrapper()
|
|||
nsCOMPtr<nsIContent> childContent = mDocument->GetChildAt(j);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (childContent->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (childContent->IsElement()) {
|
||||
rootLocation = j;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -613,7 +613,7 @@ txMozillaXSLTProcessor::ImportStylesheet(nsIDOMNode *aStyle)
|
|||
|
||||
nsCOMPtr<nsINode> styleNode = do_QueryInterface(aStyle);
|
||||
NS_ENSURE_TRUE(styleNode &&
|
||||
(styleNode->IsNodeOfType(nsINode::eELEMENT) ||
|
||||
(styleNode->IsElement() ||
|
||||
styleNode->IsNodeOfType(nsINode::eDOCUMENT)),
|
||||
NS_ERROR_INVALID_ARG);
|
||||
|
||||
|
@ -622,7 +622,7 @@ txMozillaXSLTProcessor::ImportStylesheet(nsIDOMNode *aStyle)
|
|||
// XXX set up exception context, bug 204658
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (styleNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
if (styleNode->IsElement()) {
|
||||
mStylesheetDocument = styleNode->GetOwnerDoc();
|
||||
NS_ENSURE_TRUE(mStylesheetDocument, NS_ERROR_UNEXPECTED);
|
||||
|
||||
|
|
|
@ -4237,7 +4237,7 @@ nsXULDocument::FindBroadcaster(nsIContent* aElement,
|
|||
nsString& aAttribute,
|
||||
nsIDOMElement** aBroadcaster)
|
||||
{
|
||||
NS_ASSERTION(aElement->IsNodeOfType(nsINode::eELEMENT),
|
||||
NS_ASSERTION(aElement->IsElement(),
|
||||
"Only pass elements into FindBroadcaster!");
|
||||
|
||||
nsresult rv;
|
||||
|
|
|
@ -1346,7 +1346,7 @@ nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement)
|
|||
// it should be moved outside the inner loop. Bug 297290.
|
||||
if (element->NodeInfo()->Equals(nsGkAtoms::_template,
|
||||
kNameSpaceID_XUL) ||
|
||||
!element->IsNodeOfType(nsINode::eELEMENT))
|
||||
!element->IsElement())
|
||||
continue;
|
||||
|
||||
// If the element is in the template map, then we
|
||||
|
|
|
@ -76,7 +76,7 @@ nsXULTemplateResultXML::GetIsEmpty(PRBool* aIsEmpty)
|
|||
if (content) {
|
||||
PRUint32 count = content->GetChildCount();
|
||||
for (PRUint32 c = 0; c < count; c++) {
|
||||
if (content->GetChildAt(c)->IsNodeOfType(nsIContent::eELEMENT)) {
|
||||
if (content->GetChildAt(c)->IsElement()) {
|
||||
*aIsEmpty = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче