[CSS Regions] Remove regionLayoutUpdate event
authorstavila@adobe.com <stavila@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 May 2014 18:49:54 +0000 (18:49 +0000)
committerstavila@adobe.com <stavila@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 May 2014 18:49:54 +0000 (18:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132564

Reviewed by Simon Fraser.

Source/WebCore:
The regionLayoutUpdate event was removed from the regions spec and was replaced by two other events:
regionOversetChange and regionFragmentChange.

No new tests needed, this patch removes a feature.

* dom/EventNames.h:
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::dispatchRegionLayoutUpdateEvent): Deleted.
* dom/WebKitNamedFlow.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::resetNonPersistentData):
(WebCore::InspectorCSSAgent::willRemoveNamedFlow):
(WebCore::UpdateRegionLayoutTask::UpdateRegionLayoutTask): Deleted.
(WebCore::UpdateRegionLayoutTask::scheduleFor): Deleted.
(WebCore::UpdateRegionLayoutTask::unschedule): Deleted.
(WebCore::UpdateRegionLayoutTask::reset): Deleted.
(WebCore::UpdateRegionLayoutTask::timerFired): Deleted.
(WebCore::InspectorCSSAgent::didUpdateRegionLayout): Deleted.
(WebCore::InspectorCSSAgent::regionLayoutUpdated): Deleted.
* inspector/InspectorCSSAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didUpdateRegionLayoutImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didUpdateRegionLayout): Deleted.
* inspector/protocol/CSS.json:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::updateOversetState):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
(WebCore::RenderNamedFlowThread::removeRegionFromThread):
(WebCore::RenderNamedFlowThread::layout):
(WebCore::RenderNamedFlowThread::dispatchRegionLayoutUpdateEventIfNeeded): Deleted.
(WebCore::RenderNamedFlowThread::regionLayoutUpdateEventTimerFired): Deleted.
* rendering/RenderNamedFlowThread.h:

Source/WebInspectorUI:
The regionLayoutUpdate event was removed from the regions spec and was replaced by two other events:
regionOversetChange and regionFragmentChange.

* UserInterface/Controllers/DOMTreeManager.js:
(WebInspector.DOMTreeManager.prototype.get regionLayoutUpdated): Deleted.
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Protocol/CSSObserver.js:
(WebInspector.CSSObserver.prototype.regionLayoutUpdated): Deleted.
* UserInterface/Protocol/Legacy/7.0/InspectorWebBackendCommands.js:
* Versions/Inspector-iOS-7.0.json:

LayoutTests:
Removed test for regionLayoutUpdate event.

* fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes-expected.txt: Removed.
* fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168306 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes-expected.txt [deleted file]
LayoutTests/fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/WebKitNamedFlow.cpp
Source/WebCore/dom/WebKitNamedFlow.h
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorCSSAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/protocol/CSS.json
Source/WebCore/rendering/RenderNamedFlowFragment.cpp
Source/WebCore/rendering/RenderNamedFlowThread.cpp
Source/WebCore/rendering/RenderNamedFlowThread.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js
Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
Source/WebInspectorUI/UserInterface/Protocol/CSSObserver.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorWebBackendCommands.js
Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json

index ac2ef22..1fa6751 100644 (file)
@@ -1,3 +1,15 @@
+2014-05-05  Radu Stavila  <stavila@adobe.com>
+
+        [CSS Regions] Remove regionLayoutUpdate event
+        https://bugs.webkit.org/show_bug.cgi?id=132564
+
+        Reviewed by Simon Fraser.
+
+        Removed test for regionLayoutUpdate event.
+
+        * fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes-expected.txt: Removed.
+        * fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes.html: Removed.
+
 2014-05-05  Rik Cabanier  <cabanier@adobe.com>
 
         Enhance IDL compiler so it supports unrestricted float and double
