Commit 141b23e5 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

SetBackground{X/Y}Origin after BackgroundPosition{X/Y}::ApplyInherit SetPosition{X/Y}

BackgroundPosition{X/Y}::ApplyInherit only SetPosition{X/Y}(),
Background{X/Y}Origin are not set. We should make them set.

Bug: 819119
Signed-off-by: default avatarZhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: Ic7d37e95c5cb91f4d613f0455d0ed7e7e8e16a24
Reviewed-on: https://chromium-review.googlesource.com/961765Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543307}
parent 1bb11747
This tests that background-position: inherit is applied correctly.
PASS
PASS
PASS
<div style="background-position: 25% 75%">
<div id="target" style="background-position: inherit;"></div>
</div>
<div style="background-position: right 25% bottom 75%">
<div id="target2" style="background-position: inherit;"></div>
</div>
<div style="background-position: bottom 75% right 25%">
<div id="target3" style="background-position: inherit;"></div>
</div>
<p>
This tests that <tt>background-position: inherit</tt> is applied correctly.
</p>
......@@ -11,6 +17,16 @@
testRunner.dumpAsText();
var targetBackgroundPosition = getComputedStyle(document.getElementById("target")).backgroundPosition,cssText;
var result = document.getElementById("result");
result.innerText = targetBackgroundPosition == "25% 75%" ? "PASS" : "FAIL: The inherited value was " + targetBackgroundPosition;
result.innerText += "\n";
var targetBackgroundPosition2 = getComputedStyle(document.getElementById("target2")).backgroundPosition,cssText;
result.innerText += targetBackgroundPosition2 == "right 25% bottom 75%" ? "PASS" : "FAIL: The inherited value was " + targetBackgroundPosition;
result.innerText += "\n";
var targetBackgroundPosition3 = getComputedStyle(document.getElementById("target3")).backgroundPosition,cssText;
result.innerText += targetBackgroundPosition3 == "right 25% bottom 75%" ? "PASS" : "FAIL: The inherited value was " + targetBackgroundPosition;
document.getElementById("result").innerText = targetBackgroundPosition == "25% 75%" ? "PASS" : "FAIL: The inherited value was " + targetBackgroundPosition;
</script>
......@@ -33,6 +33,14 @@ namespace CSSLonghand {
if (!currChild)
currChild = prevChild->EnsureNext();
currChild->Set{{fill_type}}(currParent->{{property.custom_apply_args['fill_type_getter']}}());
{% if fill_type == "PositionX" %}
if (currParent->IsBackgroundXOriginSet())
currChild->SetBackgroundXOrigin(currParent->BackgroundXOrigin());
{% endif %}
{% if fill_type == "PositionY" %}
if (currParent->IsBackgroundYOriginSet())
currChild->SetBackgroundYOrigin(currParent->BackgroundYOrigin());
{% endif %}
prevChild = currChild;
currChild = prevChild->Next();
currParent = currParent->Next();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment