No subject


Fri Mar 7 15:32:22 PST 2014


This is not a regression and I cannot fix that easily so I left a fixme.

Tests: fast/css/data-attribute-style-sharing-1.html
       fast/css/data-attribute-style-sharing-2.html
       fast/css/data-attribute-style-sharing-3.html
       fast/css/data-attribute-style-sharing-4.html
       fast/css/data-attribute-style-sharing-5.html
       fast/css/data-attribute-style-sharing-6.html
       fast/css/data-attribute-style-sharing-7.html
       fast/css/readonly-attribute-style-sharing-1.html
       fast/css/readonly-attribute-style-sharing-2.html
       fast/css/readonly-attribute-style-sharing-3.html
       fast/css/readonly-attribute-style-sharing-4.html
       fast/css/readonly-attribute-style-sharing-5.html
       fast/css/readonly-attribute-style-sharing-6.html
       fast/css/readonly-attribute-style-sharing-7.html
       fast/css/type-attribute-style-sharing-1.html
       fast/css/type-attribute-style-sharing-2.html
       fast/css/type-attribute-style-sharing-3.html
       fast/css/type-attribute-style-sharing-4.html
       fast/css/type-attribute-style-sharing-5.html
       fast/css/type-attribute-style-sharing-6.html
       fast/css/type-attribute-style-sharing-7.html

* css/RuleSet.cpp:
(WebCore::containsUncommonAttributeSelector):
(WebCore::RuleData::RuleData):
(WebCore::selectorListContainsAttributeSelector): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithControl):
(WebCore::StyleResolver::canShareStyleWithElement):

LayoutTests:

