mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Add elements to element map by 'ref', as well.
This commit is contained in:
parent
65686e242a
commit
e66ef0e374
@ -1907,6 +1907,11 @@ XULContentSinkImpl::OpenTag(const nsIParserNode& aNode, PRInt32 aNameSpaceID, ns
|
||||
|
||||
|
||||
// Add the element to the XUL document's ID-to-element map.
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(mDocument);
|
||||
if (! xuldoc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
// check for an 'id' attribute
|
||||
nsAutoString id;
|
||||
rv = element->GetAttribute(kNameSpaceID_None, kIdAtom, id);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1923,10 +1928,15 @@ XULContentSinkImpl::OpenTag(const nsIParserNode& aNode, PRInt32 aNameSpaceID, ns
|
||||
}
|
||||
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(mDocument);
|
||||
if (! xuldoc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
rv = xuldoc->AddElementForID(id, element);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// ...and a 'ref' attribute
|
||||
rv = element->GetAttribute(kNameSpaceID_None, kRefAtom, id);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
rv = xuldoc->AddElementForID(id, element);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
@ -1907,6 +1907,11 @@ XULContentSinkImpl::OpenTag(const nsIParserNode& aNode, PRInt32 aNameSpaceID, ns
|
||||
|
||||
|
||||
// Add the element to the XUL document's ID-to-element map.
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(mDocument);
|
||||
if (! xuldoc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
// check for an 'id' attribute
|
||||
nsAutoString id;
|
||||
rv = element->GetAttribute(kNameSpaceID_None, kIdAtom, id);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1923,10 +1928,15 @@ XULContentSinkImpl::OpenTag(const nsIParserNode& aNode, PRInt32 aNameSpaceID, ns
|
||||
}
|
||||
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(mDocument);
|
||||
if (! xuldoc)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
rv = xuldoc->AddElementForID(id, element);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// ...and a 'ref' attribute
|
||||
rv = element->GetAttribute(kNameSpaceID_None, kRefAtom, id);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
rv = xuldoc->AddElementForID(id, element);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user