Title: [242167] trunk/Source/WebCore
Revision
242167
Author
za...@apple.com
Date
2019-02-27 15:29:04 -0800 (Wed, 27 Feb 2019)

Log Message

[ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195087

Reviewed by Simon Fraser.

Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
(WKStartObservingStyleRecalcScheduling): Deleted.
(WKStopObservingStyleRecalcScheduling): Deleted.
(WKIsObservingStyleRecalcScheduling): Deleted.
(WKSetShouldObserveNextStyleRecalc): Deleted.
(WKShouldObserveNextStyleRecalc): Deleted.
* platform/ios/wak/WKContentObservation.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (242166 => 242167)


--- trunk/Source/WebCore/ChangeLog	2019-02-27 23:20:44 UTC (rev 242166)
+++ trunk/Source/WebCore/ChangeLog	2019-02-27 23:29:04 UTC (rev 242167)
@@ -1,5 +1,31 @@
 2019-02-27  Zalan Bujtas  <za...@apple.com>
 
+        [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
+        https://bugs.webkit.org/show_bug.cgi?id=195087
+
+        Reviewed by Simon Fraser.
+
+        Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
+
+        * page/ios/ContentChangeObserver.h:
+        * page/ios/ContentChangeObserver.mm:
+        (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
+        (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
+        (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
+        (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
+        (WebCore::ContentChangeObserver::setObservedContentChange):
+        * platform/ios/wak/WKContentObservation.cpp:
+        (WKSetObservedContentChange):
+        (WKStartObservingStyleRecalcScheduling): Deleted.
+        (WKStopObservingStyleRecalcScheduling): Deleted.
+        (WKIsObservingStyleRecalcScheduling): Deleted.
+        (WKSetShouldObserveNextStyleRecalc): Deleted.
+        (WKShouldObserveNextStyleRecalc): Deleted.
+        * platform/ios/wak/WKContentObservation.h:
+
+2019-02-27  Zalan Bujtas  <za...@apple.com>
+
         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
         https://bugs.webkit.org/show_bug.cgi?id=195070
         <rdar://problem/48417650>

Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.h (242166 => 242167)


--- trunk/Source/WebCore/page/ios/ContentChangeObserver.h	2019-02-27 23:20:44 UTC (rev 242166)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.h	2019-02-27 23:29:04 UTC (rev 242167)
@@ -95,6 +95,8 @@
 
     Page& m_page;
     HashSet<const DOMTimer*> m_DOMTimerList;
+    bool m_observingNextStyleRecalc { false };
+    bool m_observingStyleRecalcScheduling { false };
 };
 
 }

Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.mm (242166 => 242167)


--- trunk/Source/WebCore/page/ios/ContentChangeObserver.mm	2019-02-27 23:20:44 UTC (rev 242166)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.mm	2019-02-27 23:29:04 UTC (rev 242167)
@@ -182,27 +182,27 @@
 
 void ContentChangeObserver::startObservingStyleRecalcScheduling()
 {
-    WKStartObservingStyleRecalcScheduling();
+    m_observingStyleRecalcScheduling = true;
 }
 
 void ContentChangeObserver::stopObservingStyleRecalcScheduling()
 {
-    WKStopObservingStyleRecalcScheduling();
+    m_observingStyleRecalcScheduling = false;
 }
 
 bool ContentChangeObserver::isObservingStyleRecalcScheduling()
 {
-    return WKIsObservingStyleRecalcScheduling();
+    return m_observingStyleRecalcScheduling;
 }
 
 void ContentChangeObserver::setShouldObserveNextStyleRecalc(bool observe)
 {
-    WKSetShouldObserveNextStyleRecalc(observe);
+    m_observingNextStyleRecalc = observe;
 }
 
 bool ContentChangeObserver::shouldObserveNextStyleRecalc()
 {
-    return WKShouldObserveNextStyleRecalc();
+    return m_observingNextStyleRecalc;
 }
 
 WKContentChange ContentChangeObserver::observedContentChange()

Modified: trunk/Source/WebCore/platform/ios/wak/WKContentObservation.cpp (242166 => 242167)


--- trunk/Source/WebCore/platform/ios/wak/WKContentObservation.cpp	2019-02-27 23:20:44 UTC (rev 242166)
+++ trunk/Source/WebCore/platform/ios/wak/WKContentObservation.cpp	2019-02-27 23:29:04 UTC (rev 242167)
@@ -37,8 +37,6 @@
 WKContentChange _WKContentChange                    = WKContentNoChange;
 bool            _WKObservingContentChanges          = false;
 bool            _WKObservingDOMTimerScheduling      = false;
-bool            _WKObservingStyleRecalScheduling    = false;
-bool            _WKObservingNextStyleRecalc         = false;
 
 bool WKObservingContentChanges(void)
 {
@@ -71,31 +69,6 @@
     return _WKObservingDOMTimerScheduling;
 }
 
-void WKStartObservingStyleRecalcScheduling(void)
-{
-    _WKObservingStyleRecalScheduling = true;
-}
-
-void WKStopObservingStyleRecalcScheduling(void)
-{
-    _WKObservingStyleRecalScheduling = false;
-}
-
-bool WKIsObservingStyleRecalcScheduling(void)
-{
-    return _WKObservingStyleRecalScheduling;
-}
-
-void WKSetShouldObserveNextStyleRecalc(bool observe)
-{
-    _WKObservingNextStyleRecalc = observe;
-}
-
-bool WKShouldObserveNextStyleRecalc(void)
-{
-    return _WKObservingNextStyleRecalc;
-}
-
 WKContentChange WKObservedContentChange(void)
 {
     return _WKContentChange;
@@ -107,16 +80,10 @@
     if (_WKContentChange == WKContentVisibilityChange)
         return;
 
-    if (change == WKContentVisibilityChange) {
+    if (change == WKContentVisibilityChange || change == WKContentIndeterminateChange) {
         _WKContentChange = change;
-        _WKObservingNextStyleRecalc = false;
         return;
     }
-
-    if (change == WKContentIndeterminateChange) {
-        _WKContentChange = change;
-        return;
-    }
     ASSERT_NOT_REACHED();
 }
 

Modified: trunk/Source/WebCore/platform/ios/wak/WKContentObservation.h (242166 => 242167)


--- trunk/Source/WebCore/platform/ios/wak/WKContentObservation.h	2019-02-27 23:20:44 UTC (rev 242166)
+++ trunk/Source/WebCore/platform/ios/wak/WKContentObservation.h	2019-02-27 23:29:04 UTC (rev 242167)
@@ -46,13 +46,6 @@
 WEBCORE_EXPORT void WKStopObservingDOMTimerScheduling(void);
 WEBCORE_EXPORT bool WKIsObservingDOMTimerScheduling(void);
 
-WEBCORE_EXPORT void WKStartObservingStyleRecalcScheduling(void);
-WEBCORE_EXPORT void WKStopObservingStyleRecalcScheduling(void);
-WEBCORE_EXPORT bool WKIsObservingStyleRecalcScheduling(void);
-
-WEBCORE_EXPORT void WKSetShouldObserveNextStyleRecalc(bool);
-WEBCORE_EXPORT bool WKShouldObserveNextStyleRecalc(void);
-
 WEBCORE_EXPORT WKContentChange WKObservedContentChange(void);
 
 #ifdef __cplusplus
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to