Diff
Modified: trunk/Source/WTF/ChangeLog (281727 => 281728)
--- trunk/Source/WTF/ChangeLog 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WTF/ChangeLog 2021-08-28 00:25:24 UTC (rev 281728)
@@ -1,3 +1,16 @@
+2021-08-27 Simon Fraser <[email protected]>
+
+ Define ENABLE_CONTENT_CHANGE_OBSERVER for IOS_FAMILY and use it to wrap content observation code
+ https://bugs.webkit.org/show_bug.cgi?id=229624
+
+ Reviewed by Alan Bujtas.
+
+ Deploy ENABLE(CONTENT_CHANGE_OBSERVER).
+
+ * Scripts/Preferences/WebPreferences.yaml:
+ * wtf/PlatformEnable.h:
+ * wtf/PlatformEnableCocoa.h:
+
2021-08-27 Eric Carlson <[email protected]>
[ Catalina EWS ] media/track/track-disabled-addcue.html is flaky crashing
Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (281727 => 281728)
--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml 2021-08-28 00:25:24 UTC (rev 281728)
@@ -460,7 +460,7 @@
ContentChangeObserverEnabled:
type: bool
- condition: PLATFORM(IOS_FAMILY)
+ condition: ENABLE(CONTENT_CHANGE_OBSERVER)
defaultValue:
WebKitLegacy:
default: true
Modified: trunk/Source/WTF/wtf/PlatformEnable.h (281727 => 281728)
--- trunk/Source/WTF/wtf/PlatformEnable.h 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WTF/wtf/PlatformEnable.h 2021-08-28 00:25:24 UTC (rev 281728)
@@ -189,6 +189,10 @@
#define ENABLE_CHANNEL_MESSAGING 1
#endif
+#if !defined(ENABLE_CONTENT_CHANGE_OBSERVER)
+#define ENABLE_CONTENT_CHANGE_OBSERVER 0
+#endif
+
#if !defined(ENABLE_CONTENT_EXTENSIONS)
#define ENABLE_CONTENT_EXTENSIONS 0
#endif
Modified: trunk/Source/WTF/wtf/PlatformEnableCocoa.h (281727 => 281728)
--- trunk/Source/WTF/wtf/PlatformEnableCocoa.h 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WTF/wtf/PlatformEnableCocoa.h 2021-08-28 00:25:24 UTC (rev 281728)
@@ -135,6 +135,10 @@
#define ENABLE_CFPREFS_DIRECT_MODE 1
#endif
+#if !defined(ENABLE_CONTENT_CHANGE_OBSERVER) && PLATFORM(IOS_FAMILY)
+#define ENABLE_CONTENT_CHANGE_OBSERVER 1
+#endif
+
#if !defined(ENABLE_CONTENT_EXTENSIONS)
#define ENABLE_CONTENT_EXTENSIONS 1
#endif
Modified: trunk/Source/WebCore/ChangeLog (281727 => 281728)
--- trunk/Source/WebCore/ChangeLog 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/ChangeLog 2021-08-28 00:25:24 UTC (rev 281728)
@@ -1,3 +1,36 @@
+2021-08-27 Simon Fraser <[email protected]>
+
+ Define ENABLE_CONTENT_CHANGE_OBSERVER for IOS_FAMILY and use it to wrap content observation code
+ https://bugs.webkit.org/show_bug.cgi?id=229624
+
+ Reviewed by Alan Bujtas.
+
+ Deploy ENABLE(CONTENT_CHANGE_OBSERVER).
+
+ * dom/Document.cpp:
+ (WebCore::Document::updateStyleIfNeeded):
+ (WebCore::Document::willDetachPage):
+ (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
+ * dom/Document.h:
+ * dom/Node.cpp:
+ (WebCore::Node::defaultEventHandler):
+ * page/DOMTimer.cpp:
+ (WebCore::DOMTimer::install):
+ (WebCore::DOMTimer::removeById):
+ (WebCore::DOMTimer::fired):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::internalKeyEvent):
+ * page/ios/ContentChangeObserver.cpp:
+ * page/ios/ContentChangeObserver.h:
+ * page/ios/DOMTimerHoldingTank.cpp:
+ * page/ios/DOMTimerHoldingTank.h:
+ * page/ios/EventHandlerIOS.mm:
+ (WebCore::EventHandler::mouseMoved):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::willBeDestroyed):
+ * rendering/updating/RenderTreeUpdater.cpp:
+ (WebCore::RenderTreeUpdater::updateElementRenderer):
+
2021-08-27 Eric Carlson <[email protected]>
[ Catalina EWS ] media/track/track-disabled-addcue.html is flaky crashing
Modified: trunk/Source/WebCore/dom/Document.cpp (281727 => 281728)
--- trunk/Source/WebCore/dom/Document.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/dom/Document.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -289,10 +289,12 @@
#include "RenderFullScreen.h"
#endif
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "ContentChangeObserver.h"
-#include "CSSFontSelector.h"
#include "DOMTimerHoldingTank.h"
+#endif
+
+#if PLATFORM(IOS_FAMILY)
#include "DeviceMotionClientIOS.h"
#include "DeviceMotionController.h"
#include "DeviceOrientationClientIOS.h"
@@ -2194,7 +2196,7 @@
return false;
}
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
ContentChangeObserver::StyleRecalcScope observingScope(*this);
#endif
// The early exit above for !needsStyleRecalc() is needed when updateWidgetPositions() is called in runOrScheduleAsynchronousTasks().
@@ -2517,7 +2519,7 @@
void Document::willDetachPage()
{
FrameDestructionObserver::willDetachPage();
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
contentChangeObserver().willDetachPage();
#endif
if (domWindow() && frame())
@@ -2758,7 +2760,7 @@
void Document::platformSuspendOrStopActiveDOMObjects()
{
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
contentChangeObserver().didSuspendActiveDOMObjects();
#endif
}
@@ -8774,7 +8776,7 @@
}
#endif
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
ContentChangeObserver& Document::contentChangeObserver()
{
Modified: trunk/Source/WebCore/dom/Document.h (281727 => 281728)
--- trunk/Source/WebCore/dom/Document.h 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/dom/Document.h 2021-08-28 00:25:24 UTC (rev 281728)
@@ -113,10 +113,8 @@
class CharacterData;
class Comment;
class ConstantPropertyMap;
-class ContentChangeObserver;
class DOMImplementation;
class DOMSelection;
-class DOMTimerHoldingTank;
class DOMWindow;
class DOMWrapperWorld;
class Database;
@@ -241,6 +239,11 @@
class XPathNSResolver;
class XPathResult;
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
+class ContentChangeObserver;
+class DOMTimerHoldingTank;
+#endif
+
struct ApplicationManifest;
struct BoundaryPoint;
struct HighlightRangeData;
@@ -899,7 +902,9 @@
// Called when <meta name="apple-mobile-web-app-orientations"> changes.
void processWebAppOrientations();
+#endif
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
WEBCORE_EXPORT ContentChangeObserver& contentChangeObserver();
DOMTimerHoldingTank* domTimerHoldingTankIfExists() { return m_domTimerHoldingTank.get(); }
@@ -2197,7 +2202,7 @@
bool m_visibilityHiddenDueToDismissal { false };
Ref<UndoManager> m_undoManager;
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
std::unique_ptr<ContentChangeObserver> m_contentChangeObserver;
std::unique_ptr<DOMTimerHoldingTank> m_domTimerHoldingTank;
#endif
Modified: trunk/Source/WebCore/dom/Node.cpp (281727 => 281728)
--- trunk/Source/WebCore/dom/Node.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/dom/Node.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -86,7 +86,7 @@
#include <wtf/text/StringBuilder.h>
#include <wtf/text/TextStream.h>
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "ContentChangeObserver.h"
#endif
@@ -2485,11 +2485,13 @@
} else if (is<TouchEvent>(event) && eventNames().isTouchRelatedEventType(eventType, *this)) {
// Capture the target node's visibility state before dispatching touchStart.
if (is<Element>(*this) && eventType == eventNames().touchstartEvent) {
- auto& contentChangeObserver = document().contentChangeObserver();
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
+ auto& contentChangeObserver = document().contentChangeObserver();
if (ContentChangeObserver::isVisuallyHidden(*this))
contentChangeObserver.setHiddenTouchTarget(downcast<Element>(*this));
else
contentChangeObserver.resetHiddenTouchTarget();
+#endif
}
RenderObject* renderer = this->renderer();
Modified: trunk/Source/WebCore/page/DOMTimer.cpp (281727 => 281728)
--- trunk/Source/WebCore/page/DOMTimer.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/DOMTimer.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -41,7 +41,7 @@
#include <wtf/RandomNumber.h>
#include <wtf/StdLibExtras.h>
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "ContentChangeObserver.h"
#include "DOMTimerHoldingTank.h"
#endif
@@ -187,7 +187,7 @@
// Keep track of nested timer installs.
if (NestedTimersMap* nestedTimers = NestedTimersMap::instanceForContext(context))
nestedTimers->add(timer->m_timeoutId, timer.get());
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
if (is<Document>(context)) {
auto& document = downcast<Document>(context);
document.contentChangeObserver().didInstallDOMTimer(timer.get(), timeout, singleShot);
@@ -206,7 +206,7 @@
if (timeoutId <= 0)
return;
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
if (is<Document>(context)) {
auto& document = downcast<Document>(context);
if (auto* timer = document.findTimeout(timeoutId)) {
@@ -331,7 +331,7 @@
if (nestedTimers)
nestedTimers->startTracking();
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
ContentChangeObserver::DOMTimerScope observingScope(is<Document>(context) ? &downcast<Document>(context) : nullptr, *this);
#endif
m_action->execute(context);
Modified: trunk/Source/WebCore/page/EventHandler.cpp (281727 => 281728)
--- trunk/Source/WebCore/page/EventHandler.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -120,6 +120,10 @@
#include "PlatformTouchEventIOS.h"
#endif
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
+#include "DOMTimerHoldingTank.h"
+#endif
+
#if ENABLE(TOUCH_EVENTS)
#include "TouchEvent.h"
#include "TouchList.h"
@@ -137,10 +141,6 @@
#include "PointerLockController.h"
#endif
-#if PLATFORM(IOS_FAMILY)
-#include "DOMTimerHoldingTank.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -3621,7 +3621,7 @@
if (accessibilityPreventsEventPropagation(keydown))
keydown->stopPropagation();
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
DeferDOMTimersForScope deferralScope { m_frame.document()->quirks().needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand() };
#endif
Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp (281727 => 281728)
--- trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -25,7 +25,7 @@
#include "config.h"
#include "ContentChangeObserver.h"
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "Chrome.h"
#include "ChromeClient.h"
#include "DOMTimer.h"
@@ -725,4 +725,4 @@
}
-#endif // PLATFORM(IOS_FAMILY)
+#endif // ENABLE(CONTENT_CHANGE_OBSERVER)
Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.h (281727 => 281728)
--- trunk/Source/WebCore/page/ios/ContentChangeObserver.h 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.h 2021-08-28 00:25:24 UTC (rev 281728)
@@ -25,7 +25,7 @@
#pragma once
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "CSSPropertyNames.h"
#include "Document.h"
@@ -244,4 +244,4 @@
}
}
-#endif
+#endif // ENABLE(CONTENT_CHANGE_OBSERVER)
Modified: trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.cpp (281727 => 281728)
--- trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -26,7 +26,7 @@
#include "config.h"
#include "DOMTimerHoldingTank.h"
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
namespace WebCore {
@@ -77,4 +77,4 @@
} // namespace WebCore
-#endif // PLATFORM(IOS_FAMILY)
+#endif // ENABLE(CONTENT_CHANGE_OBSERVER)
Modified: trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h (281727 => 281728)
--- trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h 2021-08-28 00:25:24 UTC (rev 281728)
@@ -25,7 +25,7 @@
#pragma once
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "Timer.h"
#include <wtf/Forward.h>
@@ -72,4 +72,4 @@
} // namespace WebCore
-#endif // PLATFORM(IOS_FAMILY)
+#endif // ENABLE(CONTENT_CHANGE_OBSERVER)
Modified: trunk/Source/WebCore/page/ios/EventHandlerIOS.mm (281727 => 281728)
--- trunk/Source/WebCore/page/ios/EventHandlerIOS.mm 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/page/ios/EventHandlerIOS.mm 2021-08-28 00:25:24 UTC (rev 281728)
@@ -32,7 +32,6 @@
#import "AutoscrollController.h"
#import "Chrome.h"
#import "ChromeClient.h"
-#import "ContentChangeObserver.h"
#import "DataTransfer.h"
#import "DragState.h"
#import "EventNames.h"
@@ -54,6 +53,10 @@
#import <wtf/Noncopyable.h>
#import <wtf/SetForScope.h>
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
+#import "ContentChangeObserver.h"
+#endif
+
#if ENABLE(IOS_TOUCH_EVENTS)
#import <WebKitAdditions/EventHandlerIOSTouch.cpp>
#endif
@@ -510,15 +513,19 @@
document.updateStyleIfNeeded();
CurrentEventScope scope(event);
{
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
ContentChangeObserver::MouseMovedScope observingScope(document);
+#endif
event.wasHandled = mouseMoved(currentPlatformMouseEvent());
// Run style recalc to be able to capture content changes as the result of the mouse move event.
document.updateStyleIfNeeded();
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
callOnMainThread([protectedFrame = makeRef(m_frame)] {
// This is called by WebKitLegacy only.
if (auto* document = protectedFrame->document())
document->contentChangeObserver().willNotProceedWithFixedObservationTimeWindow();
});
+#endif
}
END_BLOCK_OBJC_EXCEPTIONS
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (281727 => 281728)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -27,9 +27,6 @@
#include "AXObjectCache.h"
#include "CachedResourceLoader.h"
-#if PLATFORM(IOS_FAMILY)
-#include "ContentChangeObserver.h"
-#endif
#include "ContentData.h"
#include "CursorList.h"
#include "DocumentTimeline.h"
@@ -89,6 +86,10 @@
#include <wtf/MathExtras.h>
#include <wtf/StackStats.h>
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
+#include "ContentChangeObserver.h"
+#endif
+
namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(RenderElement);
@@ -1057,7 +1058,7 @@
void RenderElement::willBeDestroyed()
{
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
if (!renderTreeBeingDestroyed() && element())
document().contentChangeObserver().rendererWillBeDestroyed(*element());
#endif
Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (281727 => 281728)
--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp 2021-08-28 00:25:24 UTC (rev 281728)
@@ -58,7 +58,7 @@
#include "LayoutTreeBuilder.h"
#endif
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
#include "ContentChangeObserver.h"
#endif
@@ -303,7 +303,7 @@
void RenderTreeUpdater::updateElementRenderer(Element& element, const Style::ElementUpdates& updates)
{
-#if PLATFORM(IOS_FAMILY)
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
ContentChangeObserver::StyleChangeScope observingScope(m_document, element);
#endif
Modified: trunk/Source/WebKit/ChangeLog (281727 => 281728)
--- trunk/Source/WebKit/ChangeLog 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebKit/ChangeLog 2021-08-28 00:25:24 UTC (rev 281728)
@@ -1,3 +1,15 @@
+2021-08-27 Simon Fraser <[email protected]>
+
+ Define ENABLE_CONTENT_CHANGE_OBSERVER for IOS_FAMILY and use it to wrap content observation code
+ https://bugs.webkit.org/show_bug.cgi?id=229624
+
+ Reviewed by Alan Bujtas.
+
+ Deploy ENABLE(CONTENT_CHANGE_OBSERVER).
+
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::platformWillPerformEditingCommand):
+
2021-08-27 Alex Christensen <[email protected]>
Add UIEventAttribution SPI that uses PrivateClickMeasurementAttributionEphemeral::Yes
Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (281727 => 281728)
--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2021-08-27 23:48:57 UTC (rev 281727)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2021-08-28 00:25:24 UTC (rev 281728)
@@ -352,10 +352,12 @@
void WebPage::platformWillPerformEditingCommand()
{
auto& frame = m_page->focusController().focusedOrMainFrame();
+#if ENABLE(CONTENT_CHANGE_OBSERVER)
if (auto* document = frame.document()) {
if (auto* holdingTank = document->domTimerHoldingTankIfExists())
holdingTank->removeAll();
}
+#endif
}
FloatSize WebPage::screenSize() const