New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 591939 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
inactive
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Wrong size of SVG when used in cross-fade

Reported by davve@opera.com, Mar 4 2016

Issue description

Load https://doomdavve.github.io/gists/svg-in-cross-fade.html

There should be two circles, not two hundreds.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3c7b1342b32dd6174efa9a47a4b476c940462b9c

commit 3c7b1342b32dd6174efa9a47a4b476c940462b9c
Author: davve <davve@opera.com>
Date: Tue Mar 08 10:30:09 2016

Merge image sizing algorithms

Let users of StyleImage use StyleImage::imageSize() to get the image
size instead of fetching intrinsic information and calculating the
size outside StyleImage. This let's us remove the sizing algorithm in
LayoutBoxModelObject::calculateImageIntrinsicDimensions.

By passing along the default object size to StyleImage::imageSize, we
can remove the sizing algorithm in LayoutBoxModelObject and reuse the
one in SVGImage instead for the one image type that needs the
complicated sizing algorithm. Simpler algorithms can remain simple,
e.g. for generated images with no fixed size, the default object size
is returned unmodified.

SVGImage::concreteObjectSize almost had the necessary bits to
support full sizing of SVG images within a style context, i.e. through
StyleImage. The only missing bit was the the contain constraint on the
default object size added by this patch.

Some zoom juggling needed since the provided default object size is
sometimes zoomed and SVGImage has no notion of zoom. Thus the zoom is
removed before calling SVGImage::concreteObjectSize() and reapplied on
the result afterwards.

Background images and other decorative images should never respect the
exif rotation[1], so StyleImage::imageSize now requests the image size
from ImageResource without exif rotation applied. Presumably
StyleImage::imageSize() was broken but unused in this regard before.

In contrast to LBMO::calculateImageIntrinsicDimensions(),
StyleImage::imageSize returns the size for layout, i.e. the size
compensated for the image scale factor. This fixes two hidpi bugs, one
for list item marker images and one for shape-outside.

BUG= 581357 ,  591935 ,  591939 ,  592888 ,  592886 

Review URL: https://codereview.chromium.org/1756763004

Cr-Commit-Position: refs/heads/master@{#379801}

[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/css3/images/cross-fade-svg-size-expected.html
[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/css3/images/cross-fade-svg-size.html
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt
[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/fast/hidpi/image-set-list-style-image-expected.html
[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/fast/hidpi/image-set-list-style-image.html
[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/fast/hidpi/image-set-shape-outside-expected.html
[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/fast/hidpi/image-set-shape-outside.html
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/LayoutTests/svg/as-list-image/svg-list-image-intrinsic-size-zoom.html
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/css/CSSCrossfadeValue.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/paint/BoxPainter.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleFetchedImage.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleFetchedImageSet.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleGeneratedImage.h
[add] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleImage.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleImage.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StyleInvalidImage.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/style/StylePendingImage.h
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c/third_party/WebKit/Source/core/svg/graphics/SVGImage.h

Comment 2 by davve@opera.com, Mar 8 2016

Cc: f...@opera.com pdr@chromium.org davve@opera.com
 Issue 576010  has been merged into this issue.

Comment 3 by davve@opera.com, Mar 8 2016

Status: Fixed (was: Started)

Sign in to add a comment