OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 if (!m_parentFlowThread) | 97 if (!m_parentFlowThread) |
98 return -1; | 98 return -1; |
99 | 99 |
100 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); | 100 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); |
101 if (regionList.isEmpty()) | 101 if (regionList.isEmpty()) |
102 return -1; | 102 return -1; |
103 RenderRegionList::const_iterator iter = regionList.begin(); | 103 RenderRegionList::const_iterator iter = regionList.begin(); |
104 for (int index = 0; iter != regionList.end(); ++index, ++iter) { | 104 for (int index = 0; iter != regionList.end(); ++index, ++iter) { |
105 const RenderRegion* renderRegion = *iter; | 105 const RenderRegion* renderRegion = *iter; |
106 if (renderRegion->regionState() == RenderRegion::RegionEmpty) | 106 if (renderRegion->regionOversetState() == RegionEmpty) |
107 return index; | 107 return index; |
108 } | 108 } |
109 return -1; | 109 return -1; |
110 } | 110 } |
111 | 111 |
112 PassRefPtr<NodeList> NamedFlow::getRegionsByContent(Node* contentNode) | 112 PassRefPtr<NodeList> NamedFlow::getRegionsByContent(Node* contentNode) |
113 { | 113 { |
114 Vector<RefPtr<Node> > regionNodes; | 114 Vector<RefPtr<Node> > regionNodes; |
115 | 115 |
116 if (!contentNode) | 116 if (!contentNode) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 // If the flow is in the "NULL" state the event should not be dispatched any
more. | 211 // If the flow is in the "NULL" state the event should not be dispatched any
more. |
212 if (flowState() == FlowStateNull) | 212 if (flowState() == FlowStateNull) |
213 return; | 213 return; |
214 | 214 |
215 RefPtr<Event> event = UIEvent::create(eventNames().webkitregionlayoutupdateE
vent, false, false, m_flowManager->document()->defaultView(), 0); | 215 RefPtr<Event> event = UIEvent::create(eventNames().webkitregionlayoutupdateE
vent, false, false, m_flowManager->document()->defaultView(), 0); |
216 | 216 |
217 dispatchEvent(event); | 217 dispatchEvent(event); |
218 } | 218 } |
219 | 219 |
| 220 void NamedFlow::dispatchRegionOversetChangeEvent() |
| 221 { |
| 222 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
| 223 |
| 224 // If the flow is in the "NULL" state the event should not be dispatched any
more. |
| 225 if (flowState() == FlowStateNull) |
| 226 return; |
| 227 |
| 228 RefPtr<Event> event = UIEvent::create(eventNames().webkitregionoversetchange
Event, false, false, m_flowManager->document()->defaultView(), 0); |
| 229 |
| 230 dispatchEvent(event); |
| 231 } |
| 232 |
220 const AtomicString& NamedFlow::interfaceName() const | 233 const AtomicString& NamedFlow::interfaceName() const |
221 { | 234 { |
222 return eventNames().interfaceForNamedFlow; | 235 return eventNames().interfaceForNamedFlow; |
223 } | 236 } |
224 | 237 |
225 ScriptExecutionContext* NamedFlow::scriptExecutionContext() const | 238 ScriptExecutionContext* NamedFlow::scriptExecutionContext() const |
226 { | 239 { |
227 return m_flowManager->document(); | 240 return m_flowManager->document(); |
228 } | 241 } |
229 | 242 |
230 Node* NamedFlow::ownerNode() const | 243 Node* NamedFlow::ownerNode() const |
231 { | 244 { |
232 return m_flowManager->document(); | 245 return m_flowManager->document(); |
233 } | 246 } |
234 | 247 |
235 } // namespace WebCore | 248 } // namespace WebCore |
236 | 249 |
OLD | NEW |