mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix for bug 582601 (Make GetContentInternal return Element*). r=bz.
This commit is contained in:
parent
dfcfc976fb
commit
e3ae7d53bb
12
content/base/crashtests/582601.html
Normal file
12
content/base/crashtests/582601.html
Normal file
@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Crashtest</title>
|
||||
<script>
|
||||
var attr = document.createAttribute("foo");
|
||||
attr.lookupPrefix("");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -68,3 +68,4 @@ load 558973.html
|
||||
load 564079-1.html
|
||||
load 564114.html
|
||||
load 565125-1.html
|
||||
load 582601.html
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
protected:
|
||||
virtual mozilla::dom::Element* GetNameSpaceElement()
|
||||
{
|
||||
return GetContentInternal()->AsElement();
|
||||
return GetContentInternal();
|
||||
}
|
||||
|
||||
static PRBool sInitialized;
|
||||
@ -143,7 +143,7 @@ private:
|
||||
// pointer so we can implement GetChildArray().
|
||||
nsIContent* mChild;
|
||||
|
||||
nsIContent *GetContentInternal() const
|
||||
mozilla::dom::Element *GetContentInternal() const
|
||||
{
|
||||
return mAttrMap ? mAttrMap->GetContent() : nsnull;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsDOMAttributeMap::nsDOMAttributeMap(nsIContent* aContent)
|
||||
nsDOMAttributeMap::nsDOMAttributeMap(Element* aContent)
|
||||
: mContent(aContent)
|
||||
{
|
||||
// We don't add a reference to our content. If it goes away,
|
||||
|
@ -56,6 +56,12 @@ class nsDOMAttribute;
|
||||
class nsINodeInfo;
|
||||
class nsIDocument;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
/**
|
||||
* Structure used as a key for caching nsDOMAttributes in nsDOMAttributeMap's mAttributeCache.
|
||||
*/
|
||||
@ -119,7 +125,9 @@ private:
|
||||
class nsDOMAttributeMap : public nsIDOMNamedNodeMap
|
||||
{
|
||||
public:
|
||||
nsDOMAttributeMap(nsIContent* aContent);
|
||||
typedef mozilla::dom::Element Element;
|
||||
|
||||
nsDOMAttributeMap(Element *aContent);
|
||||
virtual ~nsDOMAttributeMap();
|
||||
|
||||
/**
|
||||
@ -134,7 +142,7 @@ public:
|
||||
|
||||
void DropReference();
|
||||
|
||||
nsIContent* GetContent()
|
||||
Element* GetContent()
|
||||
{
|
||||
return mContent;
|
||||
}
|
||||
@ -193,7 +201,7 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(nsDOMAttributeMap)
|
||||
|
||||
private:
|
||||
nsIContent* mContent; // Weak reference
|
||||
Element *mContent; // Weak reference
|
||||
|
||||
/**
|
||||
* Cache of nsDOMAttributes.
|
||||
|
Loading…
Reference in New Issue
Block a user