OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef HTMLImport_h | 31 #ifndef HTMLImport_h |
32 #define HTMLImport_h | 32 #define HTMLImport_h |
33 | 33 |
34 #include "core/html/imports/HTMLImportState.h" | 34 #include "core/html/imports/HTMLImportState.h" |
35 #include "wtf/TreeNode.h" | 35 #include "wtf/TreeNode.h" |
36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 class CustomElementMicrotaskImportStep; | |
41 class Document; | 40 class Document; |
42 class LocalFrame; | 41 class LocalFrame; |
43 class HTMLImportChild; | 42 class HTMLImportChild; |
| 43 class HTMLImportLoader; |
44 class HTMLImportsController; | 44 class HTMLImportsController; |
45 class KURL; | 45 class KURL; |
46 | 46 |
47 // | 47 // |
48 // # Basic Data Structure and Algorithms of HTML Imports implemenation. | 48 // # Basic Data Structure and Algorithms of HTML Imports implemenation. |
49 // | 49 // |
50 // ## The Import Tree | 50 // ## The Import Tree |
51 // | 51 // |
52 // HTML Imports form a tree: | 52 // HTML Imports form a tree: |
53 // | 53 // |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 class HTMLImport : public TreeNode<HTMLImport> { | 99 class HTMLImport : public TreeNode<HTMLImport> { |
100 public: | 100 public: |
101 enum SyncMode { | 101 enum SyncMode { |
102 Sync = 0, | 102 Sync = 0, |
103 Async = 1 | 103 Async = 1 |
104 }; | 104 }; |
105 | 105 |
106 virtual ~HTMLImport() { } | 106 virtual ~HTMLImport() { } |
107 | 107 |
108 HTMLImport* root(); | 108 HTMLImport* root(); |
| 109 bool precedes(HTMLImport*); |
109 bool isRoot() const { return !isChild(); } | 110 bool isRoot() const { return !isChild(); } |
110 bool isSync() const { return SyncMode(m_sync) == Sync; } | 111 bool isSync() const { return SyncMode(m_sync) == Sync; } |
111 const HTMLImportState& state() const { return m_state; } | 112 const HTMLImportState& state() const { return m_state; } |
112 | 113 |
113 void appendChild(HTMLImport*); | 114 void appendImport(HTMLImport*); |
114 | 115 |
115 virtual bool isChild() const { return false; } | 116 virtual bool isChild() const { return false; } |
116 virtual Document* document() const = 0; | 117 virtual Document* document() const = 0; |
117 virtual bool isDone() const = 0; // FIXME: Should be renamed to haveFinished
Loading() | 118 virtual bool isDone() const = 0; // FIXME: Should be renamed to haveFinished
Loading() |
118 virtual bool hasLoader() const = 0; | 119 virtual HTMLImportLoader* loader() const { return 0; } |
119 virtual bool ownsLoader() const { return false; } | |
120 virtual CustomElementMicrotaskImportStep* customElementMicrotaskStep() const
{ return 0; } | |
121 virtual void stateWillChange() { } | 120 virtual void stateWillChange() { } |
122 virtual void stateDidChange(); | 121 virtual void stateDidChange(); |
123 | 122 |
124 protected: | 123 protected: |
125 // Stating from most conservative state. | 124 // Stating from most conservative state. |
126 // It will be corrected through state update flow. | 125 // It will be corrected through state update flow. |
127 explicit HTMLImport(SyncMode sync) | 126 explicit HTMLImport(SyncMode sync) |
128 : m_sync(sync) | 127 : m_sync(sync) |
129 { } | 128 { } |
130 | 129 |
131 static void recalcTreeState(HTMLImport* root); | 130 static void recalcTreeState(HTMLImport* root); |
132 | 131 |
133 #if !defined(NDEBUG) | 132 #if !defined(NDEBUG) |
134 void show(); | 133 void show(); |
135 void showTree(HTMLImport* highlight, unsigned depth); | 134 void showTree(HTMLImport* highlight, unsigned depth); |
136 virtual void showThis(); | 135 virtual void showThis(); |
137 #endif | 136 #endif |
138 | 137 |
139 private: | 138 private: |
140 HTMLImportState m_state; | 139 HTMLImportState m_state; |
141 unsigned m_sync : 1; | 140 unsigned m_sync : 1; |
142 }; | 141 }; |
143 | 142 |
144 } // namespace WebCore | 143 } // namespace WebCore |
145 | 144 |
146 #endif // HTMLImport_h | 145 #endif // HTMLImport_h |
OLD | NEW |