Diff
Modified: trunk/LayoutTests/ChangeLog (239088 => 239089)
--- trunk/LayoutTests/ChangeLog 2018-12-11 21:54:20 UTC (rev 239088)
+++ trunk/LayoutTests/ChangeLog 2018-12-11 22:00:30 UTC (rev 239089)
@@ -1,5 +1,12 @@
2018-12-11 Chris Dumez <cdu...@apple.com>
+ Unreviewed, fix typos in console log from r239087.
+
+ * http/tests/events/device-orientation-motion-non-secure-context.html:
+ * platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt:
+
+2018-12-11 Chris Dumez <cdu...@apple.com>
+
Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
https://bugs.webkit.org/show_bug.cgi?id=192595
<rdar://problem/46382603>
Modified: trunk/LayoutTests/http/tests/events/device-orientation-motion-non-secure-context.html (239088 => 239089)
--- trunk/LayoutTests/http/tests/events/device-orientation-motion-non-secure-context.html 2018-12-11 21:54:20 UTC (rev 239088)
+++ trunk/LayoutTests/http/tests/events/device-orientation-motion-non-secure-context.html 2018-12-11 22:00:30 UTC (rev 239089)
@@ -27,7 +27,7 @@
debug("* Registering device motion listener");
addEventListener("devicemotion", function() { });
internals.postTask(() => {
- shouldBeEqualToString("lastConsoleMessage", "Blocked attempt add device motion or orientation listener because the browsing context is not secure.");
+ shouldBeEqualToString("lastConsoleMessage", "Blocked attempt to add a device motion or orientation listener because the browsing context is not secure.");
finishJSTest();
});
}
@@ -44,7 +44,7 @@
debug("* Registering device orientation listener");
addEventListener("deviceorientation", function() { });
internals.postTask(() => {
- shouldBeEqualToString("lastConsoleMessage", "Blocked attempt add device motion or orientation listener because the browsing context is not secure.");
+ shouldBeEqualToString("lastConsoleMessage", "Blocked attempt to add a device motion or orientation listener because the browsing context is not secure.");
runDeviceMotionTest();
});
}
Modified: trunk/LayoutTests/platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt (239088 => 239089)
--- trunk/LayoutTests/platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt 2018-12-11 21:54:20 UTC (rev 239088)
+++ trunk/LayoutTests/platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt 2018-12-11 22:00:30 UTC (rev 239089)
@@ -1,5 +1,5 @@
-CONSOLE MESSAGE: line 45: Blocked attempt add device motion or orientation listener because the browsing context is not secure.
-CONSOLE MESSAGE: line 28: Blocked attempt add device motion or orientation listener because the browsing context is not secure.
+CONSOLE MESSAGE: line 45: Blocked attempt to add a device motion or orientation listener because the browsing context is not secure.
+CONSOLE MESSAGE: line 28: Blocked attempt to add a device motion or orientation listener because the browsing context is not secure.
Tests that trying to set an event listener for deviceorientation and deviceorientation logs an error in non-secure contexts.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -6,10 +6,10 @@
* Registering device orientation listener
-PASS lastConsoleMessage is "Blocked attempt add device motion or orientation listener because the browsing context is not secure."
+PASS lastConsoleMessage is "Blocked attempt to add a device motion or orientation listener because the browsing context is not secure."
* Registering device motion listener
-PASS lastConsoleMessage is "Blocked attempt add device motion or orientation listener because the browsing context is not secure."
+PASS lastConsoleMessage is "Blocked attempt to add a device motion or orientation listener because the browsing context is not secure."
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/Source/WebCore/ChangeLog (239088 => 239089)
--- trunk/Source/WebCore/ChangeLog 2018-12-11 21:54:20 UTC (rev 239088)
+++ trunk/Source/WebCore/ChangeLog 2018-12-11 22:00:30 UTC (rev 239089)
@@ -1,3 +1,10 @@
+2018-12-11 Chris Dumez <cdu...@apple.com>
+
+ Unreviewed, fix typos in console log from r239087.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+
2018-12-11 Tim Horton <timothy_hor...@apple.com>
WebCore shouldn't have a Objective-C class named NSCursor
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (239088 => 239089)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2018-12-11 21:54:20 UTC (rev 239088)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2018-12-11 22:00:30 UTC (rev 239089)
@@ -1831,9 +1831,9 @@
document()->deviceMotionController()->addDeviceEventListener(this);
} else if (document()) {
if (isSecureContext())
- document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt add device motion or orientation listener from child frame that wasn't the same security origin as the main page."_s);
+ document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt to add a device motion or orientation listener from child frame that wasn't the same security origin as the main page."_s);
else
- document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt add device motion or orientation listener because the browsing context is not secure."_s);
+ document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt to add a device motion or orientation listener because the browsing context is not secure."_s);
}
}
#else
@@ -1842,7 +1842,7 @@
if (DeviceMotionController* controller = DeviceMotionController::from(page()))
controller->addDeviceEventListener(this);
} else if (document())
- document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt add device motion listener from child frame that wasn't the same security origin as the main page."_s);
+ document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt to add a device motion listener from child frame that wasn't the same security origin as the main page."_s);
} else if (eventType == eventNames().deviceorientationEvent) {
if (isSameSecurityOriginAsMainFrame() && isSecureContext()) {
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
@@ -1849,9 +1849,9 @@
controller->addDeviceEventListener(this);
} else if (document()) {
if (isSecureContext())
- document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt add device orientation listener from child frame that wasn't the same security origin as the main page."_s);
+ document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt to add a device orientation listener from child frame that wasn't the same security origin as the main page."_s);
else
- document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt add device motion or orientation listener because the browsing context is not secure."_s);
+ document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "Blocked attempt to add a device motion or orientation listener because the browsing context is not secure."_s);
}
}
#endif // PLATFORM(IOS_FAMILY)