<!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>[176174] 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/176174">176174</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-11-16 23:01:21 -0800 (Sun, 16 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement :valid and :invalid matching for the fieldset element
https://bugs.webkit.org/show_bug.cgi?id=138769

Reviewed by Darin Adler.

Source/WebCore:

In the latest HTML spec, the pseudo classes :valid and :invalid match
a fieldset element based on its descendants:
    https://html.spec.whatwg.org/#selector-valid
    https://html.spec.whatwg.org/#selector-invalid

This patch adds that behavior.

There are two key problems to solve with these pseudo classes on fieldset:
-Efficient matching.
-Style invalidation when any of the descendant changes.

To implement the style invalidation, I have modified HTMLFormControlElement
to notify its ancestor when its state changes.

The first change is making the state fully internal to HTMLFormControlElement,
we do not want subclass to be able to change the behavior and forget to update
the ancestors.

To achieve that encapsulation, the interface was changed a bit:
-Neither willValidate() nor isValidFormControlElement() inherit from Element.
 Instead, willValidate() is the implementation of FormAssociatedElement's interface
 and it is final. The method isValidFormControlElement() becomes completely internal
 to HTMLFormControlElement.
-Since willValidate() should no longer be re-implemented by subclass, the elements
 that were depending on it have been migrated to recalcWillValidate() to set
 the initial state as needed.

With the validity state fully encapsulated in HTMLFormControlElement, all I need
is a way to communicate that information to HTMLFieldSetElement ancestors.
This is done in two cases:
-The validity state changes.
-The tree changes in a way that would make the input element not a descendant
 of a HTMLFieldSetElement.

The invalidation is simply done by walking up the ancestors and adding the current
element to a &quot;validity dependency list&quot; on each HTMLFieldSetElement.

Tests: fast/css/pseudo-invalid-fieldset-invalidation-optimization.html
       fast/css/pseudo-invalid-fieldset-style-sharing.html
       fast/css/pseudo-invalid-fieldset.html
       fast/css/pseudo-valid-fieldset-invalidation-optimization.html
       fast/css/pseudo-valid-fieldset-style-sharing.html
       fast/css/pseudo-valid-fieldset.html
       fast/selectors/invalid-fieldset-style-update-1.html
       fast/selectors/invalid-fieldset-style-update-2.html
       fast/selectors/invalid-fieldset-style-update-3.html
       fast/selectors/invalid-fieldset-style-update-4.html
       fast/selectors/invalid-fieldset-style-update-5.html
       fast/selectors/valid-fieldset-style-update-1.html
       fast/selectors/valid-fieldset-style-update-2.html
       fast/selectors/valid-fieldset-style-update-3.html
       fast/selectors/valid-fieldset-style-update-4.html
       fast/selectors/valid-fieldset-style-update-5.html

* css/SelectorCheckerTestFunctions.h:
(WebCore::isInRange):
(WebCore::isOutOfRange):
(WebCore::isInvalid):
(WebCore::isValid):
The hack &quot;ContainsValidityStyleRules&quot; is in the way of correct styling
of FieldSet and Form.
It is not the right way to get stylesheet properties anyway.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithControl):
Make sure style sharing does not incorrectly share style for fieldset elements.

* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::containsValidityStyleRules): Deleted.
(WebCore::Document::setContainsValidityStyleRules): Deleted.
* dom/Element.h:
(WebCore::Element::matchesValidPseudoClass):
(WebCore::Element::matchesInvalidPseudoClass):
(WebCore::Element::willValidate): Deleted.
(WebCore::Element::isValidFormControlElement): Deleted.
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::customError):
* html/FormAssociatedElement.h:

* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::matchesValidPseudoClass):
(WebCore::HTMLFieldSetElement::matchesInvalidPseudoClass):
(WebCore::HTMLFieldSetElement::addInvalidDescendant):
(WebCore::HTMLFieldSetElement::removeInvalidDescendant):
Each HTMLFormControlElement that has constraint validation adds or removes
itself from its HTMLFieldSetElement ancestors.

It should be possible to just keep track of a count instead of a HashSet.
I decided to got with the HashSet to make the code more robust and easier
to debug. A few assertions ensure that the HashSet is actually used as a counter.

* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::addInvalidElementToAncestorFromInsertionPoint):
(WebCore::removeInvalidElementToAncestorFromInsertionPoint):

(WebCore::HTMLFormControlElement::insertedInto):
(WebCore::HTMLFormControlElement::removedFrom):
One tricky part of those two functions is that we cannot use
matchesValidPseudoClass() or matchesInvalidPseudoClass().

The reason is that HTMLFieldSetElement is a subclass of HTMLFormControlElement
and it has its own definition of what Valid and Invalid mean when matching selectors.

In HTMLFormControlElement, we must use the internal state,
willValidate() and isValidFormControlElement() must be used directly.

(WebCore::HTMLFormControlElement::matchesValidPseudoClass):
(WebCore::HTMLFormControlElement::matchesInvalidPseudoClass):
(WebCore::HTMLFormControlElement::willValidate):
(WebCore::addInvalidElementToAncestors):
(WebCore::removeInvalidElementFromAncestors):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::setNeedsValidityCheck):
(WebCore::HTMLFormControlElement::isValidFormControlElement): Deleted.
* html/HTMLFormControlElement.h:
(WebCore::HTMLFormControlElement::isValidFormControlElement):
* html/HTMLKeygenElement.h:
* html/HTMLObjectElement.h:
* html/HTMLOutputElement.h:

LayoutTests:

There are many ways to change the validation state of a submittable element.
I included a series of test trying to exercises as many combination
as possible.

* fast/css/pseudo-valid-unapplied-expected.txt:
* fast/css/pseudo-valid-unapplied.html:
This test was checking that :valid and :invalid are not applied
to fieldset. Such results are incorrect with the latest specification.