diff --git a/LayoutTests/fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes-expected.txt b/LayoutTests/fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes-expected.txt
deleted file mode 100644 (file)
index 4298f6a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Test for WebKitBug 102101 [CSS Regions] regionlayoutupdate event fires continuously
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS The regionlayoutupdate fired only once.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes.html b/LayoutTests/fast/regions/auto-size/autoheight-regionlayoutupdate-multipletimes.html
deleted file mode 100644 (file)
index 3064277..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<!doctype html>
-<html>
-    <head>
-        <script src="../../../resources/js-test-pre.js"></script>
-        <script src="../resources/helper.js"></script>
-        <style>
-            .notVisible { visibility: hidden; }
-            .flow { -webkit-flow-into: flow; }
-            #article { width: 50px; height: 50px; background-color: green; }
-            #region { -webkit-flow-from: flow; }
-        </style>
-    </head>
-    <body>
-        <div id="eventCount"></div>
-        <div id="article"></div>
-        <div id="region"></div>
-        <script>
-            description("Test for WebKitBug 102101 [CSS Regions] regionlayoutupdate event fires continuously");
-
-            if (window.testRunner) {
-                window.testRunner.dumpAsText();
-                window.testRunner.waitUntilDone();
-            }
-
-            window.jsTestIsAsync = true;
-
-            var eventDispatchCount = 0;
-            var timeoutID;
-
-            function flowThreadUpdated(event) {
-                if (++eventDispatchCount > 1) {
-                    endTest();
-                    return;
-                }
-
-                // Updating the content of eventCount element should not trigger a layout
-                // on the auto-height region.
-                document.getElementById("eventCount").textContent = eventDispatchCount;
-            }
-
-            function startTest() {
-                getFlowByName("flow").addEventListener("webkitregionlayoutupdate", flowThreadUpdated);
-                document.getElementById("article").className = "flow";
-                timeoutID = window.setTimeout(endTest, 500);
-            }
-
-            function endTest() {
-                window.clearTimeout(timeoutID);
-                getFlowByName("flow").removeEventListener("webkitregionlayoutupdate", flowThreadUpdated);
-
-                document.getElementById("eventCount").className = "notVisible";
-                document.getElementById("region").className = "notVisible";
-
-                if (eventDispatchCount > 1)
-                    debug("FAIL The regionlayoutupdate event fired twice instead of once.")
-                else
-                    debug("PASS The regionlayoutupdate fired only once.");
-                finishJSTest();
-            }
-
-            window.addEventListener("load", startTest);
-</script>
-<script src="../../../resources/js-test-post.js"></script>
-</body>
-</html>
index d6c3f82..afcf103 100644 (file)
@@ -1,3 +1,45 @@
+2014-05-05  Radu Stavila  <stavila@adobe.com>
+
+        [CSS Regions] Remove regionLayoutUpdate event
+        https://bugs.webkit.org/show_bug.cgi?id=132564
+
+        Reviewed by Simon Fraser.
+
+        The regionLayoutUpdate event was removed from the regions spec and was replaced by two other events: 
+        regionOversetChange and regionFragmentChange.
+
+        No new tests needed, this patch removes a feature.
+
+        * dom/EventNames.h:
+        * dom/WebKitNamedFlow.cpp:
+        (WebCore::WebKitNamedFlow::dispatchRegionLayoutUpdateEvent): Deleted.
+        * dom/WebKitNamedFlow.h:
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::resetNonPersistentData):
+        (WebCore::InspectorCSSAgent::willRemoveNamedFlow):
+        (WebCore::UpdateRegionLayoutTask::UpdateRegionLayoutTask): Deleted.
+        (WebCore::UpdateRegionLayoutTask::scheduleFor): Deleted.
+        (WebCore::UpdateRegionLayoutTask::unschedule): Deleted.
+        (WebCore::UpdateRegionLayoutTask::reset): Deleted.
+        (WebCore::UpdateRegionLayoutTask::timerFired): Deleted.
+        (WebCore::InspectorCSSAgent::didUpdateRegionLayout): Deleted.
+        (WebCore::InspectorCSSAgent::regionLayoutUpdated): Deleted.
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didUpdateRegionLayoutImpl): Deleted.
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didUpdateRegionLayout): Deleted.
+        * inspector/protocol/CSS.json:
+        * rendering/RenderNamedFlowFragment.cpp:
+        (WebCore::RenderNamedFlowFragment::updateOversetState):
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
+        (WebCore::RenderNamedFlowThread::removeRegionFromThread):
+        (WebCore::RenderNamedFlowThread::layout):
+        (WebCore::RenderNamedFlowThread::dispatchRegionLayoutUpdateEventIfNeeded): Deleted.
+        (WebCore::RenderNamedFlowThread::regionLayoutUpdateEventTimerFired): Deleted.
+        * rendering/RenderNamedFlowThread.h:
+
 2014-05-05  Rik Cabanier  <cabanier@adobe.com>
 
         Enhance IDL compiler so it supports unrestricted float and double
