<!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>[174433] releases/WebKitGTK/webkit-2.6</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/174433">174433</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-08 04:23:45 -0700 (Wed, 08 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/173906">r173906</a> - The style resolution cache applies properties incorrectly whenever direction != ltr
https://bugs.webkit.org/show_bug.cgi?id=137052
Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-09-23
Reviewed by Andreas Kling.
Source/WebCore:
The optimization <a href="http://trac.webkit.org/projects/webkit/changeset/135021">r135021</a> introduced a bug whenever the direction of subtree is not
uniform in the whole page.
When StyleResolver::applyMatchedProperties() resolves the style, some properties are
resolved differently based on the writing-mode and the direction.
In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled
by not caching any style with anything else than the default.
The direction was ignored, causing the bugs solved here.
Tests: css3/flexbox/flex-flow-2.html
fast/css/style-resolver-cache-direction-1.html
fast/css/style-resolver-cache-direction-2.html
fast/css/style-resolver-cache-direction-3.html
* css/StyleResolver.cpp:
(WebCore::isCacheableInMatchedPropertiesCache):
LayoutTests:
* css3/flexbox/flex-flow-2-expected.txt: Added.
* css3/flexbox/flex-flow-2.html: Added.
The test flex-flow.html should have uncovered the bug. It did not because it uses
:nth-child(), which disable style optimizations.
flex-flow-2.html is a copy of flex-flow.html using classes instead of :nth-child().
This would have caught the bug.
* fast/css/style-resolver-cache-direction-1-expected.html: Added.
* fast/css/style-resolver-cache-direction-1.html: Added.
* fast/css/style-resolver-cache-direction-2-expected.html: Added.
* fast/css/style-resolver-cache-direction-2.html: Added.
* fast/css/style-resolver-cache-direction-3-expected.html: Added.
* fast/css/style-resolver-cache-direction-3.html: Added.
New basic tests for the fix.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit26SourceWebCorecssStyleResolvercpp">releases/WebKitGTK/webkit-2.6/Source/WebCore/css/StyleResolver.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexflow2expectedtxt">releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexflow2html">releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection1expectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection1html">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection2expectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection2html">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection3expectedhtml">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection3html">releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit26LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog (174432 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2014-10-08 11:20:03 UTC (rev 174432)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-09-23 Benjamin Poulain <bpoulain@apple.com>
+
+ The style resolution cache applies properties incorrectly whenever direction != ltr
+ https://bugs.webkit.org/show_bug.cgi?id=137052
+
+ Reviewed by Andreas Kling.
+
+ * css3/flexbox/flex-flow-2-expected.txt: Added.
+ * css3/flexbox/flex-flow-2.html: Added.
+ The test flex-flow.html should have uncovered the bug. It did not because it uses
+ :nth-child(), which disable style optimizations.
+
+ flex-flow-2.html is a copy of flex-flow.html using classes instead of :nth-child().
+ This would have caught the bug.
+
+ * fast/css/style-resolver-cache-direction-1-expected.html: Added.
+ * fast/css/style-resolver-cache-direction-1.html: Added.
+ * fast/css/style-resolver-cache-direction-2-expected.html: Added.
+ * fast/css/style-resolver-cache-direction-2.html: Added.
+ * fast/css/style-resolver-cache-direction-3-expected.html: Added.
+ * fast/css/style-resolver-cache-direction-3.html: Added.
+ New basic tests for the fix.
+
</ins><span class="cx"> 2014-09-19 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Latching in iframes is not working as expected
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexflow2expectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2-expected.txt (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2-expected.txt         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2-expected.txt        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestscss3flexboxflexflow2html"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/css3/flexbox/flex-flow-2.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<style>
+body {
+ margin: 0;
+}
+.flexbox {
+ width: 600px;
+ display: -webkit-flex;
+ background-color: grey;
+}
+.flexbox > div {
+ height: 20px;
+ width: 20px;
+ border: 0;
+}
+
+.rtl {
+ direction: rtl;
+}
+
+.bt {
+ -webkit-writing-mode: horizontal-bt;
+}
+
+.vertical-rl, .vertical-lr, .column, .column-reverse {
+ height: 600px;
+}
+
+.vertical-rl {
+ -webkit-writing-mode: vertical-rl;
+}
+
+.vertical-lr {
+ -webkit-writing-mode: vertical-lr;
+}
+
+.row-reverse {
+ -webkit-flex-flow: row-reverse;
+}
+
+.column {
+ -webkit-flex-flow: column;
+}
+
+.column-reverse {
+ -webkit-flex-flow: column-reverse;
+}
+
+.flexbox > .first {
+ background-color: blue;
+}
+.flexbox > .second {
+ background-color: green;
+}
+.flexbox > .third {
+ background-color: red;
+}
+
+.flexbox > div > div {
+ background-color: orange;
+ height: 10px;
+}
+</style>
+<script src="../../resources/check-layout.js"></script>
+<body onload="checkLayout('.flexbox')">
+
+<div class="flexbox">
+ <div class="first" data-expected-width="75" data-offset-x="0" style="-webkit-flex: 1 0 0; margin: 0 auto;"></div>
+ <div class="second" data-expected-width="350" data-offset-x="75" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-x="275"></div></div>
+ <div class="third" data-expected-width="75" data-offset-x="425" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+
+<div class="flexbox rtl">
+ <div class="first" data-expected-width="75" data-offset-x="525" style="-webkit-flex: 1 0 0; margin: 0 auto;"></div>
+ <div class="second" data-expected-width="350" data-offset-x="175" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-x="175"></div></div>
+ <div class="third" data-expected-width="75" data-offset-x="100" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+
+<div class="flexbox row-reverse">
+ <div class="first" data-expected-width="75" data-offset-x="525" style="-webkit-flex: 1 0 0; margin: 0 auto;"></div>
+ <div class="second" data-expected-width="350" data-offset-x="175" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-x="375"></div></div>
+ <div class="third" data-expected-width="75" data-offset-x="0" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+
+<div class="flexbox rtl row-reverse">
+ <div class="first" data-expected-width="75" data-offset-x="0" style="-webkit-flex: 1 0 0; margin: 0 auto;"></div>
+ <div class="second" data-expected-width="350" data-offset-x="75" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-x="75"></div></div>
+ <div class="third" data-expected-width="75" data-offset-x="525" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+
+<div style="position: relative;">
+<div class="flexbox column">
+ <div class="first" data-expected-height="150" data-offset-y="0" style="-webkit-flex: 1 0 0; margin: auto 200px auto 150px;"></div>
+ <div class="second" data-expected-height="300" data-offset-y="150" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="200"></div></div>
+ <div class="third" data-expected-height="150" data-offset-y="450" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div class="flexbox column-reverse">
+ <div class="first" data-expected-height="150" data-offset-y="450" style="-webkit-flex: 1 0 0; margin: auto 200px auto 150px;"></div>
+ <div class="second" data-expected-height="300" data-offset-y="150" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="200"></div></div>
+ <div class="third" data-expected-height="150" data-offset-y="0" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div class="flexbox column rtl">
+ <div class="first" data-expected-height="150" data-offset-y="0" data-offset-x="480" style="-webkit-flex: 1 0 0; margin: auto 100px auto 50px;"></div>
+ <div class="second" data-expected-height="300" data-offset-y="150" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="380"></div></div>
+ <div class="third" data-expected-height="150" data-offset-y="450" data-offset-x="580" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div class="flexbox column-reverse rtl">
+ <div class="first" data-expected-height="150" data-offset-y="450" data-offset-x="480" style="-webkit-flex: 1 0 0; margin: auto 100px auto 50px;"></div>
+ <div class="second" data-expected-height="300" data-offset-y="150" style="-webkit-flex: 2 0 0; -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="380"></div></div>
+ <div class="third" data-expected-height="150" data-offset-y="0" data-offset-x="580" style="-webkit-flex: 1 0 0; -webkit-margin-end: 100px;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div data-expected-height="600" class="flexbox vertical-lr column">
+ <div class="first" data-offset-x="0" data-expected-width="500" style="-webkit-flex: 1 0 0; min-width: 300px"></div>
+ <div class="second" data-offset-x="500" data-offset-y="100" data-expected-width="100" style="-webkit-flex: 1 0 200px; max-width: 100px; margin: 100px 0 50px 0;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div data-expected-height="600" class="flexbox vertical-lr column-reverse">
+ <div class="first" data-offset-x="100" data-expected-width="500" style="-webkit-flex: 1 0 0; min-width: 300px"></div>
+ <div class="second" data-offset-x="0" data-offset-y="100" data-expected-width="100" style="-webkit-flex: 1 0 200px; max-width: 100px; margin: 100px 0 50px 0;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div data-expected-height="600" class="flexbox vertical-rl column">
+ <div class="first" data-offset-x="100" data-expected-width="500" style="-webkit-flex: 1 0 0; min-width: 300px; margin-bottom: 100px"></div>
+ <div class="second" data-offset-x="0" data-offset-y="100" data-expected-width="100" style="-webkit-flex: 1 0 200px; max-width: 100px; margin: 100px 0 50px 0;"></div>
+</div>
+</div>
+
+<div style="position: relative;">
+<div data-expected-height="600" class="flexbox vertical-rl column-reverse">
+ <div class="first" data-offset-x="0" data-expected-width="500" style="-webkit-flex: 1 0 0; min-width: 300px; margin-bottom: 100px"></div>
+ <div class="second" data-offset-x="500" data-offset-y="100" data-expected-width="100" style="-webkit-flex: 1 0 200px; max-width: 100px; margin: 100px 0 50px 0;"></div>
+</div>
+</div>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection1expectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1-expected.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1-expected.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1-expected.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<style>
+.root {
+ background-color: lime;
+ margin: 5px;
+}
+.testcase {
+ height: 25px;
+ width: 50px;
+ background-color: red;
+}
+.left {
+ margin-left: 200px;
+}
+.right {
+ margin-left: calc(100% - 250px);
+}
+</style>
+</head>
+<body>
+ <p>This test the style is not copied from the wrong source when the direction is defined.</p>
+ <div class="root">
+ <div class="left testcase"></div>
+ <div>
+ <div class="left testcase"></div>
+ </div>
+ </div>
+ <div class="root">
+ <div class="right testcase"></div>
+ <div>
+ <div class="right testcase"></div>
+ </div>
+ </div>
+ <div class="root">
+ <div class="left testcase"></div>
+ <div>
+ <div class="left testcase"></div>
+ </div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection1html"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-1.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<style>
+.default {
+ background-color: lime;
+ margin: 5px;
+}
+.ltr {
+ direction: ltr;
+ background-color: lime;
+ margin: 5px;
+}
+.rtl {
+ direction: rtl;
+ background-color: lime;
+ margin: 5px;
+}
+</style>
+</head>
+<body>
+ <p>This test the style is not copied from the wrong source when the direction is defined.</p>
+ <!-- The inline style strings must be strictly equal. Each tested div must also match the exact same set of rules. -->
+ <div class="ltr">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+ <div class="rtl">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+ <div class="default">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection2expectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2-expected.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2-expected.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2-expected.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<style>
+.root {
+ background-color: lime;
+ margin: 5px;
+}
+.testcase {
+ height: 25px;
+ width: 50px;
+ background-color: red;
+}
+.left {
+ margin-left: 200px;
+}
+.right {
+ margin-left: calc(100% - 250px);
+}
+</style>
+</head>
+<body>
+ <p>This test the style is not copied from the wrong source when the direction is defined.</p>
+ <div class="root">
+ <div class="right testcase"></div>
+ <div>
+ <div class="right testcase"></div>
+ </div>
+ </div>
+ <div class="root">
+ <div class="left testcase"></div>
+ <div>
+ <div class="left testcase"></div>
+ </div>
+ </div>
+ <div class="root">
+ <div class="left testcase"></div>
+ <div>
+ <div class="left testcase"></div>
+ </div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection2html"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-2.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<style>
+.default {
+ background-color: lime;
+ margin: 5px;
+}
+.ltr {
+ direction: ltr;
+ background-color: lime;
+ margin: 5px;
+}
+.rtl {
+ direction: rtl;
+ background-color: lime;
+ margin: 5px;
+}
+</style>
+</head>
+<body>
+ <p>This test the style is not copied from the wrong source when the direction is defined.</p>
+ <!-- The inline style strings must be strictly equal. Each tested div must also match the exact same set of rules. -->
+ <div class="rtl">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+ <div class="ltr">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+ <div class="default">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection3expectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3-expected.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3-expected.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3-expected.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<style>
+.root {
+ background-color: lime;
+ margin: 5px;
+}
+.testcase {
+ height: 25px;
+ width: 50px;
+ background-color: red;
+}
+.left {
+ margin-left: 200px;
+}
+.right {
+ margin-left: calc(100% - 250px);
+}
+</style>
+</head>
+<body>
+ <p>This test the style is not copied from the wrong source when the direction is defined.</p>
+ <div class="root">
+ <div class="left testcase"></div>
+ <div>
+ <div class="left testcase"></div>
+ </div>
+ </div>
+ <div class="root">
+ <div class="left testcase"></div>
+ <div>
+ <div class="left testcase"></div>
+ </div>
+ </div>
+ <div class="root">
+ <div class="right testcase"></div>
+ <div>
+ <div class="right testcase"></div>
+ </div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26LayoutTestsfastcssstyleresolvercachedirection3html"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3.html (0 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3.html         (rev 0)
+++ releases/WebKitGTK/webkit-2.6/LayoutTests/fast/css/style-resolver-cache-direction-3.html        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<style>
+.default {
+ background-color: lime;
+ margin: 5px;
+}
+.ltr {
+ direction: ltr;
+ background-color: lime;
+ margin: 5px;
+}
+.rtl {
+ direction: rtl;
+ background-color: lime;
+ margin: 5px;
+}
+</style>
+</head>
+<body>
+ <p>This test the style is not copied from the wrong source when the direction is defined.</p>
+ <!-- The inline style strings must be strictly equal. Each tested div must also match the exact same set of rules. -->
+ <div class="default">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+ <div class="ltr">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+ <div class="rtl">
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ <div>
+ <div style="height: 25px; width: 50px; background-color: red; -webkit-margin-start: 200px; -moz-margin-start: 200px;"></div>
+ </div>
+ </div>
+</body>
+</html>
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog (174432 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2014-10-08 11:20:03 UTC (rev 174432)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-09-23 Benjamin Poulain <bpoulain@apple.com>
+
+ The style resolution cache applies properties incorrectly whenever direction != ltr
+ https://bugs.webkit.org/show_bug.cgi?id=137052
+
+ Reviewed by Andreas Kling.
+
+ The optimization r135021 introduced a bug whenever the direction of subtree is not
+ uniform in the whole page.
+
+ When StyleResolver::applyMatchedProperties() resolves the style, some properties are
+ resolved differently based on the writing-mode and the direction.
+
+ In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled
+ by not caching any style with anything else than the default.
+ The direction was ignored, causing the bugs solved here.
+
+ Tests: css3/flexbox/flex-flow-2.html
+ fast/css/style-resolver-cache-direction-1.html
+ fast/css/style-resolver-cache-direction-2.html
+ fast/css/style-resolver-cache-direction-3.html
+
+ * css/StyleResolver.cpp:
+ (WebCore::isCacheableInMatchedPropertiesCache):
+
</ins><span class="cx"> 2014-09-22 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Ensure that layout is up-to-date before hit-testing via RenderView
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit26SourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/css/StyleResolver.cpp (174432 => 174433)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.6/Source/WebCore/css/StyleResolver.cpp        2014-10-08 11:20:03 UTC (rev 174432)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/css/StyleResolver.cpp        2014-10-08 11:23:45 UTC (rev 174433)
</span><span class="lines">@@ -1622,7 +1622,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> if (style->zoom() != RenderStyle::initialZoom())
</span><span class="cx"> return false;
</span><del>- if (style->writingMode() != RenderStyle::initialWritingMode())
</del><ins>+ if (style->writingMode() != RenderStyle::initialWritingMode() || style->direction() != RenderStyle::initialDirection())
</ins><span class="cx"> return false;
</span><span class="cx"> // The cache assumes static knowledge about which properties are inherited.
</span><span class="cx"> if (parentStyle->hasExplicitlyInheritedProperties())
</span></span></pre>
</div>
</div>
</body>
</html>