Changeset 288707 in webkit
- Timestamp:
- Jan 27, 2022 3:24:19 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-fully-active.https-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/geolocation/Geolocation.cpp (modified) (3 diffs)
-
Source/WebCore/dom/TaskSource.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r288701 r288707 1 2022-01-27 Chris Dumez <cdumez@apple.com> 2 3 Geolocation API should callback with error if doc is not fully active 4 https://bugs.webkit.org/show_bug.cgi?id=228319 5 <rdar://problem/81450315> 6 7 Reviewed by Ryosuke Niwa. 8 9 Update existing layout tests to reflect behavior change. 10 11 * fast/dom/Geolocation/disconnected-frame-already-expected.txt: 12 * fast/dom/Geolocation/disconnected-frame-already.html: 13 Aligns test assertions with the spec. Gecko also passes it. 14 15 * TestExpectations: Unskip the WPT test. 16 1 17 2022-01-27 Kate Cheney <katherine_cheney@apple.com> 2 18 -
trunk/LayoutTests/TestExpectations
r288701 r288707 530 530 imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_allow.https.html [ Skip ] 531 531 imported/w3c/web-platform-tests/geolocation-API/getCurrentPosition_permission_deny.https.html [ Skip ] 532 imported/w3c/web-platform-tests/geolocation-API/non-fully-active.https.html [ Skip ]533 532 imported/w3c/web-platform-tests/geolocation-API/watchPosition_permission_deny.https.html [ Skip ] 534 533 imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-origin-idna.sub.window.html [ Skip ] -
trunk/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt
r288024 r288707 5 5 6 6 Method called on Geolocation object with disconnected Frame. 7 PASS successCallbackInvoked is false 8 PASS positionError.code is GeolocationPositionError.POSITION_UNAVAILABLE 9 PASS positionError.message is 'Document is not fully active' 7 10 PASS successfullyParsed is true 8 11 -
trunk/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html
r288024 r288707 18 18 } 19 19 20 var error;20 window.successCallbackInvoked = false; 21 21 function onSecondIframeLoaded() { 22 22 iframeGeolocation.getCurrentPosition(function () { 23 testFailed('Success callback invoked unexpectedly'); 24 finishJSTest(); 23 window.successCallbackInvoked = true; 25 24 }, function(e) { 26 testFailed('Error callback invoked'); 27 finishJSTest(); 25 window.positionError = e; 28 26 }); 29 27 setTimeout(finishTest, 1000); … … 32 30 function finishTest() { 33 31 debug('Method called on Geolocation object with disconnected Frame.'); 32 shouldBe("successCallbackInvoked", "false"); 33 shouldBe("positionError.code", "GeolocationPositionError.POSITION_UNAVAILABLE"); 34 shouldBe("positionError.message", "'Document is not fully active'"); 34 35 finishJSTest(); 35 36 } -
trunk/LayoutTests/imported/w3c/ChangeLog
r288701 r288707 1 2022-01-27 Chris Dumez <cdumez@apple.com> 2 3 Geolocation API should callback with error if doc is not fully active 4 https://bugs.webkit.org/show_bug.cgi?id=228319 5 <rdar://problem/81450315> 6 7 Reviewed by Ryosuke Niwa. 8 9 * web-platform-tests/geolocation-API/non-fully-active.https-expected.txt: 10 Rebaseline WPT test that is now passing. 11 1 12 2022-01-27 Kate Cheney <katherine_cheney@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/geolocation-API/non-fully-active.https-expected.txt
r288024 r288707 1 1 2 Harness Error (TIMEOUT), message = null3 2 4 TIMEOUT non-fully active document behavior Test timed out 3 PASS non-fully active document behavior 5 4 -
trunk/Source/WebCore/ChangeLog
r288703 r288707 1 2022-01-27 Chris Dumez <cdumez@apple.com> 2 3 Geolocation API should callback with error if doc is not fully active 4 https://bugs.webkit.org/show_bug.cgi?id=228319 5 <rdar://problem/81450315> 6 7 Reviewed by Ryosuke Niwa. 8 9 Test: imported/w3c/web-platform-tests/geolocation-API/non-fully-active.https.html 10 11 * Modules/geolocation/Geolocation.cpp: 12 (WebCore::Geolocation::getCurrentPosition): 13 (WebCore::Geolocation::watchPosition): 14 Schedule a task to call the error callback if the document is not fully active, as 15 per the specification: 16 - https://github.com/w3c/geolocation-api/issues/96 17 - https://github.com/w3c/geolocation-api/pull/97 18 19 * dom/TaskSource.h: 20 As Geolocation task source for the HTML5 event loop, as per the Geolocation 21 specification. 22 1 23 2022-01-27 Andres Gonzalez <andresg_22@apple.com> 2 24 -
trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp
r288024 r288707 32 32 33 33 #include "Document.h" 34 #include "EventLoop.h" 34 35 #include "FeaturePolicy.h" 35 36 #include "Frame.h" … … 300 301 void Geolocation::getCurrentPosition(Ref<PositionCallback>&& successCallback, RefPtr<PositionErrorCallback>&& errorCallback, PositionOptions&& options) 301 302 { 302 if (!frame()) 303 return; 303 if (!document() || !document()->isFullyActive()) { 304 if (errorCallback && errorCallback->scriptExecutionContext()) { 305 errorCallback->scriptExecutionContext()->eventLoop().queueTask(TaskSource::Geolocation, [errorCallback] { 306 errorCallback->handleEvent(GeolocationPositionError::create(GeolocationPositionError::POSITION_UNAVAILABLE, "Document is not fully active"_s)); 307 }); 308 } 309 return; 310 } 304 311 305 312 auto notifier = GeoNotifier::create(*this, WTFMove(successCallback), WTFMove(errorCallback), WTFMove(options)); … … 311 318 int Geolocation::watchPosition(Ref<PositionCallback>&& successCallback, RefPtr<PositionErrorCallback>&& errorCallback, PositionOptions&& options) 312 319 { 313 if (!frame()) 320 if (!document() || !document()->isFullyActive()) { 321 if (errorCallback && errorCallback->scriptExecutionContext()) { 322 errorCallback->scriptExecutionContext()->eventLoop().queueTask(TaskSource::Geolocation, [errorCallback] { 323 errorCallback->handleEvent(GeolocationPositionError::create(GeolocationPositionError::POSITION_UNAVAILABLE, "Document is not fully active"_s)); 324 }); 325 } 314 326 return 0; 327 } 315 328 316 329 auto notifier = GeoNotifier::create(*this, WTFMove(successCallback), WTFMove(errorCallback), WTFMove(options)); -
trunk/Source/WebCore/dom/TaskSource.h
r288024 r288707 33 33 FileReading, 34 34 FontLoading, 35 Geolocation, 35 36 IdleTask, 36 37 IndexedDB,
Note: See TracChangeset
for help on using the changeset viewer.