Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: Source/core/html/parser/HTMLScriptRunner.h

Issue 202813002: [HTML Import] Let script block by pending resources created by lifecycle callback (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-landing with another fix Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bool executeScriptsWaitingForParsing(); 61 bool executeScriptsWaitingForParsing();
62 62
63 bool hasParserBlockingScript() const; 63 bool hasParserBlockingScript() const;
64 bool isExecutingScript() const { return !!m_scriptNestingLevel; } 64 bool isExecutingScript() const { return !!m_scriptNestingLevel; }
65 65
66 private: 66 private:
67 HTMLScriptRunner(Document*, HTMLScriptRunnerHost*); 67 HTMLScriptRunner(Document*, HTMLScriptRunnerHost*);
68 68
69 LocalFrame* frame() const; 69 LocalFrame* frame() const;
70 70
71 enum PendingScriptType {
72 PendingScriptBlockingParser,
73 PendingScriptDeferred
74 };
75
71 void executeParsingBlockingScript(); 76 void executeParsingBlockingScript();
72 void executePendingScriptAndDispatchEvent(PendingScript&); 77 void executePendingScriptAndDispatchEvent(PendingScript&, PendingScriptType) ;
73 void executeParsingBlockingScripts(); 78 void executeParsingBlockingScripts();
74 79
75 void requestParsingBlockingScript(Element*); 80 void requestParsingBlockingScript(Element*);
76 void requestDeferredScript(Element*); 81 void requestDeferredScript(Element*);
77 bool requestPendingScript(PendingScript&, Element*) const; 82 bool requestPendingScript(PendingScript&, Element*) const;
78 83
79 void runScript(Element*, const TextPosition& scriptStartPosition); 84 void runScript(Element*, const TextPosition& scriptStartPosition);
80 85
81 // Helpers for dealing with HTMLScriptRunnerHost 86 // Helpers for dealing with HTMLScriptRunnerHost
82 void watchForLoad(PendingScript&); 87 void watchForLoad(PendingScript&);
(...skipping 10 matching lines...) Expand all
93 // We only want stylesheet loads to trigger script execution if script 98 // We only want stylesheet loads to trigger script execution if script
94 // execution is currently stopped due to stylesheet loads, otherwise we'd 99 // execution is currently stopped due to stylesheet loads, otherwise we'd
95 // cause nested script execution when parsing <style> tags since </style> 100 // cause nested script execution when parsing <style> tags since </style>
96 // tags can cause Document to call executeScriptsWaitingForResources. 101 // tags can cause Document to call executeScriptsWaitingForResources.
97 bool m_hasScriptsWaitingForResources; 102 bool m_hasScriptsWaitingForResources;
98 }; 103 };
99 104
100 } 105 }
101 106
102 #endif 107 #endif
OLDNEW
« no previous file with comments | « Source/core/html/imports/HTMLImportsController.cpp ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698