Changeset 205134 in webkit


Ignore:
Timestamp:
Aug 29, 2016 12:07:59 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Image Loader should use FetchOptions::mode according its crossOrigin attribute
https://bugs.webkit.org/show_bug.cgi?id=161309

Patch by Youenn Fablet <youenn@apple.com> on 2016-08-29
Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/security/load-image-after-redirection.html

  • loader/ImageLoader.cpp:

(WebCore::ImageLoader::updateFromElement): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.

LayoutTests:

  • http/tests/security/load-image-after-redirection-expected.txt: Added.
  • http/tests/security/load-image-after-redirection.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205126 r205134  
     12016-08-29  Youenn Fablet  <youenn@apple.com>
     2
     3        Image Loader should use FetchOptions::mode according its crossOrigin attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=161309
     5
     6        Reviewed by Darin Adler.
     7
     8        * http/tests/security/load-image-after-redirection-expected.txt: Added.
     9        * http/tests/security/load-image-after-redirection.html: Added.
     10
    1112016-08-29  Jiewen Tan  <jiewen_tan@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r205133 r205134  
     12016-08-29  Youenn Fablet  <youenn@apple.com>
     2
     3        Image Loader should use FetchOptions::mode according its crossOrigin attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=161309
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: http/tests/security/load-image-after-redirection.html
     9
     10        * loader/ImageLoader.cpp:
     11        (WebCore::ImageLoader::updateFromElement): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.
     12
    1132016-08-29  Frederic Wang  <fwang@igalia.com>
    214
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r204014 r205134  
    180180        request.setInitiator(&element());
    181181
    182         String crossOriginMode = element().attributeWithoutSynchronization(HTMLNames::crossoriginAttr);
    183         if (!crossOriginMode.isNull()) {
    184             StoredCredentials allowCredentials = equalLettersIgnoringASCIICase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
    185             ASSERT(document.securityOrigin());
    186             updateRequestForAccessControl(request.mutableResourceRequest(), *document.securityOrigin(), allowCredentials);
    187         }
     182        request.setAsPotentiallyCrossOrigin(element().attributeWithoutSynchronization(HTMLNames::crossoriginAttr), document);
    188183
    189184        if (m_loadManually) {
Note: See TracChangeset for help on using the changeset viewer.