<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[196960] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/196960">196960</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2016-02-22 14:26:23 -0800 (Mon, 22 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Repeated background images have the wrong position when using bottom/right-relative background-position
https://bugs.webkit.org/show_bug.cgi?id=154478
Reviewed by Dave Hyatt.
Source/WebCore:
Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
painting repeated background images when right/bottom edges are used.
Also rename BackgroundEdgeOrigin to Edge
Test: fast/images/background-position.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Edge):
(WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::resolveEdgeRelativeLength):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::backgroundXOrigin):
(WebCore::FillLayer::backgroundYOrigin):
(WebCore::FillLayer::setBackgroundXOrigin):
(WebCore::FillLayer::setBackgroundYOrigin):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
LayoutTests:
Enhanced background-position-serialize.html to test values that use right/bottom edge specifiers.
Ref test for background-position.
* fast/css/background-position-serialize-expected.txt:
* fast/css/background-position-serialize.html:
* fast/images/background-position-expected.html: Added.
* fast/images/background-position.html: Added.
* fast/images/resources/checker.png: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssbackgroundpositionserializeexpectedtxt">trunk/LayoutTests/fast/css/background-position-serialize-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssbackgroundpositionserializehtml">trunk/LayoutTests/fast/css/background-position-serialize.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleFillLayercpp">trunk/Source/WebCore/rendering/style/FillLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleFillLayerh">trunk/Source/WebCore/rendering/style/FillLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantscpp">trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastimagesbackgroundpositionexpectedhtml">trunk/LayoutTests/fast/images/background-position-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastimagesbackgroundpositionhtml">trunk/LayoutTests/fast/images/background-position.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/LayoutTests/ChangeLog        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-02-22 Simon Fraser <simon.fraser@apple.com>
+
+ Repeated background images have the wrong position when using bottom/right-relative background-position
+ https://bugs.webkit.org/show_bug.cgi?id=154478
+
+ Reviewed by Dave Hyatt.
+
+ Enhanced background-position-serialize.html to test values that use right/bottom edge specifiers.
+
+ Ref test for background-position.
+
+ * fast/css/background-position-serialize-expected.txt:
+ * fast/css/background-position-serialize.html:
+ * fast/images/background-position-expected.html: Added.
+ * fast/images/background-position.html: Added.
+ * fast/images/resources/checker.png: Added.
+
</ins><span class="cx"> 2016-02-22 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> [Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest of the class
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssbackgroundpositionserializeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/background-position-serialize-expected.txt (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/background-position-serialize-expected.txt        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/LayoutTests/fast/css/background-position-serialize-expected.txt        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -56,6 +56,19 @@
</span><span class="cx"> PASS: t.style.backgroundPositionX should be 10px, 20px, 30px and is.
</span><span class="cx"> PASS: t.style.backgroundPositionY should be 15px, 25px, 35px and is.
</span><span class="cx"> PASS: t.style.cssText should be background-position: 10px 15px, 20px 25px, 30px 35px; and is.
</span><ins>+t.setAttribute('style', 'background-position: bottom 10px right 20px');
+PASS: t.style.backgroundPosition should be right 20px bottom 10px and is.
+PASS: window.getComputedStyle(t).backgroundPosition should be right 20px bottom 10px and is.
+t.setAttribute('style', 'background-position: top 10px right 20px');
+PASS: t.style.backgroundPosition should be right 20px top 10px and is.
+PASS: window.getComputedStyle(t).backgroundPosition should be right 20px top 10px and is.
+t.setAttribute('style', 'background-position: 50% left');
+PASS: t.style.backgroundPosition should be and is.
+t.setAttribute('style', 'background-position-x: right 20px');
+PASS: window.getComputedStyle(t).backgroundPositionX should be 0% and is.
+t.setAttribute('style', 'background-position: right 20px bottom 10px');
+PASS: window.getComputedStyle(t).backgroundPosition should be right 20px bottom 10px and is.
+PASS: window.getComputedStyle(t).backgroundPositionX should be 20px and is.
</ins><span class="cx"> t.setAttribute('style', 'background: url(about:blank) 80% 80%;');
</span><span class="cx"> t.style.backgroundPositionY = '50px'
</span><span class="cx"> style.cssText =
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssbackgroundpositionserializehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/background-position-serialize.html (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/background-position-serialize.html        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/LayoutTests/fast/css/background-position-serialize.html        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> <html>
</span><span class="cx"> <body>
</span><del>-<div id=t></div>
-<div id=console></div>
</del><ins>+<div id="t"></div>
+<div id="console"></div>
</ins><span class="cx"> <script>
</span><span class="cx"> function print(message, color)
</span><span class="cx"> {
</span><span class="lines">@@ -111,6 +111,24 @@
</span><span class="cx"> shouldBe("t.style.backgroundPositionY", "15px, 25px, 35px");
</span><span class="cx"> shouldBe("t.style.cssText", "background-position: 10px 15px, 20px 25px, 30px 35px;");
</span><span class="cx">
</span><ins>+run("t.setAttribute('style', 'background-position: bottom 10px right 20px');");
+shouldBe("t.style.backgroundPosition", "right 20px bottom 10px");
+shouldBe("window.getComputedStyle(t).backgroundPosition", "right 20px bottom 10px");
+
+run("t.setAttribute('style', 'background-position: top 10px right 20px');");
+shouldBe("t.style.backgroundPosition", "right 20px top 10px");
+shouldBe("window.getComputedStyle(t).backgroundPosition", "right 20px top 10px");
+
+run("t.setAttribute('style', 'background-position: 50% left');"); // Invalid per spec.
+shouldBe("t.style.backgroundPosition", "");
+
+run("t.setAttribute('style', 'background-position-x: right 20px');"); // This does not parse, but perhaps it should.
+shouldBe("window.getComputedStyle(t).backgroundPositionX", "0%");
+
+run("t.setAttribute('style', 'background-position: right 20px bottom 10px');");
+shouldBe("window.getComputedStyle(t).backgroundPosition", "right 20px bottom 10px");
+shouldBe("window.getComputedStyle(t).backgroundPositionX", "20px"); // This is a bug. webkit.org/b/154551
+
</ins><span class="cx"> run("t.setAttribute('style', 'background: url(about:blank) 80% 80%;');");
</span><span class="cx"> run("t.style.backgroundPositionY = '50px'");
</span><span class="cx"> print("style.cssText =");
</span></span></pre></div>
<a id="trunkLayoutTestsfastimagesbackgroundpositionexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/background-position-expected.html (0 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/background-position-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/images/background-position-expected.html        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .container {
+ width: 100px;
+ height: 100px;
+ margin: 10px;
+ border: 2px solid gray;
+ display: inline-block;
+ position: relative;
+ }
+ .box {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background-image: url('resources/checker.png');
+ background-repeat: no-repeat;
+ }
+
+ .repeat .box {
+ background-repeat: repeat;
+ }
+ </style>
+</head>
+<body>
+ <div>
+ <div class="container">
+ <div class="box" style="background-position: 0 0"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10px 20px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 5px 25px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 25px 5px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 45px 25px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 100% 25px"></div>
+ </div>
+ </div>
+ <div class="repeat">
+ <div class="container">
+ <div class="box" style="background-position: 0 0"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10px 20px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 5px 25px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 25px 5px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 45px 25px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 100% 25px"></div>
+ </div>
+ </div>
+ <div class="repeat">
+ <div class="container">
+ <div class="box" style="background-position: 0 0; -webkit-clip-path: inset(0 50px 50px 0);"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10px 20px; -webkit-clip-path: inset(20px 40px 30px 10px);"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 5px 25px; -webkit-clip-path: inset(25px 45px 25px 5px);"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 25px 5px; -webkit-clip-path: inset(5px 25px 45px 25px);"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 45px 25px; -webkit-clip-path: inset(25px 5px 25px 45px);"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 100% 25px; -webkit-clip-path: inset(25px 0 25px 50px);"></div>
+ </div>
+ </div>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastimagesbackgroundpositionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/background-position.html (0 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/background-position.html         (rev 0)
+++ trunk/LayoutTests/fast/images/background-position.html        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .container {
+ width: 100px;
+ height: 100px;
+ margin: 10px;
+ border: 2px solid gray;
+ display: inline-block;
+ position: relative;
+ }
+ .box {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background-image: url('resources/checker.png');
+ background-repeat: no-repeat;
+ }
+
+ .repeat .box {
+ background-repeat: repeat;
+ }
+ </style>
+</head>
+<body>
+ <div>
+ <div class="container">
+ <div class="box" style="background-position: 0 0"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10px 20px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10% 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: top 10% left 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: right 10% bottom 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: center right"></div>
+ </div>
+ </div>
+ <div class="repeat">
+ <div class="container">
+ <div class="box" style="background-position: 0 0"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10px 20px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10% 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: top 10% left 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: right 10% bottom 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: center right"></div>
+ </div>
+ </div>
+ <div>
+ <div class="container">
+ <div class="box" style="background-position: 0 0"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10px 20px"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: 10% 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: top 10% left 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: right 10% bottom 50%"></div>
+ </div>
+ <div class="container">
+ <div class="box" style="background-position: center right"></div>
+ </div>
+ </div>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/ChangeLog        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-02-22 Simon Fraser <simon.fraser@apple.com>
+
+ Repeated background images have the wrong position when using bottom/right-relative background-position
+ https://bugs.webkit.org/show_bug.cgi?id=154478
+
+ Reviewed by Dave Hyatt.
+
+ Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
+ painting repeated background images when right/bottom edges are used.
+
+ Also rename BackgroundEdgeOrigin to Edge
+
+ Test: fast/images/background-position.html
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator Edge):
+ (WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::resolveEdgeRelativeLength):
+ (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+ * rendering/style/FillLayer.cpp:
+ (WebCore::FillLayer::FillLayer):
+ * rendering/style/FillLayer.h:
+ (WebCore::FillLayer::backgroundXOrigin):
+ (WebCore::FillLayer::backgroundYOrigin):
+ (WebCore::FillLayer::setBackgroundXOrigin):
+ (WebCore::FillLayer::setBackgroundYOrigin):
+ * rendering/style/RenderStyleConstants.cpp:
+ (WebCore::operator<<):
+ * rendering/style/RenderStyleConstants.h:
+
</ins><span class="cx"> 2016-02-22 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r196935.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -902,45 +902,45 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BackgroundEdgeOrigin e)
</del><ins>+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Edge e)
</ins><span class="cx"> : CSSValue(PrimitiveClass)
</span><span class="cx"> {
</span><span class="cx"> m_primitiveUnitType = CSS_VALUE_ID;
</span><span class="cx"> switch (e) {
</span><del>- case TopEdge:
</del><ins>+ case Edge::Top:
</ins><span class="cx"> m_value.valueID = CSSValueTop;
</span><span class="cx"> break;
</span><del>- case RightEdge:
</del><ins>+ case Edge::Right:
</ins><span class="cx"> m_value.valueID = CSSValueRight;
</span><span class="cx"> break;
</span><del>- case BottomEdge:
</del><ins>+ case Edge::Bottom:
</ins><span class="cx"> m_value.valueID = CSSValueBottom;
</span><span class="cx"> break;
</span><del>- case LeftEdge:
</del><ins>+ case Edge::Left:
</ins><span class="cx"> m_value.valueID = CSSValueLeft;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template<> inline CSSPrimitiveValue::operator BackgroundEdgeOrigin() const
</del><ins>+template<> inline CSSPrimitiveValue::operator Edge() const
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isValueID());
</span><span class="cx">
</span><span class="cx"> switch (m_value.valueID) {
</span><span class="cx"> case CSSValueTop:
</span><del>- return TopEdge;
</del><ins>+ return Edge::Top;
</ins><span class="cx"> case CSSValueRight:
</span><del>- return RightEdge;
</del><ins>+ return Edge::Right;
</ins><span class="cx"> case CSSValueBottom:
</span><del>- return BottomEdge;
</del><ins>+ return Edge::Bottom;
</ins><span class="cx"> case CSSValueLeft:
</span><del>- return LeftEdge;
</del><ins>+ return Edge::Left;
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return TopEdge;
</del><ins>+ return Edge::Top;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBoxSizing e)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -1044,6 +1044,19 @@
</span><span class="cx"> return space;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static LayoutUnit resolveEdgeRelativeLength(const Length& length, Edge edge, LayoutUnit availableSpace, const LayoutSize& areaSize, const LayoutSize& tileSize)
+{
+ LayoutUnit result = minimumValueForLength(length, availableSpace, false);
+
+ if (edge == Edge::Right)
+ return areaSize.width() - tileSize.width() - result;
+
+ if (edge == Edge::Bottom)
+ return areaSize.height() - tileSize.height() - result;
+
+ return result;
+}
+
</ins><span class="cx"> BackgroundImageGeometry RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer& fillLayer, const LayoutPoint& paintOffset,
</span><span class="cx"> const LayoutRect& borderBoxRect, RenderElement* backgroundObject) const
</span><span class="cx"> {
</span><span class="lines">@@ -1147,7 +1160,7 @@
</span><span class="cx"> LayoutSize spaceSize;
</span><span class="cx"> LayoutSize phase;
</span><span class="cx"> LayoutSize noRepeat;
</span><del>- LayoutUnit computedXPosition = minimumValueForLength(fillLayer.xPosition(), availableWidth, false);
</del><ins>+ LayoutUnit computedXPosition = resolveEdgeRelativeLength(fillLayer.xPosition(), fillLayer.backgroundXOrigin(), availableWidth, positioningAreaSize, tileSize);
</ins><span class="cx"> if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && tileSize.width() > 0) {
</span><span class="cx"> int numTiles = std::max(1, roundToInt(positioningAreaSize.width() / tileSize.width()));
</span><span class="cx"> if (fillLayer.size().size.height().isAuto() && backgroundRepeatY != RoundFill)
</span><span class="lines">@@ -1157,7 +1170,7 @@
</span><span class="cx"> phase.setWidth(tileSize.width() ? tileSize.width() - fmodf((computedXPosition + left), tileSize.width()) : 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- LayoutUnit computedYPosition = minimumValueForLength(fillLayer.yPosition(), availableHeight, false);
</del><ins>+ LayoutUnit computedYPosition = resolveEdgeRelativeLength(fillLayer.yPosition(), fillLayer.backgroundYOrigin(), availableHeight, positioningAreaSize, tileSize);
</ins><span class="cx"> if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > 0 && tileSize.height() > 0) {
</span><span class="cx"> int numTiles = std::max(1, roundToInt(positioningAreaSize.height() / tileSize.height()));
</span><span class="cx"> if (fillLayer.size().size.width().isAuto() && backgroundRepeatX != RoundFill)
</span><span class="lines">@@ -1181,8 +1194,9 @@
</span><span class="cx"> } else
</span><span class="cx"> backgroundRepeatX = NoRepeatFill;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (backgroundRepeatX == NoRepeatFill) {
</span><del>- LayoutUnit xOffset = left + (fillLayer.backgroundXOrigin() == RightEdge ? availableWidth - computedXPosition : computedXPosition);
</del><ins>+ LayoutUnit xOffset = left + computedXPosition;
</ins><span class="cx"> if (xOffset > 0)
</span><span class="cx"> destinationRect.move(xOffset, 0);
</span><span class="cx"> xOffset = std::min<LayoutUnit>(xOffset, 0);
</span><span class="lines">@@ -1206,7 +1220,7 @@
</span><span class="cx"> backgroundRepeatY = NoRepeatFill;
</span><span class="cx"> }
</span><span class="cx"> if (backgroundRepeatY == NoRepeatFill) {
</span><del>- LayoutUnit yOffset = top + (fillLayer.backgroundYOrigin() == BottomEdge ? availableHeight - computedYPosition : computedYPosition);
</del><ins>+ LayoutUnit yOffset = top + computedYPosition;
</ins><span class="cx"> if (yOffset > 0)
</span><span class="cx"> destinationRect.move(0, yOffset);
</span><span class="cx"> yOffset = std::min<LayoutUnit>(yOffset, 0);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleFillLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/FillLayer.cpp (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/FillLayer.cpp        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/rendering/style/FillLayer.cpp        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -65,8 +65,8 @@
</span><span class="cx"> , m_xPosSet(false)
</span><span class="cx"> , m_yPosSet(false)
</span><span class="cx"> , m_backgroundOriginSet(false)
</span><del>- , m_backgroundXOrigin(LeftEdge)
- , m_backgroundYOrigin(TopEdge)
</del><ins>+ , m_backgroundXOrigin(static_cast<unsigned>(Edge::Left))
+ , m_backgroundYOrigin(static_cast<unsigned>(Edge::Top))
</ins><span class="cx"> , m_compositeSet(type == MaskFillLayer)
</span><span class="cx"> , m_blendModeSet(false)
</span><span class="cx"> , m_maskSourceTypeSet(false)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleFillLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/FillLayer.h (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/FillLayer.h        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/rendering/style/FillLayer.h        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -70,8 +70,8 @@
</span><span class="cx"> StyleImage* image() const { return m_image.get(); }
</span><span class="cx"> const Length& xPosition() const { return m_xPosition; }
</span><span class="cx"> const Length& yPosition() const { return m_yPosition; }
</span><del>- BackgroundEdgeOrigin backgroundXOrigin() const { return static_cast<BackgroundEdgeOrigin>(m_backgroundXOrigin); }
- BackgroundEdgeOrigin backgroundYOrigin() const { return static_cast<BackgroundEdgeOrigin>(m_backgroundYOrigin); }
</del><ins>+ Edge backgroundXOrigin() const { return static_cast<Edge>(m_backgroundXOrigin); }
+ Edge backgroundYOrigin() const { return static_cast<Edge>(m_backgroundYOrigin); }
</ins><span class="cx"> EFillAttachment attachment() const { return static_cast<EFillAttachment>(m_attachment); }
</span><span class="cx"> EFillBox clip() const { return static_cast<EFillBox>(m_clip); }
</span><span class="cx"> EFillBox origin() const { return static_cast<EFillBox>(m_origin); }
</span><span class="lines">@@ -104,8 +104,8 @@
</span><span class="cx"> void setImage(PassRefPtr<StyleImage> image) { m_image = image; m_imageSet = true; }
</span><span class="cx"> void setXPosition(Length length) { m_xPosition = WTFMove(length); m_xPosSet = true; }
</span><span class="cx"> void setYPosition(Length length) { m_yPosition = WTFMove(length); m_yPosSet = true; }
</span><del>- void setBackgroundXOrigin(BackgroundEdgeOrigin o) { m_backgroundXOrigin = o; m_backgroundOriginSet = true; }
- void setBackgroundYOrigin(BackgroundEdgeOrigin o) { m_backgroundYOrigin = o; m_backgroundOriginSet = true; }
</del><ins>+ void setBackgroundXOrigin(Edge o) { m_backgroundXOrigin = static_cast<unsigned>(o); m_backgroundOriginSet = true; }
+ void setBackgroundYOrigin(Edge o) { m_backgroundYOrigin = static_cast<unsigned>(o); m_backgroundOriginSet = true; }
</ins><span class="cx"> void setAttachment(EFillAttachment attachment) { m_attachment = attachment; m_attachmentSet = true; }
</span><span class="cx"> void setClip(EFillBox b) { m_clip = b; m_clipSet = true; }
</span><span class="cx"> void setOrigin(EFillBox b) { m_origin = b; m_originSet = true; }
</span><span class="lines">@@ -202,8 +202,8 @@
</span><span class="cx"> unsigned m_xPosSet : 1;
</span><span class="cx"> unsigned m_yPosSet : 1;
</span><span class="cx"> unsigned m_backgroundOriginSet : 1;
</span><del>- unsigned m_backgroundXOrigin : 2; // BackgroundEdgeOrigin
- unsigned m_backgroundYOrigin : 2; // BackgroundEdgeOrigin
</del><ins>+ unsigned m_backgroundXOrigin : 2; // Edge
+ unsigned m_backgroundYOrigin : 2; // Edge
</ins><span class="cx"> unsigned m_compositeSet : 1;
</span><span class="cx"> unsigned m_blendModeSet : 1;
</span><span class="cx"> unsigned m_maskSourceTypeSet : 1;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -85,13 +85,13 @@
</span><span class="cx"> return ts;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-TextStream& operator<<(TextStream& ts, BackgroundEdgeOrigin edge)
</del><ins>+TextStream& operator<<(TextStream& ts, Edge edge)
</ins><span class="cx"> {
</span><span class="cx"> switch (edge) {
</span><del>- case TopEdge: ts << "top"; break;
- case RightEdge: ts << "right"; break;
- case BottomEdge: ts << "bottom"; break;
- case LeftEdge: ts << "left"; break;
</del><ins>+ case Edge::Top: ts << "top"; break;
+ case Edge::Right: ts << "right"; break;
+ case Edge::Bottom: ts << "bottom"; break;
+ case Edge::Left: ts << "left"; break;
</ins><span class="cx"> }
</span><span class="cx"> return ts;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (196959 => 196960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-02-22 22:24:51 UTC (rev 196959)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-02-22 22:26:23 UTC (rev 196960)
</span><span class="lines">@@ -230,8 +230,8 @@
</span><span class="cx"> // CSS3 Background Values
</span><span class="cx"> enum EFillSizeType { Contain, Cover, SizeLength, SizeNone };
</span><span class="cx">
</span><del>-// CSS3 Background Position
-enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge };
</del><ins>+// CSS3 <position>
+enum class Edge { Top, Right, Bottom, Left };
</ins><span class="cx">
</span><span class="cx"> // CSS3 Mask Source Types
</span><span class="cx"> enum EMaskSourceType { MaskAlpha, MaskLuminance };
</span><span class="lines">@@ -694,7 +694,7 @@
</span><span class="cx"> TextStream& operator<<(TextStream&, EFillBox);
</span><span class="cx"> TextStream& operator<<(TextStream&, EFillRepeat);
</span><span class="cx"> TextStream& operator<<(TextStream&, EMaskSourceType);
</span><del>-TextStream& operator<<(TextStream&, BackgroundEdgeOrigin);
</del><ins>+TextStream& operator<<(TextStream&, Edge);
</ins><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>