|
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
Committed: https://crrev.com/3c7b1342b32dd6174efa9a47a4b476c940462b9c
Cr-Commit-Position: refs/heads/master@{#379801}
Total comments: 11
Total comments: 3
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+228 lines, -170 lines) |
Patch |
|
A |
third_party/WebKit/LayoutTests/css3/images/cross-fade-svg-size.html
|
View
|
1
2
3
4
|
1 chunk |
+38 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/css3/images/cross-fade-svg-size-expected.html
|
View
|
1
2
3
4
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-natural-width-height-svg-expected.txt
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/hidpi/image-set-list-style-image.html
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/hidpi/image-set-list-style-image-expected.html
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/hidpi/image-set-shape-outside.html
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/fast/hidpi/image-set-shape-outside-expected.html
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/LayoutTests/svg/as-list-image/svg-list-image-intrinsic-size-zoom.html
|
View
|
|
1 chunk |
+11 lines, -6 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/core.gypi
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSCrossfadeValue.h
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h
|
View
|
1
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+0 lines, -87 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
|
View
|
3
4
5
6
7
8
|
1 chunk |
+5 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/paint/BoxPainter.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+4 lines, -8 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/paint/NinePieceImagePainter.cpp
|
View
|
1
2
3
4
5
6
7
8
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleFetchedImage.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+10 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleFetchedImageSet.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
|
View
|
1
2
3
4
5
6
7
8
|
1 chunk |
+10 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleGeneratedImage.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
|
View
|
1
2
3
4
5
6
|
1 chunk |
+6 lines, -18 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleImage.h
|
View
|
1
2
3
4
5
6
|
3 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
|
A |
third_party/WebKit/Source/core/style/StyleImage.cpp
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+37 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StyleInvalidImage.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/style/StylePendingImage.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/graphics/SVGImage.h
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+10 lines, -14 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+22 lines, -8 lines |
0 comments
|
Download
|
Total messages: 38 (16 generated)
|