|
Add support for the object-fit CSS property.
This is hidden behind an "experimental" runtime flag named
"ObjectFitPosition". Once object-fit's "sister" property, object-position,
is implemented, the plan is to also put that behind this flag, too.
This is an implementation of object-fit as described in
http://www.w3.org/TR/2012/CR-css3-images-20120417/#object-fit
Object-fit is used to maintain the aspect ratio of replaced content
within its content box. All object-fit values except the initial one
('fill') will always ensure that the aspect ratio is retained, in
different ways (fit inside the content box, cover the content box, or
use intrinsic size). Painting is always clipped against the content
box, regardless of the 'overflow' property.
Video elements used to behave like 'object-fit:contain', while the
initial value is, as mentioned above, 'fill'. Therefore we need a
section for video in the UA style sheet.
Introducing RenderImageResource::intrinsicSize(). We cannot use
imageSize(), since it may return the extrinsic size for SVG images.
Parts of this patch (both code and layout tests) are based on work
originally done by Simon Fraser < simon.fraser@apple.com>.
See https://bugs.webkit.org/show_bug.cgi?id=52040
BUG= 236331
R=pdr@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=156535
Total comments: 8
Total comments: 9
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+685 lines, -37 lines) |
Patch |
|
M |
LayoutTests/TestExpectations
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/svg/css/script-tests/svg-paint-order.js
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+106 lines, -0 lines |
0 comments
|
Download
|
|
A + |
LayoutTests/svg/css/svg-paint-order.html
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
LayoutTests/svg/css/svg-paint-order-expected.txt
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+69 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/svg/paintorder/paintorder.svg
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+37 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/svg/paintorder/paintorder-expected.svg
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+61 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/svg/paintorder/paintorder-text.svg
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+37 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/svg/paintorder/paintorder-text-expected.svg
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+61 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/svg/repaint/repaint-paintorder.svg
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSComputedStyleDeclaration.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/css/CSSParser.h
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSPrimitiveValueMappings.h
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSProperty.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/CSSValueKeywords.in
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/SVGCSSComputedStyleDeclaration.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+23 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/SVGCSSParser.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
3 chunks |
+69 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/SVGCSSPropertyNames.in
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/SVGCSSValueKeywords.in
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/css/resolver/StyleBuilderCustom.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+38 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/page/RuntimeCSSEnabled.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/page/RuntimeEnabledFeatures.in
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/page/UseCounter.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/rendering/style/SVGRenderStyle.h
|
View
|
1
2
3
4
5
6
7
8
9
|
6 chunks |
+8 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/rendering/style/SVGRenderStyle.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/rendering/style/SVGRenderStyleDefs.h
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/rendering/svg/RenderSVGShape.h
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/core/rendering/svg/RenderSVGShape.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+28 lines, -23 lines |
0 comments
|
Download
|
|
M |
Source/core/rendering/svg/SVGInlineTextBox.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+23 lines, -10 lines |
0 comments
|
Download
|
|
M |
Source/core/scripts/make_runtime_features.py
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/svg/SVGElement.cpp
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/svg/svgattrs.in
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 22 (0 generated)
|