Changeset 231910 in webkit
- Timestamp:
- May 17, 2018 11:16:56 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r231907 r231910 1 2018-05-17 Brent Fulgham <bfulgham@apple.com> 2 3 Storage Access API: Allow documents that have been granted storage access to also do a popup 4 https://bugs.webkit.org/show_bug.cgi?id=185615 5 <rdar://problem/39105791> 6 7 Reviewed by Chris Dumez. 8 9 * http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-pop-window-expected.txt: Added. 10 * http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-pop-window.html: Added. 11 * http/tests/storageAccess/resources/request-storage-access-iframe-and-pop-window.html: Added. 12 * http/tests/storageAccess/resources/request-storage-access-second-window.html: Added. 13 1 14 2018-05-17 Antoine Quint <graouts@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r231909 r231910 1 2018-05-17 Brent Fulgham <bfulgham@apple.com> 2 3 Storage Access API: Allow documents that have been granted storage access to also do a popup 4 https://bugs.webkit.org/show_bug.cgi?id=185615 5 <rdar://problem/39105791> 6 7 Reviewed by Chris Dumez. 8 9 * dom/Document.cpp: 10 (WebCore::Document::consumeTemporaryUserGesture): Added. Clear the document's active one-time user 11 activity (for window opening) state. 12 (WebCore::Document::enableTemporaryUserGesture): Added. Establish a new active one-time user 13 activity (for window opening) state. 14 (WebCore::Document::requestStorageAccess): If the user approves Storage Access, establish a new 15 UserInteraction scope, then resolve the promise. Also post a task to clear the one-time user 16 gesture state. 17 1 18 2018-05-17 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/dom/Document.cpp
r231849 r231910 123 123 #include "MediaQueryMatcher.h" 124 124 #include "MessageEvent.h" 125 #include "Microtasks.h" 125 126 #include "MouseEventWithHitTestResults.h" 126 127 #include "MutationEvent.h" … … 7610 7611 } 7611 7612 7612 page->chrome().client().requestStorageAccess(WTFMove(iframeHost), WTFMove(topHost), frameID.value(), pageID.value(), [documentReference = m_weakFactory.createWeakPtr(*this), promise = WTFMove(promise)] (bool wasGranted) {7613 page->chrome().client().requestStorageAccess(WTFMove(iframeHost), WTFMove(topHost), frameID.value(), pageID.value(), [documentReference = m_weakFactory.createWeakPtr(*this), promise = WTFMove(promise)] (bool wasGranted) mutable { 7613 7614 Document* document = documentReference.get(); 7614 7615 if (!document) … … 7617 7618 if (wasGranted) { 7618 7619 document->setHasFrameSpecificStorageAccess(true); 7620 MicrotaskQueue::mainThreadQueue().append(std::make_unique<VoidMicrotask>([documentReference = document->m_weakFactory.createWeakPtr(*document)] () { 7621 if (auto* document = documentReference.get()) 7622 document->enableTemporaryTimeUserGesture(); 7623 })); 7619 7624 promise->resolve(); 7625 MicrotaskQueue::mainThreadQueue().append(std::make_unique<VoidMicrotask>([documentReference = WTFMove(documentReference)] () { 7626 if (auto* document = documentReference.get()) 7627 document->consumeTemporaryTimeUserGesture(); 7628 })); 7620 7629 } else 7621 7630 promise->reject(); … … 7624 7633 promise->reject(); 7625 7634 #endif 7635 } 7636 7637 void Document::enableTemporaryTimeUserGesture() 7638 { 7639 m_temporaryUserGesture = std::make_unique<UserGestureIndicator>(ProcessingUserGesture, this); 7640 } 7641 7642 void Document::consumeTemporaryTimeUserGesture() 7643 { 7644 m_temporaryUserGesture = nullptr; 7626 7645 } 7627 7646 -
trunk/Source/WebCore/dom/Document.h
r231849 r231910 1430 1430 String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const URL&); 1431 1431 1432 void consumeTemporaryTimeUserGesture(); 1433 1432 1434 protected: 1433 1435 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; … … 1542 1544 1543 1545 bool domainIsRegisterable(const String&) const; 1546 1547 void enableTemporaryTimeUserGesture(); 1544 1548 1545 1549 const Ref<Settings> m_settings; … … 1920 1924 String m_primaryDomainRequestedPageSpecificStorageAccessWithUserInteraction { }; 1921 1925 #endif 1926 1927 std::unique_ptr<UserGestureIndicator> m_temporaryUserGesture; 1922 1928 }; 1923 1929
Note: See TracChangeset
for help on using the changeset viewer.