* fast/css/data-attribute-style-sharing-1-expected.html: Added.
* fast/css/data-attribute-style-sharing-1.html: Added.
* fast/css/data-attribute-style-sharing-2-expected.html: Added.
* fast/css/data-attribute-style-sharing-2.html: Added.
* fast/css/data-attribute-style-sharing-3-expected.html: Added.
* fast/css/data-attribute-style-sharing-3.html: Added.
* fast/css/data-attribute-style-sharing-4-expected.html: Added.
* fast/css/data-attribute-style-sharing-4.html: Added.
* fast/css/data-attribute-style-sharing-5-expected.html: Added.
* fast/css/data-attribute-style-sharing-5.html: Added.
* fast/css/data-attribute-style-sharing-6-expected.html: Added.
* fast/css/data-attribute-style-sharing-6.html: Added.
* fast/css/data-attribute-style-sharing-7-expected.html: Added.
* fast/css/data-attribute-style-sharing-7.html: Added.
* fast/css/readonly-attribute-style-sharing-1-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-1.html: Added.
* fast/css/readonly-attribute-style-sharing-2-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-2.html: Added.
* fast/css/readonly-attribute-style-sharing-3-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-3.html: Added.
* fast/css/readonly-attribute-style-sharing-4-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-4.html: Added.
* fast/css/readonly-attribute-style-sharing-5-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-5.html: Added.
* fast/css/readonly-attribute-style-sharing-6-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-6.html: Added.
* fast/css/readonly-attribute-style-sharing-7-expected.html: Added.
* fast/css/readonly-attribute-style-sharing-7.html: Added.
* fast/css/type-attribute-style-sharing-1-expected.html: Added.
* fast/css/type-attribute-style-sharing-1.html: Added.
* fast/css/type-attribute-style-sharing-2-expected.html: Added.
* fast/css/type-attribute-style-sharing-2.html: Added.
* fast/css/type-attribute-style-sharing-3-expected.html: Added.
* fast/css/type-attribute-style-sharing-3.html: Added.
* fast/css/type-attribute-style-sharing-4-expected.html: Added.
* fast/css/type-attribute-style-sharing-4.html: Added.
* fast/css/type-attribute-style-sharing-5-expected.html: Added.
* fast/css/type-attribute-style-sharing-5.html: Added.
* fast/css/type-attribute-style-sharing-6-expected.html: Added.
* fast/css/type-attribute-style-sharing-6.html: Added.
* fast/css/type-attribute-style-sharing-7-expected.html: Added.
* fast/css/type-attribute-style-sharing-7.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssRuleSetcpp">trunk/Source/WebCore/css/RuleSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing1expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-1-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing1html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-1.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing2expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-2-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing2html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-2.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing3expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-3-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing3html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-3.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing4expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-4-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing4html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-4.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing5expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-5-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing5html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-5.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing6expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-6-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing6html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-6.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing7expectedhtml">trunk/LayoutTests/fast/css/data-attribute-style-sharing-7-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssdataattributestylesharing7html">trunk/LayoutTests/fast/css/data-attribute-style-sharing-7.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing1expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing1html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing2expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing2html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing3expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing3html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing4expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing4html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing5expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing5html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing6expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing6html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing7expectedhtml">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssreadonlyattributestylesharing7html">trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing1expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-1-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing1html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-1.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing2expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-2-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing2html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-2.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing3expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-3-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing3html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-3.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing4expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-4-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing4html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-4.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing5expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-5-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing5html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-5.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing6expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-6-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing6html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-6.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing7expectedhtml">trunk/LayoutTests/fast/css/type-attribute-style-sharing-7-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsstypeattributestylesharing7html">trunk/LayoutTests/fast/css/type-attribute-style-sharing-7.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176863 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog	2014-12-05 20:51:02 UTC (rev 176863)
+++ trunk/LayoutTests/ChangeLog	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2014-12-05  Benjamin Poulain  &lt;bpoulain at apple.com&gt;
+
+        Fix style sharing with the &quot;type&quot; and &quot;readonly&quot; attributes
+        https://bugs.webkit.org/show_bug.cgi?id=139283
+
+        Reviewed by Antti Koivisto.
+
+        * fast/css/data-attribute-style-sharing-1-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-1.html: Added.
+        * fast/css/data-attribute-style-sharing-2-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-2.html: Added.
+        * fast/css/data-attribute-style-sharing-3-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-3.html: Added.
+        * fast/css/data-attribute-style-sharing-4-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-4.html: Added.
+        * fast/css/data-attribute-style-sharing-5-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-5.html: Added.
+        * fast/css/data-attribute-style-sharing-6-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-6.html: Added.
+        * fast/css/data-attribute-style-sharing-7-expected.html: Added.
+        * fast/css/data-attribute-style-sharing-7.html: Added.
+        * fast/css/readonly-attribute-style-sharing-1-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-1.html: Added.
+        * fast/css/readonly-attribute-style-sharing-2-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-2.html: Added.
+        * fast/css/readonly-attribute-style-sharing-3-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-3.html: Added.
+        * fast/css/readonly-attribute-style-sharing-4-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-4.html: Added.
+        * fast/css/readonly-attribute-style-sharing-5-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-5.html: Added.
+        * fast/css/readonly-attribute-style-sharing-6-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-6.html: Added.
+        * fast/css/readonly-attribute-style-sharing-7-expected.html: Added.
+        * fast/css/readonly-attribute-style-sharing-7.html: Added.
+        * fast/css/type-attribute-style-sharing-1-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-1.html: Added.
+        * fast/css/type-attribute-style-sharing-2-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-2.html: Added.
+        * fast/css/type-attribute-style-sharing-3-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-3.html: Added.
+        * fast/css/type-attribute-style-sharing-4-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-4.html: Added.
+        * fast/css/type-attribute-style-sharing-5-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-5.html: Added.
+        * fast/css/type-attribute-style-sharing-6-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-6.html: Added.
+        * fast/css/type-attribute-style-sharing-7-expected.html: Added.
+        * fast/css/type-attribute-style-sharing-7.html: Added.
+
</ins><span class="cx"> 2014-12-04  Dean Jackson  &lt;dino at apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         css3/viewport-percentage-lengths tests are flakey on WK1 Mavericks Debug
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing1expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-1-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-1-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-1-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;style&gt;
+            /* Pack them to fit everything in 800*600 */
+            div &gt; * {
+                padding: 5px;
+                width: 100px;
+                float: left;
+            }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+        &lt;div&gt;
+            &lt;div&gt;No data-webkit&lt;/div&gt;
+            &lt;div style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;/div&gt;
+            &lt;div style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+            &lt;div style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div&gt;
+            &lt;span&gt;No data-webkit&lt;/span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;/span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;/span&gt;
+        &lt;/div&gt;
+        &lt;div&gt;
+            &lt;input value=&quot;No data-webkit&quot;&gt;
+            &lt;input style=&quot;background-color: red;&quot; value=&quot;data-webkit defined&quot;&gt;
+            &lt;input style=&quot;background-color: red;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+            &lt;input style=&quot;background-color: blue;&quot; value=&quot;data-webkit is foobar&quot;&gt;
+        &lt;/div&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-1.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-1.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-1.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        [data-webkit] {
+            background-color: red;
+        }
+        [data-webkit=foobar] {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No data-webkit&lt;/div&gt;
+        &lt;div data-webkit&gt;data-webkit defined&lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No data-webkit&lt;/span&gt;
+        &lt;span data-webkit&gt;data-webkit defined&lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-2-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-2-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-2-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;No data-webkit&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;data-webkit defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+        &lt;div&gt;data-webkit is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;No data-webkit&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+        &lt;span&gt;data-webkit is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;No data-webkit&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;data-webkit defined&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-2.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-2.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        div &gt; :not([data-webkit]) {
+            background-color: red;
+        }
+        div &gt; :not([data-webkit=foobar]) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No data-webkit&lt;/div&gt;
+        &lt;div data-webkit&gt;data-webkit defined&lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No data-webkit&lt;/span&gt;
+        &lt;span data-webkit&gt;data-webkit defined&lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing3expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-3-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-3-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-3-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;style&gt;
+            /* Pack them to fit everything in 800*600 */
+            div &gt; * {
+                padding: 5px;
+                width: 100px;
+                float: left;
+            }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+        &lt;div&gt;
+            &lt;div&gt;No data-webkit&lt;/div&gt;
+            &lt;div style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;/div&gt;
+            &lt;div style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+            &lt;div style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div&gt;
+            &lt;span&gt;No data-webkit&lt;/span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;/span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;/span&gt;
+        &lt;/div&gt;
+        &lt;div&gt;
+            &lt;input value=&quot;No data-webkit&quot;&gt;
+            &lt;input style=&quot;background-color: red;&quot; value=&quot;data-webkit defined&quot;&gt;
+            &lt;input style=&quot;background-color: red;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+            &lt;input style=&quot;background-color: blue;&quot; value=&quot;data-webkit is foobar&quot;&gt;
+        &lt;/div&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-3.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-3.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-3.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([data-webkit]) {
+            background-color: red;
+        }
+        :matches([data-webkit=foobar]) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No data-webkit&lt;/div&gt;
+        &lt;div data-webkit&gt;data-webkit defined&lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No data-webkit&lt;/span&gt;
+        &lt;span data-webkit&gt;data-webkit defined&lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing4expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-4-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-4-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-4-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;style&gt;
+            /* Pack them to fit everything in 800*600 */
+            div &gt; * {
+                padding: 5px;
+                width: 100px;
+                float: left;
+            }
+        &lt;/style&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+        &lt;div&gt;
+            &lt;div&gt;No data-webkit&lt;/div&gt;
+            &lt;div style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;/div&gt;
+            &lt;div style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+            &lt;div style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div&gt;
+            &lt;span&gt;No data-webkit&lt;/span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;/span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;/span&gt;
+        &lt;/div&gt;
+        &lt;div&gt;
+            &lt;input value=&quot;No data-webkit&quot;&gt;
+            &lt;input style=&quot;background-color: red;&quot; value=&quot;data-webkit defined&quot;&gt;
+            &lt;input style=&quot;background-color: red;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+            &lt;input style=&quot;background-color: blue;&quot; value=&quot;data-webkit is foobar&quot;&gt;
+        &lt;/div&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-4.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-4.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-4.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches(:matches(:matches([data-webkit]))) {
+            background-color: red;
+        }
+        :matches(:matches(:matches([data-webkit=foobar]))) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No data-webkit&lt;/div&gt;
+        &lt;div data-webkit&gt;data-webkit defined&lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No data-webkit&lt;/span&gt;
+        &lt;span data-webkit&gt;data-webkit defined&lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;data-webkit defined empty&lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;data-webkit is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing5expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-5-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-5-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-5-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-5.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-5.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-5.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        [data-webkit] &gt; * {
+            background-color: red;
+        }
+        [data-webkit=foobar] &gt; * {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit&gt;
+            Padding
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit&gt;
+            Padding
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing6expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-6-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-6-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-6-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing6html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-6.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-6.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-6.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([data-webkit]) &gt; * {
+            background-color: red;
+        }
+        :matches([data-webkit=foobar]) &gt; * {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit&gt;
+            Padding
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit&gt;
+            Padding
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing7expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-7-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-7-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-7-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssdataattributestylesharing7html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/data-attribute-style-sharing-7.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/data-attribute-style-sharing-7.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/data-attribute-style-sharing-7.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([data-webkit] &gt; *) {
+            background-color: red;
+        }
+        :matches([data-webkit=foobar] &gt; *) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore data attributes.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit&gt;
+            Padding
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            &lt;span&gt;No data-webkit&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit&gt;
+            Padding
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            &lt;span&gt;data-webkit defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            &lt;span&gt;data-webkit defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span data-webkit=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            &lt;span&gt;data-webkit is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No data-webkit&quot;&gt;
+        &lt;input data-webkit value=&quot;data-webkit defined&quot;&gt;
+        &lt;input data-webkit=&quot;&quot; value=&quot;data-webkit defined empty&quot;&gt;
+        &lt;input data-webkit=&quot;foobar&quot; value=&quot;data-webkit is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing1expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly style=&quot;background-color: red;&quot; value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; style=&quot;background-color: red;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; style=&quot;background-color: blue;&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-1.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        [readonly] {
+            background-color: red;
+        }
+        [readonly=foobar] {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div readonly&gt;Readonly defined&lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span readonly&gt;Readonly defined&lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;No readonly&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Readonly defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;No readonly&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;No readonly&quot;&gt;
+        &lt;input readonly style=&quot;background-color: blue;&quot; value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; style=&quot;background-color: blue;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-2.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        div &gt; :not([readonly]) {
+            background-color: red;
+        }
+        div &gt; :not([readonly=foobar]) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div readonly&gt;Readonly defined&lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span readonly&gt;Readonly defined&lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing3expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly style=&quot;background-color: red;&quot; value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; style=&quot;background-color: red;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; style=&quot;background-color: blue;&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-3.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([readonly]) {
+            background-color: red;
+        }
+        :matches([readonly=foobar]) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div readonly&gt;Readonly defined&lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span readonly&gt;Readonly defined&lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing4expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly style=&quot;background-color: red;&quot; value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; style=&quot;background-color: red;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; style=&quot;background-color: blue;&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-4.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches(:matches(:matches([readonly]))) {
+            background-color: red;
+        }
+        :matches(:matches(:matches([readonly=foobar]))) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No readonly&lt;/div&gt;
+        &lt;div readonly&gt;Readonly defined&lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;Readonly defined empty&lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No readonly&lt;/span&gt;
+        &lt;span readonly&gt;Readonly defined&lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;Readonly defined empty&lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;Readonly is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing5expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-5.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        [readonly] &gt; * {
+            background-color: red;
+        }
+        [readonly=foobar] &gt; * {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly&gt;
+            Padding
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly&gt;
+            Padding
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing6expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing6html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-6.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([readonly]) &gt; * {
+            background-color: red;
+        }
+        :matches([readonly=foobar]) &gt; * {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly&gt;
+            Padding
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly&gt;
+            Padding
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing7expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssreadonlyattributestylesharing7html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readonly-attribute-style-sharing-7.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([readonly] &gt; *) {
+            background-color: red;
+        }
+        :matches([readonly=foobar] &gt; *) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;readonly&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly&gt;
+            Padding
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            &lt;span&gt;No readonly&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly&gt;
+            Padding
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            &lt;span&gt;Readonly defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            &lt;span&gt;Readonly defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span readonly=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            &lt;span&gt;Readonly is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No readonly&quot;&gt;
+        &lt;input readonly value=&quot;Readonly defined&quot;&gt;
+        &lt;input readonly=&quot;&quot; value=&quot;Readonly defined empty&quot;&gt;
+        &lt;input readonly=&quot;foobar&quot; value=&quot;Readonly is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing1expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-1-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-1-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-1-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Type defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; value=&quot;Type defined&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-1.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-1.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-1.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        [type] {
+            background-color: red;
+        }
+        [type=foobar] {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div type&gt;Type defined&lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span type&gt;Type defined&lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-2-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-2-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-2-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;No type&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Type defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;No type&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Type defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;No type&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;Type defined&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-2.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-2.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        div &gt; :not([type]) {
+            background-color: red;
+        }
+        div &gt; :not([type=foobar]) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div type&gt;Type defined&lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span type&gt;Type defined&lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing3expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-3-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-3-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-3-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Type defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; value=&quot;Type defined&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-3.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-3.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-3.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([type]) {
+            background-color: red;
+        }
+        :matches([type=foobar]) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div type&gt;Type defined&lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span type&gt;Type defined&lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing4expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-4-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-4-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-4-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Type defined&lt;/div&gt;
+        &lt;div style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;/span&gt;
+        &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; value=&quot;Type defined&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input style=&quot;background-color: blue;&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-4.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-4.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-4.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches(:matches(:matches([type]))) {
+            background-color: red;
+        }
+        :matches(:matches(:matches([type=foobar]))) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;No type&lt;/div&gt;
+        &lt;div type&gt;Type defined&lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;Type defined empty&lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;Type is foobar&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;No type&lt;/span&gt;
+        &lt;span type&gt;Type defined&lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;Type defined empty&lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;Type is foobar&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing5expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-5-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-5-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-5-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-5.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-5.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-5.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        [type] &gt; * {
+            background-color: red;
+        }
+        [type=foobar] &gt; * {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type&gt;
+            Padding
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type&gt;
+            Padding
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing6expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-6-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-6-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-6-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing6html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-6.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-6.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-6.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([type]) &gt; * {
+            background-color: red;
+        }
+        :matches([type=foobar]) &gt; * {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type&gt;
+            Padding
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type&gt;
+            Padding
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing7expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-7-expected.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-7-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-7-expected.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            &lt;span style=&quot;background-color: red;&quot;&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            &lt;span style=&quot;background-color: blue;&quot;&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsstypeattributestylesharing7html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/type-attribute-style-sharing-7.html (0 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/type-attribute-style-sharing-7.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/type-attribute-style-sharing-7.html	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        div &gt; * {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :matches([type] &gt; *) {
+            background-color: red;
+        }
+        :matches([type=foobar] &gt; *) {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore the &quot;type&quot; attribute.&lt;/p&gt;
+    &lt;div&gt;
+        &lt;div&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type&gt;
+            Padding
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+        &lt;div type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;span&gt;
+            Padding
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            &lt;span&gt;No type&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type&gt;
+            Padding
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            &lt;span&gt;Type defined&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;&quot;&gt;
+            Padding
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            &lt;span&gt;Type defined empty&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+        &lt;span type=&quot;foobar&quot;&gt;
+            Padding
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            &lt;span&gt;Type is foobar&lt;span&gt;
+            Padding
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;input value=&quot;No type&quot;&gt;
+        &lt;input type value=&quot;Type defined&quot;&gt;
+        &lt;input type=&quot;&quot; value=&quot;Type defined empty&quot;&gt;
+        &lt;input type=&quot;foobar&quot; value=&quot;Type is foobar&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176863 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog	2014-12-05 20:51:02 UTC (rev 176863)
+++ trunk/Source/WebCore/ChangeLog	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -1,3 +1,75 @@
</span><ins>+2014-12-05  Benjamin Poulain  &lt;bpoulain at apple.com&gt;
+
+        Fix style sharing with the &quot;type&quot; and &quot;readonly&quot; attributes
+        https://bugs.webkit.org/show_bug.cgi?id=139283
+
+        Reviewed by Antti Koivisto.
+
+        There are two bugs adressed with this patch:
+        1) The attributes &quot;type&quot; and &quot;readonly&quot; where only handled correctly
+           for input elements. For everything else, they could incorrectly
+           be ignored for style sharing.
+        2) The handling of attributes was incorrect for selector lists, leading
+           to various bugs (incorrect style sharing in some cases, disabling
+           style sharing on valid cases).
+
+        For [1], the problem was that attribute checking had been limited to
+        StyleResolver::canShareStyleWithControl(). That function is for handling
+        the special states of input element. For any other element, the attributes
+        were simply ignored.
+
+        For [2], there were a bunch of small problems. First, containsUncommonAttributeSelector()
+        was not recursive, which caused it to ignored any nested selector list. This used to be
+        correct but since we have advanced selectors we can no longer assumed selectors are not nested.
+
+        A second issue was that any attribute in a selector list was causing us to fall back
+        to the slow case. Now that we have the fast :matches(), we really don't want that.
+
+        The function containsUncommonAttributeSelector() was transformed into a recursive function
+        tracking where we are in the selector.
+
+        At the entry point, we start with the flag &quot;startsOnRightmostElement&quot; set to true. The flag is then
+        updated on the stack of each recursive call.
+
+        For example, &quot;webkit &gt; is:matches(freaking &gt; awesome)&quot;. We evalute &quot;is&quot; with the flag to true, then recurse
+        into evaluating &quot;freaking &gt; awesome&quot; with the flag still set to true. When we evalute &quot;&gt;&quot;, the flag
+        is set to false to evaluate any following selectors.
+        After evaluating &quot;freaking &gt; awesome&quot;, we go back to our previous stack frame, and the flag
+        is back to true and we can continue evaluating with the curren top level state.
+
+        From some logging, I discovered that the attribute handling is way too aggressive.
+        This is not a regression and I cannot fix that easily so I left a fixme.
+
+        Tests: fast/css/data-attribute-style-sharing-1.html
+               fast/css/data-attribute-style-sharing-2.html
+               fast/css/data-attribute-style-sharing-3.html
+               fast/css/data-attribute-style-sharing-4.html
+               fast/css/data-attribute-style-sharing-5.html
+               fast/css/data-attribute-style-sharing-6.html
+               fast/css/data-attribute-style-sharing-7.html
+               fast/css/readonly-attribute-style-sharing-1.html
+               fast/css/readonly-attribute-style-sharing-2.html
+               fast/css/readonly-attribute-style-sharing-3.html
+               fast/css/readonly-attribute-style-sharing-4.html
+               fast/css/readonly-attribute-style-sharing-5.html
+               fast/css/readonly-attribute-style-sharing-6.html
+               fast/css/readonly-attribute-style-sharing-7.html
+               fast/css/type-attribute-style-sharing-1.html
+               fast/css/type-attribute-style-sharing-2.html
+               fast/css/type-attribute-style-sharing-3.html
+               fast/css/type-attribute-style-sharing-4.html
+               fast/css/type-attribute-style-sharing-5.html
+               fast/css/type-attribute-style-sharing-6.html
+               fast/css/type-attribute-style-sharing-7.html
+
+        * css/RuleSet.cpp:
+        (WebCore::containsUncommonAttributeSelector):
+        (WebCore::RuleData::RuleData):
+        (WebCore::selectorListContainsAttributeSelector): Deleted.
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::canShareStyleWithControl):
+        (WebCore::StyleResolver::canShareStyleWithElement):
+
</ins><span class="cx"> 2014-12-05  Jer Noble  &lt;jer.noble at apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WTF] MediaTime should support round-tripping from and to doubles.
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.cpp (176863 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.cpp	2014-12-05 20:51:02 UTC (rev 176863)
+++ trunk/Source/WebCore/css/RuleSet.cpp	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -96,49 +96,44 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool selectorListContainsAttributeSelector(const CSSSelector* selector)
-{
-    const CSSSelectorList* selectorList = selector-&gt;selectorList();
-    if (!selectorList)
-        return false;
-    for (const CSSSelector* selector = selectorList-&gt;first(); selector; selector = CSSSelectorList::next(selector)) {
-        for (const CSSSelector* component = selector; component; component = component-&gt;tagHistory()) {
-            if (component-&gt;isAttributeSelector())
-                return true;
-        }
-    }
-    return false;
-}
-
</del><span class="cx"> static inline bool isCommonAttributeSelectorAttribute(const QualifiedName&amp; attribute)
</span><span class="cx"> {
</span><span class="cx">     // These are explicitly tested for equality in canShareStyleWithElement.
</span><span class="cx">     return attribute == typeAttr || attribute == readonlyAttr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool containsUncommonAttributeSelector(const CSSSelector* selector)
</del><ins>+static bool containsUncommonAttributeSelector(const CSSSelector&amp; rootSelector, bool matchesRightmostElement)
</ins><span class="cx"> {
</span><del>-    for (; selector; selector = selector-&gt;tagHistory()) {
-        // Allow certain common attributes (used in the default style) in the selectors that match the current element.
-        if (selector-&gt;isAttributeSelector() &amp;&amp; !isCommonAttributeSelectorAttribute(selector-&gt;attribute()))
-            return true;
-        if (selectorListContainsAttributeSelector(selector))
-            return true;
-        if (selector-&gt;relation() != CSSSelector::SubSelector) {
-            selector = selector-&gt;tagHistory();
-            break;
</del><ins>+    const CSSSelector* selector = &amp;rootSelector;
+    do {
+        if (selector-&gt;isAttributeSelector()) {
+            // FIXME: considering non-rightmost simple selectors is necessary because of the style sharing of cousins.
+            // It is a primitive solution which disable a lot of style sharing on pages that rely on attributes for styling.
+            // We should investigate better ways of doing this.
+            if (!isCommonAttributeSelectorAttribute(selector-&gt;attribute()) || !matchesRightmostElement)
+                return true;
</ins><span class="cx">         }
</span><del>-    }
</del><span class="cx"> 
</span><del>-    for (; selector; selector = selector-&gt;tagHistory()) {
-        if (selector-&gt;isAttributeSelector())
-            return true;
-        if (selectorListContainsAttributeSelector(selector))
-            return true;
-    }
</del><ins>+        if (const CSSSelectorList* selectorList = selector-&gt;selectorList()) {
+            for (const CSSSelector* subSelector = selectorList-&gt;first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+                if (containsUncommonAttributeSelector(*subSelector, matchesRightmostElement))
+                    return true;
+            }
+        }
+
+        if (selector-&gt;relation() != CSSSelector::SubSelector)
+            matchesRightmostElement = false;
+
+        selector = selector-&gt;tagHistory();
+    } while (selector);
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline bool containsUncommonAttributeSelector(const CSSSelector&amp; rootSelector)
+{
+    return containsUncommonAttributeSelector(rootSelector, true);
+}
+
</ins><span class="cx"> static inline PropertyWhitelistType determinePropertyWhitelistType(const AddRuleFlags addRuleFlags, const CSSSelector* selector)
</span><span class="cx"> {
</span><span class="cx">     if (addRuleFlags &amp; RuleIsInRegionRule)
</span><span class="lines">@@ -161,7 +156,7 @@
</span><span class="cx">     , m_position(position)
</span><span class="cx">     , m_matchBasedOnRuleHash(static_cast&lt;unsigned&gt;(computeMatchBasedOnRuleHash(*selector())))
</span><span class="cx">     , m_canMatchPseudoElement(selectorCanMatchPseudoElement(*selector()))
</span><del>-    , m_containsUncommonAttributeSelector(WebCore::containsUncommonAttributeSelector(selector()))
</del><ins>+    , m_containsUncommonAttributeSelector(WebCore::containsUncommonAttributeSelector(*selector()))
</ins><span class="cx">     , m_linkMatchType(SelectorChecker::determineLinkMatchType(selector()))
</span><span class="cx">     , m_propertyWhitelistType(determinePropertyWhitelistType(addRuleFlags, selector()))
</span><span class="cx"> #if ENABLE(CSS_SELECTOR_JIT) &amp;&amp; CSS_SELECTOR_JIT_PROFILING
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (176863 => 176864)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp	2014-12-05 20:51:02 UTC (rev 176863)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2014-12-05 20:58:08 UTC (rev 176864)
</span><span class="lines">@@ -505,13 +505,6 @@
</span><span class="cx">     if (!thisInputElement || !otherInputElement)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (thisInputElement-&gt;elementData() != otherInputElement-&gt;elementData()) {
-        if (thisInputElement-&gt;fastGetAttribute(typeAttr) != otherInputElement-&gt;fastGetAttribute(typeAttr))
-            return false;
-        if (thisInputElement-&gt;fastGetAttribute(readonlyAttr) != otherInputElement-&gt;fastGetAttribute(readonlyAttr))
-            return false;
-    }
-
</del><span class="cx">     if (thisInputElement-&gt;isAutofilled() != otherInputElement-&gt;isAutofilled())
</span><span class="cx">         return false;
</span><span class="cx">     if (thisInputElement-&gt;shouldAppearChecked() != otherInputElement-&gt;shouldAppearChecked())
</span><span class="lines">@@ -647,6 +640,18 @@
</span><span class="cx">     if (element-&gt;isLink() &amp;&amp; state.elementLinkState() != style-&gt;insideLink())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (element-&gt;elementData() != state.element()-&gt;elementData()) {
+        if (element-&gt;fastGetAttribute(readonlyAttr) != state.element()-&gt;fastGetAttribute(readonlyAttr))
+            return false;
+        if (element-&gt;isSVGElement()) {
+            if (element-&gt;getAttribute(typeAttr) != state.element()-&gt;getAttribute(typeAttr))
+                return false;
+        } else {
+            if (element-&gt;fastGetAttribute(typeAttr) != state.element()-&gt;fastGetAttribute(typeAttr))
+                return false;
+        }
+    }
+
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     // Deny sharing styles between WebVTT and non-WebVTT nodes.
</span><span class="cx">     if (is&lt;WebVTTElement&gt;(*state.element()))
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list