diff --git a/mozilla/content/base/src/mozSanitizingSerializer.h b/mozilla/content/base/src/mozSanitizingSerializer.h index 27133f1dddf..dea21c726ce 100644 --- a/mozilla/content/base/src/mozSanitizingSerializer.h +++ b/mozilla/content/base/src/mozSanitizingSerializer.h @@ -106,7 +106,7 @@ public: NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode); - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset); virtual nsISupports *GetTarget() { return nsnull; } diff --git a/mozilla/content/base/src/nsPlainTextSerializer.h b/mozilla/content/base/src/nsPlainTextSerializer.h index 994a9c525e8..e8b1a7fb138 100644 --- a/mozilla/content/base/src/nsPlainTextSerializer.h +++ b/mozilla/content/base/src/nsPlainTextSerializer.h @@ -101,7 +101,7 @@ public: NS_IMETHOD AddComment(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) { return NS_OK; } NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode) { return NS_OK; } - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } virtual nsISupports *GetTarget() { return nsnull; } diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index d4ba0a24531..f6795dbf058 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -228,7 +228,7 @@ public: NS_IMETHOD WillInterrupt(void); NS_IMETHOD WillResume(void); NS_IMETHOD SetParser(nsIParser* aParser); - virtual void FlushContent(PRBool aNotify); + virtual void FlushPendingNotifications(mozFlushType aType); NS_IMETHOD SetDocumentCharset(nsACString& aCharset); virtual nsISupports *GetTarget(); @@ -4220,12 +4220,18 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode) } void -HTMLContentSink::FlushContent(PRBool aNotify) +HTMLContentSink::FlushPendingNotifications(mozFlushType aType) { // Only flush tags if we're not doing the notification ourselves // (since we aren't reentrant) if (mCurrentContext && !mInNotification) { - mCurrentContext->FlushTags(aNotify); + PRBool notify = ((aType & Flush_SinkNotifications) != 0); + mCurrentContext->FlushTags(notify); + if (aType & Flush_OnlyReflow) { + // Make sure that layout has started so that the reflow flush + // will actually happen. + StartLayout(); + } } } diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 2bee9483212..a7a52d8e297 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -1213,8 +1213,7 @@ nsHTMLDocument::FlushPendingNotifications(mozFlushType aType) (!(aType & Flush_SinkNotifications) || IsSafeToFlush())) { nsCOMPtr sink = mParser->GetContentSink(); if (sink) { - PRBool notify = ((aType & Flush_SinkNotifications) != 0); - sink->FlushContent(notify); + sink->FlushPendingNotifications(aType); } } diff --git a/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp b/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp index aa9e59ff349..29dd643d58f 100644 --- a/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLFragmentContentSink.cpp @@ -83,7 +83,7 @@ public: NS_IMETHOD WillInterrupt(void); NS_IMETHOD WillResume(void); NS_IMETHOD SetParser(nsIParser* aParser); - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } virtual nsISupports *GetTarget() { return mTargetDocument; } diff --git a/mozilla/content/xml/document/src/nsLoadSaveContentSink.cpp b/mozilla/content/xml/document/src/nsLoadSaveContentSink.cpp index bad26f0dcb3..092186a1226 100644 --- a/mozilla/content/xml/document/src/nsLoadSaveContentSink.cpp +++ b/mozilla/content/xml/document/src/nsLoadSaveContentSink.cpp @@ -122,9 +122,9 @@ nsLoadSaveContentSink::SetParser(nsIParser* aParser) } void -nsLoadSaveContentSink::FlushContent(PRBool aNotify) +nsLoadSaveContentSink::FlushPendingNotifications(mozFlushType aType) { - mBaseSink->FlushContent(aNotify); + mBaseSink->FlushPendingNotifications(aType); } NS_IMETHODIMP diff --git a/mozilla/content/xml/document/src/nsLoadSaveContentSink.h b/mozilla/content/xml/document/src/nsLoadSaveContentSink.h index 6e221dfa0a0..14f6fdbe44d 100644 --- a/mozilla/content/xml/document/src/nsLoadSaveContentSink.h +++ b/mozilla/content/xml/document/src/nsLoadSaveContentSink.h @@ -74,7 +74,7 @@ public: NS_IMETHOD WillInterrupt(void); NS_IMETHOD WillResume(void); NS_IMETHOD SetParser(nsIParser* aParser); - virtual void FlushContent(PRBool aNotify); + virtual void FlushPendingNotifications(mozFlushType aType); NS_IMETHOD SetDocumentCharset(nsAString& aCharset); private: diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.h b/mozilla/content/xml/document/src/nsXMLContentSink.h index 1c8c89dca3a..8f0be02ceda 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.h +++ b/mozilla/content/xml/document/src/nsXMLContentSink.h @@ -84,7 +84,7 @@ public: NS_IMETHOD WillInterrupt(void); NS_IMETHOD WillResume(void); NS_IMETHOD SetParser(nsIParser* aParser); - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset); virtual nsISupports *GetTarget(); diff --git a/mozilla/content/xul/document/src/nsXULContentSink.cpp b/mozilla/content/xul/document/src/nsXULContentSink.cpp index c77169a5325..47a3ec0836b 100644 --- a/mozilla/content/xul/document/src/nsXULContentSink.cpp +++ b/mozilla/content/xul/document/src/nsXULContentSink.cpp @@ -133,7 +133,7 @@ public: NS_IMETHOD WillInterrupt(void); NS_IMETHOD WillResume(void); NS_IMETHOD SetParser(nsIParser* aParser); - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset); virtual nsISupports *GetTarget(); diff --git a/mozilla/extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp b/mozilla/extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp index 2a710f23e87..960ebfd661c 100644 --- a/mozilla/extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp +++ b/mozilla/extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp @@ -111,7 +111,7 @@ public: NS_IMETHOD WillInterrupt(void) { return NS_OK; } NS_IMETHOD WillResume(void) { return NS_OK; } NS_IMETHOD SetParser(nsIParser* aParser) { return NS_OK; } - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } virtual nsISupports *GetTarget() { return nsnull; } diff --git a/mozilla/parser/htmlparser/public/nsIContentSink.h b/mozilla/parser/htmlparser/public/nsIContentSink.h index 4343b484d23..68e8737d4d5 100644 --- a/mozilla/parser/htmlparser/public/nsIContentSink.h +++ b/mozilla/parser/htmlparser/public/nsIContentSink.h @@ -50,11 +50,14 @@ */ #include "nsISupports.h" #include "nsString.h" +#include "mozFlushType.h" class nsIParser; #define NS_ICONTENT_SINK_IID \ -{0x7f459e15, 0xd559, 0x4c50, {0x91, 0x30, 0x3a, 0xe7, 0x31, 0x46, 0x67, 0xa9}} +{ 0x94ec4df1, 0x6885, 0x4b1f, \ + { 0x85, 0x10, 0xe3, 0x5f, 0x4f, 0x36, 0xea, 0xaa } } + // The base value for the content ID counter. // Values greater than or equal to this base value are used // by each of the content sinks to assign unique values @@ -111,10 +114,9 @@ public: * Flush content so that the content model is in sync with the state * of the sink. * - * @param aNotify true if notifications should be fired in the - * process (instead of deferred for now). + * @param aType the type of flush to perform */ - virtual void FlushContent(PRBool aNotify)=0; + virtual void FlushPendingNotifications(mozFlushType aType)=0; /** * Set the document character set. This should be passed on to the diff --git a/mozilla/parser/htmlparser/robot/Makefile.in b/mozilla/parser/htmlparser/robot/Makefile.in index 5629806e8a1..4df86a50c1b 100644 --- a/mozilla/parser/htmlparser/robot/Makefile.in +++ b/mozilla/parser/htmlparser/robot/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = xpcom \ docshell \ uriloader \ unicharutil \ + content \ $(NULL) CPPSRCS = nsDebugRobot.cpp nsRobotSink.cpp diff --git a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp index 7a09ff263b1..d714c8d6519 100644 --- a/mozilla/parser/htmlparser/robot/nsRobotSink.cpp +++ b/mozilla/parser/htmlparser/robot/nsRobotSink.cpp @@ -104,7 +104,7 @@ public: NS_IMETHOD WillInterrupt(void) { return NS_OK; } NS_IMETHOD WillResume(void) { return NS_OK; } NS_IMETHOD SetParser(nsIParser* aParser) { return NS_OK; } - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } virtual nsISupports *GetTarget() { return nsnull; } NS_IMETHOD WillProcessTokens(void) { return NS_OK; } diff --git a/mozilla/parser/htmlparser/src/nsLoggingSink.h b/mozilla/parser/htmlparser/src/nsLoggingSink.h index e7cb45ecea4..969ae8a8af7 100644 --- a/mozilla/parser/htmlparser/src/nsLoggingSink.h +++ b/mozilla/parser/htmlparser/src/nsLoggingSink.h @@ -72,7 +72,7 @@ public: NS_IMETHOD AddComment(const nsIParserNode& aNode); NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode); NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode); - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } virtual nsISupports *GetTarget() { return nsnull; } diff --git a/mozilla/parser/htmlparser/tests/html/Makefile.in b/mozilla/parser/htmlparser/tests/html/Makefile.in index 65cd2adb74d..6a648133305 100644 --- a/mozilla/parser/htmlparser/tests/html/Makefile.in +++ b/mozilla/parser/htmlparser/tests/html/Makefile.in @@ -49,6 +49,7 @@ PROGRAM = TestParser$(BIN_SUFFIX) REQUIRES = xpcom \ string \ necko \ + content \ $(NULL) CPPSRCS = \ diff --git a/mozilla/rdf/base/src/nsRDFContentSink.cpp b/mozilla/rdf/base/src/nsRDFContentSink.cpp index 538e08a1364..0d514161329 100644 --- a/mozilla/rdf/base/src/nsRDFContentSink.cpp +++ b/mozilla/rdf/base/src/nsRDFContentSink.cpp @@ -165,7 +165,7 @@ public: NS_IMETHOD WillInterrupt(void); NS_IMETHOD WillResume(void); NS_IMETHOD SetParser(nsIParser* aParser); - virtual void FlushContent(PRBool aNotify) { } + virtual void FlushPendingNotifications(mozFlushType aType) { } NS_IMETHOD SetDocumentCharset(nsACString& aCharset) { return NS_OK; } virtual nsISupports *GetTarget() { return nsnull; }