index 972b861..3b68567 100644 (file)
@@ -261,8 +261,6 @@ namespace WebCore {
     macro(webkitpointerlockchange) \
     macro(webkitpointerlockerror) \
     \
-    macro(webkitregionlayoutupdate) \
-    \
     macro(webkitregionoversetchange) \
     \
     macro(webkitnetworkinfochange) \
index e09a998..ac14b08 100644 (file)
@@ -208,17 +208,6 @@ void WebKitNamedFlow::setRenderer(RenderNamedFlowThread* parentFlowThread)
     m_parentFlowThread = parentFlowThread;
 }
 
-void WebKitNamedFlow::dispatchRegionLayoutUpdateEvent()
-{
-    ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
-
-    // If the flow is in the "NULL" state the event should not be dispatched any more.
-    if (flowState() == FlowStateNull)
-        return;
-
-    dispatchEvent(UIEvent::create(eventNames().webkitregionlayoutupdateEvent, false, false, m_flowManager->document()->defaultView(), 0));
-}
-    
 void WebKitNamedFlow::dispatchRegionOversetChangeEvent()
 {
     ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
index 6b1625e..e5f4318 100644 (file)
@@ -78,7 +78,6 @@ public:
 
     FlowState flowState() const { return m_parentFlowThread ? FlowStateCreated : FlowStateNull; }
 
-    void dispatchRegionLayoutUpdateEvent();
     void dispatchRegionOversetChangeEvent();
 
 private:
index 688ccc9..06e54fb 100644 (file)
@@ -105,67 +105,6 @@ static unsigned computePseudoClassMask(InspectorArray* pseudoClassArray)
     return result;
 }
 
