<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[202197] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202197">202197</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-17 22:53:28 -0700 (Fri, 17 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>:indeterminate pseudo-class should match radios whose group has no checked radio
https://bugs.webkit.org/show_bug.cgi?id=156270

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-expected.txt:
One more pass on official tests :)

Source/WebCore:

The pseudo-class &quot;:indeterminate&quot; is supposed to match radio buttons
for which the entire group has no checked button.
Spec: https://html.spec.whatwg.org/#pseudo-classes:selector-indeterminate

The change is straightforward with one non-obvious choice:
I added matchesIndeterminatePseudoClass() in addition to shouldAppearIndeterminate().

The reason is shouldAppearIndeterminate() is used for styling and AX of elements
with an indeterminate states (check boxes and progress element). There is no such
UI for radio boxes.
I could have extended shouldAppearIndeterminate() to radio box
then filter out this case in RenderTheme. The problem is doing that would also requires
changes to the repaint logic to match :indeterminate. It seemed overkill to me to
change repaint() for a case that is never used in practice.

Tests: fast/css/pseudo-indeterminate-radio-buttons-basics.html
       fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html
       fast/selectors/detached-radio-button-checked-and-indeterminate-states.html
       fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html

* css/SelectorCheckerTestFunctions.h:
(WebCore::shouldAppearIndeterminate):
* dom/Element.cpp:
(WebCore::Element::matchesIndeterminatePseudoClass):
* dom/Element.h:
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::setCheckedButton):
(WebCore::RadioButtonGroup::updateCheckedState):
(WebCore::RadioButtonGroup::remove):
(WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
(WebCore::RadioButtonGroups::hasCheckedButton):
* dom/RadioButtonGroups.h:
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::matchesIndeterminatePseudoClass):
(WebCore::CheckboxInputType::shouldAppearIndeterminate):
(WebCore::CheckboxInputType::supportsIndeterminateAppearance): Deleted.
* html/CheckboxInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::matchesIndeterminatePseudoClass):
(WebCore::HTMLInputElement::shouldAppearIndeterminate):
(WebCore::HTMLInputElement::radioButtonGroups):
* html/HTMLInputElement.h:
* html/InputType.cpp:
(WebCore::InputType::matchesIndeterminatePseudoClass):
(WebCore::InputType::shouldAppearIndeterminate):
(WebCore::InputType::supportsIndeterminateAppearance): Deleted.
* html/InputType.h:
* html/RadioInputType.cpp:
(WebCore::RadioInputType::matchesIndeterminatePseudoClass):
(WebCore::RadioInputType::willDispatchClick): Deleted.
(WebCore::RadioInputType::didDispatchClick): Deleted.
(WebCore::RadioInputType::supportsIndeterminateAppearance): Deleted.
The iOS specific code is just plain wrong.
It was changing the indeterminate state of the input element.
The spec clearly says that state is only used by checkbox:
https://html.spec.whatwg.org/#dom-input-indeterminate

Moreover, the style update would not change the indeterminate state
of other buttons in the Button Group, which is just bizarre.
RenderThemeIOS does not make use of any of this with the current style.

* html/RadioInputType.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):
(WebCore::Style::canShareStyleWithControl): Deleted.
(WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
Style sharing is unified behind the selector matching which is neat.

LayoutTests:

There are two important aspect to cover for this change:
1) The style is updated correctly when a Button Group composition change.
2) When the checkness changes for a Button Group, all its elements
   are invalidated to match :indeterminate.

* fast/forms/radio/indeterminate-radio.html:
This test was verifying that the property &quot;indeterminate&quot; of the input element
is not reflected to the style through :indeterminate.
I updated the test to still verify that except that we now match :indeterminate
before changing the property.

* fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html: Added.
* fast/css/pseudo-indeterminate-radio-buttons-basics.html: Added.

* fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt: Added.
* fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html: Added.
Verify that we don't invalidate everything when the checked button changes.
We only need to invalidate everything if the checked state of the whole group changes.

