Diff
Modified: trunk/LayoutTests/ChangeLog (251377 => 251378)
--- trunk/LayoutTests/ChangeLog 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/LayoutTests/ChangeLog 2019-10-21 20:25:49 UTC (rev 251378)
@@ -1,3 +1,18 @@
+2019-10-21 Said Abou-Hallawa <[email protected]>
+
+ [SVG2]: Add 'auto' behavior to the 'width' and 'height' properties of the SVG <image> element
+ https://bugs.webkit.org/show_bug.cgi?id=202013
+
+ Reviewed by Simon Fraser.
+
+ * svg/custom/image-width-height-auto-dynamic-expected.svg: Added.
+ * svg/custom/image-width-height-auto-dynamic.svg: Added.
+ * svg/custom/image-width-height-auto-initial-expected.svg: Added.
+ * svg/custom/image-width-height-auto-initial.svg: Added.
+ * svg/custom/image-width-height-length-initial-expected.svg: Added.
+ * svg/custom/image-width-height-length-initial.svg: Added.
+ * svg/custom/resources/100x200-green.png: Added.
+
2019-10-21 Wenson Hsieh <[email protected]>
[Clipboard API] Implement ClipboardItem.getType() for platform clipboard items
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (251377 => 251378)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-10-21 20:25:49 UTC (rev 251378)
@@ -1,3 +1,13 @@
+2019-10-21 Said Abou-Hallawa <[email protected]>
+
+ [SVG2]: Add 'auto' behavior to the 'width' and 'height' properties of the SVG <image> element
+ https://bugs.webkit.org/show_bug.cgi?id=202013
+
+ Reviewed by Simon Fraser.
+
+ * web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change-expected.txt:
+ * web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-expected.txt:
+
2019-10-21 Chris Dumez <[email protected]>
XMLHttpRequest should not prevent entering the back/forward cache
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change-expected.txt (251377 => 251378)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change-expected.txt 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-dynamic-image-change-expected.txt 2019-10-21 20:25:49 UTC (rev 251378)
@@ -1,3 +1,3 @@
-FAIL Test <svg:image>'s sizing with css size as auto, with dynamic image change assert_equals: expected 256 but got 128
+PASS Test <svg:image>'s sizing with css size as auto, with dynamic image change
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-expected.txt (251377 => 251378)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-expected.txt 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/svg/geometry/svg-image-intrinsic-size-with-cssstyle-auto-expected.txt 2019-10-21 20:25:49 UTC (rev 251378)
@@ -1,32 +1,32 @@
PASS <svg:image> 'auto' sizing with 256x256 png image, attributes width='64' height='64'
-FAIL <svg:image> 'auto' sizing with 256x256 png image, attributes width='128' height='64' and CSS 'width:auto' assert_equals: expected 64 but got 128
-FAIL <svg:image> 'auto' sizing with 256x256 png image, attributes width='64' height='128' and CSS 'height:auto' assert_equals: expected 64 but got 128
-FAIL <svg:image> 'auto' sizing with 256x256 png image, attributes width='64' height='64' and CSS 'width:auto; height:auto' assert_equals: expected 256 but got 128
+PASS <svg:image> 'auto' sizing with 256x256 png image, attributes width='128' height='64' and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with 256x256 png image, attributes width='64' height='128' and CSS 'height:auto'
+PASS <svg:image> 'auto' sizing with 256x256 png image, attributes width='64' height='64' and CSS 'width:auto; height:auto'
PASS <svg:image> 'auto' sizing with default sized svg image, attributes width='50' height='50'
-FAIL <svg:image> 'auto' sizing with 200x100 svg image, attributes width='50' height='50' and CSS 'width:auto; height:auto' assert_equals: expected 200 but got 50
-FAIL <svg:image> 'auto' sizing with 200x100 svg image, attributes width='50' height='50' and CSS 'width:auto' assert_equals: expected 100 but got 50
-FAIL <svg:image> 'auto' sizing with 200x100 svg image, without attributes width and height and CSS 'width:auto' assert_equals: expected 200 but got 0
-FAIL <svg:image> 'auto' sizing with 200x100 svg image, attributes height='50' and 'width:auto' assert_equals: expected 100 but got 0
-FAIL <svg:image> 'auto' sizing with 200x100 svg image, attributes width='50' and CSS height:auto assert_equals: expected 25 but got 0
-FAIL <svg:image> 'auto' sizing with default sized svg image, attributes width='200' height='200' and CSS 'width:auto; height:auto' assert_equals: expected 300 but got 200
-FAIL <svg:image> 'auto' sizing with default sized svg image, attributes height='200' and CSS 'width:auto; height:auto' assert_equals: expected 300 but got 0
-FAIL <svg:image> 'auto' sizing with default sized svg image, attributes width='200' and CSS 'width:auto; height:auto' assert_equals: expected 300 but got 200
-FAIL <svg:image> 'auto' sizing with default sized svg image, without attributes width and height, no css width/height specified assert_equals: expected 300 but got 0
+PASS <svg:image> 'auto' sizing with 200x100 svg image, attributes width='50' height='50' and CSS 'width:auto; height:auto'
+PASS <svg:image> 'auto' sizing with 200x100 svg image, attributes width='50' height='50' and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with 200x100 svg image, without attributes width and height and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with 200x100 svg image, attributes height='50' and 'width:auto'
+PASS <svg:image> 'auto' sizing with 200x100 svg image, attributes width='50' and CSS height:auto
+PASS <svg:image> 'auto' sizing with default sized svg image, attributes width='200' height='200' and CSS 'width:auto; height:auto'
+PASS <svg:image> 'auto' sizing with default sized svg image, attributes height='200' and CSS 'width:auto; height:auto'
+PASS <svg:image> 'auto' sizing with default sized svg image, attributes width='200' and CSS 'width:auto; height:auto'
+PASS <svg:image> 'auto' sizing with default sized svg image, without attributes width and height, no css width/height specified
PASS <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and no css width/height specified
-FAIL <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto' assert_equals: expected 240 but got 60
-FAIL <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto' assert_equals: expected 15 but got 60
-FAIL <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto' assert_equals: expected 300 but got 60
+PASS <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto'
+FAIL <svg:image> 'auto' sizing with default sized svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto' assert_equals: expected 300 but got 400
PASS <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and no css width/height specified
-FAIL <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto' assert_equals: expected 240 but got 60
-FAIL <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto' assert_equals: expected 15 but got 60
-FAIL <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto' assert_equals: expected 200 but got 60
+PASS <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto'
+FAIL <svg:image> 'auto' sizing with svg image width='200' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto' assert_equals: expected 200 but got 400
PASS <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and no css width/height specified
-FAIL <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto' assert_equals: expected 240 but got 60
-FAIL <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto' assert_equals: expected 15 but got 60
-FAIL <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto' assert_equals: expected 400 but got 60
+PASS <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto'
+PASS <svg:image> 'auto' sizing with svg image height='100' viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto'
PASS <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and no css width/height specified
-FAIL <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto' assert_equals: expected 120 but got 60
-FAIL <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto' assert_equals: expected 30 but got 60
-FAIL <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto' assert_equals: expected 200 but got 60
+PASS <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto'
+PASS <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'height:auto'
+PASS <svg:image> 'auto' sizing with 200x100 svg image viewBox='0 0 400 100', attributes width='60' height='60' and CSS 'width:auto; height:auto'
Added: trunk/LayoutTests/svg/custom/image-width-height-auto-dynamic-expected.svg (0 => 251378)
--- trunk/LayoutTests/svg/custom/image-width-height-auto-dynamic-expected.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/image-width-height-auto-dynamic-expected.svg 2019-10-21 20:25:49 UTC (rev 251378)
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect id="rect-1" x="10" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-2" x="110" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-3" x="210" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-4" x="310" y="10" width="50" height="100" fill="green"/>
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+</svg>
Added: trunk/LayoutTests/svg/custom/image-width-height-auto-dynamic.svg (0 => 251378)
--- trunk/LayoutTests/svg/custom/image-width-height-auto-dynamic.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/image-width-height-auto-dynamic.svg 2019-10-21 20:25:49 UTC (rev 251378)
@@ -0,0 +1,46 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <g id="g-1" transform="translate(10, 10)">
+ <image id="image-1" href="" width="50" height="100"/>
+ </g>
+ <g id="g-2" transform="translate(110, 10)">
+ <image id="image-2" href="" width="50" height="100"/>
+ </g>
+
+ <g id="g-3" transform="translate(210, 10)">
+ <image id="image-3" href="" width="50" height="100">
+ <animate attributeType="XML" attributeName="width" from="0" to="50" dur="1s" fill="freeze"/>
+ </image>
+ </g>
+
+ <g id="g-4" transform="translate(310, 10)">
+ <image id="image-4" href="" width="50" height="100">
+ <animate attributeType="XML" attributeName="height" from="0" to="100" dur="1s" fill="freeze"/>
+ </image>
+ </g>
+
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ window.addEventListener('load', (event) => {
+ let image1 = document.getElementById('image-1');
+ let image2 = document.getElementById('image-2');
+ let image3 = document.getElementById('image-3');
+ let image4 = document.getElementById('image-4');
+
+ image1.style['height'] = 'auto';
+ image2.style['width'] = 'auto';
+ image3.style['height'] = 'auto';
+ image4.style['width'] = 'auto';
+
+ document.documentElement.setCurrentTime(5);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ </script>
+</svg>
Added: trunk/LayoutTests/svg/custom/image-width-height-auto-initial-expected.svg (0 => 251378)
--- trunk/LayoutTests/svg/custom/image-width-height-auto-initial-expected.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/image-width-height-auto-initial-expected.svg 2019-10-21 20:25:49 UTC (rev 251378)
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect id="rect-1" x="10" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-2" x="110" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-3" x="210" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-4" x="310" y="10" width="50" height="100" fill="green"/>
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+</svg>
Added: trunk/LayoutTests/svg/custom/image-width-height-auto-initial.svg (0 => 251378)
--- trunk/LayoutTests/svg/custom/image-width-height-auto-initial.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/image-width-height-auto-initial.svg 2019-10-21 20:25:49 UTC (rev 251378)
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style>
+ #image-1 { height: auto; }
+ #image-2 { width: auto; }
+ #image-3 { height: auto; }
+ #image-4 { width: auto; }
+ </style>
+ <g id="g-1" transform="translate(10, 10)">
+ <image href="" width="50"/>
+ </g>
+ <g id="g-2" transform="translate(110, 10)">
+ <image href="" height="100"/>
+ </g>
+
+ <g id="g-3" transform="translate(210, 10)">
+ <image href=""
+ <animate attributeType="XML" attributeName="width" from="0" to="50" dur="1s" fill="freeze"/>
+ </image>
+ </g>
+
+ <g id="g-4" transform="translate(310, 10)">
+ <image href=""
+ <animate attributeType="XML" attributeName="height" from="0" to="100" dur="1s" fill="freeze"/>
+ </image>
+ </g>
+
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ window.addEventListener('load', (event) => {
+ document.documentElement.setCurrentTime(5);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ </script>
+</svg>
Added: trunk/LayoutTests/svg/custom/image-width-height-length-initial-expected.svg (0 => 251378)
--- trunk/LayoutTests/svg/custom/image-width-height-length-initial-expected.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/image-width-height-length-initial-expected.svg 2019-10-21 20:25:49 UTC (rev 251378)
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect id="rect-1" x="10" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-2" x="110" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-3" x="210" y="10" width="50" height="100" fill="green"/>
+ <rect id="rect-4" x="310" y="10" width="50" height="100" fill="green"/>
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+</svg>
Added: trunk/LayoutTests/svg/custom/image-width-height-length-initial.svg (0 => 251378)
--- trunk/LayoutTests/svg/custom/image-width-height-length-initial.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/image-width-height-length-initial.svg 2019-10-21 20:25:49 UTC (rev 251378)
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style>
+ #image-1 { height: 100px; }
+ #image-2 { width: 50px; }
+ #image-3 { height: 100px; }
+ #image-4 { width: 50px; }
+ </style>
+ <g id="g-1" transform="translate(10, 10)">
+ <image id="image-1" href="" width="50"/>
+ </g>
+ <g id="g-2" transform="translate(110, 10)">
+ <image id="image-2" href="" height="100"/>
+ </g>
+
+ <g id="g-3" transform="translate(210, 10)">
+ <image id="image-3" href=""
+ <animate attributeType="XML" attributeName="width" from="0" to="50" dur="1s" fill="freeze"/>
+ </image>
+ </g>
+
+ <g id="g-4" transform="translate(310, 10)">
+ <image id="image-4" href=""
+ <animate attributeType="XML" attributeName="height" from="0" to="100" dur="1s" fill="freeze"/>
+ </image>
+ </g>
+
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+ <use y="110" href=""
+
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ window.addEventListener('load', (event) => {
+ document.documentElement.setCurrentTime(5);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ </script>
+</svg>
Added: trunk/LayoutTests/svg/custom/resources/100x200-green.png
(Binary files differ)
Index: trunk/LayoutTests/svg/custom/resources/100x200-green.png
===================================================================
--- trunk/LayoutTests/svg/custom/resources/100x200-green.png 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/LayoutTests/svg/custom/resources/100x200-green.png 2019-10-21 20:25:49 UTC (rev 251378)
Property changes on: trunk/LayoutTests/svg/custom/resources/100x200-green.png
___________________________________________________________________
Added: svn:mime-type
+image/png
\ No newline at end of property
Modified: trunk/Source/WebCore/ChangeLog (251377 => 251378)
--- trunk/Source/WebCore/ChangeLog 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/Source/WebCore/ChangeLog 2019-10-21 20:25:49 UTC (rev 251378)
@@ -1,3 +1,24 @@
+2019-10-21 Said Abou-Hallawa <[email protected]>
+
+ [SVG2]: Add 'auto' behavior to the 'width' and 'height' properties of the SVG <image> element
+ https://bugs.webkit.org/show_bug.cgi?id=202013
+
+ Reviewed by Simon Fraser.
+
+ The spec page is: https://www.w3.org/TR/SVG/geometry.html#Sizing
+
+ Handle the case if the 'width' or the 'height' of an SVG <image> or both
+ are missing.
+
+ Tests: svg/custom/image-width-height-auto-dynamic.svg
+ svg/custom/image-width-height-auto-initial.svg
+ svg/custom/image-width-height-length-initial.svg
+
+ * rendering/svg/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::calculateObjectBoundingBox const):
+ (WebCore::RenderSVGImage::updateImageViewport):
+ * rendering/svg/RenderSVGImage.h:
+
2019-10-21 Wenson Hsieh <[email protected]>
[Clipboard API] Implement ClipboardItem.getType() for platform clipboard items
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp (251377 => 251378)
--- trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp 2019-10-21 20:25:49 UTC (rev 251378)
@@ -68,14 +68,42 @@
return downcast<SVGImageElement>(RenderSVGModelObject::element());
}
+FloatRect RenderSVGImage::calculateObjectBoundingBox() const
+{
+ LayoutSize intrinsicSize;
+ if (CachedImage* cachedImage = imageResource().cachedImage())
+ intrinsicSize = cachedImage->imageSizeForRenderer(nullptr, style().effectiveZoom());
+
+ SVGLengthContext lengthContext(&imageElement());
+
+ Length width = style().width();
+ Length height = style().height();
+
+ float concreteWidth;
+ if (!width.isAuto())
+ concreteWidth = lengthContext.valueForLength(width, SVGLengthMode::Width);
+ else if (!height.isAuto() && !intrinsicSize.isEmpty())
+ concreteWidth = lengthContext.valueForLength(height, SVGLengthMode::Height) * intrinsicSize.width() / intrinsicSize.height();
+ else
+ concreteWidth = intrinsicSize.width();
+
+ float concreteHeight;
+ if (!height.isAuto())
+ concreteHeight = lengthContext.valueForLength(height, SVGLengthMode::Height);
+ else if (!width.isAuto() && !intrinsicSize.isEmpty())
+ concreteHeight = lengthContext.valueForLength(width, SVGLengthMode::Width) * intrinsicSize.height() / intrinsicSize.width();
+ else
+ concreteHeight = intrinsicSize.height();
+
+ return { imageElement().x().value(lengthContext), imageElement().y().value(lengthContext), concreteWidth, concreteHeight };
+}
+
bool RenderSVGImage::updateImageViewport()
{
FloatRect oldBoundaries = m_objectBoundingBox;
+ m_objectBoundingBox = calculateObjectBoundingBox();
+
bool updatedViewport = false;
-
- SVGLengthContext lengthContext(&imageElement());
- m_objectBoundingBox = FloatRect(imageElement().x().value(lengthContext), imageElement().y().value(lengthContext), imageElement().width().value(lengthContext), imageElement().height().value(lengthContext));
-
URL imageSourceURL = document().completeURL(imageElement().imageSourceURL());
// Images with preserveAspectRatio=none should force non-uniform scaling. This can be achieved
@@ -223,7 +251,8 @@
// Update the SVGImageCache sizeAndScales entry in case image loading finished after layout.
// (https://bugs.webkit.org/show_bug.cgi?id=99489)
m_objectBoundingBox = FloatRect();
- updateImageViewport();
+ if (updateImageViewport())
+ setNeedsLayout();
invalidateBufferedForeground();
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGImage.h (251377 => 251378)
--- trunk/Source/WebCore/rendering/svg/RenderSVGImage.h 2019-10-21 20:19:53 UTC (rev 251377)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGImage.h 2019-10-21 20:25:49 UTC (rev 251378)
@@ -62,6 +62,7 @@
const AffineTransform& localToParentTransform() const override { return m_localTransform; }
+ FloatRect calculateObjectBoundingBox() const;
FloatRect objectBoundingBox() const override { return m_objectBoundingBox; }
FloatRect strokeBoundingBox() const override { return m_objectBoundingBox; }
FloatRect repaintRectInLocalCoordinates() const override { return m_repaintBoundingBox; }