* fast/css/pseudo-invalid-fieldset-expected.html: Added.
* fast/css/pseudo-invalid-fieldset-invalidation-optimization-expected.txt: Added.
* fast/css/pseudo-invalid-fieldset-invalidation-optimization.html: Added.
* fast/css/pseudo-invalid-fieldset-style-sharing-expected.html: Added.
* fast/css/pseudo-invalid-fieldset-style-sharing.html: Added.
* fast/css/pseudo-invalid-fieldset.html: Added.
* fast/css/pseudo-valid-fieldset-expected.html: Added.
* fast/css/pseudo-valid-fieldset-invalidation-optimization-expected.txt: Added.
* fast/css/pseudo-valid-fieldset-invalidation-optimization.html: Added.
* fast/css/pseudo-valid-fieldset-style-sharing-expected.html: Added.
* fast/css/pseudo-valid-fieldset-style-sharing.html: Added.
* fast/css/pseudo-valid-fieldset.html: Added.
* fast/selectors/invalid-fieldset-style-update-1-expected.txt: Added.
* fast/selectors/invalid-fieldset-style-update-1.html: Added.
* fast/selectors/invalid-fieldset-style-update-2-expected.txt: Added.
* fast/selectors/invalid-fieldset-style-update-2.html: Added.
* fast/selectors/invalid-fieldset-style-update-3-expected.txt: Added.
* fast/selectors/invalid-fieldset-style-update-3.html: Added.
* fast/selectors/invalid-fieldset-style-update-4-expected.txt: Added.
* fast/selectors/invalid-fieldset-style-update-4.html: Added.
* fast/selectors/invalid-fieldset-style-update-5-expected.txt: Added.
* fast/selectors/invalid-fieldset-style-update-5.html: Added.
* fast/selectors/valid-fieldset-style-update-1-expected.txt: Added.
* fast/selectors/valid-fieldset-style-update-1.html: Added.
* fast/selectors/valid-fieldset-style-update-2-expected.txt: Added.
* fast/selectors/valid-fieldset-style-update-2.html: Added.
* fast/selectors/valid-fieldset-style-update-3-expected.txt: Added.
* fast/selectors/valid-fieldset-style-update-3.html: Added.
* fast/selectors/valid-fieldset-style-update-4-expected.txt: Added.
* fast/selectors/valid-fieldset-style-update-4.html: Added.
* fast/selectors/valid-fieldset-style-update-5-expected.txt: Added.
* fast/selectors/valid-fieldset-style-update-5.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidunappliedexpectedtxt">trunk/LayoutTests/fast/css/pseudo-valid-unapplied-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidunappliedhtml">trunk/LayoutTests/fast/css/pseudo-valid-unapplied.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerTestFunctionsh">trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorehtmlFormAssociatedElementcpp">trunk/Source/WebCore/html/FormAssociatedElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlFormAssociatedElementh">trunk/Source/WebCore/html/FormAssociatedElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFieldSetElementcpp">trunk/Source/WebCore/html/HTMLFieldSetElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFieldSetElementh">trunk/Source/WebCore/html/HTMLFieldSetElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementcpp">trunk/Source/WebCore/html/HTMLFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementh">trunk/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLKeygenElementh">trunk/Source/WebCore/html/HTMLKeygenElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementh">trunk/Source/WebCore/html/HTMLObjectElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOutputElementh">trunk/Source/WebCore/html/HTMLOutputElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidfieldsetexpectedhtml">trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidfieldsetinvalidationoptimizationexpectedtxt">trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidfieldsetinvalidationoptimizationhtml">trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidfieldsetstylesharingexpectedhtml">trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidfieldsetstylesharinghtml">trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidfieldsethtml">trunk/LayoutTests/fast/css/pseudo-invalid-fieldset.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidfieldsetexpectedhtml">trunk/LayoutTests/fast/css/pseudo-valid-fieldset-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidfieldsetinvalidationoptimizationexpectedtxt">trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidfieldsetinvalidationoptimizationhtml">trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidfieldsetstylesharingexpectedhtml">trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidfieldsetstylesharinghtml">trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidfieldsethtml">trunk/LayoutTests/fast/css/pseudo-valid-fieldset.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate1expectedtxt">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate1html">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate2expectedtxt">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate2html">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate3expectedtxt">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate3html">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate4expectedtxt">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate4html">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate5expectedtxt">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate5html">trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate1expectedtxt">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate1html">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate2expectedtxt">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate2html">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate3expectedtxt">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate3html">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate4expectedtxt">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate4html">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate5expectedtxt">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate5html">trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/LayoutTests/ChangeLog        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2014-11-16  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Implement :valid and :invalid matching for the fieldset element
+        https://bugs.webkit.org/show_bug.cgi?id=138769
+
+        Reviewed by Darin Adler.
+
+        There are many ways to change the validation state of a submittable element.
+        I included a series of test trying to exercises as many combination
+        as possible.
+
+        * fast/css/pseudo-valid-unapplied-expected.txt:
+        * fast/css/pseudo-valid-unapplied.html:
+        This test was checking that :valid and :invalid are not applied
+        to fieldset. Such results are incorrect with the latest specification.
+
+        * fast/css/pseudo-invalid-fieldset-expected.html: Added.
+        * fast/css/pseudo-invalid-fieldset-invalidation-optimization-expected.txt: Added.
+        * fast/css/pseudo-invalid-fieldset-invalidation-optimization.html: Added.
+        * fast/css/pseudo-invalid-fieldset-style-sharing-expected.html: Added.
+        * fast/css/pseudo-invalid-fieldset-style-sharing.html: Added.
+        * fast/css/pseudo-invalid-fieldset.html: Added.
+        * fast/css/pseudo-valid-fieldset-expected.html: Added.
+        * fast/css/pseudo-valid-fieldset-invalidation-optimization-expected.txt: Added.
+        * fast/css/pseudo-valid-fieldset-invalidation-optimization.html: Added.
+        * fast/css/pseudo-valid-fieldset-style-sharing-expected.html: Added.
+        * fast/css/pseudo-valid-fieldset-style-sharing.html: Added.
+        * fast/css/pseudo-valid-fieldset.html: Added.
+        * fast/selectors/invalid-fieldset-style-update-1-expected.txt: Added.
+        * fast/selectors/invalid-fieldset-style-update-1.html: Added.
+        * fast/selectors/invalid-fieldset-style-update-2-expected.txt: Added.
+        * fast/selectors/invalid-fieldset-style-update-2.html: Added.
+        * fast/selectors/invalid-fieldset-style-update-3-expected.txt: Added.
+        * fast/selectors/invalid-fieldset-style-update-3.html: Added.
+        * fast/selectors/invalid-fieldset-style-update-4-expected.txt: Added.
+        * fast/selectors/invalid-fieldset-style-update-4.html: Added.
+        * fast/selectors/invalid-fieldset-style-update-5-expected.txt: Added.
+        * fast/selectors/invalid-fieldset-style-update-5.html: Added.
+        * fast/selectors/valid-fieldset-style-update-1-expected.txt: Added.
+        * fast/selectors/valid-fieldset-style-update-1.html: Added.
+        * fast/selectors/valid-fieldset-style-update-2-expected.txt: Added.
+        * fast/selectors/valid-fieldset-style-update-2.html: Added.
+        * fast/selectors/valid-fieldset-style-update-3-expected.txt: Added.
+        * fast/selectors/valid-fieldset-style-update-3.html: Added.
+        * fast/selectors/valid-fieldset-style-update-4-expected.txt: Added.
+        * fast/selectors/valid-fieldset-style-update-4.html: Added.
+        * fast/selectors/valid-fieldset-style-update-5-expected.txt: Added.
+        * fast/selectors/valid-fieldset-style-update-5.html: Added.
+
</ins><span class="cx"> 2014-11-16  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Crash when setting 'order' CSS property to a calculated value
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidfieldsetexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-expected.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-expected.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,175 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body style=&quot;color: green;&quot;&gt;
+    &lt;p style=&quot;color: green;&quot;&gt;Test the styling with the pseudo class :valid with the &amp;lt;fieldset&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Fieldset by itself. --&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;Text&lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs without any requirements. --&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;
+        Text
+        &lt;input style=&quot;color: green;&quot;&gt;
+        &lt;input style=&quot;color: green;&quot; value&gt;
+        &lt;input style=&quot;color: green;&quot; value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs without any requirements. --&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: green;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: green;&quot;&gt;
+                Text
+                &lt;input style=&quot;color: green;&quot;&gt;
+                &lt;input style=&quot;color: green;&quot; value&gt;
+                &lt;input style=&quot;color: green;&quot; value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; required&gt;
+        &lt;input style=&quot;background-color: red;&quot; required value&gt;
+        &lt;input style=&quot;background-color: red;&quot; required value=&quot;&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: green;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: green;&quot;&gt;
+                Text
+                &lt;input style=&quot;background-color: red;&quot; required&gt;
+                &lt;input style=&quot;background-color: red;&quot; required value&gt;
+                &lt;input style=&quot;background-color: red;&quot; required value=&quot;&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;
+        &lt;input style=&quot;color: green;&quot; required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: green;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: green;&quot;&gt;
+                Text
+                &lt;input style=&quot;color: green;&quot; required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with a mix of satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+        &lt;input style=&quot;background-color: red;&quot; required&gt;
+        &lt;input style=&quot;background-color: red;&quot; required value&gt;
+        &lt;input style=&quot;background-color: red;&quot; required value=&quot;&quot;&gt;
+        &lt;input style=&quot;color: green;&quot; required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: green;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: green;&quot;&gt;
+                Text
+                &lt;input style=&quot;background-color: red;&quot; required&gt;
+                &lt;input style=&quot;background-color: red;&quot; required value&gt;
+                &lt;input style=&quot;background-color: red;&quot; required value=&quot;&quot;&gt;
+                &lt;input style=&quot;color: green;&quot; required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- The cases above repeated with multiple nested fieldset --&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;
+        &lt;div style=&quot;color: green;&quot;&gt;
+            &lt;fieldset style=&quot;color: green;&quot;&gt;
+                &lt;fieldset style=&quot;color: green;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: green;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: green;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;color: green;&quot;&gt;
+                            &lt;input style=&quot;color: green;&quot; value&gt;
+                            &lt;input style=&quot;color: green;&quot; value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+        &lt;div style=&quot;color: green;&quot;&gt;
+            &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+                &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: green;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: green;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;background-color: red;&quot; required&gt;
+                            &lt;input style=&quot;background-color: red;&quot; required value&gt;
+                            &lt;input style=&quot;background-color: red;&quot; required value=&quot;&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset style=&quot;color: green;&quot;&gt;
+        &lt;div style=&quot;color: green;&quot;&gt;
+            &lt;fieldset style=&quot;color: green;&quot;&gt;
+                &lt;fieldset style=&quot;color: green;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: green;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: green;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;color: green;&quot; required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+        &lt;div style=&quot;color: green;&quot;&gt;
+            &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+                &lt;fieldset style=&quot;background-color: red;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: green;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: green;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;background-color: red;&quot; required&gt;
+                            &lt;input style=&quot;background-color: red;&quot; required value&gt;
+                            &lt;input style=&quot;background-color: red;&quot; required value=&quot;&quot;&gt;
+                            &lt;input style=&quot;color: green;&quot; required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidfieldsetinvalidationoptimizationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test that we do not invalidate the style of &lt;fieldset&gt; excessively when matching :invalid based on the descendants.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidfieldsetinvalidationoptimizationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-invalidation-optimization.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,96 @@
</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;
+fieldset {
+    color: black;
+}
+fieldset:invalid {
+    color: rgb(0, 1, 2);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;fieldset id=&quot;with-renderer&quot;&gt;
+            &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;fieldset id=&quot;without-renderer&quot;&gt;
+            &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+
+description('Test that we do not invalidate the style of &amp;lt;fieldset&amp;gt; excessively when matching :invalid based on the descendants.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;))');
+}
+
+function checkStyle(expectedColor) {
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color', expectedColor);
+}
+
+// Force a layout to ensure we don't have dirty styles.
+var offsetTop = document.documentElement.offsetTop;
+
+// Initial state.
+shouldNeedStyleRecalc(false);
+checkStyle('rgb(0, 0, 0)');
+
+// Make input3 invalid, the fieldset should also become invalid.
+var inputs3 = document.querySelectorAll('.input3');
+inputs3[0].value = '';
+inputs3[1].value = '';
+
+shouldNeedStyleRecalc(true);
+checkStyle('rgb(0, 1, 2)');
+
+// Making more fields invalid should not invalidate the fieldset's style.
+var inputs = document.querySelectorAll(':matches(.input2, .input4)');
+for (var i = 0; i &lt; inputs.length; ++i)
+    inputs[i].value = '';
+
+shouldNeedStyleRecalc(false);
+checkStyle('rgb(0, 1, 2)');
+
+// Removing valid fields should not invalidate the style.
+var inputs1 = document.querySelectorAll(':matches(.input1)');
+for (var i = 0; i &lt; inputs1.length; ++i)
+    inputs1[i].parentNode.removeChild(inputs1[i]);
+
+// Making all fields valid but one, fieldset still does not need to be invalidated.
+var inputs = document.querySelectorAll(':matches(.input2, .input3)');
+for (var i = 0; i &lt; inputs.length; ++i)
+    inputs[i].removeAttribute('required');
+
+shouldNeedStyleRecalc(false);
+checkStyle('rgb(0, 1, 2)');
+
+// Making the last input valid. The style must update, fieldset must be invalidated.
+var inputs = document.querySelectorAll(':matches(.input4)');
+for (var i = 0; i &lt; inputs.length; ++i)
+    inputs[i].removeAttribute('required');
+
+shouldNeedStyleRecalc(true);
+checkStyle('rgb(0, 0, 0)');
+
+document.getElementById(&quot;with-renderer&quot;).style.display = 'none';
+&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="trunkLayoutTestsfastcsspseudoinvalidfieldsetstylesharingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing-expected.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing-expected.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        fieldset:invalid {
+            style=&quot;background-color: blue;&quot;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore :invalid affecting a &amp;lt;fieldset&amp;gt;.&lt;/p&gt;
+
+    &lt;!-- Empty fieldset are :valid, non-empty's :valid depend on the children. --&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- The style of field set varies with its required children. --&gt;
+    &lt;div&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: blue;&quot;&gt;
+            &lt;textarea style=&quot;background-color: red;&quot; required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidfieldsetstylesharinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-fieldset-style-sharing.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        textarea:invalid {
+            background-color: red;
+        }
+        fieldset:invalid {
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore :invalid affecting a &amp;lt;fieldset&amp;gt;.&lt;/p&gt;
+
+    &lt;!-- Empty fieldset are :valid, non-empty's :valid depend on the children. --&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- The style of field set varies with its required children. --&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidfieldsethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-fieldset.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-fieldset.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-fieldset.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :invalid {
+            background-color: red;
+        }
+        :not(:invalid) {
+            color: green;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the styling with the pseudo class :valid with the &amp;lt;fieldset&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Fieldset by itself. --&gt;
+    &lt;fieldset&gt;Text&lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs without any requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;input&gt;
+        &lt;input value&gt;
+        &lt;input value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs without any requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input&gt;
+                &lt;input value&gt;
+                &lt;input value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        &lt;input required&gt;
+        &lt;input required value&gt;
+        &lt;input required value=&quot;&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input required&gt;
+                &lt;input required value&gt;
+                &lt;input required value=&quot;&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        &lt;input required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with a mix of satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        &lt;input required&gt;
+        &lt;input required value&gt;
+        &lt;input required value=&quot;&quot;&gt;
+        &lt;input required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input required&gt;
+                &lt;input required value&gt;
+                &lt;input required value=&quot;&quot;&gt;
+                &lt;input required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- The cases above repeated with multiple nested fieldset --&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input&gt;
+                            &lt;input value&gt;
+                            &lt;input value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input required&gt;
+                            &lt;input required value&gt;
+                            &lt;input required value=&quot;&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input required&gt;
+                            &lt;input required value&gt;
+                            &lt;input required value=&quot;&quot;&gt;
+                            &lt;input required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidfieldsetexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-fieldset-expected.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-fieldset-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-fieldset-expected.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body style=&quot;color: red;&quot;&gt;
+    &lt;p style=&quot;color: red;&quot;&gt;Test the styling with the pseudo class :valid with the &amp;lt;fieldset&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Fieldset by itself. --&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;Text&lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs without any requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+        Text
+        &lt;input style=&quot;background-color: green;&quot;&gt;
+        &lt;input style=&quot;background-color: green;&quot; value&gt;
+        &lt;input style=&quot;background-color: green;&quot; value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs without any requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: red;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: red;&quot;&gt;
+                Text
+                &lt;input style=&quot;background-color: green;&quot;&gt;
+                &lt;input style=&quot;background-color: green;&quot; value&gt;
+                &lt;input style=&quot;background-color: green;&quot; value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;color: red;&quot;&gt;
+        &lt;input style=&quot;color: red;&quot; required&gt;
+        &lt;input style=&quot;color: red;&quot; required value&gt;
+        &lt;input style=&quot;color: red;&quot; required value=&quot;&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;color: red;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: red;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: red;&quot;&gt;
+                Text
+                &lt;input style=&quot;color: red;&quot; required&gt;
+                &lt;input style=&quot;color: red;&quot; required value&gt;
+                &lt;input style=&quot;color: red;&quot; required value=&quot;&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+        &lt;input style=&quot;background-color: green;&quot; required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: red;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: red;&quot;&gt;
+                Text
+                &lt;input style=&quot;background-color: green;&quot; required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with a mix of satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;color: red;&quot;&gt;
+        &lt;input style=&quot;color: red;&quot; required&gt;
+        &lt;input style=&quot;color: red;&quot; required value&gt;
+        &lt;input style=&quot;color: red;&quot; required value=&quot;&quot;&gt;
+        &lt;input style=&quot;background-color: green;&quot; required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset style=&quot;color: red;&quot;&gt;
+        Text
+        &lt;div style=&quot;color: red;&quot;&gt;
+            Text
+            &lt;div style=&quot;color: red;&quot;&gt;
+                Text
+                &lt;input style=&quot;color: red;&quot; required&gt;
+                &lt;input style=&quot;color: red;&quot; required value&gt;
+                &lt;input style=&quot;color: red;&quot; required value=&quot;&quot;&gt;
+                &lt;input style=&quot;background-color: green;&quot; required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- The cases above repeated with multiple nested fieldset --&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+        &lt;div style=&quot;color: red;&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+                &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: red;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: red;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;background-color: green;&quot;&gt;
+                            &lt;input style=&quot;background-color: green;&quot; value&gt;
+                            &lt;input style=&quot;background-color: green;&quot; value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset style=&quot;color: red;&quot;&gt;
+        &lt;div style=&quot;color: red;&quot;&gt;
+            &lt;fieldset style=&quot;color: red;&quot;&gt;
+                &lt;fieldset style=&quot;color: red;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: red;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: red;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;color: red;&quot; required&gt;
+                            &lt;input style=&quot;color: red;&quot; required value&gt;
+                            &lt;input style=&quot;color: red;&quot; required value=&quot;&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+        &lt;div style=&quot;color: red;&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+                &lt;fieldset style=&quot;background-color: green;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: red;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: red;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;background-color: green;&quot; required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset style=&quot;color: red;&quot;&gt;
+        &lt;div style=&quot;color: red;&quot;&gt;
+            &lt;fieldset style=&quot;color: red;&quot;&gt;
+                &lt;fieldset style=&quot;color: red;&quot;&gt;
+                    Text
+                    &lt;div style=&quot;color: red;&quot;&gt;
+                        Text
+                        &lt;div style=&quot;color: red;&quot;&gt;
+                            Text
+                            &lt;input style=&quot;color: red;&quot; required&gt;
+                            &lt;input style=&quot;color: red;&quot; required value&gt;
+                            &lt;input style=&quot;color: red;&quot; required value=&quot;&quot;&gt;
+                            &lt;input style=&quot;background-color: green;&quot; required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidfieldsetinvalidationoptimizationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test that we do not invalidate the style of &lt;fieldset&gt; excessively when matching :valid based on the descendants.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidfieldsetinvalidationoptimizationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-fieldset-invalidation-optimization.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,96 @@
</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;
+fieldset {
+    color: black;
+}
+fieldset:valid {
+    color: rgb(0, 1, 2);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;fieldset id=&quot;with-renderer&quot;&gt;
+            &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;fieldset id=&quot;without-renderer&quot;&gt;
+            &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+
+description('Test that we do not invalidate the style of &amp;lt;fieldset&amp;gt; excessively when matching :valid based on the descendants.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;with-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;without-renderer&quot;))');
+}
+
+function checkStyle(expectedColor) {
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;with-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;without-renderer&quot;)).color', expectedColor);
+}
+
+// Force a layout to ensure we don't have dirty styles.
+var offsetTop = document.documentElement.offsetTop;
+
+// Initial state.
+shouldNeedStyleRecalc(false);
+checkStyle('rgb(0, 1, 2)');
+
+// Make input3 invalid, the fieldset should also become invalid.
+var inputs3 = document.querySelectorAll('.input3');
+inputs3[0].value = '';
+inputs3[1].value = '';
+
+shouldNeedStyleRecalc(true);
+checkStyle('rgb(0, 0, 0)');
+
+// Making more fields invalid should not invalidate the fieldset's style.
+var inputs = document.querySelectorAll(':matches(.input2, .input4)');
+for (var i = 0; i &lt; inputs.length; ++i)
+    inputs[i].value = '';
+
+shouldNeedStyleRecalc(false);
+checkStyle('rgb(0, 0, 0)');
+
+// Removing valid fields should not invalidate the style.
+var inputs1 = document.querySelectorAll(':matches(.input1)');
+for (var i = 0; i &lt; inputs1.length; ++i)
+    inputs1[i].parentNode.removeChild(inputs1[i]);
+
+// Making all fields valid but one, fieldset still does not need to be invalidated.
+var inputs = document.querySelectorAll(':matches(.input2, .input3)');
+for (var i = 0; i &lt; inputs.length; ++i)
+    inputs[i].removeAttribute('required');
+
+shouldNeedStyleRecalc(false);
+checkStyle('rgb(0, 0, 0)');
+
+// Making the last input valid. The style must update, fieldset must be invalidated.
+var inputs = document.querySelectorAll(':matches(.input4)');
+for (var i = 0; i &lt; inputs.length; ++i)
+    inputs[i].removeAttribute('required');
+
+shouldNeedStyleRecalc(true);
+checkStyle('rgb(0, 1, 2)');
+
+document.getElementById(&quot;with-renderer&quot;).style.display = 'none';
+&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="trunkLayoutTestsfastcsspseudovalidfieldsetstylesharingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing-expected.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing-expected.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore :valid affecting a &amp;lt;fieldset&amp;gt;.&lt;/p&gt;
+
+    &lt;div&gt;
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;&lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;&lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;
+            &lt;textarea style=&quot;background-color: green;&quot;&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;
+            &lt;textarea style=&quot;background-color: green;&quot; required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;&lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset style=&quot;background-color: lime;&quot;&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;
+            &lt;textarea style=&quot;background-color: green;&quot; required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;fieldset style=&quot;background-color: lime;&quot;&gt;
+            &lt;textarea style=&quot;background-color: green;&quot; required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidfieldsetstylesharinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-fieldset-style-sharing.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        textarea:valid {
+            background-color: green;
+        }
+        fieldset:valid {
+            background-color: lime;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Verify style sharing does not ignore :valid affecting a &amp;lt;fieldset&amp;gt;.&lt;/p&gt;
+
+    &lt;!-- Empty fieldset are :valid, non-empty's :valid depend on the children. --&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- The style of field set varies with its required children. --&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;Foobar&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset&gt;
+            &lt;textarea required&gt;&lt;/textarea&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidfieldsethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-fieldset.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-fieldset.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-fieldset.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        /* Pack them to fit everything in 800*600 */
+        fieldset {
+            padding: 5px;
+            width: 100px;
+            float: left;
+        }
+        :valid {
+            background-color: green;
+        }
+        :not(:valid) {
+            color: red;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the styling with the pseudo class :valid with the &amp;lt;fieldset&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Fieldset by itself. --&gt;
+    &lt;fieldset&gt;Text&lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs without any requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;input&gt;
+        &lt;input value&gt;
+        &lt;input value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs without any requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input&gt;
+                &lt;input value&gt;
+                &lt;input value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        &lt;input required&gt;
+        &lt;input required value&gt;
+        &lt;input required value=&quot;&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input required&gt;
+                &lt;input required value&gt;
+                &lt;input required value=&quot;&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        &lt;input required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with a direct child inputs with a mix of satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        &lt;input required&gt;
+        &lt;input required value&gt;
+        &lt;input required value=&quot;&quot;&gt;
+        &lt;input required value=&quot;text&quot;&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- Fieldset with an indirect direct child inputs with satisfied and unsatisfied requirements. --&gt;
+    &lt;fieldset&gt;
+        Text
+        &lt;div&gt;
+            Text
+            &lt;div&gt;
+                Text
+                &lt;input required&gt;
+                &lt;input required value&gt;
+                &lt;input required value=&quot;&quot;&gt;
+                &lt;input required value=&quot;text&quot;&gt;
+            &lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+
+    &lt;!-- The cases above repeated with multiple nested fieldset --&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input&gt;
+                            &lt;input value&gt;
+                            &lt;input value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input required&gt;
+                            &lt;input required value&gt;
+                            &lt;input required value=&quot;&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+    &lt;fieldset&gt;
+        &lt;div&gt;
+            &lt;fieldset&gt;
+                &lt;fieldset&gt;
+                    Text
+                    &lt;div&gt;
+                        Text
+                        &lt;div&gt;
+                            Text
+                            &lt;input required&gt;
+                            &lt;input required value&gt;
+                            &lt;input required value=&quot;&quot;&gt;
+                            &lt;input required value=&quot;text&quot;&gt;
+                        &lt;/div&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/fieldset&gt;
+        &lt;/div&gt;
+    &lt;/fieldset&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidunappliedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/pseudo-valid-unapplied-expected.txt (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-unapplied-expected.txt        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/LayoutTests/fast/css/pseudo-valid-unapplied-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -9,7 +9,6 @@
</span><span class="cx"> PASS getBackgroundColor('input-reset') is normalColor
</span><span class="cx"> PASS getBackgroundColor('input-hidden') is normalColor
</span><span class="cx"> PASS getBackgroundColor('input-image') is normalColor
</span><del>-PASS getBackgroundColor('fieldset') is normalColor
</del><span class="cx"> PASS getBackgroundColor('object') is normalColor
</span><span class="cx"> PASS getBackgroundColor('button-button') is normalColor
</span><span class="cx"> PASS getBackgroundColor('button-reset') is normalColor
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidunappliedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/pseudo-valid-unapplied.html (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-unapplied.html        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/LayoutTests/fast/css/pseudo-valid-unapplied.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx">     &quot;input-reset&quot;,
</span><span class="cx">     &quot;input-hidden&quot;,
</span><span class="cx">     &quot;input-image&quot;,
</span><del>-    &quot;fieldset&quot;,
</del><span class="cx">     &quot;object&quot;,
</span><span class="cx">     &quot;button-button&quot;,
</span><span class="cx">     &quot;button-reset&quot;,
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,259 @@
</span><ins>+Test style update for :invalid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Back to invalid. We should be in the initial state.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move the invalid text area into fieldset3.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Make the text area valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the input invalid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move text area as a child of fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move text area as a child of div1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area invalid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the input valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area valid, everything should be valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the input invalid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move fieldset2 inside div3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Destroy the content of div2
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-1.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,171 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :invalid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset2&quot;&gt;
+                    &lt;div class=&quot;div2&quot;&gt;
+                        &lt;input class=&quot;input1&quot; required value=&quot;valid&quot;&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+                &lt;textarea class=&quot;textarea1&quot; required&gt;&lt;/textarea&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset class=&quot;fieldset3&quot;&gt;
+            &lt;div class=&quot;div3&quot;&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :invalid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle(['fieldset1', 'textarea1']);
+
+debug('');
+debug(&quot;Make the text area valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Back to invalid. We should be in the initial state.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;&quot;;
+});
+testStyle(['fieldset1', 'textarea1']);
+
+
+debug('');
+debug(&quot;Move the invalid text area into fieldset3.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var fieldset3 = root.querySelector('.fieldset3');
+    fieldset3.appendChild(textArea);
+});
+testStyle(['fieldset3', 'textarea1']);
+
+debug('');
+debug(&quot;Make the text area valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Make the input invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;&quot;;
+});
+testStyle(['fieldset1', 'fieldset2', 'input1']);
+
+debug('');
+debug(&quot;Move text area as a child of fieldset1.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var fieldset1 = root.querySelector('.fieldset1');
+    fieldset1.appendChild(textArea);
+});
+testStyle(['fieldset1', 'fieldset2', 'input1']);
+
+debug('');
+debug(&quot;Move text area as a child of div1.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var div1 = root.querySelector('.div1');
+    div1.appendChild(textArea);
+});
+testStyle(['fieldset1', 'fieldset2', 'input1']);
+
+debug('');
+debug(&quot;Make the text area invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;&quot;;
+});
+testStyle(['fieldset1', 'fieldset2', 'input1', 'textarea1']);
+
+debug('');
+debug(&quot;Make the input valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;Valid&quot;;
+});
+testStyle(['fieldset1', 'textarea1']);
+
+debug('');
+debug(&quot;Make the text area valid, everything should be valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Make the input invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;&quot;;
+});
+testStyle(['fieldset1', 'fieldset2', 'input1']);
+
+
+debug('');
+debug(&quot;Move fieldset2 inside div3&quot;);
+modifyTree(function(root) {
+    var fieldset2 = root.querySelector('.fieldset2');
+    var div3 = root.querySelector('.div3');
+    div3.appendChild(fieldset2);
+});
+testStyle(['fieldset3', 'fieldset2', 'input1']);
+
+debug('');
+debug(&quot;Destroy the content of div2&quot;);
+modifyTree(function(root) {
+    root.querySelector('.div2').textContent = '';
+});
+testStyle([]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,369 @@
</span><ins>+Test style update for :invalid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input3 to something that validates.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input7 to something that validates.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input9 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input5 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input6 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input7 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Change the type of input10 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable the text area.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-2.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,136 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :invalid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset2&quot;&gt;
+                    &lt;div class=&quot;div2&quot;&gt;
+                        &lt;input class=&quot;input1&quot; required value=&quot;valid&quot;&gt;
+                        &lt;input class=&quot;input2&quot; type=&quot;button&quot; required value=&quot;valid&quot;&gt;
+                        &lt;input class=&quot;input3&quot; type=&quot;hidden&quot; required value=&quot;valid&quot;&gt;
+                        &lt;input class=&quot;input4&quot; type=&quot;email&quot; required value=&quot;awesome@webkit.org&quot;&gt;
+                        &lt;input class=&quot;input5&quot; type=&quot;password&quot; required value=&quot;valid&quot;&gt;
+                        &lt;button class=&quot;button1&quot;&gt;Base button&lt;/button&gt;
+                        &lt;button class=&quot;button2&quot; type=&quot;submit&quot;&gt;Submit button&lt;/button&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+                &lt;textarea class=&quot;textarea1&quot; required&gt;&lt;/textarea&gt;
+                &lt;input class=&quot;input6&quot; required&gt;
+                &lt;input class=&quot;input7&quot; type=&quot;button&quot; required&gt;
+                &lt;input class=&quot;input8&quot; type=&quot;hidden&quot; required&gt;
+                &lt;input class=&quot;input9&quot; type=&quot;email&quot; required&gt;
+                &lt;input class=&quot;input10&quot; type=&quot;password&quot; required&gt;
+                &lt;button class=&quot;button3&quot;&gt;Base button&lt;/button&gt;
+                &lt;button class=&quot;button4&quot; type=&quot;submit&quot;&gt;Submit button&lt;/button&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :invalid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle(['fieldset1', 'textarea1', 'input6', 'input9', 'input10']);
+
+debug('');
+debug(&quot;Change the type of input3 to something that validates.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').type = &quot;search&quot;;
+});
+testStyle(['fieldset1', 'textarea1', 'input6', 'input9', 'input10']);
+
+debug('');
+debug(&quot;Change the type of input7 to something that validates.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input7').type = &quot;search&quot;;
+});
+testStyle(['fieldset1', 'textarea1', 'input6', 'input7', 'input9', 'input10']);
+
+debug('');
+debug(&quot;Change the type of input9 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input9').type = &quot;hidden&quot;;
+});
+testStyle(['fieldset1', 'textarea1', 'input6', 'input7', 'input10']);
+
+debug('');
+debug(&quot;Change the type of input5 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input5').type = &quot;button&quot;;
+});
+testStyle(['fieldset1', 'textarea1', 'input6', 'input7', 'input10']);
+
+// Change everything in the second half of controls without validation, eventually, fieldset1 should validate.
+debug('');
+debug(&quot;Change the type of input6 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input6').type = &quot;button&quot;;
+});
+testStyle(['fieldset1', 'textarea1', 'input7', 'input10']);
+
+debug('');
+debug(&quot;Change the type of input7 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input7').type = &quot;reset&quot;;
+});
+testStyle(['fieldset1', 'textarea1', 'input10']);
+
+debug('');
+debug(&quot;Change the type of input10 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input10').type = &quot;reset&quot;;
+});
+testStyle(['fieldset1', 'textarea1']);
+
+debug('');
+debug(&quot;Disable the text area.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').setAttribute('disabled', '');
+});
+testStyle([]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+Test style update for :invalid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input1 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input2 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input3 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input4 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input5 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input6 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Enable fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Remove input1
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Remove input2
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Remove input3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Remove input4
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Remove input5
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Remove input6
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-3.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,183 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :invalid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset class=&quot;fieldset2&quot; disabled&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :invalid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle([]);
+
+debug('');
+debug(&quot;Add input1 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input1 = document.createElement('input');
+    input1.className = 'input1';
+    root.querySelector('.fieldset1').appendChild(input1);
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Add input2 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input2 = document.createElement('input');
+    input2.className = 'input2';
+    input2.setAttribute('required', '');
+    root.querySelector('.fieldset1').appendChild(input2);
+});
+testStyle(['fieldset1', 'input2']);
+
+debug('');
+debug(&quot;Add input3 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input3 = document.createElement('input');
+    input3.className = 'input3';
+    input3.setAttribute('required', '');
+    input3.value = &quot;valid&quot;;
+    root.querySelector('.fieldset1').appendChild(input3);
+});
+testStyle(['fieldset1', 'input2']);
+
+debug('');
+debug(&quot;Add input4 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input4 = document.createElement('input');
+    input4.className = 'input4';
+    root.querySelector('.fieldset2').appendChild(input4);
+});
+testStyle(['fieldset1', 'input2']);
+
+debug('');
+debug(&quot;Add input5 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input5 = document.createElement('input');
+    input5.className = 'input5';
+    input5.setAttribute('required', '');
+    root.querySelector('.fieldset2').appendChild(input5);
+});
+testStyle(['fieldset1', 'input2']);
+
+debug('');
+debug(&quot;Add input6 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input6 = document.createElement('input');
+    input6.className = 'input6';
+    input6.setAttribute('required', '');
+    input6.value = &quot;valid&quot;
+    root.querySelector('.fieldset2').appendChild(input6);
+});
+testStyle(['fieldset1', 'input2']);
+
+debug('');
+debug(&quot;Enable fieldset2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.fieldset2').removeAttribute('disabled');
+});
+testStyle(['fieldset1', 'input2', 'fieldset2', 'input5']);
+
+debug('');
+debug(&quot;Disable fieldset1.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.fieldset1').setAttribute('disabled', '');
+});
+testStyle(['fieldset2', 'input5']);
+
+debug('');
+debug(&quot;Remove input1&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input1');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset2', 'input5']);
+
+debug('');
+debug(&quot;Remove input2&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input2');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset2', 'input5']);
+
+debug('');
+debug(&quot;Remove input3&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input3');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset2', 'input5']);
+
+debug('');
+debug(&quot;Remove input4&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input4');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset2', 'input5']);
+
+debug('');
+debug(&quot;Remove input5&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input5');
+    input.parentNode.removeChild(input);
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Remove input6&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input6');
+    input.parentNode.removeChild(input);
+});
+testStyle([]);
+
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,191 @@
</span><ins>+Test style update for :invalid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input1 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input1 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input2 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input2 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input3 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input3.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input3.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input3 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input4 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input4.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input4.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input4 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-4.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,182 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :invalid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset class=&quot;fieldset2&quot; disabled&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :invalid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle([]);
+
+debug('');
+debug(&quot;Add input1 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input1 = document.createElement('input');
+    input1.className = 'input1';
+    root.querySelector('.fieldset1').appendChild(input1);
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Disable input1.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').setAttribute('disabled', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Re-enable input1.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').removeAttribute('disabled');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Make input1 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').setAttribute('readonly', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Add input2 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input2 = document.createElement('input');
+    input2.className = 'input2';
+    root.querySelector('.fieldset2').appendChild(input2);
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Disable input2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input2').setAttribute('disabled', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Re-enable input2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input2').removeAttribute('disabled');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Make input2 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input2').setAttribute('readonly', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Add input3 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input3 = document.createElement('input');
+    input3.className = 'input3';
+    input3.setAttribute('required', '');
+    root.querySelector('.fieldset1').appendChild(input3);
+});
+testStyle(['fieldset1', 'input3']);
+
+debug('');
+debug(&quot;Disable input3.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').setAttribute('disabled', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Re-enable input3.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').removeAttribute('disabled');
+});
+testStyle(['fieldset1', 'input3']);
+
+debug('');
+debug(&quot;Make input3 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').setAttribute('readonly', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Add input4 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input4 = document.createElement('input');
+    input4.className = 'input4';
+    input4.setAttribute('required', '');
+    root.querySelector('.fieldset2').appendChild(input4);
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Disable input4.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input4').setAttribute('disabled', '');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Re-enable input4.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input4').removeAttribute('disabled');
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Make input4 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input4').setAttribute('readonly', '');
+});
+testStyle([]);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate5expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test style update for :invalid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Move fieldset2 inside div3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidfieldsetstyleupdate5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-fieldset-style-update-5.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,73 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :invalid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset2&quot;&gt;
+                    &lt;div class=&quot;div2&quot;&gt;
+                        &lt;input class=&quot;input1&quot; required value=&quot;&quot;&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+        &lt;div class=&quot;div3&quot;&gt;
+        &lt;/div&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :invalid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug(&quot;Move fieldset2 inside div3&quot;);
+modifyTree(function(root) {
+    var fieldset2 = root.querySelector('.fieldset2');
+    var div3 = root.querySelector('.div3');
+    div3.appendChild(fieldset2);
+});
+testStyle(['fieldset2', 'input1']);
+
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,259 @@
</span><ins>+Test style update for :valid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Back to invalid. We should be in the initial state.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move the invalid text area into fieldset3.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Make the input invalid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Move text area as a child of fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move text area as a child of div1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area invalid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the input valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the text area valid, everything should be valid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make the input invalid.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Move fieldset2 inside div3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Destroy the content of div2
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-1.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,171 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :valid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset2&quot;&gt;
+                    &lt;div class=&quot;div2&quot;&gt;
+                        &lt;input class=&quot;input1&quot; required value=&quot;valid&quot;&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+                &lt;textarea class=&quot;textarea1&quot; required&gt;&lt;/textarea&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset class=&quot;fieldset3&quot;&gt;
+            &lt;div class=&quot;div3&quot;&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :valid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle(['fieldset2', 'input1', 'fieldset3']);
+
+debug('');
+debug(&quot;Make the text area valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle(['fieldset1', 'fieldset2', 'input1', 'fieldset3', 'textarea1']);
+
+debug('');
+debug(&quot;Back to invalid. We should be in the initial state.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;&quot;;
+});
+testStyle(['fieldset2', 'input1', 'fieldset3']);
+
+
+debug('');
+debug(&quot;Move the invalid text area into fieldset3.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var fieldset3 = root.querySelector('.fieldset3');
+    fieldset3.appendChild(textArea);
+});
+testStyle(['fieldset1', 'fieldset2', 'input1']);
+
+debug('');
+debug(&quot;Make the text area valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle(['fieldset1', 'fieldset2', 'input1', 'fieldset3', 'textarea1']);
+
+debug('');
+debug(&quot;Make the input invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;&quot;;
+});
+testStyle(['fieldset3', 'textarea1']);
+
+debug('');
+debug(&quot;Move text area as a child of fieldset1.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var fieldset1 = root.querySelector('.fieldset1');
+    fieldset1.appendChild(textArea);
+});
+testStyle(['textarea1', 'fieldset3']);
+
+debug('');
+debug(&quot;Move text area as a child of div1.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var div1 = root.querySelector('.div1');
+    div1.appendChild(textArea);
+});
+testStyle(['textarea1', 'fieldset3']);
+
+debug('');
+debug(&quot;Make the text area invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;&quot;;
+});
+testStyle(['fieldset3']);
+
+debug('');
+debug(&quot;Make the input valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;Valid&quot;;
+});
+testStyle(['fieldset2', 'input1', 'fieldset3']);
+
+debug('');
+debug(&quot;Make the text area valid, everything should be valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle(['fieldset1', 'fieldset2', 'input1', 'textarea1', 'fieldset3']);
+
+debug('');
+debug(&quot;Make the input invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;&quot;;
+});
+testStyle(['fieldset3', 'textarea1']);
+
+
+debug('');
+debug(&quot;Move fieldset2 inside div3&quot;);
+modifyTree(function(root) {
+    var fieldset2 = root.querySelector('.fieldset2');
+    var div3 = root.querySelector('.div3');
+    div3.appendChild(fieldset2);
+});
+testStyle(['fieldset1', 'textarea1']);
+
+debug('');
+debug(&quot;Destroy the content of div2&quot;);
+modifyTree(function(root) {
+    root.querySelector('.div2').textContent = '';
+});
+testStyle(['fieldset1', 'textarea1', 'fieldset3', 'fieldset2']);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,369 @@
</span><ins>+Test style update for :valid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input3 to something that validates.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input7 to something that validates.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input9 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input5 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input6 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input7 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Change the type of input10 to something that does not validate.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Disable the text area.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.textarea1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input7&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input8&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input9&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input10&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.button4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-2.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,136 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :valid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset2&quot;&gt;
+                    &lt;div class=&quot;div2&quot;&gt;
+                        &lt;input class=&quot;input1&quot; required value=&quot;valid&quot;&gt;
+                        &lt;input class=&quot;input2&quot; type=&quot;button&quot; required value=&quot;valid&quot;&gt;
+                        &lt;input class=&quot;input3&quot; type=&quot;hidden&quot; required value=&quot;valid&quot;&gt;
+                        &lt;input class=&quot;input4&quot; type=&quot;email&quot; required value=&quot;awesome@webkit.org&quot;&gt;
+                        &lt;input class=&quot;input5&quot; type=&quot;password&quot; required value=&quot;valid&quot;&gt;
+                        &lt;button class=&quot;button1&quot;&gt;Base button&lt;/button&gt;
+                        &lt;button class=&quot;button2&quot; type=&quot;submit&quot;&gt;Submit button&lt;/button&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+                &lt;textarea class=&quot;textarea1&quot; required&gt;&lt;/textarea&gt;
+                &lt;input class=&quot;input6&quot; required&gt;
+                &lt;input class=&quot;input7&quot; type=&quot;button&quot; required&gt;
+                &lt;input class=&quot;input8&quot; type=&quot;hidden&quot; required&gt;
+                &lt;input class=&quot;input9&quot; type=&quot;email&quot; required&gt;
+                &lt;input class=&quot;input10&quot; type=&quot;password&quot; required&gt;
+                &lt;button class=&quot;button3&quot;&gt;Base button&lt;/button&gt;
+                &lt;button class=&quot;button4&quot; type=&quot;submit&quot;&gt;Submit button&lt;/button&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :valid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle(['fieldset2', 'input1', 'input4', 'input5', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Change the type of input3 to something that validates.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').type = &quot;search&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'input5', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Change the type of input7 to something that validates.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input7').type = &quot;search&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'input5', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Change the type of input9 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input9').type = &quot;hidden&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'input5', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Change the type of input5 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input5').type = &quot;button&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+// Change everything in the second half of controls without validation, eventually, fieldset1 should validate.
+debug('');
+debug(&quot;Change the type of input6 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input6').type = &quot;button&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Change the type of input7 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input7').type = &quot;reset&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Change the type of input10 to something that does not validate.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input10').type = &quot;reset&quot;;
+});
+testStyle(['fieldset2', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Disable the text area.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').setAttribute('disabled', '');
+});
+testStyle(['fieldset1', 'fieldset2', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+Test style update for :valid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input1 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input2 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input3 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input4 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input5 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input6 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Enable fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Disable fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Remove input1
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Remove input2
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Remove input3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Remove input4
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input5&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Remove input5
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input6&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Remove input6
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-3.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,183 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :valid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset class=&quot;fieldset2&quot; disabled&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :valid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input1 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input1 = document.createElement('input');
+    input1.className = 'input1';
+    root.querySelector('.fieldset1').appendChild(input1);
+});
+testStyle(['fieldset1', 'input1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input2 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input2 = document.createElement('input');
+    input2.className = 'input2';
+    input2.setAttribute('required', '');
+    root.querySelector('.fieldset1').appendChild(input2);
+});
+testStyle(['input1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input3 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input3 = document.createElement('input');
+    input3.className = 'input3';
+    input3.setAttribute('required', '');
+    input3.value = &quot;valid&quot;;
+    root.querySelector('.fieldset1').appendChild(input3);
+});
+testStyle(['input1', 'input3', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input4 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input4 = document.createElement('input');
+    input4.className = 'input4';
+    root.querySelector('.fieldset2').appendChild(input4);
+});
+testStyle(['input1', 'input3', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input5 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input5 = document.createElement('input');
+    input5.className = 'input5';
+    input5.setAttribute('required', '');
+    root.querySelector('.fieldset2').appendChild(input5);
+});
+testStyle(['input1', 'input3', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input6 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input6 = document.createElement('input');
+    input6.className = 'input6';
+    input6.setAttribute('required', '');
+    input6.value = &quot;valid&quot;
+    root.querySelector('.fieldset2').appendChild(input6);
+});
+testStyle(['input1', 'input3', 'fieldset2']);
+
+debug('');
+debug(&quot;Enable fieldset2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.fieldset2').removeAttribute('disabled');
+});
+testStyle(['input1', 'input3', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Disable fieldset1.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.fieldset1').setAttribute('disabled', '');
+});
+testStyle(['fieldset1', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input1&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input1');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset1', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input2&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input2');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset1', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input3&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input3');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset1', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input4&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input4');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset1', 'input6']);
+
+debug('');
+debug(&quot;Remove input5&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input5');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset1', 'fieldset2', 'input6']);
+
+debug('');
+debug(&quot;Remove input6&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input6');
+    input.parentNode.removeChild(input);
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,191 @@
</span><ins>+Test style update for :valid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Initial state
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input1 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Disable input1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Re-enable input1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Make input1 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input2 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input2 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input3 to fieldset1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input3.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input3.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input3 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input4 to fieldset2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Disable input4.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Re-enable input4.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Make input4 readonly.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input4&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-4.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,182 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :valid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+        &lt;/fieldset&gt;
+        &lt;fieldset class=&quot;fieldset2&quot; disabled&gt;
+        &lt;/fieldset&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :valid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug('Initial state');
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input1 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input1 = document.createElement('input');
+    input1.className = 'input1';
+    root.querySelector('.fieldset1').appendChild(input1);
+});
+testStyle(['fieldset1', 'input1', 'fieldset2']);
+
+debug('');
+debug(&quot;Disable input1.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').setAttribute('disabled', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Re-enable input1.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').removeAttribute('disabled');
+});
+testStyle(['fieldset1', 'input1', 'fieldset2']);
+
+debug('');
+debug(&quot;Make input1 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').setAttribute('readonly', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input2 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input2 = document.createElement('input');
+    input2.className = 'input2';
+    root.querySelector('.fieldset2').appendChild(input2);
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Disable input2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input2').setAttribute('disabled', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Re-enable input2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input2').removeAttribute('disabled');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Make input2 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input2').setAttribute('readonly', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input3 to fieldset1.&quot;);
+modifyTree(function(root) {
+    var input3 = document.createElement('input');
+    input3.className = 'input3';
+    input3.setAttribute('required', '');
+    root.querySelector('.fieldset1').appendChild(input3);
+});
+testStyle(['fieldset2']);
+
+debug('');
+debug(&quot;Disable input3.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').setAttribute('disabled', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Re-enable input3.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').removeAttribute('disabled');
+});
+testStyle(['fieldset2']);
+
+debug('');
+debug(&quot;Make input3 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input3').setAttribute('readonly', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Add input4 to fieldset2.&quot;);
+modifyTree(function(root) {
+    var input4 = document.createElement('input');
+    input4.className = 'input4';
+    input4.setAttribute('required', '');
+    root.querySelector('.fieldset2').appendChild(input4);
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Disable input4.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input4').setAttribute('disabled', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Re-enable input4.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input4').removeAttribute('disabled');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+debug('');
+debug(&quot;Make input4 readonly.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input4').setAttribute('readonly', '');
+});
+testStyle(['fieldset1', 'fieldset2']);
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate5expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5-expected.txt (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5-expected.txt        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test style update for :valid applied on a fieldset.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Move fieldset2 inside div3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div3&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.fieldset2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.div2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.input1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsvalidfieldsetstyleupdate5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5.html (0 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-fieldset-style-update-5.html        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -0,0 +1,73 @@
</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;
+:matches(#with-renderer, #without-renderer) * {
+    background-color: rgb(1, 2, 3);
+}
+:matches(#with-renderer, #without-renderer) :valid {
+    background-color: rgb(4, 5, 6);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;template id=&quot;test-source&quot;&gt;
+        &lt;fieldset class=&quot;fieldset1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset2&quot;&gt;
+                    &lt;div class=&quot;div2&quot;&gt;
+                        &lt;input class=&quot;input1&quot; required value=&quot;&quot;&gt;
+                    &lt;/div&gt;
+                &lt;/fieldset&gt;
+            &lt;/div&gt;
+        &lt;/fieldset&gt;
+        &lt;div class=&quot;div3&quot;&gt;
+        &lt;/div&gt;
+    &lt;/template&gt;
+    &lt;div id=&quot;with-renderer&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;without-renderer&quot; style=&quot;display:none;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test style update for :valid applied on a fieldset.');
+
+var withRenderer = document.getElementById(&quot;with-renderer&quot;);
+var withoutRenderer = document.getElementById(&quot;without-renderer&quot;);
+var source = document.getElementById(&quot;test-source&quot;).content;
+
+withRenderer.appendChild(source.cloneNode(true));
+withoutRenderer.appendChild(source.cloneNode(true));
+
+function testStyleAtId(rootId, matchedClass) {
+    var allElements = document.getElementById(rootId).querySelectorAll('*');
+    for (var i = 0; i &lt; allElements.length; ++i) {
+        var expectedStyle = matchedClass.indexOf(allElements[i].className) &gt;= 0 ? 'rgb(4, 5, 6)' : 'rgb(1, 2, 3)';
+        shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;' + rootId + '&quot;).querySelector(&quot;.' + allElements[i].className + '&quot;)).backgroundColor', expectedStyle);
+    }
+}
+
+function testStyle(matchedClass) {
+    testStyleAtId('with-renderer', matchedClass);
+    testStyleAtId('without-renderer', matchedClass);
+}
+
+function modifyTree(updateFunction) {
+    updateFunction(withRenderer);
+    updateFunction(withoutRenderer);
+}
+
+debug('');
+debug(&quot;Move fieldset2 inside div3&quot;);
+modifyTree(function(root) {
+    var fieldset2 = root.querySelector('.fieldset2');
+    var div3 = root.querySelector('.div3');
+    div3.appendChild(fieldset2);
+});
+testStyle(['fieldset1']);
+
+
+// Remove the content otherwise it will appear in the results.
+withRenderer.style.display = 'none';
+&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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/ChangeLog        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -1,3 +1,133 @@
</span><ins>+2014-11-16  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        Implement :valid and :invalid matching for the fieldset element
+        https://bugs.webkit.org/show_bug.cgi?id=138769
+
+        Reviewed by Darin Adler.
+
+        In the latest HTML spec, the pseudo classes :valid and :invalid match
+        a fieldset element based on its descendants:
+            https://html.spec.whatwg.org/#selector-valid
+            https://html.spec.whatwg.org/#selector-invalid
+
+        This patch adds that behavior.
+
+        There are two key problems to solve with these pseudo classes on fieldset:
+        -Efficient matching.
+        -Style invalidation when any of the descendant changes.
+
+        To implement the style invalidation, I have modified HTMLFormControlElement
+        to notify its ancestor when its state changes.
+
+        The first change is making the state fully internal to HTMLFormControlElement,
+        we do not want subclass to be able to change the behavior and forget to update
+        the ancestors.
+
+        To achieve that encapsulation, the interface was changed a bit:
+        -Neither willValidate() nor isValidFormControlElement() inherit from Element.
+         Instead, willValidate() is the implementation of FormAssociatedElement's interface
+         and it is final. The method isValidFormControlElement() becomes completely internal
+         to HTMLFormControlElement.
+        -Since willValidate() should no longer be re-implemented by subclass, the elements
+         that were depending on it have been migrated to recalcWillValidate() to set
+         the initial state as needed.
+
+        With the validity state fully encapsulated in HTMLFormControlElement, all I need
+        is a way to communicate that information to HTMLFieldSetElement ancestors.
+        This is done in two cases:
+        -The validity state changes.
+        -The tree changes in a way that would make the input element not a descendant
+         of a HTMLFieldSetElement.
+
+        The invalidation is simply done by walking up the ancestors and adding the current
+        element to a &quot;validity dependency list&quot; on each HTMLFieldSetElement.
+
+        Tests: fast/css/pseudo-invalid-fieldset-invalidation-optimization.html
+               fast/css/pseudo-invalid-fieldset-style-sharing.html
+               fast/css/pseudo-invalid-fieldset.html
+               fast/css/pseudo-valid-fieldset-invalidation-optimization.html
+               fast/css/pseudo-valid-fieldset-style-sharing.html
+               fast/css/pseudo-valid-fieldset.html
+               fast/selectors/invalid-fieldset-style-update-1.html
+               fast/selectors/invalid-fieldset-style-update-2.html
+               fast/selectors/invalid-fieldset-style-update-3.html
+               fast/selectors/invalid-fieldset-style-update-4.html
+               fast/selectors/invalid-fieldset-style-update-5.html
+               fast/selectors/valid-fieldset-style-update-1.html
+               fast/selectors/valid-fieldset-style-update-2.html
+               fast/selectors/valid-fieldset-style-update-3.html
+               fast/selectors/valid-fieldset-style-update-4.html
+               fast/selectors/valid-fieldset-style-update-5.html
+
+        * css/SelectorCheckerTestFunctions.h:
+        (WebCore::isInRange):
+        (WebCore::isOutOfRange):
+        (WebCore::isInvalid):
+        (WebCore::isValid):
+        The hack &quot;ContainsValidityStyleRules&quot; is in the way of correct styling
+        of FieldSet and Form.
+        It is not the right way to get stylesheet properties anyway.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::canShareStyleWithControl):
+        Make sure style sharing does not incorrectly share style for fieldset elements.
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        * dom/Document.h:
+        (WebCore::Document::containsValidityStyleRules): Deleted.
+        (WebCore::Document::setContainsValidityStyleRules): Deleted.
+        * dom/Element.h:
+        (WebCore::Element::matchesValidPseudoClass):
+        (WebCore::Element::matchesInvalidPseudoClass):
+        (WebCore::Element::willValidate): Deleted.
+        (WebCore::Element::isValidFormControlElement): Deleted.
+        * html/FormAssociatedElement.cpp:
+        (WebCore::FormAssociatedElement::customError):
+        * html/FormAssociatedElement.h:
+
+        * html/HTMLFieldSetElement.cpp:
+        (WebCore::HTMLFieldSetElement::matchesValidPseudoClass):
+        (WebCore::HTMLFieldSetElement::matchesInvalidPseudoClass):
+        (WebCore::HTMLFieldSetElement::addInvalidDescendant):
+        (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
+        Each HTMLFormControlElement that has constraint validation adds or removes
+        itself from its HTMLFieldSetElement ancestors.
+
+        It should be possible to just keep track of a count instead of a HashSet.
+        I decided to got with the HashSet to make the code more robust and easier
+        to debug. A few assertions ensure that the HashSet is actually used as a counter.
+
+        * html/HTMLFieldSetElement.h:
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::addInvalidElementToAncestorFromInsertionPoint):
+        (WebCore::removeInvalidElementToAncestorFromInsertionPoint):
+
+        (WebCore::HTMLFormControlElement::insertedInto):
+        (WebCore::HTMLFormControlElement::removedFrom):
+        One tricky part of those two functions is that we cannot use
+        matchesValidPseudoClass() or matchesInvalidPseudoClass().
+
+        The reason is that HTMLFieldSetElement is a subclass of HTMLFormControlElement
+        and it has its own definition of what Valid and Invalid mean when matching selectors.
+
+        In HTMLFormControlElement, we must use the internal state,
+        willValidate() and isValidFormControlElement() must be used directly.
+
+        (WebCore::HTMLFormControlElement::matchesValidPseudoClass):
+        (WebCore::HTMLFormControlElement::matchesInvalidPseudoClass):
+        (WebCore::HTMLFormControlElement::willValidate):
+        (WebCore::addInvalidElementToAncestors):
+        (WebCore::removeInvalidElementFromAncestors):
+        (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
+        (WebCore::HTMLFormControlElement::setNeedsValidityCheck):
+        (WebCore::HTMLFormControlElement::isValidFormControlElement): Deleted.
+        * html/HTMLFormControlElement.h:
+        (WebCore::HTMLFormControlElement::isValidFormControlElement):
+        * html/HTMLKeygenElement.h:
+        * html/HTMLObjectElement.h:
+        * html/HTMLOutputElement.h:
+
</ins><span class="cx"> 2014-11-16  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [TexMap] Add typecasting support for GraphicsLayerTextureMapper
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerTestFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -86,20 +86,17 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isInRange(Element* element)
</span><span class="cx"> {
</span><del>-    element-&gt;document().setContainsValidityStyleRules();
</del><span class="cx">     return element-&gt;isInRange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isOutOfRange(Element* element)
</span><span class="cx"> {
</span><del>-    element-&gt;document().setContainsValidityStyleRules();
</del><span class="cx">     return element-&gt;isOutOfRange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isInvalid(const Element* element)
</span><span class="cx"> {
</span><del>-    element-&gt;document().setContainsValidityStyleRules();
-    return element-&gt;willValidate() &amp;&amp; !element-&gt;isValidFormControlElement();
</del><ins>+    return element-&gt;matchesInvalidPseudoClass();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isOptionalFormControl(const Element* element)
</span><span class="lines">@@ -114,8 +111,7 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isValid(const Element* element)
</span><span class="cx"> {
</span><del>-    element-&gt;document().setContainsValidityStyleRules();
-    return element-&gt;willValidate() &amp;&amp; element-&gt;isValidFormControlElement();
</del><ins>+    return element-&gt;matchesValidPseudoClass();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isWindowInactive(const Element* element)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -525,22 +525,18 @@
</span><span class="cx">     if (element-&gt;isDefaultButtonForForm() != state.element()-&gt;isDefaultButtonForForm())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (state.document().containsValidityStyleRules()) {
-        bool willValidate = element-&gt;willValidate();
</del><ins>+    if (element-&gt;matchesValidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
+        return false;
</ins><span class="cx"> 
</span><del>-        if (willValidate != state.element()-&gt;willValidate())
-            return false;
</del><ins>+    if (element-&gt;matchesInvalidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
+        return false;
</ins><span class="cx"> 
</span><del>-        if (willValidate &amp;&amp; (element-&gt;isValidFormControlElement() != state.element()-&gt;isValidFormControlElement()))
-            return false;
</del><ins>+    if (element-&gt;isInRange() != state.element()-&gt;isInRange())
+        return false;
</ins><span class="cx"> 
</span><del>-        if (element-&gt;isInRange() != state.element()-&gt;isInRange())
-            return false;
</del><ins>+    if (element-&gt;isOutOfRange() != state.element()-&gt;isOutOfRange())
+        return false;
</ins><span class="cx"> 
</span><del>-        if (element-&gt;isOutOfRange() != state.element()-&gt;isOutOfRange())
-            return false;
-    }
-
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -440,7 +440,6 @@
</span><span class="cx">     , m_closeAfterStyleRecalc(false)
</span><span class="cx">     , m_gotoAnchorNeededAfterStylesheetsLoad(false)
</span><span class="cx">     , m_frameElementsShouldIgnoreScrolling(false)
</span><del>-    , m_containsValidityStyleRules(false)
</del><span class="cx">     , m_updateFocusAppearanceRestoresSelection(false)
</span><span class="cx">     , m_ignoreDestructiveWriteCount(0)
</span><span class="cx">     , m_titleSetExplicitly(false)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/dom/Document.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -1108,9 +1108,6 @@
</span><span class="cx">     virtual bool isContextThread() const override final;
</span><span class="cx">     virtual bool isJSExecutionForbidden() const override final { return false; }
</span><span class="cx"> 
</span><del>-    bool containsValidityStyleRules() const { return m_containsValidityStyleRules; }
-    void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; }
-
</del><span class="cx">     void enqueueWindowEvent(PassRefPtr&lt;Event&gt;);
</span><span class="cx">     void enqueueDocumentEvent(PassRefPtr&lt;Event&gt;);
</span><span class="cx">     void enqueueOverflowEvent(PassRefPtr&lt;Event&gt;);
</span><span class="lines">@@ -1478,7 +1475,6 @@
</span><span class="cx">     bool m_isDNSPrefetchEnabled;
</span><span class="cx">     bool m_haveExplicitlyDisabledDNSPrefetch;
</span><span class="cx">     bool m_frameElementsShouldIgnoreScrolling;
</span><del>-    bool m_containsValidityStyleRules;
</del><span class="cx">     bool m_updateFocusAppearanceRestoresSelection;
</span><span class="cx"> 
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-writes-counter
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/dom/Element.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -453,14 +453,14 @@
</span><span class="cx">     virtual bool isMediaElement() const { return false; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    virtual bool matchesValidPseudoClass() const { return false; }
+    virtual bool matchesInvalidPseudoClass() const { return false; }
</ins><span class="cx">     virtual bool isFormControlElement() const { return false; }
</span><span class="cx">     virtual bool isSpinButtonElement() const { return false; }
</span><span class="cx">     virtual bool isTextFormControl() const { return false; }
</span><span class="cx">     virtual bool isOptionalFormControl() const { return false; }
</span><span class="cx">     virtual bool isRequiredFormControl() const { return false; }
</span><span class="cx">     virtual bool isDefaultButtonForForm() const { return false; }
</span><del>-    virtual bool willValidate() const { return false; }
-    virtual bool isValidFormControlElement() const { return false; }
</del><span class="cx">     virtual bool isInRange() const { return false; }
</span><span class="cx">     virtual bool isOutOfRange() const { return false; }
</span><span class="cx">     virtual bool isFrameElementBase() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlFormAssociatedElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/FormAssociatedElement.cpp (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/FormAssociatedElement.cpp        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/FormAssociatedElement.cpp        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool FormAssociatedElement::customError() const
</span><span class="cx"> {
</span><del>-    return asHTMLElement().willValidate() &amp;&amp; !m_customValidationMessage.isEmpty();
</del><ins>+    return willValidate() &amp;&amp; !m_customValidationMessage.isEmpty();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FormAssociatedElement::hasBadInput() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlFormAssociatedElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/FormAssociatedElement.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/FormAssociatedElement.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/FormAssociatedElement.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx">     String customValidationMessage() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    virtual bool willValidate() const = 0;
</ins><span class="cx">     virtual void refFormAssociatedElement() = 0;
</span><span class="cx">     virtual void derefFormAssociatedElement() = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFieldSetElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.cpp (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFieldSetElement.cpp        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.cpp        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -128,6 +128,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLFieldSetElement::matchesValidPseudoClass() const
+{
+    return m_invalidDescendants.isEmpty();
+}
+
+bool HTMLFieldSetElement::matchesInvalidPseudoClass() const
+{
+    return !m_invalidDescendants.isEmpty();
+}
+
</ins><span class="cx"> bool HTMLFieldSetElement::supportsFocus() const
</span><span class="cx"> {
</span><span class="cx">     return HTMLElement::supportsFocus();
</span><span class="lines">@@ -189,4 +199,25 @@
</span><span class="cx">     return length;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void HTMLFieldSetElement::addInvalidDescendant(const HTMLFormControlElement&amp; invalidFormControlElement)
+{
+    ASSERT_WITH_MESSAGE(!is&lt;HTMLFieldSetElement&gt;(invalidFormControlElement), &quot;FieldSet are never candidates for constraint validation.&quot;);
+    ASSERT(static_cast&lt;const Element&amp;&gt;(invalidFormControlElement).matchesInvalidPseudoClass());
+    ASSERT_WITH_MESSAGE(!m_invalidDescendants.contains(&amp;invalidFormControlElement), &quot;Updating the fieldset on validity change is not an efficient operation, it should only be done when necessary.&quot;);
+
+    if (m_invalidDescendants.isEmpty())
+        setNeedsStyleRecalc();
+    m_invalidDescendants.add(&amp;invalidFormControlElement);
+}
+
+void HTMLFieldSetElement::removeInvalidDescendant(const HTMLFormControlElement&amp; formControlElement)
+{
+    ASSERT_WITH_MESSAGE(!is&lt;HTMLFieldSetElement&gt;(formControlElement), &quot;FieldSet are never candidates for constraint validation.&quot;);
+    ASSERT_WITH_MESSAGE(m_invalidDescendants.contains(&amp;formControlElement), &quot;Updating the fieldset on validity change is not an efficient operation, it should only be done when necessary.&quot;);
+
+    m_invalidDescendants.remove(&amp;formControlElement);
+    if (m_invalidDescendants.isEmpty())
+        setNeedsStyleRecalc();
+}
+
</ins><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFieldSetElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFieldSetElement.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #define HTMLFieldSetElement_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;HTMLFormControlElement.h&quot;
</span><ins>+#include &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,7 +42,8 @@
</span><span class="cx">     const Vector&lt;FormAssociatedElement*&gt;&amp; associatedElements() const;
</span><span class="cx">     unsigned length() const;
</span><span class="cx"> 
</span><del>-protected:
</del><ins>+    void addInvalidDescendant(const HTMLFormControlElement&amp;);
+    void removeInvalidDescendant(const HTMLFormControlElement&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTMLFieldSetElement(const QualifiedName&amp;, Document&amp;, HTMLFormElement*);
</span><span class="lines">@@ -57,11 +59,15 @@
</span><span class="cx">     virtual void childrenChanged(const ChildChange&amp;) override;
</span><span class="cx">     virtual void didMoveToNewDocument(Document* oldDocument) override;
</span><span class="cx"> 
</span><ins>+    virtual bool matchesValidPseudoClass() const override;
+    virtual bool matchesInvalidPseudoClass() const override;
+
</ins><span class="cx">     void refreshElementsIfNeeded() const;
</span><span class="cx"> 
</span><span class="cx">     mutable Vector&lt;FormAssociatedElement*&gt; m_associatedElements;
</span><span class="cx">     // When dom tree is modified, we have to refresh the m_associatedElements array.
</span><span class="cx">     mutable uint64_t m_documentVersion;
</span><ins>+    HashSet&lt;const HTMLFormControlElement*&gt; m_invalidDescendants;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Attribute.h&quot;
</span><span class="cx"> #include &quot;ControlStates.h&quot;
</span><ins>+#include &quot;ElementAncestorIterator.h&quot;
</ins><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="lines">@@ -230,25 +231,52 @@
</span><span class="cx">     HTMLElement::didMoveToNewDocument(oldDocument);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void addInvalidElementToAncestorFromInsertionPoint(const HTMLFormControlElement&amp; element, ContainerNode* insertionPoint)
+{
+    if (!is&lt;Element&gt;(insertionPoint))
+        return;
+
+    for (auto&amp; ancestor : lineageOfType&lt;HTMLFieldSetElement&gt;(downcast&lt;Element&gt;(*insertionPoint)))
+        ancestor.addInvalidDescendant(element);
+}
+
+static void removeInvalidElementToAncestorFromInsertionPoint(const HTMLFormControlElement&amp; element, ContainerNode* insertionPoint)
+{
+    if (!is&lt;Element&gt;(insertionPoint))
+        return;
+
+    for (auto&amp; ancestor : lineageOfType&lt;HTMLFieldSetElement&gt;(downcast&lt;Element&gt;(*insertionPoint)))
+        ancestor.removeInvalidDescendant(element);
+}
+
</ins><span class="cx"> Node::InsertionNotificationRequest HTMLFormControlElement::insertedInto(ContainerNode&amp; insertionPoint)
</span><span class="cx"> {
</span><ins>+    if (willValidate() &amp;&amp; !isValidFormControlElement())
+        addInvalidElementToAncestorFromInsertionPoint(*this, &amp;insertionPoint);
+
</ins><span class="cx">     if (document().hasDisabledFieldsetElement())
</span><span class="cx">         setAncestorDisabled(computeIsDisabledByFieldsetAncestor());
</span><span class="cx">     m_dataListAncestorState = Unknown;
</span><span class="cx">     setNeedsWillValidateCheck();
</span><span class="cx">     HTMLElement::insertedInto(insertionPoint);
</span><span class="cx">     FormAssociatedElement::insertedInto(insertionPoint);
</span><ins>+
</ins><span class="cx">     return InsertionDone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLFormControlElement::removedFrom(ContainerNode&amp; insertionPoint)
</span><span class="cx"> {
</span><ins>+    bool wasMatchingInvalidPseudoClass = willValidate() &amp;&amp; !isValidFormControlElement();
+
</ins><span class="cx">     m_validationMessage = nullptr;
</span><span class="cx">     if (m_disabledByAncestorFieldset)
</span><span class="cx">         setAncestorDisabled(computeIsDisabledByFieldsetAncestor());
</span><span class="cx">     m_dataListAncestorState = Unknown;
</span><span class="cx">     HTMLElement::removedFrom(insertionPoint);
</span><span class="cx">     FormAssociatedElement::removedFrom(insertionPoint);
</span><ins>+
+    if (wasMatchingInvalidPseudoClass)
+        removeInvalidElementToAncestorFromInsertionPoint(*this, &amp;insertionPoint);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool changed)
</span><span class="lines">@@ -329,6 +357,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLFormControlElement::matchesValidPseudoClass() const
+{
+    return willValidate() &amp;&amp; isValidFormControlElement();
+}
+
+bool HTMLFormControlElement::matchesInvalidPseudoClass() const
+{
+    return willValidate() &amp;&amp; !isValidFormControlElement();
+}
+
</ins><span class="cx"> short HTMLFormControlElement::tabIndex() const
</span><span class="cx"> {
</span><span class="cx">     // Skip the supportsFocus check in HTMLElement.
</span><span class="lines">@@ -355,10 +393,8 @@
</span><span class="cx">     if (!m_willValidateInitialized || m_dataListAncestorState == Unknown) {
</span><span class="cx">         m_willValidateInitialized = true;
</span><span class="cx">         bool newWillValidate = recalcWillValidate();
</span><del>-        if (m_willValidate != newWillValidate) {
</del><ins>+        if (m_willValidate != newWillValidate)
</ins><span class="cx">             m_willValidate = newWillValidate;
</span><del>-            const_cast&lt;HTMLFormControlElement*&gt;(this)-&gt;setNeedsValidityCheck();
-        }
</del><span class="cx">     } else {
</span><span class="cx">         // If the following assertion fails, setNeedsWillValidateCheck() is not
</span><span class="cx">         // called correctly when something which changes recalcWillValidate() result
</span><span class="lines">@@ -374,10 +410,18 @@
</span><span class="cx">     bool newWillValidate = recalcWillValidate();
</span><span class="cx">     if (m_willValidateInitialized &amp;&amp; m_willValidate == newWillValidate)
</span><span class="cx">         return;
</span><ins>+
+    bool wasValid = m_isValid;
+
</ins><span class="cx">     m_willValidateInitialized = true;
</span><span class="cx">     m_willValidate = newWillValidate;
</span><ins>+
</ins><span class="cx">     setNeedsValidityCheck();
</span><span class="cx">     setNeedsStyleRecalc();
</span><ins>+
+    if (!m_willValidate &amp;&amp; !wasValid)
+        removeInvalidElementToAncestorFromInsertionPoint(*this, parentNode());
+
</ins><span class="cx">     if (!m_willValidate)
</span><span class="cx">         hideVisibleValidationMessage();
</span><span class="cx"> }
</span><span class="lines">@@ -414,7 +458,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HTMLFormControlElement::isValidFormControlElement() const
</del><ins>+inline bool HTMLFormControlElement::isValidFormControlElement() const
</ins><span class="cx"> {
</span><span class="cx">     // If the following assertion fails, setNeedsValidityCheck() is not called
</span><span class="cx">     // correctly when something which changes validity is updated.
</span><span class="lines">@@ -424,12 +468,20 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLFormControlElement::setNeedsValidityCheck()
</span><span class="cx"> {
</span><del>-    bool newIsValid = valid();
-    if (willValidate() &amp;&amp; newIsValid != m_isValid) {
</del><ins>+    bool willValidate = this-&gt;willValidate();
+    bool wasValid = m_isValid;
+
+    m_isValid = valid();
+
+    if (willValidate &amp;&amp; m_isValid != wasValid) {
</ins><span class="cx">         // Update style for pseudo classes such as :valid :invalid.
</span><span class="cx">         setNeedsStyleRecalc();
</span><ins>+
+        if (!m_isValid)
+            addInvalidElementToAncestorFromInsertionPoint(*this, parentNode());
+        else
+            removeInvalidElementToAncestorFromInsertionPoint(*this, parentNode());
</ins><span class="cx">     }
</span><del>-    m_isValid = newIsValid;
</del><span class="cx"> 
</span><span class="cx">     // Updates only if this control already has a validtion message.
</span><span class="cx">     if (m_validationMessage &amp;&amp; m_validationMessage-&gt;isVisible()) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     void setAutocapitalize(const AtomicString&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual bool willValidate() const override;
</del><ins>+    virtual bool willValidate() const override final;
</ins><span class="cx">     void updateVisibleValidationMessage();
</span><span class="cx">     void hideVisibleValidationMessage();
</span><span class="cx">     bool checkValidity(Vector&lt;RefPtr&lt;FormAssociatedElement&gt;&gt;* unhandledInvalidControls = 0);
</span><span class="lines">@@ -150,6 +150,9 @@
</span><span class="cx">     virtual void refFormAssociatedElement() override { ref(); }
</span><span class="cx">     virtual void derefFormAssociatedElement() override { deref(); }
</span><span class="cx"> 
</span><ins>+    virtual bool matchesValidPseudoClass() const override;
+    virtual bool matchesInvalidPseudoClass() const override;
+
</ins><span class="cx">     virtual bool isFormControlElement() const override final { return true; }
</span><span class="cx">     virtual bool alwaysCreateUserAgentShadowRoot() const override { return true; }
</span><span class="cx"> 
</span><span class="lines">@@ -157,7 +160,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual HTMLFormElement* virtualForm() const override;
</span><span class="cx">     virtual bool isDefaultButtonForForm() const override;
</span><del>-    virtual bool isValidFormControlElement() const override;
</del><ins>+    bool isValidFormControlElement() const;
</ins><span class="cx"> 
</span><span class="cx">     bool computeIsDisabledByFieldsetAncestor() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLKeygenElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLKeygenElement.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLKeygenElement.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.h        2014-11-17 07:01:21 UTC (rev 176174)
</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, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2010, 2014 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">@@ -34,11 +34,10 @@
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;HTMLKeygenElement&gt; create(const QualifiedName&amp;, Document&amp;, HTMLFormElement*);
</span><span class="cx"> 
</span><del>-    virtual bool willValidate() const override { return false; }
-
</del><span class="cx"> private:
</span><span class="cx">     HTMLKeygenElement(const QualifiedName&amp;, Document&amp;, HTMLFormElement*);
</span><span class="cx"> 
</span><ins>+    virtual bool recalcWillValidate() const override { return false; }
</ins><span class="cx">     virtual bool canStartSelection() const override { return false; }
</span><span class="cx"> 
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLObjectElement.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx">     virtual bool useFallbackContent() const override { return m_useFallbackContent; }
</span><span class="cx">     void renderFallbackContent();
</span><span class="cx"> 
</span><ins>+    virtual bool willValidate() const override { return false; }
+
</ins><span class="cx">     // Implementation of constraint validation API.
</span><span class="cx">     // Note that the object elements are always barred from constraint validation.
</span><span class="cx">     static bool checkValidity() { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOutputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOutputElement.h (176173 => 176174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOutputElement.h        2014-11-17 06:49:41 UTC (rev 176173)
+++ trunk/Source/WebCore/html/HTMLOutputElement.h        2014-11-17 07:01:21 UTC (rev 176174)
</span><span class="lines">@@ -40,8 +40,6 @@
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;HTMLOutputElement&gt; create(const QualifiedName&amp;, Document&amp;, HTMLFormElement*);
</span><span class="cx"> 
</span><del>-    virtual bool willValidate() const override { return false; }
-
</del><span class="cx">     String value() const;
</span><span class="cx">     void setValue(const String&amp;);
</span><span class="cx">     String defaultValue() const;
</span><span class="lines">@@ -54,6 +52,7 @@
</span><span class="cx"> private:
</span><span class="cx">     HTMLOutputElement(const QualifiedName&amp;, Document&amp;, HTMLFormElement*);
</span><span class="cx"> 
</span><ins>+    virtual bool recalcWillValidate() const override { return false; }
</ins><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx">     virtual const AtomicString&amp; formControlType() const override;
</span><span class="cx">     virtual bool isEnumeratable() const override { return true; }
</span></span></pre>
</div>
</div>

</body>
</html>