-class UpdateRegionLayoutTask {
-public:
-    UpdateRegionLayoutTask(InspectorCSSAgent*);
-    void scheduleFor(WebKitNamedFlow*, int documentNodeId);
-    void unschedule(WebKitNamedFlow*);
-    void reset();
-    void timerFired(Timer<UpdateRegionLayoutTask>&);
-
-private:
-    InspectorCSSAgent* m_cssAgent;
-    Timer<UpdateRegionLayoutTask> m_timer;
-    HashMap<WebKitNamedFlow*, int> m_namedFlows;
-};
-
-UpdateRegionLayoutTask::UpdateRegionLayoutTask(InspectorCSSAgent* cssAgent)
-    : m_cssAgent(cssAgent)
-    , m_timer(this, &UpdateRegionLayoutTask::timerFired)
-{
-}
-
-void UpdateRegionLayoutTask::scheduleFor(WebKitNamedFlow* namedFlow, int documentNodeId)
-{
-    m_namedFlows.add(namedFlow, documentNodeId);
-
-    if (!m_timer.isActive())
-        m_timer.startOneShot(0);
-}
-
-void UpdateRegionLayoutTask::unschedule(WebKitNamedFlow* namedFlow)
-{
-    m_namedFlows.remove(namedFlow);
-}
-
-void UpdateRegionLayoutTask::reset()
-{
-    m_timer.stop();
-    m_namedFlows.clear();
-}
-
-void UpdateRegionLayoutTask::timerFired(Timer<UpdateRegionLayoutTask>&)
-{
-    // The timer is stopped on m_cssAgent destruction, so this method will never be called after m_cssAgent has been destroyed.
-    Vector<std::pair<WebKitNamedFlow*, int>> namedFlows;
-
-    for (HashMap<WebKitNamedFlow*, int>::iterator it = m_namedFlows.begin(), end = m_namedFlows.end(); it != end; ++it)
-        namedFlows.append(std::make_pair(it->key, it->value));
-
-    for (unsigned i = 0, size = namedFlows.size(); i < size; ++i) {
-        WebKitNamedFlow* namedFlow = namedFlows.at(i).first;
-        int documentNodeId = namedFlows.at(i).second;
-
-        if (m_namedFlows.contains(namedFlow)) {
-            m_cssAgent->regionLayoutUpdated(namedFlow, documentNodeId);
-            m_namedFlows.remove(namedFlow);
-        }
-    }
-
-    if (!m_namedFlows.isEmpty() && !m_timer.isActive())
-        m_timer.startOneShot(0);
-}
-
 class ChangeRegionOversetTask {
 public:
     ChangeRegionOversetTask(InspectorCSSAgent*);
@@ -541,8 +480,6 @@ void InspectorCSSAgent::reset()
 void InspectorCSSAgent::resetNonPersistentData()
 {
     m_namedFlowCollectionsRequested.clear();
-    if (m_updateRegionLayoutTask)
-        m_updateRegionLayoutTask->reset();
     if (m_changeRegionOversetTask)
         m_changeRegionOversetTask->reset();
     resetPseudoStates();
@@ -580,37 +517,12 @@ void InspectorCSSAgent::willRemoveNamedFlow(Document* document, WebKitNamedFlow*
     if (!documentNodeId)
         return;
 
-    if (m_updateRegionLayoutTask)
-        m_updateRegionLayoutTask->unschedule(namedFlow);
-
     if (m_changeRegionOversetTask)
         m_changeRegionOversetTask->unschedule(namedFlow);
 
     m_frontendDispatcher->namedFlowRemoved(documentNodeId, namedFlow->name().string());
 }
 
-void InspectorCSSAgent::didUpdateRegionLayout(Document* document, WebKitNamedFlow* namedFlow)
-{
-    int documentNodeId = documentNodeWithRequestedFlowsId(document);
-    if (!documentNodeId)
-        return;
-
-    if (!m_updateRegionLayoutTask)
-        m_updateRegionLayoutTask = std::make_unique<UpdateRegionLayoutTask>(this);
-    m_updateRegionLayoutTask->scheduleFor(namedFlow, documentNodeId);
-}
-
-void InspectorCSSAgent::regionLayoutUpdated(WebKitNamedFlow* namedFlow, int documentNodeId)
-{
-    if (namedFlow->flowState() == WebKitNamedFlow::FlowStateNull)
-        return;
-
-    ErrorString errorString;
-    Ref<WebKitNamedFlow> protect(*namedFlow);
-
-    m_frontendDispatcher->regionLayoutUpdated(buildObjectForNamedFlow(&errorString, namedFlow, documentNodeId));
-}
-
 void InspectorCSSAgent::didChangeRegionOverset(Document* document, WebKitNamedFlow* namedFlow)
 {
     int documentNodeId = documentNodeWithRequestedFlowsId(document);
index 375eb46..365237f 100644 (file)
@@ -60,7 +60,6 @@ class Node;
 class NodeList;
 class StyleResolver;
 class StyleRule;
-class UpdateRegionLayoutTask;
 class ChangeRegionOversetTask;
 
 #if ENABLE(INSPECTOR)
@@ -105,8 +104,6 @@ public:
     void mediaQueryResultChanged();
     void didCreateNamedFlow(Document*, WebKitNamedFlow*);
     void willRemoveNamedFlow(Document*, WebKitNamedFlow*);
-    void didUpdateRegionLayout(Document*, WebKitNamedFlow*);
-    void regionLayoutUpdated(WebKitNamedFlow*, int documentNodeId);
     void didChangeRegionOverset(Document*, WebKitNamedFlow*);
     void regionOversetChanged(WebKitNamedFlow*, int documentNodeId);
     void didRegisterNamedFlowContentElement(Document*, WebKitNamedFlow*, Node* contentElement, Node* nextContentElement = nullptr);
@@ -182,7 +179,6 @@ private:
     DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet;
     NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
     HashSet<int> m_namedFlowCollectionsRequested;
-    std::unique_ptr<UpdateRegionLayoutTask> m_updateRegionLayoutTask;
     std::unique_ptr<ChangeRegionOversetTask> m_changeRegionOversetTask;
 
     int m_lastStyleSheetId;
index c030bf5..f151abe 100644 (file)
@@ -220,12 +220,6 @@ void InspectorInstrumentation::willRemoveNamedFlowImpl(InstrumentingAgents* inst
         cssAgent->willRemoveNamedFlow(document, namedFlow);
 }
 
-void InspectorInstrumentation::didUpdateRegionLayoutImpl(InstrumentingAgents* instrumentingAgents, Document* document, WebKitNamedFlow* namedFlow)
-{
-    if (InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent())
-        cssAgent->didUpdateRegionLayout(document, namedFlow);
-}
-
 void InspectorInstrumentation::didChangeRegionOversetImpl(InstrumentingAgents* instrumentingAgents, Document* document, WebKitNamedFlow* namedFlow)
 {
     if (InspectorCSSAgent* cssAgent = instrumentingAgents->inspectorCSSAgent())
index 169cfad..d541014 100644 (file)
@@ -127,7 +127,6 @@ public:
     static void willPopShadowRoot(Element* host, ShadowRoot*);
     static void didCreateNamedFlow(Document*, WebKitNamedFlow*);
     static void willRemoveNamedFlow(Document*, WebKitNamedFlow*);
-    static void didUpdateRegionLayout(Document*, WebKitNamedFlow*);
     static void didChangeRegionOverset(Document*, WebKitNamedFlow*);
     static void didRegisterNamedFlowContentElement(Document*, WebKitNamedFlow*, Node* contentElement, Node* nextContentElement = nullptr);
     static void didUnregisterNamedFlowContentElement(Document*, WebKitNamedFlow*, Node* contentElement);
@@ -326,7 +325,6 @@ private:
     static void willPopShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
     static void didCreateNamedFlowImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
     static void willRemoveNamedFlowImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
-    static void didUpdateRegionLayoutImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
     static void didChangeRegionOversetImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
     static void didRegisterNamedFlowContentElementImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*, Node* contentElement, Node* nextContentElement = nullptr);
     static void didUnregisterNamedFlowContentElementImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*, Node* contentElement);
@@ -690,18 +688,6 @@ inline void InspectorInstrumentation::willRemoveNamedFlow(Document* document, We
 #endif
 }
 
-inline void InspectorInstrumentation::didUpdateRegionLayout(Document* document, WebKitNamedFlow* namedFlow)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        didUpdateRegionLayoutImpl(instrumentingAgents, document, namedFlow);
-#else
-    UNUSED_PARAM(document);
-    UNUSED_PARAM(namedFlow);
-#endif
-}
-
 inline void InspectorInstrumentation::didChangeRegionOverset(Document* document, WebKitNamedFlow* namedFlow)
 {
 #if ENABLE(INSPECTOR)
index f9c2629..ca90cf7 100644 (file)
             "description": "Fires when a Named Flow is removed: has no associated content nodes and regions."
         },
         {
-            "name": "regionLayoutUpdated",
-            "parameters": [
-                { "name": "namedFlow", "$ref": "NamedFlow", "description": "The Named Flow whose layout may have changed." }
-            ],
-            "description": "Fires when a Named Flow's layout may have changed."
-        },
-        {
             "name": "regionOversetChanged",
             "parameters": [
                 { "name": "namedFlow", "$ref": "NamedFlow", "description": "The Named Flow containing the regions whose regionOverset values changed." }
index 92c8df6..55d8637 100644 (file)
@@ -323,12 +323,7 @@ void RenderNamedFlowFragment::updateOversetState()
     
     setRegionOversetState(state);
 
-    // Determine whether the NamedFlow object should dispatch a regionLayoutUpdate event
-    if (previousState != state
-        || state == RegionFit
-        || state == RegionOverset)
-        flowThread->setDispatchRegionLayoutUpdateEvent(true);
-    
+    // Determine whether the NamedFlow object should dispatch a regionOversetChange event
     if (previousState != state)
         flowThread->setDispatchRegionOversetChangeEvent(true);
 }
index b9177b5..25810d3 100644 (file)
@@ -48,10 +48,8 @@ namespace WebCore {
 RenderNamedFlowThread::RenderNamedFlowThread(Document& document, PassRef<RenderStyle> style, PassRef<WebKitNamedFlow> namedFlow)
     : RenderFlowThread(document, std::move(style))
     , m_hasRegionsWithStyling(false)
-    , m_dispatchRegionLayoutUpdateEvent(false)
     , m_dispatchRegionOversetChangeEvent(false)
     , m_namedFlow(std::move(namedFlow))
-    , m_regionLayoutUpdateEventTimer(this, &RenderNamedFlowThread::regionLayoutUpdateEventTimerFired)
     , m_regionOversetChangeEventTimer(this, &RenderNamedFlowThread::regionOversetChangeEventTimerFired)
 {
 }
@@ -271,10 +269,7 @@ void RenderNamedFlowThread::removeRegionFromThread(RenderRegion* renderRegion)
     if (canBeDestroyed())
         setMarkForDestruction();
 
-    // After removing all the regions in the flow the following layout needs to dispatch the regionLayoutUpdate event
-    if (m_regionList.isEmpty())
-        setDispatchRegionLayoutUpdateEvent(true);
-    else if (wasFirst)
+    if (!m_regionList.isEmpty() && wasFirst)
         updateWritingMode();
 
     invalidateRegions();
@@ -416,8 +411,6 @@ void RenderNamedFlowThread::layout()
         setDispatchRegionOversetChangeEvent(true);
         updatePreviousRegionCount();
     }
-
-    dispatchRegionLayoutUpdateEventIfNeeded();
 }
 
 void RenderNamedFlowThread::dispatchNamedFlowEvents()
@@ -555,18 +548,6 @@ bool RenderNamedFlowThread::isChildAllowed(const RenderObject& child, const Rend
     return toElement(originalParent)->renderer()->isChildAllowed(child, style);
 }
 
-void RenderNamedFlowThread::dispatchRegionLayoutUpdateEventIfNeeded()
-{
-    if (!m_dispatchRegionLayoutUpdateEvent)
-        return;
-
-    m_dispatchRegionLayoutUpdateEvent = false;
-    InspectorInstrumentation::didUpdateRegionLayout(&document(), &namedFlow());
-
-    if (!m_regionLayoutUpdateEventTimer.isActive() && namedFlow().hasEventListeners())
-        m_regionLayoutUpdateEventTimer.startOneShot(0);
-}
-
 void RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded()
 {
     if (!m_dispatchRegionOversetChangeEvent)
@@ -579,11 +560,6 @@ void RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded()
         m_regionOversetChangeEventTimer.startOneShot(0);
 }
 
-void RenderNamedFlowThread::regionLayoutUpdateEventTimerFired(Timer<RenderNamedFlowThread>&)
-{
-    namedFlow().dispatchRegionLayoutUpdateEvent();
-}
-
 void RenderNamedFlowThread::regionOversetChangeEventTimerFired(Timer<RenderNamedFlowThread>&)
 {
     namedFlow().dispatchRegionOversetChangeEvent();
index 82f73ee..01d7cef 100644 (file)
@@ -96,7 +96,6 @@ public:
     LayoutUnit flowContentBottom() const { return m_flowContentBottom; }
     void dispatchNamedFlowEvents();
 
-    void setDispatchRegionLayoutUpdateEvent(bool value) { m_dispatchRegionLayoutUpdateEvent = value; }
     void setDispatchRegionOversetChangeEvent(bool value) { m_dispatchRegionOversetChangeEvent = value; }
 
     virtual bool absoluteQuadsForBox(Vector<FloatQuad>&, bool*, const RenderBox*, float, float) const override;
@@ -112,7 +111,6 @@ private:
     virtual void computeOverflow(LayoutUnit, bool = false) override;
     virtual void layout() override final;
 
-    void dispatchRegionLayoutUpdateEventIfNeeded();
     void dispatchRegionOversetChangeEventIfNeeded();
 
     bool dependsOn(RenderNamedFlowThread* otherRenderFlowThread) const;
@@ -124,7 +122,6 @@ private:
     void checkInvalidRegions();
 
     bool canBeDestroyed() const { return m_invalidRegionList.isEmpty() && m_regionList.isEmpty() && m_contentElements.isEmpty(); }
-    void regionLayoutUpdateEventTimerFired(Timer<RenderNamedFlowThread>&);
     void regionOversetChangeEventTimerFired(Timer<RenderNamedFlowThread>&);
     void clearContentElements();
     void updateWritingMode();
@@ -150,13 +147,11 @@ private:
     RenderRegionList m_invalidRegionList;
 
     bool m_hasRegionsWithStyling : 1;
-    bool m_dispatchRegionLayoutUpdateEvent : 1;
     bool m_dispatchRegionOversetChangeEvent : 1;
 
     // The DOM Object that represents a named flow.
     Ref<WebKitNamedFlow> m_namedFlow;
 
-    Timer<RenderNamedFlowThread> m_regionLayoutUpdateEventTimer;
     Timer<RenderNamedFlowThread> m_regionOversetChangeEventTimer;
 
     LayoutUnit m_flowContentBottom;
index 7492ae7..79c8e62 100644 (file)
@@ -1,3 +1,21 @@
+2014-05-05  Radu Stavila  <stavila@adobe.com>
+
+        [CSS Regions] Remove regionLayoutUpdate event
+        https://bugs.webkit.org/show_bug.cgi?id=132564
+
+        Reviewed by Simon Fraser.
+
+        The regionLayoutUpdate event was removed from the regions spec and was replaced by two other events: 
+        regionOversetChange and regionFragmentChange.
+
+        * UserInterface/Controllers/DOMTreeManager.js:
+        (WebInspector.DOMTreeManager.prototype.get regionLayoutUpdated): Deleted.
+        * UserInterface/Models/ScriptTimelineRecord.js:
+        * UserInterface/Protocol/CSSObserver.js:
+        (WebInspector.CSSObserver.prototype.regionLayoutUpdated): Deleted.
+        * UserInterface/Protocol/Legacy/7.0/InspectorWebBackendCommands.js:
+        * Versions/Inspector-iOS-7.0.json:
+
 2014-05-02  Jono Wells  <jonowells@apple.com>
 
         Web Inspector: CodeMirror 4 CSS mode new state data structure breaks helpers.
index 4a71aea..f4b8425 100644 (file)
@@ -58,7 +58,6 @@ WebInspector.DOMTreeManager.Event = {
     ContentFlowListWasUpdated: "dom-tree-manager-content-flow-list-was-updated",
     ContentFlowWasAdded: "dom-tree-manager-content-flow-was-added",
     ContentFlowWasRemoved: "dom-tree-manager-content-flow-was-removed",
-    RegionLayoutUpdated: "dom-tree-manager-region-layout-updated",
     RegionOversetChanged: "dom-tree-manager-region-overset-changed"
 };
 
@@ -617,11 +616,6 @@ WebInspector.DOMTreeManager.prototype = {
         this._updateContentFlowFromPayload(this._flows.get(flowKey), flowPayload);
     },
 
-    regionLayoutUpdated: function(flowPayload)
-    {
-        this._sendNamedFlowUpdateEvents(flowPayload);
-    },
-
     regionOversetChanged: function(flowPayload)
     {
         this._sendNamedFlowUpdateEvents(flowPayload);
index ef621b4..45800d5 100644 (file)
@@ -190,7 +190,6 @@ WebInspector.ScriptTimelineRecord.EventType.displayName = function(eventType, de
         nameMap.set("webkitplaybacktargetavailabilitychanged", "Playback Target Availability Changed");
         nameMap.set("webkitpointerlockchange", "Pointer Lock Change");
         nameMap.set("webkitpointerlockerror", "Pointer Lock Error");
-        nameMap.set("webkitregionlayoutupdate", "Region Layout Update");
         nameMap.set("webkitregionoversetchange", "Region Overset Change");
         nameMap.set("webkitremovesourcebuffer", "Remove Source Buffer");
         nameMap.set("webkitresourcetimingbufferfull", "Resource Timing Buffer Full");
index a4b7360..a184165 100644 (file)
@@ -63,11 +63,6 @@ WebInspector.CSSObserver.prototype = {
         WebInspector.domTreeManager.namedFlowRemoved(documentNodeId, flowName);
     },
 
-    regionLayoutUpdated: function(namedFlow)
-    {
-        WebInspector.domTreeManager.regionLayoutUpdated(namedFlow);
-    },
-
     regionOversetChanged: function(namedFlow)
     {
         WebInspector.domTreeManager.regionOversetChanged(namedFlow);
index 93b4479..1badb19 100644 (file)
@@ -203,7 +203,6 @@ InspectorBackend.registerEvent("CSS.mediaQueryResultChanged", []);
 InspectorBackend.registerEvent("CSS.styleSheetChanged", ["styleSheetId"]);
 InspectorBackend.registerEvent("CSS.namedFlowCreated", ["namedFlow"]);
 InspectorBackend.registerEvent("CSS.namedFlowRemoved", ["documentNodeId", "flowName"]);
-InspectorBackend.registerEvent("CSS.regionLayoutUpdated", ["namedFlow"]);
 InspectorBackend.registerCommand("CSS.enable", [], []);
 InspectorBackend.registerCommand("CSS.disable", [], []);
 InspectorBackend.registerCommand("CSS.getMatchedStylesForNode", [{"name": "nodeId", "type": "number", "optional": false}, {"name": "includePseudo", "type": "boolean", "optional": true}, {"name": "includeInherited", "type": "boolean", "optional": true}], ["matchedCSSRules", "pseudoElements", "inherited"]);
index d053209..4bb5702 100644 (file)
                     { "name": "flowName", "type": "string", "description": "Identifier of the removed Named Flow." }
                 ],
                 "description": "Fires when a Named Flow is removed: has no associated content nodes and regions."
-            },
-            {
-                "name": "regionLayoutUpdated",
-                "parameters": [
-                    { "name": "namedFlow", "$ref": "NamedFlow", "description": "The Named Flow whose layout may have changed." }
-                ],
-                "description": "Fires when a Named Flow's layout may have changed."
             }
         ]
     },