* fast/selectors/detached-radio-button-checked-and-indeterminate-states-expected.txt: Added.
* fast/selectors/detached-radio-button-checked-and-indeterminate-states.html: Added.
* fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update-expected.txt: Added.
* fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastformsradioindeterminateradiohtml">trunk/LayoutTests/fast/forms/radio/indeterminate-radio.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsselectorspseudoclassesindeterminateexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerTestFunctionsh">trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomRadioButtonGroupscpp">trunk/Source/WebCore/dom/RadioButtonGroups.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRadioButtonGroupsh">trunk/Source/WebCore/dom/RadioButtonGroups.h</a></li>
<li><a href="#trunkSourceWebCorehtmlCheckboxInputTypecpp">trunk/Source/WebCore/html/CheckboxInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlCheckboxInputTypeh">trunk/Source/WebCore/html/CheckboxInputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypecpp">trunk/Source/WebCore/html/InputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypeh">trunk/Source/WebCore/html/InputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlRadioInputTypecpp">trunk/Source/WebCore/html/RadioInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlRadioInputTypeh">trunk/Source/WebCore/html/RadioInputType.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleSharingResolvercpp">trunk/Source/WebCore/style/StyleSharingResolver.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsspseudoindeterminateradiobuttonsbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoindeterminateradiobuttonsbasicshtml">trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoindeterminatewithradiobuttonsstyleinvalidationexpectedtxt">trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoindeterminatewithradiobuttonsstyleinvalidationhtml">trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsdetachedradiobuttoncheckedandindeterminatestatesexpectedtxt">trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsdetachedradiobuttoncheckedandindeterminatestateshtml">trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorspseudoindeterminatewithradiobuttonsstyleupdateexpectedtxt">trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorspseudoindeterminatewithradiobuttonsstyleupdatehtml">trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/selectors/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/LayoutTests/ChangeLog        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2016-06-17  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        :indeterminate pseudo-class should match radios whose group has no checked radio
+        https://bugs.webkit.org/show_bug.cgi?id=156270
+
+        Reviewed by Simon Fraser.
+
+        There are two important aspect to cover for this change:
+        1) The style is updated correctly when a Button Group composition change.
+        2) When the checkness changes for a Button Group, all its elements
+           are invalidated to match :indeterminate.
+
+        * fast/forms/radio/indeterminate-radio.html:
+        This test was verifying that the property &quot;indeterminate&quot; of the input element
+        is not reflected to the style through :indeterminate.
+        I updated the test to still verify that except that we now match :indeterminate
+        before changing the property.
+
+        * fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html: Added.
+        * fast/css/pseudo-indeterminate-radio-buttons-basics.html: Added.
+
+        * fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt: Added.
+        * fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html: Added.
+        Verify that we don't invalidate everything when the checked button changes.
+        We only need to invalidate everything if the checked state of the whole group changes.
+
+        * fast/selectors/detached-radio-button-checked-and-indeterminate-states-expected.txt: Added.
+        * fast/selectors/detached-radio-button-checked-and-indeterminate-states.html: Added.
+        * fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update-expected.txt: Added.
+        * fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html: Added.
+
</ins><span class="cx"> 2016-06-17  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202152.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoindeterminateradiobuttonsbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics-expected.html        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,206 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    input {
+        background-color: blue;
+        width: 15px;
+        height: 15px;
+        -webkit-appearance: none;
+    }
+    .checked {
+        border: 2px solid red;
+    }
+    .indeterminate {
+        background-color: green;
+    }
+    .disabled {
+        border-left: 3px solid orange;
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled class=&quot;disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;form&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked class=&quot;checked&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked class=&quot;checked&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled class=&quot;checked disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled class=&quot;checked disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly class=&quot;checked&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly class=&quot;checked&quot;&gt;&lt;/span&gt;
+    &lt;/form&gt;
+    &lt;form disabled&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked class=&quot;checked&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked class=&quot;checked&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled class=&quot;checked disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled class=&quot;checked disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly class=&quot;checked&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly class=&quot;checked&quot;&gt;&lt;/span&gt;
+    &lt;/form&gt;
+    &lt;fieldset disabled class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked class=&quot;checked disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot; class=&quot;disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked class=&quot;checked disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled class=&quot;checked disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled class=&quot;disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled class=&quot;checked disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly class=&quot;disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly class=&quot;checked disabled&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly class=&quot;disabled&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly class=&quot;checked disabled&quot;&gt;&lt;/span&gt;
+    &lt;/fieldset&gt;
+    &lt;form&gt;
+        &lt;fieldset disabled class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot; class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group4&quot; class=&quot;disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked class=&quot;disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled class=&quot;disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled class=&quot;disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly class=&quot;disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly class=&quot;disabled&quot;&gt;&lt;/span&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot; class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot; class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked class=&quot;checked&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked class=&quot;checked&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled class=&quot;indeterminate disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled class=&quot;disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled class=&quot;checked disabled&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled class=&quot;disabled&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled class=&quot;checked disabled&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; readonly class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly class=&quot;indeterminate&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly class=&quot;indeterminate&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly class=&quot;checked&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly class=&quot;checked&quot;&gt;&lt;/span&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoindeterminateradiobuttonsbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics.html (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-indeterminate-radio-buttons-basics.html        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,206 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    input {
+        background-color: blue;
+        width: 15px;
+        height: 15px;
+        -webkit-appearance: none;
+    }
+    :checked {
+        border: 2px solid red;
+    }
+    :indeterminate {
+        background-color: green;
+    }
+    :disabled {
+        border-left: 3px solid orange;
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+    &lt;/div&gt;
+    &lt;form&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+    &lt;/form&gt;
+    &lt;form disabled&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+    &lt;/form&gt;
+    &lt;fieldset disabled&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;&lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+        &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+    &lt;/fieldset&gt;
+    &lt;form&gt;
+        &lt;fieldset disabled&gt;
+            &lt;input type=&quot;radio&quot;&gt;
+            &lt;input type=&quot;radio&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;input type=&quot;radio&quot;&gt;
+            &lt;input type=&quot;radio&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group2&quot;&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group3&quot; checked&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group4&quot;&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group4&quot; checked&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group5&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group6&quot; disabled&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group7&quot; checked disabled&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group8&quot; disabled&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group8&quot; checked disabled&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group9&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group10&quot; readonly&gt;&lt;/span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group11&quot; checked readonly&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group12&quot; readonly&gt;
+            &lt;span&gt;&lt;input type=&quot;radio&quot; name=&quot;group12&quot; checked readonly&gt;&lt;/span&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoindeterminatewithradiobuttonsstyleinvalidationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation-expected.txt        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+Verify that we do not invalidate more than needed to satisfy :indeterminate
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS elementsNeedingStyleRecalc() is []
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is []
+Check radio3
+PASS elementsNeedingStyleRecalc() is [&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;]
+PASS elementsWithIndeterminateStyle() is [&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio3&quot;]
+Check radio8
+PASS elementsNeedingStyleRecalc() is [&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS elementsWithIndeterminateStyle() is []
+PASS checkedElements() is [&quot;radio3&quot;, &quot;radio8&quot;]
+Check radio4
+PASS elementsNeedingStyleRecalc() is [&quot;radio3&quot;, &quot;radio4&quot;]
+PASS elementsWithIndeterminateStyle() is []
+PASS checkedElements() is [&quot;radio4&quot;, &quot;radio8&quot;]
+Check radio9
+PASS elementsNeedingStyleRecalc() is [&quot;radio8&quot;, &quot;radio9&quot;]
+PASS elementsWithIndeterminateStyle() is []
+PASS checkedElements() is [&quot;radio4&quot;, &quot;radio9&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoindeterminatewithradiobuttonsstyleinvalidationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+    input {
+        background-color: rgb(1, 2, 3);
+    }
+    :indeterminate {
+        background-color: rgb(4, 5, 6);
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio2&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio3&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio4&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio5&quot;&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio6&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio7&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio8&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio9&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio10&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+
+description('Verify that we do not invalidate more than needed to satisfy :indeterminate');
+let allInputs = document.querySelectorAll(&quot;input&quot;);
+
+function elementsNeedingStyleRecalc() {
+    let elementsRequiringNeedStyleRecalc = []
+    for (let inputElement of allInputs) {
+        let needsStyleRecalc = window.internals.nodeNeedsStyleRecalc(inputElement);
+        if (needsStyleRecalc)
+            elementsRequiringNeedStyleRecalc.push(inputElement.id);
+    }
+    return elementsRequiringNeedStyleRecalc;
+}
+
+function elementsWithIndeterminateStyle() {
+    let elements = [];
+    for (let inputElement of allInputs) {
+        let backgroundColor = getComputedStyle(inputElement).backgroundColor;
+        if (backgroundColor === &quot;rgb(4, 5, 6)&quot;)
+            elements.push(inputElement.id);
+    }
+    return elements;
+}
+
+function checkedElements() {
+    let elements = [];
+    for (let inputElement of allInputs) {
+        if (inputElement.checked)
+            elements.push(inputElement.id);
+    }
+    return elements;
+}
+
+// Force a layout to ensure we don't have dirty styles.
+var offsetTop = document.documentElement.offsetTop;
+
+// Initial state.
+shouldBe(&quot;elementsNeedingStyleRecalc()&quot;, '[]');
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[]');
+
+// Check radio3. All the group1 require style recalc.
+debug(&quot;Check radio3&quot;);
+document.getElementById(&quot;radio3&quot;).checked = true;
+shouldBe(&quot;elementsNeedingStyleRecalc()&quot;, '[&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;]');
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio3&quot;]');
+
+// Check radio8. All the group1 require style recalc.
+debug(&quot;Check radio8&quot;);
+document.getElementById(&quot;radio8&quot;).checked = true;
+shouldBe(&quot;elementsNeedingStyleRecalc()&quot;, '[&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio3&quot;, &quot;radio8&quot;]');
+
+// Checking radio4, we should not need to invalidate anything but the two modified elements.
+debug(&quot;Check radio4&quot;);
+document.getElementById(&quot;radio4&quot;).checked = true;
+shouldBe(&quot;elementsNeedingStyleRecalc()&quot;, '[&quot;radio3&quot;, &quot;radio4&quot;]');
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio4&quot;, &quot;radio8&quot;]');
+
+// Checking radio9, we should not need to invalidate anything but the two modified elements.
+debug(&quot;Check radio9&quot;);
+document.getElementById(&quot;radio9&quot;).checked = true;
+shouldBe(&quot;elementsNeedingStyleRecalc()&quot;, '[&quot;radio8&quot;, &quot;radio9&quot;]');
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio4&quot;, &quot;radio9&quot;]');
+
+// Hide the elements to make the results prettier.
+document.getElementById(&quot;with-renderer&quot;).style.display = &quot;none&quot;;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastformsradioindeterminateradiohtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/radio/indeterminate-radio.html (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/radio/indeterminate-radio.html        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/LayoutTests/fast/forms/radio/indeterminate-radio.html        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -27,9 +27,6 @@
</span><span class="cx">     {
</span><span class="cx">         try
</span><span class="cx">         {
</span><del>-
-        document.getElementsByTagName(&quot;input&quot;)[0].indeterminate = true;
-
</del><span class="cx">         function ArrayContains(array, value, ci)
</span><span class="cx">         {
</span><span class="cx">             ci = ci == true ? true : false;
</span><span class="lines">@@ -46,11 +43,15 @@
</span><span class="cx">             }
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><ins>+
</ins><span class="cx">         var target = document.getElementById(&quot;test&quot;);
</span><span class="cx">         var val = getComputedStyle(target, null).getPropertyValue(&quot;color&quot;);
</span><del>-        var aExpectedValues = new Array(&quot;green&quot;, &quot;#008000&quot;, &quot;rgb(0, 128, 0)&quot;);
</del><ins>+        var aExpectedValues = new Array(&quot;red&quot;, &quot;#FF0000&quot;, &quot;rgb(255, 0, 0)&quot;);
+        let wasIndeterminate = ArrayContains(aExpectedValues, val, true);
</ins><span class="cx"> 
</span><del>-        if (ArrayContains(aExpectedValues, val, true))
</del><ins>+        document.getElementsByTagName(&quot;input&quot;)[0].indeterminate = true;
+
+        if (wasIndeterminate &amp;&amp; ArrayContains(aExpectedValues, val, true))
</ins><span class="cx">         {
</span><span class="cx"> 
</span><span class="cx">           document.getElementById(&quot;testresult&quot;).innerHTML = &quot;Pass&quot;;
</span><span class="lines">@@ -66,4 +67,4 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> &lt;/body&gt;
</span><del>-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsdetachedradiobuttoncheckedandindeterminatestatesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states-expected.txt (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states-expected.txt        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,148 @@
</span><ins>+Verify :indeterminate, :checked and the indeterminate property on radio button detached from the document.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Initial state
+PASS document.getElementById('radio1-in-document').indeterminate is false
+PASS document.getElementById('radio2-in-document').indeterminate is false
+PASS document.getElementById('radio3-in-document').indeterminate is false
+PASS document.getElementById('radio4-in-document').indeterminate is false
+PASS document.getElementById('radio1-in-document').checked is false
+PASS document.getElementById('radio2-in-document').checked is true
+PASS document.getElementById('radio3-in-document').checked is false
+PASS document.getElementById('radio4-in-document').checked is false
+PASS document.getElementById('radio1-in-document').matches(':indeterminate') is false
+PASS document.getElementById('radio2-in-document').matches(':indeterminate') is false
+PASS document.getElementById('radio3-in-document').matches(':indeterminate') is true
+PASS document.getElementById('radio4-in-document').matches(':indeterminate') is true
+PASS document.getElementById('radio1-in-document').matches(':checked') is false
+PASS document.getElementById('radio2-in-document').matches(':checked') is true
+PASS document.getElementById('radio3-in-document').matches(':checked') is false
+PASS document.getElementById('radio4-in-document').matches(':checked') is false
+PASS getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById('radio2-in-document')).backgroundColor is &quot;rgb(7, 8, 9)&quot;
+PASS getComputedStyle(document.getElementById('radio3-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById('radio1-in-document')).color is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById('radio2-in-document')).color is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById('radio3-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+Remove radio2-in-document from document, into variable radio2
+PASS document.querySelectorAll('radio2-in-document') is []
+PASS document.getElementById('radio1-in-document').indeterminate is false
+PASS radio2.indeterminate is false
+PASS document.getElementById('radio3-in-document').indeterminate is false
+PASS document.getElementById('radio4-in-document').indeterminate is false
+PASS document.getElementById('radio1-in-document').checked is false
+PASS radio2.checked is true
+PASS document.getElementById('radio3-in-document').checked is false
+PASS document.getElementById('radio4-in-document').checked is false
+PASS document.getElementById('radio1-in-document').matches(':indeterminate') is true
+PASS radio2.matches(':indeterminate') is false
+PASS document.getElementById('radio3-in-document').matches(':indeterminate') is true
+PASS document.getElementById('radio4-in-document').matches(':indeterminate') is true
+PASS document.getElementById('radio1-in-document').matches(':checked') is false
+PASS radio2.matches(':checked') is true
+PASS document.getElementById('radio3-in-document').matches(':checked') is false
+PASS document.getElementById('radio4-in-document').matches(':checked') is false
+PASS getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(radio2).backgroundColor is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio3-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById('radio1-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(radio2).color is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio3-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+Remove radio3-in-document from document, into variable radio3
+PASS document.querySelectorAll('radio3-in-document') is []
+PASS document.getElementById('radio1-in-document').indeterminate is false
+PASS radio2.indeterminate is false
+PASS radio3.indeterminate is false
+PASS document.getElementById('radio4-in-document').indeterminate is false
+PASS document.getElementById('radio1-in-document').checked is false
+PASS radio2.checked is true
+PASS radio3.checked is false
+PASS document.getElementById('radio4-in-document').checked is false
+PASS document.getElementById('radio1-in-document').matches(':indeterminate') is true
+PASS radio2.matches(':indeterminate') is false
+PASS radio3.matches(':indeterminate') is true
+PASS document.getElementById('radio4-in-document').matches(':indeterminate') is true
+PASS document.getElementById('radio1-in-document').matches(':checked') is false
+PASS radio2.matches(':checked') is true
+PASS radio3.matches(':checked') is false
+PASS document.getElementById('radio4-in-document').matches(':checked') is false
+PASS getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(radio2).backgroundColor is &quot;&quot;
+PASS getComputedStyle(radio3).backgroundColor is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById('radio1-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(radio2).color is &quot;&quot;
+PASS getComputedStyle(radio3).color is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+Create new element named webkitRadio
+PASS document.getElementById('radio1-in-document').indeterminate is false
+PASS radio2.indeterminate is false
+PASS radio3.indeterminate is false
+PASS document.getElementById('radio4-in-document').indeterminate is false
+PASS webkitRadio.indeterminate is false
+PASS document.getElementById('radio1-in-document').checked is false
+PASS radio2.checked is true
+PASS radio3.checked is false
+PASS document.getElementById('radio4-in-document').checked is false
+PASS webkitRadio.checked is false
+PASS document.getElementById('radio1-in-document').matches(':indeterminate') is true
+PASS radio2.matches(':indeterminate') is false
+PASS radio3.matches(':indeterminate') is true
+PASS document.getElementById('radio4-in-document').matches(':indeterminate') is true
+PASS webkitRadio.matches(':indeterminate') is true
+PASS document.getElementById('radio1-in-document').matches(':checked') is false
+PASS radio2.matches(':checked') is true
+PASS radio3.matches(':checked') is false
+PASS document.getElementById('radio4-in-document').matches(':checked') is false
+PASS webkitRadio.matches(':checked') is false
+PASS getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(radio2).backgroundColor is &quot;&quot;
+PASS getComputedStyle(radio3).backgroundColor is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(webkitRadio).backgroundColor is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio1-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(radio2).color is &quot;&quot;
+PASS getComputedStyle(radio3).color is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(webkitRadio).color is &quot;&quot;
+Check webkitRadio
+PASS document.getElementById('radio1-in-document').indeterminate is false
+PASS radio2.indeterminate is false
+PASS radio3.indeterminate is false
+PASS document.getElementById('radio4-in-document').indeterminate is false
+PASS webkitRadio.indeterminate is false
+PASS document.getElementById('radio1-in-document').checked is false
+PASS radio2.checked is true
+PASS radio3.checked is false
+PASS document.getElementById('radio4-in-document').checked is false
+PASS webkitRadio.checked is true
+PASS document.getElementById('radio1-in-document').matches(':indeterminate') is true
+PASS radio2.matches(':indeterminate') is false
+PASS radio3.matches(':indeterminate') is true
+PASS document.getElementById('radio4-in-document').matches(':indeterminate') is true
+PASS webkitRadio.matches(':indeterminate') is false
+PASS document.getElementById('radio1-in-document').matches(':checked') is false
+PASS radio2.matches(':checked') is true
+PASS radio3.matches(':checked') is false
+PASS document.getElementById('radio4-in-document').matches(':checked') is false
+PASS webkitRadio.matches(':checked') is true
+PASS getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(radio2).backgroundColor is &quot;&quot;
+PASS getComputedStyle(radio3).backgroundColor is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(webkitRadio).backgroundColor is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio1-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(radio2).color is &quot;&quot;
+PASS getComputedStyle(radio3).color is &quot;&quot;
+PASS getComputedStyle(document.getElementById('radio4-in-document')).color is &quot;rgb(10, 11, 12)&quot;
+PASS getComputedStyle(webkitRadio).color is &quot;&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsdetachedradiobuttoncheckedandindeterminatestateshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states.html (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/detached-radio-button-checked-and-indeterminate-states.html        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+    input {
+        background-color: rgb(1, 2, 3);
+        color: rgb(4, 5, 6);
+    }
+    :checked {
+        background-color: rgb(7, 8, 9);
+    }
+    :indeterminate {
+        color: rgb(10, 11, 12);
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div id=&quot;testcases&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio1-in-document&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio2-in-document&quot; checked&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio3-in-document&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio4-in-document&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Verify :indeterminate, :checked and the indeterminate property on radio button detached from the document.');
+
+debug(&quot;Initial state&quot;);
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio2-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio3-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').indeterminate&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').checked&quot;);
+shouldBeTrue(&quot;document.getElementById('radio2-in-document').checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio3-in-document').checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').checked&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').matches(':indeterminate')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio2-in-document').matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio3-in-document').matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio4-in-document').matches(':indeterminate')&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').matches(':checked')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio2-in-document').matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio3-in-document').matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').matches(':checked')&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio2-in-document')).backgroundColor&quot;, &quot;rgb(7, 8, 9)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio3-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).color&quot;, &quot;rgb(4, 5, 6)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio2-in-document')).color&quot;, &quot;rgb(4, 5, 6)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio3-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+
+debug(&quot;Remove radio2-in-document from document, into variable radio2&quot;);
+let radio2 = document.getElementById('radio2-in-document');
+radio2.parentElement.removeChild(radio2);
+shouldBe(&quot;document.querySelectorAll('radio2-in-document')&quot;, &quot;[]&quot;);
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;radio2.indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio3-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').indeterminate&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').checked&quot;);
+shouldBeTrue(&quot;radio2.checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio3-in-document').checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').checked&quot;);
+
+shouldBeTrue(&quot;document.getElementById('radio1-in-document').matches(':indeterminate')&quot;);
+shouldBeFalse(&quot;radio2.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio3-in-document').matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio4-in-document').matches(':indeterminate')&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').matches(':checked')&quot;);
+shouldBeTrue(&quot;radio2.matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio3-in-document').matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').matches(':checked')&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio3-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio3-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+
+debug(&quot;Remove radio3-in-document from document, into variable radio3&quot;);
+let radio3 = document.getElementById('radio3-in-document');
+radio3.parentElement.removeChild(radio3);
+shouldBe(&quot;document.querySelectorAll('radio3-in-document')&quot;, &quot;[]&quot;);
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;radio2.indeterminate&quot;);
+shouldBeFalse(&quot;radio3.indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').indeterminate&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').checked&quot;);
+shouldBeTrue(&quot;radio2.checked&quot;);
+shouldBeFalse(&quot;radio3.checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').checked&quot;);
+
+shouldBeTrue(&quot;document.getElementById('radio1-in-document').matches(':indeterminate')&quot;);
+shouldBeFalse(&quot;radio2.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;radio3.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio4-in-document').matches(':indeterminate')&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').matches(':checked')&quot;);
+shouldBeTrue(&quot;radio2.matches(':checked')&quot;);
+shouldBeFalse(&quot;radio3.matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').matches(':checked')&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio3).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio3).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+
+debug(&quot;Create new element named webkitRadio&quot;);
+let webkitRadio = document.createElement(&quot;input&quot;);
+webkitRadio.type = &quot;radio&quot;;
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;radio2.indeterminate&quot;);
+shouldBeFalse(&quot;radio3.indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;webkitRadio.indeterminate&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').checked&quot;);
+shouldBeTrue(&quot;radio2.checked&quot;);
+shouldBeFalse(&quot;radio3.checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').checked&quot;);
+shouldBeFalse(&quot;webkitRadio.checked&quot;);
+
+shouldBeTrue(&quot;document.getElementById('radio1-in-document').matches(':indeterminate')&quot;);
+shouldBeFalse(&quot;radio2.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;radio3.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio4-in-document').matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;webkitRadio.matches(':indeterminate')&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').matches(':checked')&quot;);
+shouldBeTrue(&quot;radio2.matches(':checked')&quot;);
+shouldBeFalse(&quot;radio3.matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').matches(':checked')&quot;);
+shouldBeFalse(&quot;webkitRadio.matches(':checked')&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio3).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(webkitRadio).backgroundColor&quot;, &quot;&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio3).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(webkitRadio).color&quot;, &quot;&quot;);
+
+debug(&quot;Check webkitRadio&quot;);
+webkitRadio.checked = true;
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;radio2.indeterminate&quot;);
+shouldBeFalse(&quot;radio3.indeterminate&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').indeterminate&quot;);
+shouldBeFalse(&quot;webkitRadio.indeterminate&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').checked&quot;);
+shouldBeTrue(&quot;radio2.checked&quot;);
+shouldBeFalse(&quot;radio3.checked&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').checked&quot;);
+shouldBeTrue(&quot;webkitRadio.checked&quot;);
+
+shouldBeTrue(&quot;document.getElementById('radio1-in-document').matches(':indeterminate')&quot;);
+shouldBeFalse(&quot;radio2.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;radio3.matches(':indeterminate')&quot;);
+shouldBeTrue(&quot;document.getElementById('radio4-in-document').matches(':indeterminate')&quot;);
+shouldBeFalse(&quot;webkitRadio.matches(':indeterminate')&quot;);
+
+shouldBeFalse(&quot;document.getElementById('radio1-in-document').matches(':checked')&quot;);
+shouldBeTrue(&quot;radio2.matches(':checked')&quot;);
+shouldBeFalse(&quot;radio3.matches(':checked')&quot;);
+shouldBeFalse(&quot;document.getElementById('radio4-in-document').matches(':checked')&quot;);
+shouldBeTrue(&quot;webkitRadio.matches(':checked')&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio3).backgroundColor&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).backgroundColor&quot;, &quot;rgb(1, 2, 3)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(webkitRadio).backgroundColor&quot;, &quot;&quot;);
+
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio1-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio2).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(radio3).color&quot;, &quot;&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(document.getElementById('radio4-in-document')).color&quot;, &quot;rgb(10, 11, 12)&quot;);
+shouldBeEqualToString(&quot;getComputedStyle(webkitRadio).color&quot;, &quot;&quot;);
+
+document.getElementById(&quot;testcases&quot;).style.display = &quot;none&quot;;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorspseudoindeterminatewithradiobuttonsstyleupdateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update-expected.txt (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update-expected.txt        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+Verify we invalidate radio button groups to match :indeterminate when a button is checked/unchecked
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is []
+Check radio3
+PASS elementsWithIndeterminateStyle() is [&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio3&quot;]
+Check radio8
+PASS elementsWithIndeterminateStyle() is []
+PASS checkedElements() is [&quot;radio3&quot;, &quot;radio8&quot;]
+Check radio4
+PASS elementsWithIndeterminateStyle() is []
+PASS checkedElements() is [&quot;radio4&quot;, &quot;radio8&quot;]
+Check radio9
+PASS elementsWithIndeterminateStyle() is []
+PASS checkedElements() is [&quot;radio4&quot;, &quot;radio9&quot;]
+Uncheck radio4
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;]
+PASS checkedElements() is [&quot;radio9&quot;]
+Uncheck radio9
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is []
+Check radio1
+PASS elementsWithIndeterminateStyle() is [&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio1&quot;]
+Check radio2
+PASS elementsWithIndeterminateStyle() is [&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio2&quot;]
+Remove radio3 from its group
+PASS elementsWithIndeterminateStyle() is [&quot;radio3&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio2&quot;]
+Remove radio6 from its group
+PASS elementsWithIndeterminateStyle() is [&quot;radio3&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio2&quot;]
+Remove radio2 from its group
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio2&quot;]
+Check radio7
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;]
+PASS checkedElements() is [&quot;radio2&quot;, &quot;radio7&quot;]
+Check radio8
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;]
+PASS checkedElements() is [&quot;radio2&quot;, &quot;radio8&quot;]
+Remove radio9 from its group
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio9&quot;]
+PASS checkedElements() is [&quot;radio2&quot;, &quot;radio8&quot;]
+Remove radio8 from its group
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio2&quot;, &quot;radio8&quot;]
+Remove radio7 from its group
+PASS elementsWithIndeterminateStyle() is [&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio9&quot;, &quot;radio10&quot;]
+PASS checkedElements() is [&quot;radio2&quot;, &quot;radio8&quot;]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorspseudoindeterminatewithradiobuttonsstyleupdatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html (0 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -0,0 +1,148 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+    input {
+        background-color: rgb(1, 2, 3);
+    }
+    :indeterminate {
+        background-color: rgb(4, 5, 6);
+    }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio1&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio2&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio3&quot;&gt;
+        &lt;span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio4&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group1&quot; id=&quot;radio5&quot;&gt;
+        &lt;/span&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio6&quot;&gt;
+        &lt;span&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio7&quot;&gt;
+            &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio8&quot;&gt;
+        &lt;/span&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio9&quot;&gt;
+        &lt;input type=&quot;radio&quot; name=&quot;group2&quot; id=&quot;radio10&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+
+description('Verify we invalidate radio button groups to match :indeterminate when a button is checked/unchecked');
+let allInputs = document.querySelectorAll(&quot;input&quot;);
+
+function elementsWithIndeterminateStyle() {
+    let elements = [];
+    for (let inputElement of allInputs) {
+        let backgroundColor = getComputedStyle(inputElement).backgroundColor;
+        if (backgroundColor === &quot;rgb(4, 5, 6)&quot;)
+            elements.push(inputElement.id);
+    }
+    return elements;
+}
+
+function checkedElements() {
+    let elements = [];
+    for (let inputElement of allInputs) {
+        if (inputElement.checked)
+            elements.push(inputElement.id);
+    }
+    return elements;
+}
+
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[]');
+
+debug(&quot;Check radio3&quot;);
+document.getElementById(&quot;radio3&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio3&quot;]');
+
+debug(&quot;Check radio8&quot;);
+document.getElementById(&quot;radio8&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio3&quot;, &quot;radio8&quot;]');
+
+debug(&quot;Check radio4&quot;);
+document.getElementById(&quot;radio4&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio4&quot;, &quot;radio8&quot;]');
+
+debug(&quot;Check radio9&quot;);
+document.getElementById(&quot;radio9&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio4&quot;, &quot;radio9&quot;]');
+
+debug(&quot;Uncheck radio4&quot;);
+document.getElementById(&quot;radio4&quot;).checked = false;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio9&quot;]');
+
+debug(&quot;Uncheck radio9&quot;);
+document.getElementById(&quot;radio9&quot;).checked = false;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio2&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[]');
+
+debug(&quot;Check radio1&quot;);
+document.getElementById(&quot;radio1&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio1&quot;]');
+
+debug(&quot;Check radio2&quot;);
+document.getElementById(&quot;radio2&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;]');
+
+debug(&quot;Remove radio3 from its group&quot;);
+document.getElementById(&quot;radio3&quot;).name = &quot;&quot;;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio3&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;]');
+
+debug(&quot;Remove radio6 from its group&quot;);
+document.getElementById(&quot;radio6&quot;).name = &quot;&quot;;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio3&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;]');
+
+debug(&quot;Remove radio2 from its group&quot;);
+document.getElementById(&quot;radio2&quot;).name = &quot;&quot;;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio8&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;]');
+
+debug(&quot;Check radio7&quot;);
+document.getElementById(&quot;radio7&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;, &quot;radio7&quot;]');
+
+debug(&quot;Check radio8&quot;);
+document.getElementById(&quot;radio8&quot;).checked = true;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;, &quot;radio8&quot;]');
+
+debug(&quot;Remove radio9 from its group&quot;);
+document.getElementById(&quot;radio9&quot;).name = &quot;&quot;;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio9&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;, &quot;radio8&quot;]');
+
+debug(&quot;Remove radio8 from its group&quot;);
+document.getElementById(&quot;radio8&quot;).name = &quot;&quot;;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;, &quot;radio8&quot;]');
+
+debug(&quot;Remove radio7 from its group&quot;);
+document.getElementById(&quot;radio7&quot;).name = &quot;&quot;;
+shouldBe(&quot;elementsWithIndeterminateStyle()&quot;, '[&quot;radio1&quot;, &quot;radio3&quot;, &quot;radio4&quot;, &quot;radio5&quot;, &quot;radio6&quot;, &quot;radio7&quot;, &quot;radio9&quot;, &quot;radio10&quot;]');
+shouldBe(&quot;checkedElements()&quot;, '[&quot;radio2&quot;, &quot;radio8&quot;]');
+
+
+// Hide the elements to make the results prettier.
+document.getElementById(&quot;with-renderer&quot;).style.display = &quot;none&quot;;
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-06-17  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        :indeterminate pseudo-class should match radios whose group has no checked radio
+        https://bugs.webkit.org/show_bug.cgi?id=156270
+
+        Reviewed by Simon Fraser.
+
+        * web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-expected.txt:
+        One more pass on official tests :)
+
</ins><span class="cx"> 2016-06-17  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         CORS preflight with a non-200 response should be a preflight failure
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsselectorspseudoclassesindeterminateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-expected.txt (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-expected.txt        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/indeterminate-expected.txt        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx">         
</span><span class="cx"> 
</span><del>-FAIL ':progress' matches &lt;input&gt;s radio buttons whose radio button group contains no checked input and &lt;progress&gt; elements without value attribute assert_array_equals: lengths differ, expected 5 got 1
-FAIL dynamically check a radio input in a radio button group assert_array_equals: lengths differ, expected 3 got 1
</del><ins>+PASS ':progress' matches &lt;input&gt;s radio buttons whose radio button group contains no checked input and &lt;progress&gt; elements without value attribute 
+PASS dynamically check a radio input in a radio button group 
</ins><span class="cx"> FAIL click on radio4 which is in the indeterminate state assert_array_equals: lengths differ, expected 2 got 1
</span><span class="cx"> PASS adding a value to progress1 should put it in a determinate state 
</span><span class="cx"> PASS removing progress2's value should put it in an indeterminate state 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/ChangeLog        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2016-06-17  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        :indeterminate pseudo-class should match radios whose group has no checked radio
+        https://bugs.webkit.org/show_bug.cgi?id=156270
+
+        Reviewed by Simon Fraser.
+
+        The pseudo-class &quot;:indeterminate&quot; is supposed to match radio buttons
+        for which the entire group has no checked button.
+        Spec: https://html.spec.whatwg.org/#pseudo-classes:selector-indeterminate
+
+        The change is straightforward with one non-obvious choice:
+        I added matchesIndeterminatePseudoClass() in addition to shouldAppearIndeterminate().
+
+        The reason is shouldAppearIndeterminate() is used for styling and AX of elements
+        with an indeterminate states (check boxes and progress element). There is no such
+        UI for radio boxes.
+        I could have extended shouldAppearIndeterminate() to radio box
+        then filter out this case in RenderTheme. The problem is doing that would also requires
+        changes to the repaint logic to match :indeterminate. It seemed overkill to me to
+        change repaint() for a case that is never used in practice.
+
+        Tests: fast/css/pseudo-indeterminate-radio-buttons-basics.html
+               fast/css/pseudo-indeterminate-with-radio-buttons-style-invalidation.html
+               fast/selectors/detached-radio-button-checked-and-indeterminate-states.html
+               fast/selectors/pseudo-indeterminate-with-radio-buttons-style-update.html
+
+        * css/SelectorCheckerTestFunctions.h:
+        (WebCore::shouldAppearIndeterminate):
+        * dom/Element.cpp:
+        (WebCore::Element::matchesIndeterminatePseudoClass):
+        * dom/Element.h:
+        * dom/RadioButtonGroups.cpp:
+        (WebCore::RadioButtonGroup::setCheckedButton):
+        (WebCore::RadioButtonGroup::updateCheckedState):
+        (WebCore::RadioButtonGroup::remove):
+        (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
+        (WebCore::RadioButtonGroups::hasCheckedButton):
+        * dom/RadioButtonGroups.h:
+        * html/CheckboxInputType.cpp:
+        (WebCore::CheckboxInputType::matchesIndeterminatePseudoClass):
+        (WebCore::CheckboxInputType::shouldAppearIndeterminate):
+        (WebCore::CheckboxInputType::supportsIndeterminateAppearance): Deleted.
+        * html/CheckboxInputType.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setChecked):
+        (WebCore::HTMLInputElement::matchesIndeterminatePseudoClass):
+        (WebCore::HTMLInputElement::shouldAppearIndeterminate):
+        (WebCore::HTMLInputElement::radioButtonGroups):
+        * html/HTMLInputElement.h:
+        * html/InputType.cpp:
+        (WebCore::InputType::matchesIndeterminatePseudoClass):
+        (WebCore::InputType::shouldAppearIndeterminate):
+        (WebCore::InputType::supportsIndeterminateAppearance): Deleted.
+        * html/InputType.h:
+        * html/RadioInputType.cpp:
+        (WebCore::RadioInputType::matchesIndeterminatePseudoClass):
+        (WebCore::RadioInputType::willDispatchClick): Deleted.
+        (WebCore::RadioInputType::didDispatchClick): Deleted.
+        (WebCore::RadioInputType::supportsIndeterminateAppearance): Deleted.
+        The iOS specific code is just plain wrong.
+        It was changing the indeterminate state of the input element.
+        The spec clearly says that state is only used by checkbox:
+        https://html.spec.whatwg.org/#dom-input-indeterminate
+
+        Moreover, the style update would not change the indeterminate state
+        of other buttons in the Button Group, which is just bizarre.
+        RenderThemeIOS does not make use of any of this with the current style.
+
+        * html/RadioInputType.h:
+        * style/StyleSharingResolver.cpp:
+        (WebCore::Style::SharingResolver::canShareStyleWithElement):
+        (WebCore::Style::canShareStyleWithControl): Deleted.
+        (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
+        Style sharing is unified behind the selector matching which is neat.
+
</ins><span class="cx"> 2016-06-17  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202152.
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -983,7 +983,7 @@
</span><span class="cx">         case CSSSelector::PseudoClassChecked:
</span><span class="cx">             return isChecked(element);
</span><span class="cx">         case CSSSelector::PseudoClassIndeterminate:
</span><del>-            return shouldAppearIndeterminate(element);
</del><ins>+            return matchesIndeterminatePseudoClass(element);
</ins><span class="cx">         case CSSSelector::PseudoClassRoot:
</span><span class="cx">             if (&amp;element == element.document().documentElement())
</span><span class="cx">                 return true;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerTestFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2014 Dhi Aurrahman &lt;diorahman@rockybars.com&gt;
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -221,9 +221,9 @@
</span><span class="cx">     return element.matchesReadWritePseudoClass();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE bool shouldAppearIndeterminate(const Element&amp; element)
</del><ins>+ALWAYS_INLINE bool matchesIndeterminatePseudoClass(const Element&amp; element)
</ins><span class="cx"> {
</span><del>-    return element.shouldAppearIndeterminate();
</del><ins>+    return element.matchesIndeterminatePseudoClass();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool scrollbarMatchesEnabledPseudoClass(const SelectorChecker::CheckingContext&amp; context)
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx">         fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isInRange));
</span><span class="cx">         return FunctionType::SimpleSelectorChecker;
</span><span class="cx">     case CSSSelector::PseudoClassIndeterminate:
</span><del>-        fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(shouldAppearIndeterminate));
</del><ins>+        fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(matchesIndeterminatePseudoClass));
</ins><span class="cx">         return FunctionType::SimpleSelectorChecker;
</span><span class="cx">     case CSSSelector::PseudoClassInvalid:
</span><span class="cx">         fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isInvalid));
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx">  *           (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2007 David Smith (catfish.man@gmail.com)
</span><del>- * Copyright (C) 2004-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2007 Eric Seidel (eric@webkit.org)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -2755,6 +2755,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Element::matchesIndeterminatePseudoClass() const
+{
+    return shouldAppearIndeterminate();
+}
+
</ins><span class="cx"> bool Element::matches(const String&amp; selector, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     SelectorQuery* selectorQuery = document().selectorQueryForString(selector, ec);
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/dom/Element.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Peter Kelly (pmk@post.com)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -386,6 +386,7 @@
</span><span class="cx">     void didShadowTreeAwareChildrenChange();
</span><span class="cx"> 
</span><span class="cx">     virtual bool matchesReadWritePseudoClass() const;
</span><ins>+    virtual bool matchesIndeterminatePseudoClass() const;
</ins><span class="cx">     bool matches(const String&amp; selectors, ExceptionCode&amp;);
</span><span class="cx">     Element* closest(const String&amp; selectors, ExceptionCode&amp;);
</span><span class="cx">     virtual bool shouldAppearIndeterminate() const;
</span></span></pre></div>
<a id="trunkSourceWebCoredomRadioButtonGroupscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/RadioButtonGroups.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/RadioButtonGroups.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/dom/RadioButtonGroups.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007, 2008, 2009, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -42,8 +42,10 @@
</span><span class="cx">     Vector&lt;HTMLInputElement*&gt; members() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    void setNeedsStyleRecalcForAllButtons();
</ins><span class="cx">     void updateValidityForAllButtons();
</span><span class="cx">     bool isValid() const;
</span><ins>+    void changeCheckedButton(HTMLInputElement*);
</ins><span class="cx">     void setCheckedButton(HTMLInputElement*);
</span><span class="cx"> 
</span><span class="cx">     HashSet&lt;HTMLInputElement*&gt; m_members;
</span><span class="lines">@@ -75,6 +77,12 @@
</span><span class="cx">     HTMLInputElement* oldCheckedButton = m_checkedButton;
</span><span class="cx">     if (oldCheckedButton == button)
</span><span class="cx">         return;
</span><ins>+
+    bool hadCheckedButton = m_checkedButton;
+    bool willHaveCheckedButton = button;
+    if (hadCheckedButton != willHaveCheckedButton)
+        setNeedsStyleRecalcForAllButtons();
+
</ins><span class="cx">     m_checkedButton = button;
</span><span class="cx">     if (oldCheckedButton)
</span><span class="cx">         oldCheckedButton-&gt;setChecked(false);
</span><span class="lines">@@ -110,7 +118,7 @@
</span><span class="cx">         setCheckedButton(button);
</span><span class="cx">     else {
</span><span class="cx">         if (m_checkedButton == button)
</span><del>-            m_checkedButton = nullptr;
</del><ins>+            setCheckedButton(nullptr);
</ins><span class="cx">     }
</span><span class="cx">     if (wasValid != isValid())
</span><span class="cx">         updateValidityForAllButtons();
</span><span class="lines">@@ -137,14 +145,20 @@
</span><span class="cx">     HashSet&lt;HTMLInputElement*&gt;::iterator it = m_members.find(button);
</span><span class="cx">     if (it == m_members.end())
</span><span class="cx">         return;
</span><ins>+
</ins><span class="cx">     bool wasValid = isValid();
</span><span class="cx">     m_members.remove(it);
</span><span class="cx">     if (button-&gt;isRequired()) {
</span><span class="cx">         ASSERT(m_requiredCount);
</span><span class="cx">         --m_requiredCount;
</span><span class="cx">     }
</span><del>-    if (m_checkedButton == button)
-        m_checkedButton = nullptr;
</del><ins>+    if (m_checkedButton) {
+        button-&gt;setNeedsStyleRecalc();
+        if (m_checkedButton == button) {
+            m_checkedButton = nullptr;
+            setNeedsStyleRecalcForAllButtons();
+        }
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (m_members.isEmpty()) {
</span><span class="cx">         ASSERT(!m_requiredCount);
</span><span class="lines">@@ -158,6 +172,14 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RadioButtonGroup::setNeedsStyleRecalcForAllButtons()
+{
+    for (auto&amp; button : m_members) {
+        ASSERT(button-&gt;isRadioButton());
+        button-&gt;setNeedsStyleRecalc();
+    }
+}
+
</ins><span class="cx"> void RadioButtonGroup::updateValidityForAllButtons()
</span><span class="cx"> {
</span><span class="cx">     for (auto&amp; button : m_members) {
</span><span class="lines">@@ -250,6 +272,17 @@
</span><span class="cx">     return group ? group-&gt;checkedButton() : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RadioButtonGroups::hasCheckedButton(const HTMLInputElement* element) const
+{
+    ASSERT(element-&gt;isRadioButton());
+    const AtomicString&amp; name = element-&gt;name();
+    if (name.isEmpty() || !m_nameToGroupMap)
+        return element-&gt;checked();
+
+    const RadioButtonGroup* group = m_nameToGroupMap-&gt;get(name.impl());
+    return group-&gt;checkedButton();
+}
+
</ins><span class="cx"> bool RadioButtonGroups::isInRequiredGroup(HTMLInputElement* element) const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(element-&gt;isRadioButton());
</span></span></pre></div>
<a id="trunkSourceWebCoredomRadioButtonGroupsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/RadioButtonGroups.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/RadioButtonGroups.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/dom/RadioButtonGroups.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">     void requiredAttributeChanged(HTMLInputElement*);
</span><span class="cx">     void removeButton(HTMLInputElement*);
</span><span class="cx">     HTMLInputElement* checkedButtonForGroup(const AtomicString&amp; groupName) const;
</span><ins>+    bool hasCheckedButton(const HTMLInputElement*) const;
</ins><span class="cx">     bool isInRequiredGroup(HTMLInputElement*) const;
</span><span class="cx">     Vector&lt;HTMLInputElement*&gt; groupMembers(const HTMLInputElement&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlCheckboxInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/CheckboxInputType.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/CheckboxInputType.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/CheckboxInputType.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -92,9 +92,14 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CheckboxInputType::supportsIndeterminateAppearance() const
</del><ins>+bool CheckboxInputType::matchesIndeterminatePseudoClass() const
</ins><span class="cx"> {
</span><del>-    return true;
</del><ins>+    return shouldAppearIndeterminate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool CheckboxInputType::shouldAppearIndeterminate() const
+{
+    return element().indeterminate();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlCheckboxInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/CheckboxInputType.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/CheckboxInputType.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/CheckboxInputType.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -47,7 +47,8 @@
</span><span class="cx">     void willDispatchClick(InputElementClickState&amp;) override;
</span><span class="cx">     void didDispatchClick(Event*, const InputElementClickState&amp;) override;
</span><span class="cx">     bool isCheckbox() const override;
</span><del>-    bool supportsIndeterminateAppearance() const override;
</del><ins>+    bool matchesIndeterminatePseudoClass() const override;
+    bool shouldAppearIndeterminate() const override;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -861,7 +861,7 @@
</span><span class="cx">     setNeedsStyleRecalc();
</span><span class="cx"> 
</span><span class="cx">     if (RadioButtonGroups* buttons = radioButtonGroups())
</span><del>-            buttons-&gt;updateCheckedState(this);
</del><ins>+        buttons-&gt;updateCheckedState(this);
</ins><span class="cx">     if (renderer() &amp;&amp; renderer()-&gt;style().hasAppearance())
</span><span class="cx">         renderer()-&gt;theme().stateChanged(*renderer(), ControlStates::CheckedState);
</span><span class="cx">     updateValidity();
</span><span class="lines">@@ -1763,9 +1763,21 @@
</span><span class="cx">     return m_inputType-&gt;defaultToolTip();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLInputElement::matchesIndeterminatePseudoClass() const
+{
+    // For input elements, matchesIndeterminatePseudoClass()
+    // is not equivalent to shouldAppearIndeterminate() because of radio button.
+    //
+    // A group of radio button without any checked button is indeterminate
+    // for the :indeterminate selector. On the other hand, RenderTheme
+    // currently only supports single element being indeterminate.
+    // Because of this, radio is indetermindate for CSS but not for render theme.
+    return m_inputType-&gt;matchesIndeterminatePseudoClass();
+}
+
</ins><span class="cx"> bool HTMLInputElement::shouldAppearIndeterminate() const 
</span><span class="cx"> {
</span><del>-    return m_inputType-&gt;supportsIndeterminateAppearance() &amp;&amp; indeterminate();
</del><ins>+    return m_inputType-&gt;shouldAppearIndeterminate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_CAPTURE)
</span><span class="lines">@@ -1801,12 +1813,12 @@
</span><span class="cx"> RadioButtonGroups* HTMLInputElement::radioButtonGroups() const
</span><span class="cx"> {
</span><span class="cx">     if (!isRadioButton())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (HTMLFormElement* formElement = form())
</span><span class="cx">         return &amp;formElement-&gt;radioButtonGroups();
</span><span class="cx">     if (inDocument())
</span><span class="cx">         return &amp;document().formController().radioButtonGroups();
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void HTMLInputElement::addToRadioButtonGroup()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2007, 2010, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -162,6 +162,7 @@
</span><span class="cx">     void setIndeterminate(bool);
</span><span class="cx">     // shouldAppearChecked is used by the rendering tree/CSS while checked() is used by JS to determine checked state
</span><span class="cx">     bool shouldAppearChecked() const;
</span><ins>+    bool matchesIndeterminatePseudoClass() const final;
</ins><span class="cx">     bool shouldAppearIndeterminate() const final;
</span><span class="cx"> 
</span><span class="cx">     unsigned size() const;
</span><span class="lines">@@ -274,6 +275,8 @@
</span><span class="cx">     Vector&lt;HTMLInputElement*&gt; radioButtonGroup() const;
</span><span class="cx">     HTMLInputElement* checkedRadioButtonForGroup() const;
</span><span class="cx">     bool isInRequiredRadioButtonGroup();
</span><ins>+    // Returns null if this isn't associated with any radio button group.
+    RadioButtonGroups* radioButtonGroups() const;
</ins><span class="cx"> 
</span><span class="cx">     // Functions for InputType classes.
</span><span class="cx">     void setValueInternal(const String&amp;, TextFieldEventBehavior);
</span><span class="lines">@@ -422,8 +425,6 @@
</span><span class="cx">     void maxLengthAttributeChanged(const AtomicString&amp; newValue);
</span><span class="cx">     void updateValueIfNeeded();
</span><span class="cx"> 
</span><del>-    // Returns null if this isn't associated with any radio button group.
-    RadioButtonGroups* radioButtonGroups() const;
</del><span class="cx">     void addToRadioButtonGroup();
</span><span class="cx">     void removeFromRadioButtonGroup();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/InputType.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -966,11 +966,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-bool InputType::supportsIndeterminateAppearance() const
</del><ins>+bool InputType::matchesIndeterminatePseudoClass() const
</ins><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool InputType::shouldAppearIndeterminate() const
+{
+    return false;
+}
+
</ins><span class="cx"> bool InputType::supportsSelectionAPI() const
</span><span class="cx"> {
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/InputType.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -267,7 +267,8 @@
</span><span class="cx">     virtual void capsLockStateMayHaveChanged();
</span><span class="cx">     virtual void updateAutoFillButton();
</span><span class="cx">     virtual String defaultToolTip() const;
</span><del>-    virtual bool supportsIndeterminateAppearance() const;
</del><ins>+    virtual bool matchesIndeterminatePseudoClass() const;
+    virtual bool shouldAppearIndeterminate() const;
</ins><span class="cx">     virtual bool supportsSelectionAPI() const;
</span><span class="cx">     virtual Color valueAsColor() const;
</span><span class="cx">     virtual void selectColor(const Color&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlRadioInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/RadioInputType.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RadioInputType.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/RadioInputType.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005, 2011, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -151,13 +151,6 @@
</span><span class="cx">     state.checked = element().checked();
</span><span class="cx">     state.checkedRadioButton = element().checkedRadioButtonForGroup();
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    state.indeterminate = element().indeterminate();
-
-    if (element().indeterminate())
-        element().setIndeterminate(false);
-#endif
-
</del><span class="cx">     element().setChecked(true, DispatchChangeEvent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -173,11 +166,6 @@
</span><span class="cx">                 &amp;&amp; checkedRadioButton-&gt;name() == element().name()) {
</span><span class="cx">             checkedRadioButton-&gt;setChecked(true);
</span><span class="cx">         }
</span><del>-
-#if PLATFORM(IOS)        
-        element().setIndeterminate(state.indeterminate);
-#endif
-
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // The work we did in willDispatchClick was default handling.
</span><span class="lines">@@ -189,13 +177,12 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RadioInputType::supportsIndeterminateAppearance() const
</del><ins>+bool RadioInputType::matchesIndeterminatePseudoClass() const
</ins><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
-    return true;
-#else
-    return false;
-#endif
</del><ins>+    const HTMLInputElement&amp; element = this-&gt;element();
+    if (const RadioButtonGroups* radioButtonGroups = element.radioButtonGroups())
+        return !radioButtonGroups-&gt;hasCheckedButton(&amp;element);
+    return !element.checked();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlRadioInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/RadioInputType.h (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RadioInputType.h        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/html/RadioInputType.h        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -51,7 +52,7 @@
</span><span class="cx">     void willDispatchClick(InputElementClickState&amp;) override;
</span><span class="cx">     void didDispatchClick(Event*, const InputElementClickState&amp;) override;
</span><span class="cx">     bool isRadioButton() const override;
</span><del>-    bool supportsIndeterminateAppearance() const override;
</del><ins>+    bool matchesIndeterminatePseudoClass() const override;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleSharingResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleSharingResolver.cpp (202196 => 202197)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-06-18 03:33:19 UTC (rev 202196)
+++ trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-06-18 05:53:28 UTC (rev 202197)
</span><span class="lines">@@ -179,8 +179,6 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (thisInputElement.shouldAppearChecked() != otherInputElement.shouldAppearChecked())
</span><span class="cx">         return false;
</span><del>-    if (thisInputElement.shouldAppearIndeterminate() != otherInputElement.shouldAppearIndeterminate())
-        return false;
</del><span class="cx">     if (thisInputElement.isRequired() != otherInputElement.isRequired())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -283,6 +281,9 @@
</span><span class="cx">     if (element.matchesInvalidPseudoClass() != element.matchesValidPseudoClass())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (candidateElement.matchesIndeterminatePseudoClass() != element.matchesIndeterminatePseudoClass())
+        return false;
+
</ins><span class="cx">     if (element.shadowRoot() &amp;&amp; !element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle()-&gt;hostPseudoClassRules().isEmpty())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -329,11 +330,6 @@
</span><span class="cx">     if (const_cast&lt;StyledElement&amp;&gt;(element).presentationAttributeStyle() != const_cast&lt;StyledElement&amp;&gt;(sharingCandidate).presentationAttributeStyle())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element.hasTagName(HTMLNames::progressTag)) {
-        if (element.shouldAppearIndeterminate() != sharingCandidate.shouldAppearIndeterminate())
-            return false;
-    }
-
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>