summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/ScriptableDocumentParser.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/dom/ScriptableDocumentParser.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/dom/ScriptableDocumentParser.h')
-rw-r--r--Source/WebCore/dom/ScriptableDocumentParser.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/Source/WebCore/dom/ScriptableDocumentParser.h b/Source/WebCore/dom/ScriptableDocumentParser.h
index 8f8dc98c8..8fc1c9ca0 100644
--- a/Source/WebCore/dom/ScriptableDocumentParser.h
+++ b/Source/WebCore/dom/ScriptableDocumentParser.h
@@ -23,11 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptableDocumentParser_h
-#define ScriptableDocumentParser_h
+#pragma once
#include "DecodedDataDocumentParser.h"
#include "FragmentScriptingPermission.h"
+#include "Timer.h"
#include <wtf/text/TextPosition.h>
namespace WebCore {
@@ -38,14 +38,18 @@ public:
// JavaScript document.open() call right now, or it should be ignored.
virtual bool isExecutingScript() const { return false; }
- // FIXME: Only the HTMLDocumentParser ever blocks script execution on
- // stylesheet load, which is likely a bug in the XMLDocumentParser.
- virtual void executeScriptsWaitingForStylesheets() { }
-
virtual bool isWaitingForScripts() const = 0;
virtual TextPosition textPosition() const = 0;
+ virtual bool hasScriptsWaitingForStylesheets() const { return false; }
+
+ void executeScriptsWaitingForStylesheetsSoon();
+
+ // Returns true if the parser didn't yield or pause or synchronously execute a script,
+ // so calls to PageConsoleClient should be associated with the parser's text position.
+ virtual bool shouldAssociateConsoleMessagesWithTextPosition() const = 0;
+
void setWasCreatedByScript(bool wasCreatedByScript) { m_wasCreatedByScript = wasCreatedByScript; }
bool wasCreatedByScript() const { return m_wasCreatedByScript; }
@@ -54,14 +58,19 @@ public:
protected:
explicit ScriptableDocumentParser(Document&, ParserContentPolicy = AllowScriptingContent);
+ virtual void executeScriptsWaitingForStylesheets() { }
+
+ void detach() override;
+
private:
- virtual ScriptableDocumentParser* asScriptableDocumentParser() override { return this; }
+ ScriptableDocumentParser* asScriptableDocumentParser() final { return this; }
+
+ void scriptsWaitingForStylesheetsExecutionTimerFired();
// http://www.whatwg.org/specs/web-apps/current-work/#script-created-parser
bool m_wasCreatedByScript;
ParserContentPolicy m_parserContentPolicy;
+ Timer m_scriptsWaitingForStylesheetsExecutionTimer;
};
-}
-
-#endif // ScriptableDocumentParser_h
+} // namespace WebCore