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

Changeset 269155 in webkit


Ignore:
Timestamp:
Oct 29, 2020, 10:53:22 AM (6 years ago)
Author:
Noam Rosenthal
Message:

REGRESSION(r268249): image-orientation:none is broken for local (file://) urls
https://bugs.webkit.org/show_bug.cgi?id=217808
<rdar://problem/70603407>

Reviewed by Myles C. Maxfield.

Source/WebCore:

Use isCORSSameOrigin() instead of isOriginClean(), it's a more accureate method
for this purpose.
Allow image-orientation: none overriding when the image is local or a data-url.

Test: fast/images/image-orientation-none-local.html

  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::allowsOrientationOverride const):

LayoutTests:

Added a tests that ensure image-orientation: none is supported in file and data URLs.

  • fast/images/image-orientation-none-local-expected.txt: Added.
  • fast/images/image-orientation-none-local.html: Added.
  • fast/images/image-orientation-none-data-url-expected.txt: Added.
  • fast/images/image-orientation-none-data-url.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269148 r269155  
     12020-10-29  Noam Rosenthal  <noam@webkit.org>
     2
     3        REGRESSION(r268249): image-orientation:none is broken for local (file://) urls
     4        https://bugs.webkit.org/show_bug.cgi?id=217808
     5        <rdar://problem/70603407>
     6
     7        Reviewed by Myles C. Maxfield.
     8
     9        Added a tests that ensure image-orientation: none is supported in file and data URLs.
     10
     11        * fast/images/image-orientation-none-local-expected.txt: Added.
     12        * fast/images/image-orientation-none-local.html: Added.
     13        * fast/images/image-orientation-none-data-url-expected.txt: Added.
     14        * fast/images/image-orientation-none-data-url.html: Added.
     15
    1162020-10-29  Karl Rackler  <rackler@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r269153 r269155  
     12020-10-29  Noam Rosenthal  <noam@webkit.org>
     2
     3        REGRESSION(r268249): image-orientation:none is broken for local (file://) urls
     4        https://bugs.webkit.org/show_bug.cgi?id=217808
     5        <rdar://problem/70603407>
     6
     7        Reviewed by Myles C. Maxfield.
     8
     9        Use isCORSSameOrigin() instead of isOriginClean(), it's a more accureate method
     10        for this purpose.
     11        Allow image-orientation: none overriding when the image is local or a data-url.
     12
     13        Test: fast/images/image-orientation-none-local.html
     14
     15        * html/HTMLImageElement.cpp:
     16        (WebCore::HTMLImageElement::allowsOrientationOverride const):
     17
    1182020-10-29  Antti Koivisto  <antti@apple.com>
    219
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r268249 r269155  
    684684bool HTMLImageElement::allowsOrientationOverride() const
    685685{
    686     auto* image = cachedImage();
    687     return !image || image->isOriginClean(&(document().securityOrigin()));
     686    auto* cachedImage = this->cachedImage();
     687    if (!cachedImage)
     688        return true;
     689
     690    auto image = cachedImage->image();
     691    return !image || image->sourceURL().protocolIsData() || cachedImage->isCORSSameOrigin();
    688692}
    689693
Note: See TracChangeset for help on using the changeset viewer.