⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236970 in webkit


Ignore:
Timestamp:
Oct 9, 2018, 11:25:29 AM (8 years ago)
Author:
Chris Dumez
Message:

REGRESSION (Safari 12): Download of Blob URL fails
https://bugs.webkit.org/show_bug.cgi?id=190351
<rdar://problem/45091181>

Reviewed by Geoffrey Garen.

Source/WebCore:

When using both the download attribute and target="_blank" on an anchor element, we would
mistakenly drop the download attribute after the "new window" policy decision has been made.
As a result, we would try to load the blob instead of downloading it.

Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):

LayoutTests:

Add layout test coverage.

  • fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-expected.txt: Added.
  • fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r236963 r236970  
     12018-10-09  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (Safari 12): Download of Blob URL fails
     4        https://bugs.webkit.org/show_bug.cgi?id=190351
     5        <rdar://problem/45091181>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add layout test coverage.
     10
     11        * fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-expected.txt: Added.
     12        * fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html: Added.
     13
    1142018-10-09  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r236921 r236970  
    308308webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html [ Skip ]
    309309webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-file-blob-download.html [ Skip ]
     310webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html [ Skip ]
    310311webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html [ Skip ]
    311312webkit.org/b/156069 fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html [ Skip ]
  • trunk/LayoutTests/platform/win/TestExpectations

    r236954 r236970  
    456456fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html [ Skip ]
    457457fast/dom/HTMLAnchorElement/anchor-file-blob-download.html [ Skip ]
     458fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html [ Skip ]
    458459fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html [ Skip ]
    459460fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r236967 r236970  
     12018-10-09  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (Safari 12): Download of Blob URL fails
     4        https://bugs.webkit.org/show_bug.cgi?id=190351
     5        <rdar://problem/45091181>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        When using both the download attribute and target="_blank" on an anchor element, we would
     10        mistakenly drop the download attribute after the "new window" policy decision has been made.
     11        As a result, we would try to load the blob instead of downloading it.
     12
     13        Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html
     14
     15        * loader/FrameLoader.cpp:
     16        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
     17
    1182018-10-09  Alicia Boya García  <aboya@igalia.com>
    219
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r236927 r236970  
    33973397    }
    33983398
    3399     NavigationAction newAction { *frame->document(), request, InitiatedByMainFrame::Unknown, NavigationType::Other, action.shouldOpenExternalURLsPolicy() };
     3399    NavigationAction newAction { *frame->document(), request, InitiatedByMainFrame::Unknown, NavigationType::Other, action.shouldOpenExternalURLsPolicy(), nullptr, action.downloadAttribute() };
    34003400    mainFrame->loader().loadWithNavigationAction(request, WTFMove(newAction), LockHistory::No, FrameLoadType::Standard, formState, allowNavigationToInvalidURL);
    34013401}
Note: See TracChangeset for help on using the changeset viewer.