Changeset 268249 in webkit
- Timestamp:
- Oct 9, 2020, 1:19:01 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/css/css-images (added)
-
LayoutTests/http/wpt/css/css-images/image-orientation (added)
-
LayoutTests/http/wpt/css/css-images/image-orientation/image-orientation-none-cross-origin-canvas-expected.html (added)
-
LayoutTests/http/wpt/css/css-images/image-orientation/image-orientation-none-cross-origin-canvas.html (added)
-
LayoutTests/http/wpt/css/css-images/image-orientation/support (added)
-
LayoutTests/http/wpt/css/css-images/image-orientation/support/exif-orientation-1-ul.jpg (added)
-
LayoutTests/http/wpt/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg (added)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-orientation/image-orientation-none-cross-origin-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-images/image-orientation/image-orientation-none-cross-origin.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLImageElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLImageElement.h (modified) (1 diff)
-
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderElement.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268244 r268249 1 2020-10-09 Noam Rosenthal <noam@webkit.org> 2 3 CSS image-orientation: none should be ignored for cross-origin images 4 https://bugs.webkit.org/show_bug.cgi?id=217294 5 6 Reviewed by Youenn Fablet. 7 8 * http/wpt/css/css-images/image-orientation/image-orientation-none-cross-origin-canvas.html: Added. 9 * http/wpt/css/css-images/image-orientation/image-orientation-none-cross-origin-canvas-expected.html: Added. 10 1 11 2020-10-08 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/ChangeLog
r268232 r268249 1 2020-10-09 Noam Rosenthal <noam@webkit.org> 2 3 CSS image-orientation: none should be ignored for cross-origin images 4 https://bugs.webkit.org/show_bug.cgi?id=217294 5 6 Reviewed by Youenn Fablet. 7 8 * web-platform-tests/css/css-images/image-orientation/image-orientation-none-cross-origin-expected.html: Added. 9 * web-platform-tests/css/css-images/image-orientation/image-orientation-none-cross-origin.html: Added. 10 Imported a new W3C test for remote image with image-orientation. 11 1 12 2020-10-08 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r268245 r268249 1 2020-10-09 Noam Rosenthal <noam@webkit.org> 2 3 CSS image-orientation: none should be ignored for cross-origin images 4 https://bugs.webkit.org/show_bug.cgi?id=217294 5 6 Reviewed by Youenn Fablet. 7 8 Per the new spec in https://github.com/w3c/csswg-drafts/issues/5165, 9 the orientation should be baked into the image if the image is cross origin, to avoid 10 exposing remote image orientation to embedders. 11 12 The meaning of it in practice is that image-orientation: none would have no effect on remote, 13 image as it's the only web-facing feature exposing image-orientation. 14 15 This change disables image-orientation override for remote images. 16 17 Tests: http/wpt/css/css-images/image-orientation/image-orientation-none-cross-origin-canvas.html 18 imported/w3c/web-platform-tests/css/css-images/image-orientation/image-orientation-none-cross-origin.html 19 20 * html/HTMLImageElement.cpp: 21 (WebCore::HTMLImageElement::allowsOrientationOverride const): 22 * html/HTMLImageElement.h: 23 Add a check whether an element is allowed to override/expose orientation. 24 25 * html/canvas/CanvasRenderingContext2DBase.cpp: 26 (WebCore::CanvasRenderingContext2DBase::drawImage): 27 * rendering/RenderElement.cpp: 28 (WebCore::RenderElement::imageOrientation const): 29 Only apply orientation for eligible images. 30 1 31 2020-10-08 Eric Carlson <eric.carlson@apple.com> 2 32 -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r267007 r268249 682 682 } 683 683 684 bool HTMLImageElement::allowsOrientationOverride() const 685 { 686 auto* image = cachedImage(); 687 return !image || image->isOriginClean(&(document().securityOrigin())); 688 } 689 684 690 #if ENABLE(ATTACHMENT_ELEMENT) 685 691 -
trunk/Source/WebCore/html/HTMLImageElement.h
r267007 r268249 140 140 String referrerPolicyForBindings() const; 141 141 ReferrerPolicy referrerPolicy() const; 142 143 bool allowsOrientationOverride() const; 142 144 143 145 protected: -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
r267645 r268249 1451 1451 1452 1452 auto orientation = ImageOrientation::FromImage; 1453 if (auto* renderer = imageElement.renderer()) 1454 orientation = renderer->style().imageOrientation(); 1455 else if (auto* computedStyle = imageElement.computedStyle()) 1456 orientation = computedStyle->imageOrientation(); 1453 if (imageElement.allowsOrientationOverride()) { 1454 if (auto* renderer = imageElement.renderer()) 1455 orientation = renderer->style().imageOrientation(); 1456 else if (auto* computedStyle = imageElement.computedStyle()) 1457 orientation = computedStyle->imageOrientation(); 1458 } 1457 1459 1458 1460 auto result = drawImage(imageElement.document(), imageElement.cachedImage(), imageElement.renderer(), imageRect, srcRect, dstRect, op, blendMode, orientation); -
trunk/Source/WebCore/rendering/RenderElement.cpp
r268075 r268249 2141 2141 ImageOrientation RenderElement::imageOrientation() const 2142 2142 { 2143 return style().imageOrientation(); 2143 auto* imageElement = is<HTMLImageElement>(element()) ? downcast<HTMLImageElement>(element()) : nullptr; 2144 return (imageElement && !imageElement->allowsOrientationOverride()) ? ImageOrientation(ImageOrientation::FromImage) : style().imageOrientation(); 2144 2145 } 2145 2146
Note:
See TracChangeset
for help on using the changeset viewer.