| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 // Only used by Document::open for deciding if its safe to act on a | 38 // Only used by Document::open for deciding if its safe to act on a |
| 39 // JavaScript document.open() call right now, or it should be ignored. | 39 // JavaScript document.open() call right now, or it should be ignored. |
| 40 virtual bool isExecutingScript() const { return false; } | 40 virtual bool isExecutingScript() const { return false; } |
| 41 | 41 |
| 42 // FIXME: Only the HTMLDocumentParser ever blocks script execution on | 42 // FIXME: Only the HTMLDocumentParser ever blocks script execution on |
| 43 // stylesheet load, which is likely a bug in the XMLDocumentParser. | 43 // stylesheet load, which is likely a bug in the XMLDocumentParser. |
| 44 virtual void executeScriptsWaitingForResources() {} | 44 virtual void executeScriptsWaitingForResources() {} |
| 45 | 45 |
| 46 virtual bool isWaitingForScripts() const = 0; | 46 virtual bool isWaitingForScripts() const = 0; |
| 47 virtual void didAddPendingStylesheetInBody() {} |
| 48 virtual void didLoadAllStylesheets() {} |
| 47 | 49 |
| 48 // These are used to expose the current line/column to the scripting system. | 50 // These are used to expose the current line/column to the scripting system. |
| 49 virtual bool isParsingAtLineNumber() const; | 51 virtual bool isParsingAtLineNumber() const; |
| 50 virtual OrdinalNumber lineNumber() const = 0; | 52 virtual OrdinalNumber lineNumber() const = 0; |
| 51 virtual TextPosition textPosition() const = 0; | 53 virtual TextPosition textPosition() const = 0; |
| 52 | 54 |
| 53 void setWasCreatedByScript(bool wasCreatedByScript) { | 55 void setWasCreatedByScript(bool wasCreatedByScript) { |
| 54 m_wasCreatedByScript = wasCreatedByScript; | 56 m_wasCreatedByScript = wasCreatedByScript; |
| 55 } | 57 } |
| 56 bool wasCreatedByScript() const { return m_wasCreatedByScript; } | 58 bool wasCreatedByScript() const { return m_wasCreatedByScript; } |
| 57 | 59 |
| 58 ParserContentPolicy getParserContentPolicy() { return m_parserContentPolicy; } | 60 ParserContentPolicy getParserContentPolicy() { return m_parserContentPolicy; } |
| 59 | 61 |
| 60 protected: | 62 protected: |
| 61 explicit ScriptableDocumentParser( | 63 explicit ScriptableDocumentParser( |
| 62 Document&, | 64 Document&, |
| 63 ParserContentPolicy = AllowScriptingContent); | 65 ParserContentPolicy = AllowScriptingContent); |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 ScriptableDocumentParser* asScriptableDocumentParser() final { return this; } | 68 ScriptableDocumentParser* asScriptableDocumentParser() final { return this; } |
| 67 | 69 |
| 68 // http://www.whatwg.org/specs/web-apps/current-work/#script-created-parser | 70 // http://www.whatwg.org/specs/web-apps/current-work/#script-created-parser |
| 69 bool m_wasCreatedByScript; | 71 bool m_wasCreatedByScript; |
| 70 ParserContentPolicy m_parserContentPolicy; | 72 ParserContentPolicy m_parserContentPolicy; |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace blink | 75 } // namespace blink |
| 74 | 76 |
| 75 #endif // ScriptableDocumentParser_h | 77 #endif // ScriptableDocumentParser_h |
| OLD | NEW |