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

Side by Side Diff: Source/core/dom/NamedFlow.cpp

Issue 17176018: [CSS Regions] Add new regionOversetChange event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Integrated styling fixes Created 7 years, 6 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
« no previous file with comments | « Source/core/dom/NamedFlow.h ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/NamedFlow.h ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698