Web Inspector: Protocol Extension: Add "regionLayoutUpdate" event
https://bugs.webkit.org/show_bug.cgi?id=93443
Patch by Andrei Poenaru <poenaru@adobe.com> on 2012-09-12
Reviewed by Alexander Pavlov.
Source/WebCore:
Added "regionLayoutUpdate" event to the protocol.
Removed "getFlowByName" from protocol.
The front-end keeps in sync the requested Named Flow Collections.
Modified existing test: inspector/styles/protocol-css-regions-commands.html
* dom/NamedFlowCollection.cpp:
(WebCore::NamedFlowCollection::ensureFlowWithName):
(WebCore::NamedFlowCollection::discardNamedFlow):
* inspector/Inspector.json:
* inspector/InspectorCSSAgent.cpp:
(UpdateRegionLayoutTask):
(WebCore):
(WebCore::UpdateRegionLayoutTask::UpdateRegionLayoutTask):
(WebCore::UpdateRegionLayoutTask::scheduleFor):
(WebCore::UpdateRegionLayoutTask::unschedule):
(WebCore::UpdateRegionLayoutTask::reset):
(WebCore::UpdateRegionLayoutTask::onTimer):
(WebCore::InspectorCSSAgent::reset):
(WebCore::InspectorCSSAgent::didCreateNamedFlow):
(WebCore::InspectorCSSAgent::willRemoveNamedFlow):
(WebCore::InspectorCSSAgent::didUpdateRegionLayout):
(WebCore::InspectorCSSAgent::regionLayoutUpdated):
(WebCore::InspectorCSSAgent::getNamedFlowCollection):
(WebCore::InspectorCSSAgent::documentNodeWithRequestedFlowsId):
* inspector/InspectorCSSAgent.h:
(WebCore):
(InspectorCSSAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::didCreateNamedFlowImpl):
(WebCore::InspectorInstrumentation::willRemoveNamedFlowImpl):
(WebCore::InspectorInstrumentation::didUpdateRegionLayoutImpl):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::didCreateNamedFlow):
(WebCore::InspectorInstrumentation::willRemoveNamedFlow):
(WebCore):
(WebCore::InspectorInstrumentation::didUpdateRegionLayout):
* inspector/front-end/CSSStyleModel.js:
(WebInspector.CSSStyleModel):
(WebInspector.CSSStyleModel.prototype.getNamedFlowCollectionAsync.callback):
(WebInspector.CSSStyleModel.prototype.getNamedFlowCollectionAsync):
(WebInspector.CSSStyleModel.prototype.getFlowByNameAsync.callback):
(WebInspector.CSSStyleModel.prototype.getFlowByNameAsync):
(WebInspector.CSSStyleModel.prototype._namedFlowCreated):
(WebInspector.CSSStyleModel.prototype._namedFlowRemoved):
(WebInspector.CSSStyleModel.prototype._regionLayoutUpdated):
(WebInspector.CSSStyleModel.prototype._resetNamedFlowCollections):
(WebInspector.CSSDispatcher.prototype.namedFlowCreated):
(WebInspector.CSSDispatcher.prototype.namedFlowRemoved):
(WebInspector.CSSDispatcher.prototype.regionLayoutUpdated):
(WebInspector.NamedFlow):
(WebInspector.NamedFlowCollection):
(WebInspector.NamedFlowCollection.prototype._appendNamedFlow):
(WebInspector.NamedFlowCollection.prototype._removeNamedFlow):
(WebInspector.NamedFlowCollection.prototype.flowByName):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::dispatchRegionLayoutUpdateEvent):
LayoutTests:
Validate "regionLayoutUpdate" event.
* inspector/styles/protocol-css-regions-commands-expected.txt:
* inspector/styles/protocol-css-regions-commands.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/dom/NamedFlowCollection.cpp b/Source/WebCore/dom/NamedFlowCollection.cpp
index 1588fc6..5547506 100644
--- a/Source/WebCore/dom/NamedFlowCollection.cpp
+++ b/Source/WebCore/dom/NamedFlowCollection.cpp
@@ -81,7 +81,7 @@
RefPtr<WebKitNamedFlow> newFlow = WebKitNamedFlow::create(this, flowName);
m_namedFlows.add(newFlow.get());
- InspectorInstrumentation::didCreateNamedFlow(m_document, newFlow->name());
+ InspectorInstrumentation::didCreateNamedFlow(m_document, newFlow.get());
return newFlow.release();
}
@@ -95,9 +95,9 @@
ASSERT(namedFlow->flowState() == WebKitNamedFlow::FlowStateNull);
ASSERT(m_namedFlows.contains(namedFlow));
- m_namedFlows.remove(namedFlow);
+ InspectorInstrumentation::willRemoveNamedFlow(m_document, namedFlow);
- InspectorInstrumentation::didRemoveNamedFlow(m_document, namedFlow->name());
+ m_namedFlows.remove(namedFlow);
}
void NamedFlowCollection::documentDestroyed()