diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 665c561ec9f..78f3103463c 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -352,6 +352,9 @@ CreateContentObject(const nsIParserNode& aNode, // Create content object for the given tag nsresult rv = NS_OK; switch (aNodeType) { + case eHTMLTag_a: + rv = NS_NewHTMLAnchor(aResult, atom); + break; case eHTMLTag_applet: rv = NS_NewHTMLApplet(aResult, atom); break; @@ -760,7 +763,7 @@ SinkContext::AddLeaf(const nsIParserNode& aNode) NS_ASSERTION(mStackPos > 0, "leaf w/o container"); nsIHTMLContent* parent = mStack[mStackPos-1].mContent; parent->AppendChildTo(content, PR_FALSE); - NS_IF_RELEASE(content); + NS_RELEASE(content); // Mark sink dirty if it can safely reflow something MaybeMarkSinkDirty(); diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 665c561ec9f..78f3103463c 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -352,6 +352,9 @@ CreateContentObject(const nsIParserNode& aNode, // Create content object for the given tag nsresult rv = NS_OK; switch (aNodeType) { + case eHTMLTag_a: + rv = NS_NewHTMLAnchor(aResult, atom); + break; case eHTMLTag_applet: rv = NS_NewHTMLApplet(aResult, atom); break; @@ -760,7 +763,7 @@ SinkContext::AddLeaf(const nsIParserNode& aNode) NS_ASSERTION(mStackPos > 0, "leaf w/o container"); nsIHTMLContent* parent = mStack[mStackPos-1].mContent; parent->AppendChildTo(content, PR_FALSE); - NS_IF_RELEASE(content); + NS_RELEASE(content); // Mark sink dirty if it can safely reflow something MaybeMarkSinkDirty(); diff --git a/mozilla/layout/html/document/src/nsHTMLParts.cpp b/mozilla/layout/html/document/src/nsHTMLParts.cpp index b03355d258b..ab72e6a846d 100644 --- a/mozilla/layout/html/document/src/nsHTMLParts.cpp +++ b/mozilla/layout/html/document/src/nsHTMLParts.cpp @@ -40,6 +40,8 @@ NS_CreateHTMLElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* atom = NS_NewAtom(tmp); switch (id) { case eHTMLTag_a: + rv = NS_NewHTMLAnchor(aInstancePtrResult, atom); + break; case eHTMLTag_abbr: case eHTMLTag_acronym: case eHTMLTag_address: