OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void resetMarkForDestruction(); | 80 void resetMarkForDestruction(); |
81 | 81 |
82 private: | 82 private: |
83 RenderNamedFlowThread(PassRefPtr<NamedFlow>); | 83 RenderNamedFlowThread(PassRefPtr<NamedFlow>); |
84 | 84 |
85 virtual const char* renderName() const OVERRIDE; | 85 virtual const char* renderName() const OVERRIDE; |
86 virtual bool isRenderNamedFlowThread() const OVERRIDE { return true; } | 86 virtual bool isRenderNamedFlowThread() const OVERRIDE { return true; } |
87 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; | 87 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; |
88 | 88 |
89 virtual void dispatchRegionLayoutUpdateEvent() OVERRIDE; | 89 virtual void dispatchRegionLayoutUpdateEvent() OVERRIDE; |
| 90 virtual void dispatchRegionOversetChangeEvent() OVERRIDE; |
90 | 91 |
91 bool dependsOn(RenderNamedFlowThread* otherRenderFlowThread) const; | 92 bool dependsOn(RenderNamedFlowThread* otherRenderFlowThread) const; |
92 void addDependencyOnFlowThread(RenderNamedFlowThread*); | 93 void addDependencyOnFlowThread(RenderNamedFlowThread*); |
93 void removeDependencyOnFlowThread(RenderNamedFlowThread*); | 94 void removeDependencyOnFlowThread(RenderNamedFlowThread*); |
94 | 95 |
95 void addRegionToNamedFlowThread(RenderRegion*); | 96 void addRegionToNamedFlowThread(RenderRegion*); |
96 | 97 |
97 void checkInvalidRegions(); | 98 void checkInvalidRegions(); |
98 | 99 |
99 bool canBeDestroyed() const { return m_invalidRegionList.isEmpty() && m_regi
onList.isEmpty() && m_contentNodes.isEmpty(); } | 100 bool canBeDestroyed() const { return m_invalidRegionList.isEmpty() && m_regi
onList.isEmpty() && m_contentNodes.isEmpty(); } |
100 void regionLayoutUpdateEventTimerFired(Timer<RenderNamedFlowThread>*); | 101 void regionLayoutUpdateEventTimerFired(Timer<RenderNamedFlowThread>*); |
| 102 void regionOversetChangeEventTimerFired(Timer<RenderNamedFlowThread>*); |
101 void clearContentNodes(); | 103 void clearContentNodes(); |
102 | 104 |
103 private: | 105 private: |
104 // Observer flow threads have invalid regions that depend on the state of th
is thread | 106 // Observer flow threads have invalid regions that depend on the state of th
is thread |
105 // to re-validate their regions. Keeping a set of observer threads make it e
asy | 107 // to re-validate their regions. Keeping a set of observer threads make it e
asy |
106 // to notify them when a region was removed from this flow. | 108 // to notify them when a region was removed from this flow. |
107 RenderNamedFlowThreadCountedSet m_observerThreadsSet; | 109 RenderNamedFlowThreadCountedSet m_observerThreadsSet; |
108 | 110 |
109 // Some threads need to have a complete layout before we layout this flow. | 111 // Some threads need to have a complete layout before we layout this flow. |
110 // That's because they contain a RenderRegion that should display this threa
d. The set makes it | 112 // That's because they contain a RenderRegion that should display this threa
d. The set makes it |
111 // easy to sort the order of threads layout. | 113 // easy to sort the order of threads layout. |
112 RenderNamedFlowThreadCountedSet m_layoutBeforeThreadsSet; | 114 RenderNamedFlowThreadCountedSet m_layoutBeforeThreadsSet; |
113 | 115 |
114 // Holds the sorted children of a named flow. This is the only way we can ge
t the ordering right. | 116 // Holds the sorted children of a named flow. This is the only way we can ge
t the ordering right. |
115 typedef ListHashSet<RenderObject*> FlowThreadChildList; | 117 typedef ListHashSet<RenderObject*> FlowThreadChildList; |
116 FlowThreadChildList m_flowThreadChildList; | 118 FlowThreadChildList m_flowThreadChildList; |
117 | 119 |
118 NamedFlowContentNodes m_contentNodes; | 120 NamedFlowContentNodes m_contentNodes; |
119 | 121 |
120 RenderRegionList m_invalidRegionList; | 122 RenderRegionList m_invalidRegionList; |
121 | 123 |
122 // The DOM Object that represents a named flow. | 124 // The DOM Object that represents a named flow. |
123 RefPtr<NamedFlow> m_namedFlow; | 125 RefPtr<NamedFlow> m_namedFlow; |
124 | 126 |
125 Timer<RenderNamedFlowThread> m_regionLayoutUpdateEventTimer; | 127 Timer<RenderNamedFlowThread> m_regionLayoutUpdateEventTimer; |
| 128 Timer<RenderNamedFlowThread> m_regionOversetChangeEventTimer; |
126 }; | 129 }; |
127 | 130 |
128 inline RenderNamedFlowThread* toRenderNamedFlowThread(RenderObject* object) | 131 inline RenderNamedFlowThread* toRenderNamedFlowThread(RenderObject* object) |
129 { | 132 { |
130 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderNamedFlowThread(
)); | 133 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderNamedFlowThread(
)); |
131 return static_cast<RenderNamedFlowThread*>(object); | 134 return static_cast<RenderNamedFlowThread*>(object); |
132 } | 135 } |
133 | 136 |
134 inline const RenderNamedFlowThread* toRenderNamedFlowThread(const RenderObject*
object) | 137 inline const RenderNamedFlowThread* toRenderNamedFlowThread(const RenderObject*
object) |
135 { | 138 { |
136 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderNamedFlowThread(
)); | 139 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderNamedFlowThread(
)); |
137 return static_cast<const RenderNamedFlowThread*>(object); | 140 return static_cast<const RenderNamedFlowThread*>(object); |
138 } | 141 } |
139 | 142 |
140 // This will catch anyone doing an unnecessary cast. | 143 // This will catch anyone doing an unnecessary cast. |
141 void toRenderNamedFlowThread(const RenderNamedFlowThread*); | 144 void toRenderNamedFlowThread(const RenderNamedFlowThread*); |
142 | 145 |
143 } // namespace WebCore | 146 } // namespace WebCore |
144 | 147 |
145 #endif // RenderNamedFlowThread_h | 148 #endif // RenderNamedFlowThread_h |
146 | 149 |
OLD | NEW |