summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html
diff options
context:
space:
mode:
authortimloh@chromium.org <timloh@chromium.org>2015-02-20 02:25:52 +0000
committertimloh@chromium.org <timloh@chromium.org>2015-02-20 02:25:52 +0000
commita22867810241c3f2e1a96d4f79a8373bbf026093 (patch)
treece38d9d2fa05fd4ebb1fd972572666526d25071f /third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html
parentf41b6113dc74c587eb5e0af4d0994c012de017b2 (diff)
downloadchromium_src-a22867810241c3f2e1a96d4f79a8373bbf026093.zip
chromium_src-a22867810241c3f2e1a96d4f79a8373bbf026093.tar.gz
chromium_src-a22867810241c3f2e1a96d4f79a8373bbf026093.tar.bz2
Fix object-position handling for complex <position> values
This patch fixes object-position to properly handle complex <position> values, such as "left 20px bottom 40%". Previously the StyleBuilder code would assume we simply had two <length>|<percent> CSSValues, but the parser actually can output Pairs here for these cases. We handle these with subtractFromOneHundredPercent, which will create a calc as needed. BUG=415731,458008 Review URL: https://codereview.chromium.org/937773004 git-svn-id: svn://svn.chromium.org/blink/trunk@190517 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html')
-rw-r--r--third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html b/third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html
index 5db7f73..eae26f5 100644
--- a/third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html
+++ b/third_party/WebKit/LayoutTests/fast/css/parsing-object-position.html
@@ -34,6 +34,9 @@
shouldBeEqualToString('testComputedStyle("object-position: 10px 10px;")', '10px 10px');
shouldBeEqualToString('testComputedStyle("object-position: right top;")', '100% 0%');
shouldBeEqualToString('testComputedStyle("object-position: top right;")', '100% 0%');
+ shouldBeEqualToString('testComputedStyle("object-position: left 20px center;")', '20px 50%');
+ shouldBeEqualToString('testComputedStyle("object-position: center bottom 25%;")', '50% 75%');
+ shouldBeEqualToString('testComputedStyle("object-position: bottom 20px right 12px;")', 'calc(-12px + 100%) calc(-20px + 100%)');
shouldBeEqualToString('test("object-position: inherit;")', 'inherit');
shouldBeEqualToString('test("object-position: initial;")', 'initial');
@@ -58,6 +61,9 @@
shouldBeEqualToString('test("object-position: 33px center;")', '33px 50%');
shouldBeEqualToString('test("object-position: 33px bottom;")', '33px 100%');
shouldBeEqualToString('test("object-position: 1vh 1vw;")', '1vh 1vw');
+ shouldBeEqualToString('test("object-position: left 20px center;")', 'left 20px top 50%');
+ shouldBeEqualToString('test("object-position: center bottom 25%;")', 'left 50% bottom 25%');
+ shouldBeEqualToString('test("object-position: bottom 20px right 12px;")', 'right 12px bottom 20px');
shouldBeNull('test("object-position: 100px 100px 100px;")');
shouldBeNull('test("object-position: 100px 100px 200px 200px;")');