[ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKCont...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 19:14:02 +0000 (19:14 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 19:14:02 +0000 (19:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195197
<rdar://problem/48498332>

Reviewed by Simon Fraser.

Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
* page/ios/ContentChangeObserver.h:

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

Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h

index e174dfc..9334a6e 100644 (file)
@@ -1,3 +1,18 @@
+2019-03-01  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
+        https://bugs.webkit.org/show_bug.cgi?id=195197
+        <rdar://problem/48498332>
+
+        Reviewed by Simon Fraser.
+
+        Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
+
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::didContentVisibilityChange):
+        (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
+        * page/ios/ContentChangeObserver.h:
+
 2019-03-01  Jer Noble  <jer.noble@apple.com>
 
         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
index 0d36fb7..006be89 100644 (file)
@@ -147,6 +147,11 @@ void ContentChangeObserver::willDetachPage()
     clearTimersAndReportContentChange();
 }
 
+void ContentChangeObserver::didContentVisibilityChange()
+{
+    setObservedContentChange(WKContentVisibilityChange);
+}
+
 void ContentChangeObserver::startObservingContentChanges()
 {
     startObservingDOMTimerScheduling();
@@ -311,7 +316,7 @@ ContentChangeObserver::StyleChangeScope::~StyleChangeScope()
     if ((m_previousDisplay == DisplayType::None && style->display() != DisplayType::None)
         || (m_previousVisibility == Visibility::Hidden && style->visibility() != Visibility::Hidden)
         || (m_previousImplicitVisibility == Visibility::Hidden && elementImplicitVisibility(m_element) == Visibility::Visible))
-        m_contentChangeObserver->setObservedContentChange(WKContentVisibilityChange);
+        m_contentChangeObserver->didContentVisibilityChange();
 }
 
 ContentChangeObserver::StyleRecalcScope::StyleRecalcScope(Page* page)
index c2ac8e4..c244c24 100644 (file)
@@ -44,7 +44,7 @@ public:
 
     void didInstallDOMTimer(const DOMTimer&, Seconds timeout, bool singleShot);
     void didRemoveDOMTimer(const DOMTimer&);
-
+    void didContentVisibilityChange();
     void didScheduleStyleRecalc();
     void didSuspendActiveDOMObjects();
     void willDetachPage();