зеркало из https://github.com/mozilla/gecko-dev.git
deCOMtaminate nsIContent::GetNameSpaceID. Bug 272079, r+sr=jst
This commit is contained in:
Родитель
73fc272455
Коммит
076b2a64a6
|
@ -150,15 +150,17 @@ STDMETHODIMP nsAccessNodeWrap::get_nodeInfo(
|
|||
mDOMNode->GetNodeValue(nodeValue);
|
||||
*aNodeValue = ::SysAllocString(nodeValue.get());
|
||||
|
||||
PRInt32 nameSpaceID = 0;
|
||||
PRInt32 nameSpaceID;
|
||||
*aUniqueID = 0; // magic value of 0 means we're on the document node.
|
||||
if (content) {
|
||||
content->GetNameSpaceID(&nameSpaceID);
|
||||
nameSpaceID = content->GetNameSpaceID();
|
||||
// This is a unique ID for every content node. The 3rd party
|
||||
// accessibility application can compare this to the childID we
|
||||
// return for events such as focus events, to correlate back to
|
||||
// data nodes in their internal object model.
|
||||
*aUniqueID = content->ContentID();
|
||||
} else {
|
||||
nameSpaceID = 0;
|
||||
}
|
||||
*aNameSpaceID = NS_STATIC_CAST(short, nameSpaceID);
|
||||
|
||||
|
|
|
@ -60,8 +60,8 @@ class nsIURI;
|
|||
|
||||
// IID for the nsIContent interface
|
||||
#define NS_ICONTENT_IID \
|
||||
{ 0xdd5c7dd9, 0x4c9b, 0x46ac, \
|
||||
{ 0x87, 0x5c, 0xcb, 0xba, 0xe5, 0x41, 0x84, 0xb5 } }
|
||||
{ 0x84840657, 0x2f0b, 0x4b11, \
|
||||
{ 0xa8, 0xba, 0xbc, 0x0e, 0xe3, 0xcd, 0xef, 0x08 } }
|
||||
|
||||
/**
|
||||
* A node of content in a document's content model. This interface
|
||||
|
@ -152,9 +152,9 @@ public:
|
|||
|
||||
/**
|
||||
* Get the namespace that this element's tag is defined in
|
||||
* @param aResult the namespace [OUT]
|
||||
* @return the namespace
|
||||
*/
|
||||
virtual void GetNameSpaceID(PRInt32* aResult) const = 0;
|
||||
virtual PRInt32 GetNameSpaceID() const = 0;
|
||||
|
||||
/**
|
||||
* Get the tag for this element. This will always return a non-null
|
||||
|
|
|
@ -622,10 +622,10 @@ nsGenericDOMDataNode::SetNativeAnonymous(PRBool aAnonymous)
|
|||
// XXX Need to fix this to do something - bug 165110
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericDOMDataNode::GetNameSpaceID(PRInt32* aID) const
|
||||
PRInt32
|
||||
nsGenericDOMDataNode::GetNameSpaceID() const
|
||||
{
|
||||
*aID = kNameSpaceID_None;
|
||||
return kNameSpaceID_None;
|
||||
}
|
||||
|
||||
nsIAtom *
|
||||
|
|
|
@ -193,7 +193,7 @@ public:
|
|||
virtual void SetParent(nsIContent* aParent);
|
||||
virtual PRBool IsNativeAnonymous() const;
|
||||
virtual void SetNativeAnonymous(PRBool aAnonymous);
|
||||
virtual void GetNameSpaceID(PRInt32* aID) const;
|
||||
virtual PRInt32 GetNameSpaceID() const;
|
||||
virtual nsIAtom *GetIDAttributeName() const;
|
||||
virtual nsIAtom *GetClassAttributeName() const;
|
||||
virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
|
||||
|
|
|
@ -1820,10 +1820,10 @@ nsGenericElement::SetNativeAnonymous(PRBool aAnonymous)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericElement::GetNameSpaceID(PRInt32* aNameSpaceID) const
|
||||
PRInt32
|
||||
nsGenericElement::GetNameSpaceID() const
|
||||
{
|
||||
*aNameSpaceID = mNodeInfo->NamespaceID();
|
||||
return mNodeInfo->NamespaceID();
|
||||
}
|
||||
|
||||
nsIAtom *
|
||||
|
|
|
@ -370,7 +370,7 @@ public:
|
|||
virtual void SetParent(nsIContent* aParent);
|
||||
virtual PRBool IsNativeAnonymous() const;
|
||||
virtual void SetNativeAnonymous(PRBool aAnonymous);
|
||||
virtual void GetNameSpaceID(PRInt32* aNameSpaceID) const;
|
||||
virtual PRInt32 GetNameSpaceID() const;
|
||||
virtual nsIAtom *Tag() const;
|
||||
virtual nsINodeInfo *GetNodeInfo() const;
|
||||
virtual PRUint32 GetChildCount() const;
|
||||
|
|
|
@ -641,9 +641,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
|||
continue;
|
||||
|
||||
if (namespaceID == kNameSpaceID_None) {
|
||||
PRInt32 elementNsID;
|
||||
content->GetNameSpaceID(&elementNsID);
|
||||
if (elementNsID == kNameSpaceID_XHTML) {
|
||||
if (content->GetNameSpaceID() == kNameSpaceID_XHTML) {
|
||||
if (IsShorthandAttr(attrName, content->Tag()) &&
|
||||
valueStr.IsEmpty()) {
|
||||
valueStr = nameStr;
|
||||
|
|
|
@ -1229,11 +1229,11 @@ nsEventListenerManager::AddScriptEventListener(nsISupports *aObject,
|
|||
else {
|
||||
PRInt32 nameSpace = kNameSpaceID_Unknown;
|
||||
if (content)
|
||||
content->GetNameSpaceID(&nameSpace);
|
||||
nameSpace = content->GetNameSpaceID();
|
||||
else if (doc) {
|
||||
nsCOMPtr<nsIContent> root = doc->GetRootContent();
|
||||
if (root)
|
||||
root->GetNameSpaceID(&nameSpace);
|
||||
nameSpace = root->GetNameSpaceID();
|
||||
}
|
||||
const char *eventName = nsContentUtils::GetEventArgName(nameSpace);
|
||||
|
||||
|
@ -1446,9 +1446,8 @@ nsEventListenerManager::CompileEventHandlerInternal(nsIScriptContext *aContext,
|
|||
&handler);
|
||||
}
|
||||
else {
|
||||
PRInt32 nameSpace = kNameSpaceID_Unknown;
|
||||
content->GetNameSpaceID(&nameSpace);
|
||||
const char *eventName = nsContentUtils::GetEventArgName(nameSpace);
|
||||
const char *eventName =
|
||||
nsContentUtils::GetEventArgName(content->GetNameSpaceID());
|
||||
|
||||
result = aContext->CompileEventHandler(jsobj, aName, eventName,
|
||||
handlerBody,
|
||||
|
|
|
@ -1607,13 +1607,13 @@ nsGenericHTMLElement::GetHrefURIForAnchors(nsIURI** aURI)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericHTMLElement::GetNameSpaceID(PRInt32* aID) const
|
||||
PRInt32
|
||||
nsGenericHTMLElement::GetNameSpaceID() const
|
||||
{
|
||||
// XXX
|
||||
// XXX This is incorrect!!!!!!!!!!!!!!!!
|
||||
// XXX
|
||||
*aID = kNameSpaceID_XHTML;
|
||||
return kNameSpaceID_XHTML;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -174,7 +174,7 @@ public:
|
|||
// Implementation for nsIContent
|
||||
virtual void SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
||||
PRBool aCompileEventHandlers);
|
||||
virtual void GetNameSpaceID(PRInt32* aID) const;
|
||||
virtual PRInt32 GetNameSpaceID() const;
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
const nsAString& aValue, PRBool aNotify)
|
||||
{
|
||||
|
|
|
@ -612,7 +612,7 @@ nsBindingManager::ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID,
|
|||
}
|
||||
}
|
||||
|
||||
aContent->GetNameSpaceID(aNameSpaceID);
|
||||
*aNameSpaceID = aContent->GetNameSpaceID();
|
||||
NS_ADDREF(*aResult = aContent->Tag());
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -684,7 +684,7 @@ nsXBLService::ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID,
|
|||
return bindingManager->ResolveTag(aContent, aNameSpaceID, aResult);
|
||||
}
|
||||
|
||||
aContent->GetNameSpaceID(aNameSpaceID);
|
||||
*aNameSpaceID = aContent->GetNameSpaceID();
|
||||
NS_ADDREF(*aResult = aContent->Tag());
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -1965,10 +1965,10 @@ nsXULElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsXULElement::GetNameSpaceID(PRInt32* aNameSpaceID) const
|
||||
PRInt32
|
||||
nsXULElement::GetNameSpaceID() const
|
||||
{
|
||||
*aNameSpaceID = NodeInfo()->NamespaceID();
|
||||
return NodeInfo()->NamespaceID();
|
||||
}
|
||||
|
||||
nsIAtom *
|
||||
|
|
|
@ -458,7 +458,7 @@ public:
|
|||
virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify,
|
||||
PRBool aDeepSetDocument);
|
||||
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify);
|
||||
virtual void GetNameSpaceID(PRInt32* aNameSpeceID) const;
|
||||
virtual PRInt32 GetNameSpaceID() const;
|
||||
virtual nsIAtom *Tag() const;
|
||||
virtual nsINodeInfo *GetNodeInfo() const;
|
||||
virtual nsIAtom *GetIDAttributeName() const;
|
||||
|
|
|
@ -446,8 +446,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
|||
for (PRUint32 kid = 0; kid < count; kid++) {
|
||||
nsIContent *tmplKid = aTemplateNode->GetChildAt(kid);
|
||||
|
||||
PRInt32 nameSpaceID;
|
||||
tmplKid->GetNameSpaceID(&nameSpaceID);
|
||||
PRInt32 nameSpaceID = tmplKid->GetNameSpaceID();
|
||||
|
||||
// Check whether this element is the "resource" element. The
|
||||
// "resource" element is the element that is cookie-cutter
|
||||
|
@ -1570,10 +1569,8 @@ nsXULContentBuilder::AttributeChanged(nsIDocument* aDocument,
|
|||
// Handle "open" and "close" cases. We do this handling before
|
||||
// we've notified the observer, so that content is already created
|
||||
// for the frame system to walk.
|
||||
PRInt32 nameSpaceID = kNameSpaceID_Unknown;
|
||||
aContent->GetNameSpaceID(&nameSpaceID);
|
||||
|
||||
if ((nameSpaceID == kNameSpaceID_XUL) && (aAttribute == nsXULAtoms::open)) {
|
||||
if ((aContent->GetNameSpaceID() == kNameSpaceID_XUL) &&
|
||||
(aAttribute == nsXULAtoms::open)) {
|
||||
// We're on a XUL tag, and an ``open'' attribute changed.
|
||||
nsAutoString open;
|
||||
aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open);
|
||||
|
|
|
@ -176,10 +176,7 @@ nsXULContentUtils::FindChildByTag(nsIContent* aElement,
|
|||
for (PRUint32 i = 0; i < count; ++i) {
|
||||
nsIContent *kid = aElement->GetChildAt(i);
|
||||
|
||||
PRInt32 nameSpaceID;
|
||||
kid->GetNameSpaceID(&nameSpaceID);
|
||||
|
||||
if (nameSpaceID != aNameSpaceID)
|
||||
if (kid->GetNameSpaceID() != aNameSpaceID)
|
||||
continue; // wrong namespace
|
||||
|
||||
nsINodeInfo *ni = kid->GetNodeInfo();
|
||||
|
|
|
@ -3954,9 +3954,6 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
|||
styleContext = contentFrame->GetStyleContext();
|
||||
} else {
|
||||
// otherwise build a box or a block
|
||||
#if defined(MOZ_SVG)
|
||||
PRInt32 nameSpaceID;
|
||||
#endif
|
||||
#ifdef MOZ_XUL
|
||||
if (aDocElement->IsContentOfType(nsIContent::eXUL)) {
|
||||
rv = NS_NewDocElementBoxFrame(aPresShell, &contentFrame);
|
||||
|
@ -3967,8 +3964,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell,
|
|||
else
|
||||
#endif
|
||||
#ifdef MOZ_SVG
|
||||
if (aDocElement->GetNameSpaceID(&nameSpaceID),
|
||||
(nameSpaceID == kNameSpaceID_SVG)) {
|
||||
if (aDocElement->GetNameSpaceID() == kNameSpaceID_SVG) {
|
||||
rv = NS_NewSVGOuterSVGFrame(aPresShell, aDocElement, &contentFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
@ -7439,9 +7435,6 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresShell* aPresShell,
|
|||
nsRefPtr<nsStyleContext> styleContext;
|
||||
styleContext = ResolveStyleContext(aPresContext, aParentFrame, aContent);
|
||||
|
||||
PRInt32 nameSpaceID;
|
||||
aContent->GetNameSpaceID(&nameSpaceID);
|
||||
|
||||
PRBool pageBreakAfter = PR_FALSE;
|
||||
|
||||
if (aPresContext->IsPaginated()) {
|
||||
|
@ -7451,7 +7444,8 @@ nsCSSFrameConstructor::ConstructFrame(nsIPresShell* aPresShell,
|
|||
}
|
||||
// construct the frame
|
||||
rv = ConstructFrameInternal(aPresShell, aPresContext, aState, aContent, aParentFrame,
|
||||
tag, nameSpaceID, styleContext, aFrameItems, PR_FALSE);
|
||||
tag, aContent->GetNameSpaceID(), styleContext,
|
||||
aFrameItems, PR_FALSE);
|
||||
if (NS_SUCCEEDED(rv) && pageBreakAfter) {
|
||||
// Construct the page break after
|
||||
ConstructPageBreakFrame(aPresShell, aPresContext, aState, aContent,
|
||||
|
@ -10513,12 +10507,10 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
|||
nsStyleContext* styleContext = aFrame->GetStyleContext();
|
||||
|
||||
// Get aFrame's content object and the tag name
|
||||
PRInt32 nameSpaceID;
|
||||
nsIAtom* tag;
|
||||
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
NS_ASSERTION(content, "null content object");
|
||||
content->GetNameSpaceID(&nameSpaceID);
|
||||
tag = content->Tag();
|
||||
|
||||
// Get the child list name that the frame is contained in
|
||||
|
@ -10622,7 +10614,7 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresShell* aPresShell,
|
|||
// Note: if the old frame was out-of-flow, then so will the new frame
|
||||
// and we'll get a new placeholder frame
|
||||
rv = ConstructFrameByDisplayType(aPresShell, aPresContext, state, display,
|
||||
content, nameSpaceID, tag,
|
||||
content, content->GetNameSpaceID(), tag,
|
||||
inFlowParent, styleContext, frameItems);
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -12647,12 +12639,10 @@ nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 namespaceID;
|
||||
aChild->GetNameSpaceID(&namespaceID);
|
||||
|
||||
rv = ConstructFrameInternal(aPresContext->PresShell(),
|
||||
aPresContext, state, aChild,
|
||||
aParentFrame, aChild->Tag(), namespaceID,
|
||||
aParentFrame, aChild->Tag(),
|
||||
aChild->GetNameSpaceID(),
|
||||
styleContext, frameItems, PR_FALSE);
|
||||
|
||||
nsIFrame* newFrame = frameItems.childList;
|
||||
|
|
|
@ -2847,7 +2847,7 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
|
|||
mContent = aContent;
|
||||
|
||||
// get the namespace
|
||||
aContent->GetNameSpaceID(&mNameSpaceID);
|
||||
mNameSpaceID = aContent->GetNameSpaceID();
|
||||
|
||||
// get the tag and parent
|
||||
mContentTag = aContent->Tag();
|
||||
|
|
Загрузка…
Ссылка в новой задаче