Diff
Modified: trunk/LayoutTests/ChangeLog (208982 => 208983)
--- trunk/LayoutTests/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/LayoutTests/ChangeLog 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,3 +1,16 @@
+2016-11-26 Sam Weinig <[email protected]>
+
+ Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
+ https://bugs.webkit.org/show_bug.cgi?id=164965
+
+ Reviewed by Simon Fraser.
+
+ * intersection-observer/intersection-observer-entry-interface.html:
+ * intersection-observer/intersection-observer-interface.html:
+ * resources/testharnessreport.js:
+ Switch from enabling IntersectionObserver via internals.settings to using
+ comment header switches.
+
2016-11-26 Simon Fraser <[email protected]>
Composited negative z-index elements are hidden behind the body sometimes
Modified: trunk/LayoutTests/intersection-observer/intersection-observer-entry-interface.html (208982 => 208983)
--- trunk/LayoutTests/intersection-observer/intersection-observer-entry-interface.html 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/LayoutTests/intersection-observer/intersection-observer-entry-interface.html 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ enableIntersectionObserver=true ] -->
<head>
<title>IntersectionObserverEntry interface tests.</title>
<link rel="author" title="Simon Fraser" href="" />
Modified: trunk/LayoutTests/intersection-observer/intersection-observer-interface.html (208982 => 208983)
--- trunk/LayoutTests/intersection-observer/intersection-observer-interface.html 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/LayoutTests/intersection-observer/intersection-observer-interface.html 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ enableIntersectionObserver=true ] -->
<head>
<title>IntersectionObserver interface tests.</title>
<link rel="author" title="Simon Fraser" href="" />
Modified: trunk/LayoutTests/resources/testharnessreport.js (208982 => 208983)
--- trunk/LayoutTests/resources/testharnessreport.js 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/LayoutTests/resources/testharnessreport.js 2016-11-27 04:21:49 UTC (rev 208983)
@@ -90,6 +90,5 @@
if (window.internals) {
internals.setResourceTimingSupport(true);
- internals.settings.setIntersectionObserverEnabled(true);
}
}
Modified: trunk/Source/_javascript_Core/ChangeLog (208982 => 208983)
--- trunk/Source/_javascript_Core/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,3 +1,13 @@
+2016-11-26 Sam Weinig <[email protected]>
+
+ Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
+ https://bugs.webkit.org/show_bug.cgi?id=164965
+
+ Reviewed by Simon Fraser.
+
+ * runtime/CommonIdentifiers.h:
+ Add identifiers needed for RuntimeEnabledFeatures.
+
2016-11-23 Zan Dobersek <[email protected]>
Remove ENABLE_ASSEMBLER_WX_EXCLUSIVE code
Modified: trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h (208982 => 208983)
--- trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -64,6 +64,8 @@
macro(IDBVersionChangeEvent) \
macro(Infinity) \
macro(InputEvent) \
+ macro(IntersectionObserver) \
+ macro(IntersectionObserverEntry) \
macro(Intl) \
macro(JSON) \
macro(Loader) \
Modified: trunk/Source/WebCore/ChangeLog (208982 => 208983)
--- trunk/Source/WebCore/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebCore/ChangeLog 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,3 +1,24 @@
+2016-11-26 Sam Weinig <[email protected]>
+
+ Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
+ https://bugs.webkit.org/show_bug.cgi?id=164965
+
+ Reviewed by Simon Fraser.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore::RuntimeEnabledFeatures::reset):
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::setIntersectionObserverEnabled):
+ (WebCore::RuntimeEnabledFeatures::intersectionObserverEnabled):
+ Add intersection observer setting.
+
+ * page/IntersectionObserver.idl:
+ * page/IntersectionObserverEntry.idl:
+ Convert to use EnabledAtRuntime extended attribute.
+
+ * page/Settings.in:
+ Remove the old intersection observer setting.
+
2016-11-26 Simon Fraser <[email protected]>
Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp (208982 => 208983)
--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp 2016-11-27 04:21:49 UTC (rev 208983)
@@ -109,7 +109,9 @@
#if ENABLE(CSS_GRID_LAYOUT)
m_cssGridLayoutEnabled = true;
#endif
-
+#if ENABLE(INTERSECTION_OBSERVER)
+ m_intersectionObserverEnabled = false;
+#endif
}
RuntimeEnabledFeatures& RuntimeEnabledFeatures::sharedFeatures()
Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (208982 => 208983)
--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -227,6 +227,11 @@
bool isCSSGridLayoutEnabled() const { return m_cssGridLayoutEnabled; }
#endif
+#if ENABLE(INTERSECTION_OBSERVER)
+ void setIntersectionObserverEnabled(bool isEnabled) { m_intersectionObserverEnabled = isEnabled; }
+ bool intersectionObserverEnabled() const { return m_intersectionObserverEnabled; }
+#endif
+
void setModernMediaControlsEnabled(bool areEnabled) { m_areModernMediaControlsEnabled = areEnabled; }
bool modernMediaControlsEnabled() const { return m_areModernMediaControlsEnabled; }
@@ -353,6 +358,10 @@
bool m_encryptedMediaAPIEnabled { false };
#endif
+#if ENABLE(INTERSECTION_OBSERVER)
+ bool m_intersectionObserverEnabled { false };
+#endif
+
friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
};
Modified: trunk/Source/WebCore/page/IntersectionObserver.idl (208982 => 208983)
--- trunk/Source/WebCore/page/IntersectionObserver.idl 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebCore/page/IntersectionObserver.idl 2016-11-27 04:21:49 UTC (rev 208983)
@@ -29,7 +29,7 @@
Conditional=INTERSECTION_OBSERVER,
Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
ImplementationLacksVTable,
- EnabledBySetting=IntersectionObserver
+ EnabledAtRuntime=IntersectionObserver
] interface IntersectionObserver {
readonly attribute Element? root;
readonly attribute DOMString rootMargin;
Modified: trunk/Source/WebCore/page/IntersectionObserverEntry.idl (208982 => 208983)
--- trunk/Source/WebCore/page/IntersectionObserverEntry.idl 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebCore/page/IntersectionObserverEntry.idl 2016-11-27 04:21:49 UTC (rev 208983)
@@ -31,7 +31,7 @@
Conditional=INTERSECTION_OBSERVER,
Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit),
ImplementationLacksVTable,
- EnabledBySetting=IntersectionObserver
+ EnabledAtRuntime=IntersectionObserver
] interface IntersectionObserverEntry {
readonly attribute DOMHighResTimeStamp time;
readonly attribute DOMRectReadOnly rootBounds;
Modified: trunk/Source/WebCore/page/Settings.in (208982 => 208983)
--- trunk/Source/WebCore/page/Settings.in 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebCore/page/Settings.in 2016-11-27 04:21:49 UTC (rev 208983)
@@ -279,7 +279,6 @@
# Runtime-enabled features
visualViewportEnabled initial=false, setNeedsStyleRecalcInAllFrames=1
-intersectionObserverEnabled initial=false
inputEventsEnabled initial=true
Modified: trunk/Source/WebKit/mac/ChangeLog (208982 => 208983)
--- trunk/Source/WebKit/mac/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,3 +1,19 @@
+2016-11-26 Sam Weinig <[email protected]>
+
+ Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
+ https://bugs.webkit.org/show_bug.cgi?id=164965
+
+ Reviewed by Simon Fraser.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences intersectionObserverEnabled]):
+ (-[WebPreferences setIntersectionObserverEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+ Add a preference, defaulting to off, for enabling IntersectionObserver.
+
2016-11-22 Dan Bernstein <[email protected]>
[Mac] In Legacy WebKit, pressing an arrow key in editable content doesn’t hide the mouse cursor
Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (208982 => 208983)
--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -216,6 +216,6 @@
#define WebKitMediaDataLoadsAutomaticallyPreferenceKey @"WebKitMediaDataLoadsAutomatically"
#define WebKitMockCaptureDevicesEnabledPreferenceKey @"WebKitMockCaptureDevicesEnabled"
#define WebKitMediaCaptureRequiresSecureConnectionPreferenceKey @"WebKitMediaCaptureRequiresSecureConnection"
-
#define WebKitAttachmentElementEnabledPreferenceKey @"WebKitAttachmentElementEnabled"
+#define WebKitIntersectionObserverEnabledPreferenceKey @"WebKitIntersectionObserverEnabled"
Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (208982 => 208983)
--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2016-11-27 04:21:49 UTC (rev 208983)
@@ -2849,6 +2849,16 @@
[self _setBoolValue:flag forKey:WebKitModernMediaControlsEnabledPreferenceKey];
}
+- (BOOL)intersectionObserverEnabled
+{
+ return [self _boolValueForKey:WebKitIntersectionObserverEnabledPreferenceKey];
+}
+
+- (void)setIntersectionObserverEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitIntersectionObserverEnabledPreferenceKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (208982 => 208983)
--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -518,6 +518,6 @@
@property (nonatomic) BOOL mediaDataLoadsAutomatically;
@property (nonatomic) BOOL attachmentElementEnabled;
@property (nonatomic) BOOL allowsInlineMediaPlaybackAfterFullscreen;
+@property (nonatomic) BOOL intersectionObserverEnabled;
-
@end
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (208982 => 208983)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2016-11-27 04:21:49 UTC (rev 208983)
@@ -2862,6 +2862,10 @@
RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsEnabled([preferences webAnimationsEnabled]);
#endif
+#if ENABLE(INTERSECTION_OBSERVER)
+ RuntimeEnabledFeatures::sharedFeatures().setIntersectionObserverEnabled(preferences.intersectionObserverEnabled);
+#endif
+
NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
if (timeout > 0)
settings.setIncrementalRenderingSuppressionTimeoutInSeconds(timeout);
Modified: trunk/Source/WebKit2/ChangeLog (208982 => 208983)
--- trunk/Source/WebKit2/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit2/ChangeLog 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,3 +1,19 @@
+2016-11-26 Sam Weinig <[email protected]>
+
+ Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
+ https://bugs.webkit.org/show_bug.cgi?id=164965
+
+ Reviewed by Simon Fraser.
+
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetIntersectionObserverEnabled):
+ (WKPreferencesGetIntersectionObserverEnabled):
+ * UIProcess/API/C/WKPreferencesRefPrivate.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+ Add a preference, defaulting to off, for enabling IntersectionObserver.
+
2016-11-26 Simon Fraser <[email protected]>
Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (208982 => 208983)
--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -237,6 +237,7 @@
macro(AsyncImageDecodingEnabled, asyncImageDecodingEnabled, Bool, bool, true, "", "") \
macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, true, "", "") \
macro(EncryptedMediaAPIEnabled, encryptedMediaAPIEnabled, Bool, bool, false, "", "") \
+ macro(IntersectionObserverEnabled, intersectionObserverEnabled, Bool, bool, false, "Intersection Observer", "Enable Intersection Observer support") \
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (208982 => 208983)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1551,6 +1551,16 @@
return toImpl(preferencesRef)->es6ModulesEnabled();
}
+void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setIntersectionObserverEnabled(flag);
+}
+
+bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->intersectionObserverEnabled();
+}
+
void WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef preferencesRef, bool flag)
{
toImpl(preferencesRef)->setSelectionPaintingWithoutSelectionGapsEnabled(flag);
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (208982 => 208983)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -442,6 +442,10 @@
WK_EXPORT void WKPreferencesSetES6ModulesEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetES6ModulesEnabled(WKPreferencesRef);
+// Defaults to false
+WK_EXPORT void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208982 => 208983)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-27 04:21:49 UTC (rev 208983)
@@ -3191,6 +3191,10 @@
RuntimeEnabledFeatures::sharedFeatures().setEncryptedMediaAPIEnabled(store.getBoolValueForKey(WebPreferencesKey::encryptedMediaAPIEnabledKey()));
#endif
+#if ENABLE(INTERSECTION_OBSERVER)
+ RuntimeEnabledFeatures::sharedFeatures().setIntersectionObserverEnabled(store.getBoolValueForKey(WebPreferencesKey::intersectionObserverEnabledKey()));
+#endif
+
platformPreferencesDidChange(store);
if (m_drawingArea)
Modified: trunk/Tools/ChangeLog (208982 => 208983)
--- trunk/Tools/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Tools/ChangeLog 2016-11-27 04:21:49 UTC (rev 208983)
@@ -1,3 +1,32 @@
+2016-11-26 Sam Weinig <[email protected]>
+
+ Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
+ https://bugs.webkit.org/show_bug.cgi?id=164965
+
+ Reviewed by Simon Fraser.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * DumpRenderTree/TestOptions.h: Added.
+ * DumpRenderTree/TestOptions.mm: Added.
+ (parseBooleanTestHeaderValue):
+ (TestOptions::TestOptions):
+ Port TestOption parsing from WKTR to DRT.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebPreferencesToConsistentValues):
+ (resetWebViewToConsistentStateBeforeTesting):
+ (runTest):
+ * WebKitTestRunner/TestController.cpp:
+ Pass TestOptions down to resetWebPreferencesToConsistentValues to allow setting
+ preferences conditionally.
+
+ (WTR::TestController::resetPreferencesToConsistentValues):
+ (WTR::updateTestOptionsFromTestHeader):
+ * WebKitTestRunner/TestOptions.h:
+ Add a new test option header, enableIntersectionObserver, to enable IntersectionObserver.
+
2016-11-26 Simon Fraser <[email protected]>
Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (208982 => 208983)
--- trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj 2016-11-27 04:21:49 UTC (rev 208983)
@@ -102,6 +102,7 @@
5DB9AC9E0F722C3600684641 /* WebKitWeightWatcher700.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */; };
5DB9AC9F0F722C3600684641 /* WebKitWeightWatcher800.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */; };
5DB9ACA00F722C3600684641 /* WebKitWeightWatcher900.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */; };
+ 7CBBC3231DDFCF9A00786B9D /* TestOptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CBBC3211DDFCF9A00786B9D /* TestOptions.mm */; };
80045AEE147718E7008290A8 /* AccessibilityNotificationHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 80045AEC147718E7008290A8 /* AccessibilityNotificationHandler.mm */; };
8465E2C70FFA8DF2003B8342 /* PixelDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */; };
9830F31F15C81181005AB206 /* DumpRenderTreeCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9830F31E15C81181005AB206 /* DumpRenderTreeCommon.cpp */; };
@@ -321,6 +322,8 @@
53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CyclicRedundancyCheck.cpp; sourceTree = "<group>"; };
53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicRedundancyCheck.h; sourceTree = "<group>"; };
5DE8AE4313A2C15800D6A37D /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7CBBC3211DDFCF9A00786B9D /* TestOptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestOptions.mm; sourceTree = "<group>"; };
+ 7CBBC3221DDFCF9A00786B9D /* TestOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestOptions.h; sourceTree = "<group>"; };
80045AEB147718E7008290A8 /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessibilityNotificationHandler.h; path = mac/AccessibilityNotificationHandler.h; sourceTree = "<group>"; };
80045AEC147718E7008290A8 /* AccessibilityNotificationHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityNotificationHandler.mm; path = mac/AccessibilityNotificationHandler.mm; sourceTree = "<group>"; };
8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
@@ -489,6 +492,8 @@
A134E52F188FC27000901D06 /* DumpRenderTreeMain.mm */,
A8B91BF70CF522B4008F91FF /* CheckedMalloc.cpp */,
A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */,
+ 7CBBC3211DDFCF9A00786B9D /* TestOptions.mm */,
+ 7CBBC3221DDFCF9A00786B9D /* TestOptions.h */,
BC4741290D038A4C0072B006 /* _javascript_Threading.h */,
BCA18C0A0C9B59EF00114369 /* DumpRenderTreeMac.h */,
BCA18B730C9B08F100114369 /* DumpRenderTreeDraggingInfo.h */,
@@ -1145,6 +1150,7 @@
0F18E6EC1D6B9C070027E547 /* UIScriptContext.cpp in Sources */,
0F18E6ED1D6B9C070027E547 /* UIScriptController.cpp in Sources */,
0F18E70D1D6BAC8C0027E547 /* UIScriptControllerIOS.mm in Sources */,
+ 7CBBC3231DDFCF9A00786B9D /* TestOptions.mm in Sources */,
0F18E70F1D6BACB60027E547 /* UIScriptControllerMac.mm in Sources */,
4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */,
440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */,
Copied: trunk/Tools/DumpRenderTree/TestOptions.h (from rev 208982, trunk/Tools/WebKitTestRunner/TestOptions.h) (0 => 208983)
--- trunk/Tools/DumpRenderTree/TestOptions.h (rev 0)
+++ trunk/Tools/DumpRenderTree/TestOptions.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2016 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
+
+struct TestOptions {
+ bool enableIntersectionObserver { false };
+
+ TestOptions(NSURL *testURL);
+};
Added: trunk/Tools/DumpRenderTree/TestOptions.mm (0 => 208983)
--- trunk/Tools/DumpRenderTree/TestOptions.mm (rev 0)
+++ trunk/Tools/DumpRenderTree/TestOptions.mm 2016-11-27 04:21:49 UTC (rev 208983)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#include "config.h"
+#include "TestOptions.h"
+
+#include <fstream>
+#include <string>
+
+static bool parseBooleanTestHeaderValue(const std::string& value)
+{
+ if (value == "true")
+ return true;
+ if (value == "false")
+ return false;
+
+ NSLog(@"Found unexpected value '%s' for boolean option. Expected 'true' or 'false'.", value.c_str());
+ return false;
+}
+
+TestOptions::TestOptions(NSURL *testURL)
+{
+ if (![testURL isFileURL])
+ return;
+
+ std::string path = [testURL fileSystemRepresentation];
+
+ std::string options;
+ std::ifstream testFile(path.data());
+ if (!testFile.good())
+ return;
+ getline(testFile, options);
+ std::string beginString("webkit-test-runner [ ");
+ std::string endString(" ]");
+ size_t beginLocation = options.find(beginString);
+ if (beginLocation == std::string::npos)
+ return;
+ size_t endLocation = options.find(endString, beginLocation);
+ if (endLocation == std::string::npos) {
+ NSLog(@"Could not find end of test header in %s", path.c_str());
+ return;
+ }
+ std::string pairString = options.substr(beginLocation + beginString.size(), endLocation - (beginLocation + beginString.size()));
+ size_t pairStart = 0;
+ while (pairStart < pairString.size()) {
+ size_t pairEnd = pairString.find(" ", pairStart);
+ if (pairEnd == std::string::npos)
+ pairEnd = pairString.size();
+ size_t equalsLocation = pairString.find("=", pairStart);
+ if (equalsLocation == std::string::npos) {
+ NSLog(@"Malformed option in test header (could not find '=' character) in %s", path.c_str());
+ break;
+ }
+ auto key = pairString.substr(pairStart, equalsLocation - pairStart);
+ auto value = pairString.substr(equalsLocation + 1, pairEnd - (equalsLocation + 1));
+ if (key == "enableIntersectionObserver")
+ this->enableIntersectionObserver = parseBooleanTestHeaderValue(value);
+ pairStart = pairEnd + 1;
+ }
+}
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (208982 => 208983)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2016-11-27 04:21:49 UTC (rev 208983)
@@ -49,6 +49,7 @@
#import "PixelDumpSupport.h"
#import "PolicyDelegate.h"
#import "ResourceLoadDelegate.h"
+#import "TestOptions.h"
#import "TestRunner.h"
#import "UIDelegate.h"
#import "WebArchiveDumpSupport.h"
@@ -895,7 +896,7 @@
}
// Called before each test.
-static void resetWebPreferencesToConsistentValues()
+static void resetWebPreferencesToConsistentValues(const TestOptions& options)
{
WebPreferences *preferences = [WebPreferences standardPreferences];
@@ -999,6 +1000,8 @@
[preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
[preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
+ preferences.intersectionObserverEnabled = options.enableIntersectionObserver;
+
[WebPreferences _clearNetworkLoaderSession];
[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
}
@@ -1818,7 +1821,7 @@
}
#endif
-static void resetWebViewToConsistentStateBeforeTesting()
+static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& options)
{
WebView *webView = [mainFrame webView];
#if PLATFORM(IOS)
@@ -1851,7 +1854,7 @@
[WebCache clearCachedCredentials];
- resetWebPreferencesToConsistentValues();
+ resetWebPreferencesToConsistentValues(options);
TestRunner::setSerializeHTTPLoads(false);
TestRunner::setAllowsAnySSLCertificate(false);
@@ -1985,9 +1988,11 @@
NSString *informationString = [@"CRASHING TEST: " stringByAppendingString:testPath];
WKSetCrashReportApplicationSpecificInformation((CFStringRef)informationString);
+ TestOptions options(url);
+ resetWebViewToConsistentStateBeforeTesting(options);
+
const char* testURL([[url absoluteString] UTF8String]);
-
- resetWebViewToConsistentStateBeforeTesting();
+
#if !PLATFORM(IOS)
changeWindowScaleIfNeeded(testURL);
#endif
@@ -2096,7 +2101,7 @@
}
}
- resetWebViewToConsistentStateBeforeTesting();
+ resetWebViewToConsistentStateBeforeTesting(options);
// Loading an empty request synchronously replaces the document with a blank one, which is necessary
// to stop timers, WebSockets and other activity that could otherwise spill output into next test's results.
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (208982 => 208983)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2016-11-27 04:21:49 UTC (rev 208983)
@@ -649,6 +649,7 @@
WKPreferencesSetInteractiveFormValidationEnabled(preferences, true);
WKPreferencesSetMockScrollbarsEnabled(preferences, options.useMockScrollbars);
WKPreferencesSetNeedsSiteSpecificQuirks(preferences, options.needsSiteSpecificQuirks);
+ WKPreferencesSetIntersectionObserverEnabled(preferences, options.enableIntersectionObserver);
static WKStringRef defaultTextEncoding = WKStringCreateWithUTF8CString("ISO-8859-1");
WKPreferencesSetDefaultTextEncodingName(preferences, defaultTextEncoding);
@@ -954,6 +955,8 @@
testOptions.ignoresViewportScaleLimits = parseBooleanTestHeaderValue(value);
if (key == "useCharacterSelectionGranularity")
testOptions.useCharacterSelectionGranularity = parseBooleanTestHeaderValue(value);
+ if (key == "enableIntersectionObserver")
+ testOptions.enableIntersectionObserver = parseBooleanTestHeaderValue(value);
pairStart = pairEnd + 1;
}
}
Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (208982 => 208983)
--- trunk/Tools/WebKitTestRunner/TestOptions.h 2016-11-27 02:27:55 UTC (rev 208982)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h 2016-11-27 04:21:49 UTC (rev 208983)
@@ -43,6 +43,7 @@
bool needsSiteSpecificQuirks { false };
bool ignoresViewportScaleLimits { false };
bool useCharacterSelectionGranularity { false };
+ bool enableIntersectionObserver { false };
float deviceScaleFactor { 1 };
Vector<String> overrideLanguages;