Changeset 282282 in webkit


Ignore:
Timestamp:
Sep 10, 2021 11:32:56 AM (10 months ago)
Author:
commit-queue@webkit.org
Message:

[Web-Share] handle non-fully active documents
https://bugs.webkit.org/show_bug.cgi?id=230088

Patch by Marcos Caceres <Marcos Caceres> on 2021-09-10
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

  • web-platform-tests/web-share/resources/blank.html: Added.
  • web-platform-tests/web-share/test-fully-active.https-expected.txt: Added.
  • web-platform-tests/web-share/test-fully-active.https.html: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/web-share/test-fully-active.https.html

  • page/Navigator.cpp:

(WebCore::Navigator::canShare):
(WebCore::Navigator::share):

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r282281 r282282  
     12021-09-10  Marcos Caceres  <marcos@marcosc.com>
     2
     3        [Web-Share] handle non-fully active documents
     4        https://bugs.webkit.org/show_bug.cgi?id=230088
     5
     6        Reviewed by Darin Adler.
     7
     8        * web-platform-tests/web-share/resources/blank.html: Added.
     9        * web-platform-tests/web-share/test-fully-active.https-expected.txt: Added.
     10        * web-platform-tests/web-share/test-fully-active.https.html: Added.
     11
    1122021-09-10  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r282281 r282282  
     12021-09-10  Marcos Caceres  <marcos@marcosc.com>
     2
     3        [Web-Share] handle non-fully active documents
     4        https://bugs.webkit.org/show_bug.cgi?id=230088
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: imported/w3c/web-platform-tests/web-share/test-fully-active.https.html
     9
     10        * page/Navigator.cpp:
     11        (WebCore::Navigator::canShare):
     12        (WebCore::Navigator::share):
     13
    1142021-09-10  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/page/Navigator.cpp

    r281126 r282282  
    127127bool Navigator::canShare(Document& document, const ShareData& data)
    128128{
    129     auto* frame = this->frame();
    130     if (!frame || !frame->page())
     129    if (!document.isFullyActive())
    131130        return false;
    132131
     
    144143void Navigator::share(Document& document, const ShareData& data, Ref<DeferredPromise>&& promise)
    145144{
     145    if (!document.isFullyActive()) {
     146        promise->reject(InvalidStateError);
     147        return;
     148    }
     149
    146150    if (m_hasPendingShare) {
    147151        promise->reject(NotAllowedError);
Note: See TracChangeset for help on using the changeset viewer.