WebKit Bugzilla
Attachment 362829 Details for
Bug 194977
: Introduce ContentChangeObserver class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194977-20190223114017.patch (text/plain), 41.09 KB, created by
zalan
on 2019-02-23 11:40:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-02-23 11:40:27 PST
Size:
41.09 KB
patch
obsolete
>Subversion Revision: 241945 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c7b81ce05f6067872c43d516124eac69ff6bf398..d8c99a0f26cd07214984baead69803e36609cdc3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,38 @@ >+2019-02-23 Zalan Bujtas <zalan@apple.com> >+ >+ Introduce ContentChangeObserver class >+ https://bugs.webkit.org/show_bug.cgi?id=194977 >+ <rdar://problem/48338115> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WIP. >+ >+ This patch is about piping through all the related WK* calls. >+ >+ * SourcesCocoa.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * dom/Document.cpp: >+ (WebCore::Document::scheduleStyleRecalc): >+ (WebCore::Document::updateStyleIfNeeded): >+ (WebCore::Document::platformSuspendOrStopActiveDOMObjects): >+ * loader/FrameLoader.cpp: >+ * page/DOMTimer.cpp: >+ (WebCore::DOMTimer::install): >+ (WebCore::DOMTimer::fired): >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::clearTimeout): >+ * page/Frame.cpp: >+ (WebCore::Frame::willDetachPage): >+ * page/Page.h: >+ (WebCore::Page::contentChangeObserver): >+ * page/ios/EventHandlerIOS.mm: >+ (WebCore::EventHandler::mouseMoved): >+ * rendering/updating/RenderTreeUpdater.cpp: >+ (WebCore::RenderTreeUpdater::updateElementRenderer): >+ (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): >+ (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): >+ > 2019-02-22 Eric Carlson <eric.carlson@apple.com> > > Update some media logging >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 286d055c39d8eda6b3427003626f95d9021ba32d..8903c273643096f78262d8f6aa66a97bb81c7577 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-23 Zalan Bujtas <zalan@apple.com> >+ >+ Introduce ContentChangeObserver class >+ https://bugs.webkit.org/show_bug.cgi?id=194977 >+ <rdar://problem/48338115> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::handleSyntheticClick): >+ (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): >+ > 2019-02-21 Adrian Perez de Castro <aperez@igalia.com> > > [WPE][GTK] No API documentation generated for WebKitUserContentFilterStore >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index 054e7116f41b40a1ad481dd08250fc0e6a217380..6980df2a1e86876af8273983600413ee327fa623 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-23 Zalan Bujtas <zalan@apple.com> >+ >+ Introduce ContentChangeObserver class >+ https://bugs.webkit.org/show_bug.cgi?id=194977 >+ <rdar://problem/48338115> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebChromeClientIOS.mm: >+ (WebChromeClientIOS::observedContentChange): >+ (WebChromeClientIOS::clearContentChangeObservers): >+ > 2019-02-17 David Kilzer <ddkilzer@apple.com> > > Unreviewed, rolling out r241620. >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index 2aa2367f1adf482128ea69ffbf1fcfdfb592b4a5..fe997d1bf33d96508628357d001e6d8e8363b833 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -131,6 +131,7 @@ page/cocoa/ResourceUsageOverlayCocoa.mm > page/cocoa/ResourceUsageThreadCocoa.mm > page/cocoa/SettingsBaseCocoa.mm > >+page/ios/ContentChangeObserver.mm > page/ios/EventHandlerIOS.mm > page/ios/FrameIOS.mm > page/ios/WebEventRegion.mm >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 46a2d8ce7084e774b3f282772c6cee0b5017e6f3..ed25b8f6ebba24d524938c41bbc53534e1a0d919 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2068,6 +2068,7 @@ > 6F995A3A1A70833700A735F4 /* JSWebGLVertexArrayObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F995A301A70833700A735F4 /* JSWebGLVertexArrayObject.h */; }; > 6FA4454E898F2FC168BC38C1 /* JSBeforeUnloadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 29E04A27BED2F81F98E9022B /* JSBeforeUnloadEvent.h */; }; > 6FB11B5C21783FD000E2A574 /* TextUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB11B5921783FCF00E2A574 /* TextUtil.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 6FB5E214221F2453003989CF /* ContentChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FB5E212221F2447003989CF /* ContentChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 6FE198172178397C00446F08 /* InlineLineBreaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE198152178397C00446F08 /* InlineLineBreaker.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7CFA02177EEF1005B1573 /* InlineItem.h */; }; > 6FE7CFA42177EF10005B1573 /* LayoutLineBreakBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7CFA32177EF10005B1573 /* LayoutLineBreakBox.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -9242,6 +9243,7 @@ > 6F995A301A70833700A735F4 /* JSWebGLVertexArrayObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLVertexArrayObject.h; sourceTree = "<group>"; }; > 6FB11B5921783FCF00E2A574 /* TextUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextUtil.h; sourceTree = "<group>"; }; > 6FB11B5B21783FCF00E2A574 /* TextUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextUtil.cpp; sourceTree = "<group>"; }; >+ 6FB5E212221F2447003989CF /* ContentChangeObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentChangeObserver.h; sourceTree = "<group>"; }; > 6FBB860520B464B600DAD938 /* FormattingContextGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FormattingContextGeometry.cpp; sourceTree = "<group>"; }; > 6FE198132178397B00446F08 /* InlineLineBreaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineLineBreaker.cpp; sourceTree = "<group>"; }; > 6FE198152178397C00446F08 /* InlineLineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineLineBreaker.h; sourceTree = "<group>"; }; >@@ -9249,6 +9251,7 @@ > 6FE7CFA02177EEF1005B1573 /* InlineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineItem.h; sourceTree = "<group>"; }; > 6FE7CFA32177EF10005B1573 /* LayoutLineBreakBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutLineBreakBox.h; sourceTree = "<group>"; }; > 6FE7CFA52177F069005B1573 /* LayoutLineBreakBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutLineBreakBox.cpp; sourceTree = "<group>"; }; >+ 6FE9F09222211035004C5082 /* ContentChangeObserver.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentChangeObserver.mm; sourceTree = "<group>"; }; > 6FFDC43E212EFF1600A9CA91 /* FloatAvoider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatAvoider.cpp; sourceTree = "<group>"; }; > 6FFDC440212EFF1600A9CA91 /* FloatAvoider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatAvoider.h; sourceTree = "<group>"; }; > 709A01FD1E3D0BCC006B0D4C /* ModuleFetchFailureKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleFetchFailureKind.h; sourceTree = "<group>"; }; >@@ -16607,6 +16610,8 @@ > 18A6CD6F0D8F2025001DC3CE /* ios */ = { > isa = PBXGroup; > children = ( >+ 6FB5E212221F2447003989CF /* ContentChangeObserver.h */, >+ 6FE9F09222211035004C5082 /* ContentChangeObserver.mm */, > FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */, > FED13D3B0CEA936A00D89466 /* FrameIOS.mm */, > 225A16B30D5C11E900090295 /* WebEventRegion.h */, >@@ -28711,6 +28716,7 @@ > 2DAF343D1EA7E0F100382CD3 /* ConstantPropertyMap.h in Headers */, > A818721C0977D3C0005826D9 /* ContainerNode.h in Headers */, > E1A1470811102B1500EEC0F3 /* ContainerNodeAlgorithms.h in Headers */, >+ 6FB5E214221F2453003989CF /* ContentChangeObserver.h in Headers */, > BC5EB9810E82072500B25965 /* ContentData.h in Headers */, > 51B45D211AB8D1E200117CD2 /* ContentExtension.h in Headers */, > 5CDFA6C81AA4F2DA00EA8746 /* ContentExtensionActions.h in Headers */, >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 2ba962e5860aaf8a0a23c19749608a07369a85cf..2755f76dfab60be40ee8a656c1099138b386a5d5 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -258,6 +258,7 @@ > #endif > > #if PLATFORM(IOS_FAMILY) >+#include "ContentChangeObserver.h" > #include "CSSFontSelector.h" > #include "DeviceMotionClientIOS.h" > #include "DeviceMotionController.h" >@@ -266,8 +267,6 @@ > #include "Geolocation.h" > #include "Navigator.h" > #include "NavigatorGeolocation.h" >-#include "WKContentObservation.h" >-#include "WKContentObservationInternal.h" > #endif > > #if ENABLE(IOS_GESTURE_EVENTS) >@@ -1812,9 +1811,12 @@ void Document::scheduleStyleRecalc() > ASSERT(childNeedsStyleRecalc() || m_needsFullStyleRebuild); > > #if PLATFORM(IOS_FAMILY) >- if (WKIsObservingStyleRecalcScheduling()) { >- LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: register this style recalc schedule and observe when it fires."); >- WKSetObservedContentChange(WKContentIndeterminateChange); >+ if (auto* page = this->page()) { >+ auto& contentChangeObserver = page->contentChangeObserver(); >+ if (contentChangeObserver.isObservingStyleRecalcScheduling()) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: register this style recalc schedule and observe when it fires."); >+ contentChangeObserver.setObservedContentChange(WKContentIndeterminateChange); >+ } > } > #endif > >@@ -2048,11 +2050,15 @@ bool Document::updateStyleIfNeeded() > } > > #if PLATFORM(IOS_FAMILY) >- auto observingContentChange = WKShouldObserveNextStyleRecalc(); >- if (observingContentChange) { >- LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: start observing content change."); >- WKSetShouldObserveNextStyleRecalc(false); >- WKStartObservingContentChanges(); >+ auto observingContentChange = false; >+ if (auto* page = this->page()) { >+ auto& contentChangeObserver = page->contentChangeObserver(); >+ observingContentChange = contentChangeObserver.shouldObserveNextStyleRecalc(); >+ if (observingContentChange) { >+ LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: start observing content change."); >+ contentChangeObserver.setShouldObserveNextStyleRecalc(false); >+ contentChangeObserver.startObservingContentChanges(); >+ } > } > #endif > // The early exit above for !needsStyleRecalc() is needed when updateWidgetPositions() is called in runOrScheduleAsynchronousTasks(). >@@ -2061,15 +2067,15 @@ bool Document::updateStyleIfNeeded() > resolveStyle(); > > #if PLATFORM(IOS_FAMILY) >- if (observingContentChange) { >+ if (observingContentChange && page()) { > LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: stop observing content change."); >- WKStopObservingContentChanges(); >+ auto& contentChangeObserver = page()->contentChangeObserver(); >+ contentChangeObserver.stopObservingContentChanges(); > >- auto inDeterminedState = WKObservedContentChange() == WKContentVisibilityChange || !WebThreadCountOfObservedDOMTimers(); >+ auto inDeterminedState = contentChangeObserver.observedContentChange() == WKContentVisibilityChange || !contentChangeObserver.countOfObservedDOMTimers(); > if (inDeterminedState) { > LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: notify the pending synthetic click handler."); >- if (auto* page = this->page()) >- page->chrome().client().observedContentChange(*frame()); >+ page()->chrome().client().observedContentChange(*frame()); > } else { > LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: can't decided it yet."); > } >@@ -2651,13 +2657,13 @@ bool Document::shouldBypassMainWorldContentSecurityPolicy() const > void Document::platformSuspendOrStopActiveDOMObjects() > { > #if PLATFORM(IOS_FAMILY) >- if (WebThreadCountOfObservedDOMTimers() > 0) { >- LOG_WITH_STREAM(ContentObservation, stream << "Document::platformSuspendOrStopActiveDOMObjects: remove registered timers."); >- if (auto* frame = this->frame()) { >- if (auto* page = frame->page()) >- page->chrome().client().clearContentChangeObservers(*frame); >- } >- } >+ if (!page() || !frame()) >+ return; >+ auto& page = *this->page(); >+ if (!page.contentChangeObserver().countOfObservedDOMTimers()) >+ return; >+ LOG_WITH_STREAM(ContentObservation, stream << "Document::platformSuspendOrStopActiveDOMObjects: remove registered timers."); >+ page.chrome().client().clearContentChangeObservers(*frame()); > #endif > } > >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 766b7e1eb251c63448fff0c52f59fd1dd9192fed..2c43a19d78467b8ee48b5dc8e8ffa4cc51e8f220 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -145,7 +145,6 @@ > #include "DocumentType.h" > #include "ResourceLoader.h" > #include "RuntimeApplicationChecks.h" >-#include "WKContentObservation.h" > #endif > > #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - FrameLoader::" fmt, this, ##__VA_ARGS__) >diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp >index e98f5f25fbb53a4096342383c472a9a2fb78e17b..344379a19a13b694967869107e69af0868ff7238 100644 >--- a/Source/WebCore/page/DOMTimer.cpp >+++ b/Source/WebCore/page/DOMTimer.cpp >@@ -44,9 +44,8 @@ > #if PLATFORM(IOS_FAMILY) > #include "Chrome.h" > #include "ChromeClient.h" >+#include "ContentChangeObserver.h" > #include "Frame.h" >-#include "WKContentObservation.h" >-#include "WKContentObservationInternal.h" > #endif > > namespace WebCore { >@@ -219,17 +218,6 @@ int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<Scheduled > // This reference will be released automatically when a one-shot timer fires, when the context > // is destroyed, or if explicitly cancelled by removeById. > DOMTimer* timer = new DOMTimer(context, WTFMove(action), timeout, singleShot); >-#if PLATFORM(IOS_FAMILY) >- if (WKIsObservingDOMTimerScheduling() && is<Document>(context)) { >- bool didDeferTimeout = context.activeDOMObjectsAreSuspended(); >- if (!didDeferTimeout && timeout <= 250_ms && singleShot) { >- WKSetObservedContentChange(WKContentIndeterminateChange); >- WebThreadAddObservedDOMTimer(timer); >- LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::install: registed this timer: (" << timer << ") and observe when it fires."); >- } >- } >-#endif >- > timer->suspendIfNeeded(); > InspectorInstrumentation::didInstallTimer(context, timer->m_timeoutId, timeout, singleShot); > >@@ -237,6 +225,25 @@ int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<Scheduled > if (NestedTimersMap* nestedTimers = NestedTimersMap::instanceForContext(context)) > nestedTimers->add(timer->m_timeoutId, *timer); > >+#if PLATFORM(IOS_FAMILY) >+ auto startObservingThisTimerIfNeeded = [&] { >+ if (!is<Document>(context)) >+ return; >+ if (context.activeDOMObjectsAreSuspended()) >+ return; >+ if (timeout > 250_ms || !singleShot) >+ return; >+ auto& contentChangeObserver = downcast<Document>(context).page()->contentChangeObserver(); >+ if (!contentChangeObserver.isObservingDOMTimerScheduling()) >+ return; >+ >+ contentChangeObserver.setObservedContentChange(WKContentIndeterminateChange); >+ contentChangeObserver.addObservedDOMTimer(*timer); >+ LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::install: registed this timer: (" << timer << ") and observe when it fires."); >+ }; >+ >+ startObservingThisTimerIfNeeded(); >+#endif > return timer->m_timeoutId; > } > >@@ -342,18 +349,23 @@ void DOMTimer::fired() > context.removeTimeout(m_timeoutId); > > #if PLATFORM(IOS_FAMILY) >- auto isObversingLastTimer = false; >+ auto isObservingLastTimer = false; > auto shouldBeginObservingChanges = false; >- if (is<Document>(context)) { >- isObversingLastTimer = WebThreadCountOfObservedDOMTimers() == 1; >- shouldBeginObservingChanges = WebThreadContainsObservedDOMTimer(this); >+ Page* page = nullptr; >+ if (is<Document>(context) && downcast<Document>(context).page()) { >+ page = downcast<Document>(context).page(); >+ auto& contentChangeObserver = page->contentChangeObserver(); >+ isObservingLastTimer = contentChangeObserver.countOfObservedDOMTimers() == 1; >+ shouldBeginObservingChanges = contentChangeObserver.containsObservedDOMTimer(*this); > } > > if (shouldBeginObservingChanges) { >+ ASSERT(page); > LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::fired: start observing (" << this << ") timer callback."); >- WKStartObservingContentChanges(); >- WKStartObservingStyleRecalcScheduling(); >- WebThreadRemoveObservedDOMTimer(this); >+ auto& contentChangeObserver = page->contentChangeObserver(); >+ contentChangeObserver.startObservingContentChanges(); >+ contentChangeObserver.startObservingStyleRecalcScheduling(); >+ contentChangeObserver.removeObservedDOMTimer(*this); > } > #endif > >@@ -366,22 +378,22 @@ void DOMTimer::fired() > > #if PLATFORM(IOS_FAMILY) > if (shouldBeginObservingChanges) { >+ ASSERT(page); > LOG_WITH_STREAM(ContentObservation, stream << "DOMTimer::fired: stop observing (" << this << ") timer callback."); >- WKStopObservingStyleRecalcScheduling(); >- WKStopObservingContentChanges(); >+ auto& contentChangeObserver = page->contentChangeObserver(); >+ contentChangeObserver.stopObservingStyleRecalcScheduling(); >+ contentChangeObserver.stopObservingContentChanges(); > >- auto observedContentChange = WKObservedContentChange(); >+ auto observedContentChange = contentChangeObserver.observedContentChange(); > // Check if the timer callback triggered either a sync or async style update. >- auto inDeterminedState = observedContentChange == WKContentVisibilityChange || (isObversingLastTimer && observedContentChange == WKContentNoChange); >+ auto inDeterminedState = observedContentChange == WKContentVisibilityChange || (isObservingLastTimer && observedContentChange == WKContentNoChange); > if (inDeterminedState) { > LOG(ContentObservation, "DOMTimer::fired: in determined state."); >- auto& document = downcast<Document>(context); >- if (auto* page = document.page()) >- page->chrome().client().observedContentChange(*document.frame()); >+ page->chrome().client().observedContentChange(*downcast<Document>(context).frame()); > } else if (observedContentChange == WKContentIndeterminateChange) { > // An async style recalc has been scheduled. Let's observe it. > LOG(ContentObservation, "DOMTimer::fired: wait until next style recalc fires."); >- WKSetShouldObserveNextStyleRecalc(true); >+ contentChangeObserver.setShouldObserveNextStyleRecalc(true); > } > } > #endif >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 8fd411915164ee37604aa4e3492cb9ff289cb550..67db6f6e9108214df49ba16501fb68b3a6b493ce 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -139,11 +139,9 @@ > #endif > > #if PLATFORM(IOS_FAMILY) >-#include "WKContentObservation.h" >-#include "WKContentObservationInternal.h" >+#include "ContentChangeObserver.h" > #endif > >- > namespace WebCore { > using namespace Inspector; > >@@ -1684,21 +1682,26 @@ ExceptionOr<int> DOMWindow::setTimeout(JSC::ExecState& state, std::unique_ptr<Sc > void DOMWindow::clearTimeout(int timeoutId) > { > #if PLATFORM(IOS_FAMILY) >- if (auto* frame = this->frame()) { >- Document* document = frame->document(); >- if (timeoutId > 0 && document) { >- DOMTimer* timer = document->findTimeout(timeoutId); >- if (timer && WebThreadContainsObservedDOMTimer(timer)) { >- LOG_WITH_STREAM(ContentObservation, stream << "DOMWindow::clearTimeout: remove registered timer (" << timer << ")"); >- WebThreadRemoveObservedDOMTimer(timer); >- >- if (!WebThreadCountOfObservedDOMTimers()) { >- if (Page* page = frame->page()) >- page->chrome().client().observedContentChange(*frame); >- } >- } >- } >- } >+ auto handleObservedTimerCancelIfNeeded = [&] { >+ if (!frame() || !frame()->document() || !frame()->document()->page()) >+ return; >+ if (timeoutId <= 0) >+ return; >+ auto& document = *frame()->document(); >+ auto* timer = document.findTimeout(timeoutId); >+ if (!timer) >+ return; >+ auto& page = *document.page(); >+ auto& contentChangeObserver = page.contentChangeObserver(); >+ if (!contentChangeObserver.containsObservedDOMTimer(*timer)) >+ return; >+ LOG_WITH_STREAM(ContentObservation, stream << "DOMWindow::clearTimeout: remove registered timer (" << timer << ")"); >+ contentChangeObserver.removeObservedDOMTimer(*timer); >+ if (contentChangeObserver.countOfObservedDOMTimers()) >+ return; >+ page.chrome().client().observedContentChange(*frame()); >+ }; >+ handleObservedTimerCancelIfNeeded(); > #endif > ScriptExecutionContext* context = scriptExecutionContext(); > if (!context) >diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp >index f689db71d0c6bb6f9864917e0b6f81acf0623e5e..d8aeb2f98757f830a7d26d3024e25d2e0f846195 100644 >--- a/Source/WebCore/page/Frame.cpp >+++ b/Source/WebCore/page/Frame.cpp >@@ -108,7 +108,7 @@ > #include <wtf/text/StringBuilder.h> > > #if PLATFORM(IOS_FAMILY) >-#include "WKContentObservation.h" >+#include "ContentChangeObserver.h" > #endif > > namespace WebCore { >@@ -838,7 +838,7 @@ void Frame::willDetachPage() > page()->scrollingCoordinator()->willDestroyScrollableArea(*m_view); > > #if PLATFORM(IOS_FAMILY) >- if (WebThreadCountOfObservedDOMTimers() > 0 && m_page) { >+ if (page() && page()->contentChangeObserver().countOfObservedDOMTimers()) { > LOG(ContentObservation, "Frame::willDetachPage: remove registered timers."); > m_page->chrome().client().clearContentChangeObservers(*this); > } >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 9464a8ddaf07a543f0b868ab083649caff7204b7..4b3d9f961effd93b63d2e3187adae047f4cceeb7 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -66,6 +66,10 @@ > #include "MediaPlaybackTargetContext.h" > #endif > >+#if PLATFORM(IOS_FAMILY) >+#include "ContentChangeObserver.h" >+#endif >+ > namespace JSC { > class Debugger; > } >@@ -250,6 +254,9 @@ public: > #endif > #if ENABLE(POINTER_LOCK) > PointerLockController& pointerLockController() const { return *m_pointerLockController; } >+#endif >+#if PLATFORM(IOS_FAMILY) >+ ContentChangeObserver& contentChangeObserver() { return m_contentChangeObserver; } > #endif > LibWebRTCProvider& libWebRTCProvider() { return m_libWebRTCProvider.get(); } > RTCController& rtcController() { return m_rtcController; } >@@ -810,6 +817,7 @@ private: > > #if PLATFORM(IOS_FAMILY) > bool m_enclosedInScrollableAncestorView { false }; >+ ContentChangeObserver m_contentChangeObserver; > #endif > > bool m_useSystemAppearance { false }; >diff --git a/Source/WebCore/page/ios/ContentChangeObserver.h b/Source/WebCore/page/ios/ContentChangeObserver.h >new file mode 100644 >index 0000000000000000000000000000000000000000..1189e96892cf4b53fe6cfb6839a2677494e36fce >--- /dev/null >+++ b/Source/WebCore/page/ios/ContentChangeObserver.h >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if PLATFORM(IOS_FAMILY) >+ >+#include "WKContentObservation.h" >+ >+namespace WebCore { >+ >+class DOMTimer; >+ >+class ContentChangeObserver { >+public: >+ ContentChangeObserver() = default; >+ >+ WEBCORE_EXPORT void startObservingContentChanges(); >+ WEBCORE_EXPORT void stopObservingContentChanges(); >+ bool isObservingContentChanges(); >+ >+ WEBCORE_EXPORT void startObservingDOMTimerScheduling(); >+ WEBCORE_EXPORT void stopObservingDOMTimerScheduling(); >+ bool isObservingDOMTimerScheduling(); >+ >+ WEBCORE_EXPORT void startObservingStyleRecalcScheduling(); >+ WEBCORE_EXPORT void stopObservingStyleRecalcScheduling(); >+ bool isObservingStyleRecalcScheduling(); >+ >+ void setShouldObserveNextStyleRecalc(bool); >+ bool shouldObserveNextStyleRecalc(); >+ >+ void setObservedContentChange(WKContentChange); >+ WEBCORE_EXPORT WKContentChange observedContentChange(); >+ >+ void addObservedDOMTimer(DOMTimer&); >+ void removeObservedDOMTimer(DOMTimer&); >+ bool containsObservedDOMTimer(DOMTimer&); >+ WEBCORE_EXPORT unsigned countOfObservedDOMTimers(); >+ WEBCORE_EXPORT void clearObservedDOMTimers(); >+}; >+ >+} >+#endif >diff --git a/Source/WebCore/page/ios/ContentChangeObserver.mm b/Source/WebCore/page/ios/ContentChangeObserver.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..09bb34cc7f71679c67524bace55fd83077d439fa >--- /dev/null >+++ b/Source/WebCore/page/ios/ContentChangeObserver.mm >@@ -0,0 +1,126 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "ContentChangeObserver.h" >+ >+#if PLATFORM(IOS_FAMILY) >+#import "DOMTimer.h" >+#import "WKContentObservationInternal.h" >+ >+namespace WebCore { >+ >+void ContentChangeObserver::startObservingContentChanges() >+{ >+ WKStartObservingContentChanges(); >+} >+ >+void ContentChangeObserver::stopObservingContentChanges() >+{ >+ WKStopObservingContentChanges(); >+} >+ >+bool ContentChangeObserver::isObservingContentChanges() >+{ >+ return WKObservingContentChanges(); >+} >+ >+void ContentChangeObserver::startObservingDOMTimerScheduling() >+{ >+ WKStartObservingDOMTimerScheduling(); >+} >+ >+void ContentChangeObserver::stopObservingDOMTimerScheduling() >+{ >+ WKStopObservingDOMTimerScheduling(); >+} >+ >+bool ContentChangeObserver::isObservingDOMTimerScheduling() >+{ >+ return WKIsObservingDOMTimerScheduling(); >+} >+ >+void ContentChangeObserver::startObservingStyleRecalcScheduling() >+{ >+ WKStartObservingStyleRecalcScheduling(); >+} >+ >+void ContentChangeObserver::stopObservingStyleRecalcScheduling() >+{ >+ WKStopObservingStyleRecalcScheduling(); >+} >+ >+bool ContentChangeObserver::isObservingStyleRecalcScheduling() >+{ >+ return WKIsObservingStyleRecalcScheduling(); >+} >+ >+void ContentChangeObserver::setShouldObserveNextStyleRecalc(bool observe) >+{ >+ WKSetShouldObserveNextStyleRecalc(observe); >+} >+ >+bool ContentChangeObserver::shouldObserveNextStyleRecalc() >+{ >+ return WKShouldObserveNextStyleRecalc(); >+} >+ >+WKContentChange ContentChangeObserver::observedContentChange() >+{ >+ return WKObservedContentChange(); >+} >+ >+unsigned ContentChangeObserver::countOfObservedDOMTimers() >+{ >+ return WebThreadCountOfObservedDOMTimers(); >+} >+ >+void ContentChangeObserver::clearObservedDOMTimers() >+{ >+ WebThreadClearObservedDOMTimers(); >+} >+ >+void ContentChangeObserver::setObservedContentChange(WKContentChange change) >+{ >+ WKSetObservedContentChange(change); >+} >+ >+bool ContentChangeObserver::containsObservedDOMTimer(DOMTimer& timer) >+{ >+ return WebThreadContainsObservedDOMTimer(&timer); >+} >+ >+void ContentChangeObserver::addObservedDOMTimer(DOMTimer& timer) >+{ >+ WebThreadAddObservedDOMTimer(&timer); >+} >+ >+void ContentChangeObserver::removeObservedDOMTimer(DOMTimer& timer) >+{ >+ WebThreadRemoveObservedDOMTimer(&timer); >+} >+ >+} >+ >+#endif // PLATFORM(IOS_FAMILY) >diff --git a/Source/WebCore/page/ios/EventHandlerIOS.mm b/Source/WebCore/page/ios/EventHandlerIOS.mm >index eccfa63d9f1a170d2093071a26a6c8c2fe4c4558..08ed6477163434a1dcb4d0a11ec568f391d770ec 100644 >--- a/Source/WebCore/page/ios/EventHandlerIOS.mm >+++ b/Source/WebCore/page/ios/EventHandlerIOS.mm >@@ -32,6 +32,7 @@ > #import "AutoscrollController.h" > #import "Chrome.h" > #import "ChromeClient.h" >+#import "ContentChangeObserver.h" > #import "DataTransfer.h" > #import "DragState.h" > #import "FocusController.h" >@@ -490,18 +491,20 @@ void EventHandler::mouseMoved(WebEvent *event) > return; > > BEGIN_BLOCK_OBJC_EXCEPTIONS; >+ auto& document = *m_frame.document(); >+ document.updateStyleIfNeeded(); > >- m_frame.document()->updateStyleIfNeeded(); >+ auto& contentChangeObserver = document.page()->contentChangeObserver(); >+ contentChangeObserver.startObservingContentChanges(); >+ contentChangeObserver.startObservingDOMTimerScheduling(); > >- WKStartObservingContentChanges(); >- WKStartObservingDOMTimerScheduling(); > CurrentEventScope scope(event); > event.wasHandled = mouseMoved(currentPlatformMouseEvent()); >- >- // FIXME: Why is this here? >- m_frame.document()->updateStyleIfNeeded(); >- WKStopObservingDOMTimerScheduling(); >- WKStopObservingContentChanges(); >+ >+ // Run style recalc to be able to capture content changes as the result of the mouse move event. >+ document.updateStyleIfNeeded(); >+ contentChangeObserver.stopObservingDOMTimerScheduling(); >+ contentChangeObserver.stopObservingContentChanges(); > > END_BLOCK_OBJC_EXCEPTIONS; > } >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >index 6ac88f88131e5b0996d983ab35f496f53ada3ac6..8505f5d61c65e32aafa8087484d3dfdf05356638 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >@@ -50,8 +50,7 @@ > #include <wtf/SystemTracing.h> > > #if PLATFORM(IOS_FAMILY) >-#include "WKContentObservation.h" >-#include "WKContentObservationInternal.h" >+#include "ContentChangeObserver.h" > #endif > > namespace WebCore { >@@ -59,11 +58,12 @@ namespace WebCore { > #if PLATFORM(IOS_FAMILY) > class CheckForVisibilityChange { > public: >- CheckForVisibilityChange(const Element&); >+ CheckForVisibilityChange(const Element&, Page*); > ~CheckForVisibilityChange(); > > private: > const Element& m_element; >+ Page* m_page { nullptr }; > DisplayType m_previousDisplay; > Visibility m_previousVisibility; > Visibility m_previousImplicitVisibility; >@@ -308,7 +308,7 @@ void RenderTreeUpdater::updateRendererStyle(RenderElement& renderer, RenderStyle > void RenderTreeUpdater::updateElementRenderer(Element& element, const Style::ElementUpdate& update) > { > #if PLATFORM(IOS_FAMILY) >- CheckForVisibilityChange checkForVisibilityChange(element); >+ CheckForVisibilityChange checkForVisibilityChange(element, m_document.page()); > #endif > > bool shouldTearDownRenderers = update.change == Style::Detach && (element.renderer() || element.hasDisplayContents()); >@@ -667,17 +667,22 @@ static Visibility elementImplicitVisibility(const Element& element) > return Visibility::Visible; > } > >-CheckForVisibilityChange::CheckForVisibilityChange(const Element& element) >+CheckForVisibilityChange::CheckForVisibilityChange(const Element& element, Page* page) > : m_element(element) >+ , m_page(page) > , m_previousDisplay(element.renderStyle() ? element.renderStyle()->display() : DisplayType::None) > , m_previousVisibility(element.renderStyle() ? element.renderStyle()->visibility() : Visibility::Hidden) >- , m_previousImplicitVisibility(WKObservingContentChanges() && WKObservedContentChange() != WKContentVisibilityChange ? elementImplicitVisibility(element) : Visibility::Visible) >+ , m_previousImplicitVisibility(page && page->contentChangeObserver().isObservingContentChanges() && page->contentChangeObserver().observedContentChange() != WKContentVisibilityChange ? elementImplicitVisibility(element) : Visibility::Visible) > { > } > > CheckForVisibilityChange::~CheckForVisibilityChange() > { >- if (!WKObservingContentChanges()) >+ if (!m_page) >+ return; >+ >+ auto& contentChangeObserver = m_page->contentChangeObserver(); >+ if (!contentChangeObserver.isObservingContentChanges()) > return; > > auto* style = m_element.renderStyle(); >@@ -696,7 +701,7 @@ CheckForVisibilityChange::~CheckForVisibilityChange() > return; > 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)) >- WKSetObservedContentChange(WKContentVisibilityChange); >+ contentChangeObserver.setObservedContentChange(WKContentVisibilityChange); > } > #endif > >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 50f85c1adfb1a30c5c3cb391e706f213aae0a8bc..62f7a5a3f36028c3fabeab51714036a7622687a7 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -57,6 +57,7 @@ > #import <WebCore/Autofill.h> > #import <WebCore/AutofillElements.h> > #import <WebCore/Chrome.h> >+#import <WebCore/ContentChangeObserver.h> > #import <WebCore/DataDetection.h> > #import <WebCore/DiagnosticLoggingClient.h> > #import <WebCore/DiagnosticLoggingKeys.h> >@@ -113,7 +114,6 @@ > #import <WebCore/TextIndicator.h> > #import <WebCore/TextIterator.h> > #import <WebCore/VisibleUnits.h> >-#import <WebCore/WKContentObservation.h> > #import <WebCore/WebEvent.h> > #import <wtf/MathExtras.h> > #import <wtf/MemoryPressureHandler.h> >@@ -538,11 +538,12 @@ void WebPage::updateSelectionAppearance() > void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::FloatPoint& location, OptionSet<WebEvent::Modifier> modifiers) > { > IntPoint roundedAdjustedPoint = roundedIntPoint(location); >- Frame& mainframe = m_page->mainFrame(); >+ auto& mainframe = m_page->mainFrame(); >+ auto& contentChangeObserver = m_page->contentChangeObserver(); > > LOG_WITH_STREAM(ContentObservation, stream << "handleSyntheticClick: node(" << nodeRespondingToClick << ") " << location); >- WKStartObservingContentChanges(); >- WKStartObservingDOMTimerScheduling(); >+ contentChangeObserver.startObservingContentChanges(); >+ contentChangeObserver.startObservingDOMTimerScheduling(); > > // FIXME: Pass caps lock state. > bool shiftKey = modifiers.contains(WebEvent::Modifier::ShiftKey); >@@ -552,8 +553,8 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F > mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap)); > mainframe.document()->updateStyleIfNeeded(); > >- WKStopObservingDOMTimerScheduling(); >- WKStopObservingContentChanges(); >+ contentChangeObserver.stopObservingDOMTimerScheduling(); >+ contentChangeObserver.stopObservingContentChanges(); > > m_pendingSyntheticClickNode = nullptr; > m_pendingSyntheticClickLocation = FloatPoint(); >@@ -562,7 +563,7 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F > if (m_isClosed) > return; > >- switch (WKObservedContentChange()) { >+ switch (contentChangeObserver.observedContentChange()) { > case WKContentVisibilityChange: > // The move event caused new contents to appear. Don't send the click event. > LOG(ContentObservation, "handleSyntheticClick: Observed meaningful visible change -> hover."); >@@ -588,7 +589,7 @@ void WebPage::completePendingSyntheticClickForContentChangeObserver() > if (!m_pendingSyntheticClickNode) > return; > // Only dispatch the click if the document didn't get changed by any timers started by the move event. >- if (WKObservedContentChange() == WKContentNoChange) { >+ if (m_page->contentChangeObserver().observedContentChange() == WKContentNoChange) { > LOG(ContentObservation, "No chage was observed -> click."); > completeSyntheticClick(m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation, m_pendingSyntheticClickModifiers, WebCore::OneFingerTap); > } else >diff --git a/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm b/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm >index 82501eb254f278c272b84c25af5aa4eb67da5bba..9e52eb64ec29132885472002dbcec6cd94638147 100644 >--- a/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm >+++ b/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm >@@ -44,6 +44,7 @@ > #import "WebView.h" > #import "WebViewInternal.h" > #import "WebViewPrivate.h" >+#import <WebCore/ContentChangeObserver.h> > #import <WebCore/DisabledAdaptations.h> > #import <WebCore/FileChooser.h> > #import <WebCore/FloatRect.h> >@@ -183,16 +184,21 @@ void WebChromeClientIOS::setNeedsScrollNotifications(WebCore::Frame& frame, bool > > void WebChromeClientIOS::observedContentChange(WebCore::Frame& frame) > { >- [[webView() _UIKitDelegateForwarder] webView:webView() didObserveDeferredContentChange:WKObservedContentChange() forFrame:kit(&frame)]; >+ if (!frame.page()) >+ return; >+ [[webView() _UIKitDelegateForwarder] webView:webView() didObserveDeferredContentChange:frame.page()->contentChangeObserver().observedContentChange() forFrame:kit(&frame)]; > } > > void WebChromeClientIOS::clearContentChangeObservers(WebCore::Frame& frame) > { >- ASSERT(WebThreadCountOfObservedDOMTimers() > 0); >- if (WebThreadCountOfObservedDOMTimers() > 0) { >- WebThreadClearObservedDOMTimers(); >- observedContentChange(frame); >- } >+ if (!frame.page()) >+ return; >+ auto& contentChangeObserver = frame.page()->contentChangeObserver(); >+ ASSERT(contentChangeObserver.countOfObservedDOMTimers()); >+ if (!contentChangeObserver.countOfObservedDOMTimers()) >+ return; >+ contentChangeObserver.clearObservedDOMTimers(); >+ observedContentChange(frame); > } > > static inline NSString *nameForViewportFitValue(ViewportFit value)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194977
:
362829
|
362882