mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 580094 - Few SetInnerHTML micro optimizations , r=jst, a=benjamin
--HG-- extra : rebase_source : d23e9583ef631e1a93d6aece9c3543c4b23ed9c2
This commit is contained in:
parent
930343bd50
commit
8d289f0549
@ -1600,12 +1600,10 @@ nsContentSink::DropParserAndPerfHint(void)
|
||||
// Do this hack to make sure that the parser
|
||||
// doesn't get destroyed, accidently, before
|
||||
// the circularity, between sink & parser, is
|
||||
// actually borken.
|
||||
nsCOMPtr<nsIParser> kungFuDeathGrip(mParser);
|
||||
|
||||
// actually broken.
|
||||
// Drop our reference to the parser to get rid of a circular
|
||||
// reference.
|
||||
mParser = nsnull;
|
||||
nsCOMPtr<nsIParser> kungFuDeathGrip(mParser.forget());
|
||||
|
||||
if (mDynamicLowerValue) {
|
||||
// Reset the performance hint which was set to FALSE
|
||||
|
@ -3793,15 +3793,16 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> fragment = do_QueryInterface(frag);
|
||||
if (contextAsContent) {
|
||||
parser->ParseFragment(aFragment,
|
||||
frag,
|
||||
fragment,
|
||||
contextAsContent->Tag(),
|
||||
contextAsContent->GetNameSpaceID(),
|
||||
(document->GetCompatibilityMode() == eCompatibility_NavQuirks));
|
||||
} else {
|
||||
parser->ParseFragment(aFragment,
|
||||
frag,
|
||||
fragment,
|
||||
nsGkAtoms::body,
|
||||
kNameSpaceID_XHTML,
|
||||
(document->GetCompatibilityMode() == eCompatibility_NavQuirks));
|
||||
|
@ -428,15 +428,12 @@ nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsISupports* aTargetNode,
|
||||
nsIContent* aTargetNode,
|
||||
nsIAtom* aContextLocalName,
|
||||
PRInt32 aContextNamespace,
|
||||
PRBool aQuirks)
|
||||
{
|
||||
nsCOMPtr<nsIContent> target = do_QueryInterface(aTargetNode);
|
||||
NS_ASSERTION(target, "Target did not QI to nsIContent");
|
||||
|
||||
nsIDocument* doc = target->GetOwnerDoc();
|
||||
nsIDocument* doc = aTargetNode->GetOwnerDoc();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
nsIURI* uri = doc->GetDocumentURI();
|
||||
@ -447,10 +444,10 @@ nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
|
||||
mExecutor->SetParser(this);
|
||||
mExecutor->SetNodeInfoManager(doc->NodeInfoManager());
|
||||
|
||||
nsIContent* weakTarget = target;
|
||||
nsIContent* target = aTargetNode;
|
||||
mTreeBuilder->setFragmentContext(aContextLocalName,
|
||||
aContextNamespace,
|
||||
&weakTarget,
|
||||
&target,
|
||||
aQuirks);
|
||||
mExecutor->EnableFragmentMode();
|
||||
|
||||
|
@ -217,13 +217,13 @@ class nsHtml5Parser : public nsIParser,
|
||||
* Invoke the fragment parsing algorithm (innerHTML).
|
||||
*
|
||||
* @param aSourceBuffer the string being set as innerHTML
|
||||
* @param aTargetNode the target container (must QI to nsIContent)
|
||||
* @param aTargetNode the target container
|
||||
* @param aContextLocalName local name of context node
|
||||
* @param aContextNamespace namespace of context node
|
||||
* @param aQuirks true to make <table> not close <p>
|
||||
*/
|
||||
NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsISupports* aTargetNode,
|
||||
nsIContent* aTargetNode,
|
||||
nsIAtom* aContextLocalName,
|
||||
PRInt32 aContextNamespace,
|
||||
PRBool aQuirks);
|
||||
|
@ -55,8 +55,8 @@
|
||||
#include "nsIAtom.h"
|
||||
|
||||
#define NS_IPARSER_IID \
|
||||
{ 0x3db442c2, 0x8a4d, 0x4ce4, \
|
||||
{ 0x86, 0x58, 0x48, 0xee, 0x55, 0x4b, 0xbb, 0xd4 } }
|
||||
{ 0xcbc0cbd8, 0xbbb7, 0x46d6, \
|
||||
{ 0xa5, 0x51, 0x37, 0x8a, 0x69, 0x53, 0xa7, 0x14 } }
|
||||
|
||||
// {41421C60-310A-11d4-816F-000064657374}
|
||||
#define NS_IDEBUG_DUMP_CONTENT_IID \
|
||||
@ -69,6 +69,7 @@ class nsIParserFilter;
|
||||
class nsString;
|
||||
class nsIURI;
|
||||
class nsIChannel;
|
||||
class nsIContent;
|
||||
|
||||
enum eParserCommands {
|
||||
eViewNormal,
|
||||
@ -263,7 +264,7 @@ class nsIParser : public nsISupports {
|
||||
nsDTDMode aMode = eDTDMode_autodetect) = 0;
|
||||
|
||||
NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsISupports* aTargetNode,
|
||||
nsIContent* aTargetNode,
|
||||
nsIAtom* aContextLocalName,
|
||||
PRInt32 aContextNamespace,
|
||||
PRBool aQuirks) = 0;
|
||||
|
@ -2123,7 +2123,7 @@ nsParser::Parse(const nsAString& aSourceBuffer,
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsParser::ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsISupports* aTargetNode,
|
||||
nsIContent* aTargetNode,
|
||||
nsIAtom* aContextLocalName,
|
||||
PRInt32 aContextNamespace,
|
||||
PRBool aQuirks)
|
||||
|
@ -216,7 +216,7 @@ class nsParser : public nsIParser,
|
||||
nsDTDMode aMode = eDTDMode_autodetect);
|
||||
|
||||
NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsISupports* aTargetNode,
|
||||
nsIContent* aTargetNode,
|
||||
nsIAtom* aContextLocalName,
|
||||
PRInt32 aContextNamespace,
|
||||
PRBool aQuirks);
|
||||
|
Loading…
Reference in New Issue
Block a user