<!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>[177664] 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/177664">177664</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-12-22 16:38:52 -0800 (Mon, 22 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Form elements should match :valid and :invalid based on their associated elements
https://bugs.webkit.org/show_bug.cgi?id=139850

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-12-22
Reviewed by Darin Adler.

Source/WebCore:

In the latest HTML spec, form elements can match :valid or :invalid based
on their associated element.

The tricky part is that object lifetime is a mess. When elements are associated
with forms by the parser, the form is set by the constructor of HTMLFormControlElement.
At that point, the real object has not been initialized yet which
makes it impossible to find its validity.

To work around the lifetime problem, the code of HTMLFormControlElement::didChangeForm()
uses m_willValidateInitialized and m_willValidate direclty instead
of invoking willValidate(). That way we don't try to validate an incomplete object.

When the object really validates, HTMLFormControlElement::setNeedsWillValidateCheck()
takes care of updating the form.

Tests: fast/css/pseudo-invalid-form-and-fieldset-basics.html
       fast/css/pseudo-invalid-form-basics.html
       fast/css/pseudo-invalid-form-dynamically-created-basics.html
       fast/css/pseudo-invalid-form-invalidation-optimization.html
       fast/css/pseudo-valid-form-and-fieldset-basics.html
       fast/css/pseudo-valid-form-basics.html
       fast/css/pseudo-valid-form-dynamically-created-basics.html
       fast/css/pseudo-valid-form-invalidation-optimization.html
       fast/selectors/invalid-form-style-update-1.html
       fast/selectors/invalid-form-style-update-2.html
       fast/selectors/invalid-form-style-update-3.html
       fast/selectors/valid-form-style-update-1.html
       fast/selectors/valid-form-style-update-2.html
       fast/selectors/valid-form-style-update-3.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithControl):
(WebCore::StyleResolver::canShareStyleWithElement):
HTMLFormElement is not a FormControl, we have to generalize the test
for :valid/:invalid with style sharing.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::~HTMLFormControlElement):
Since we now have willChangeForm(), didChangeForm(), we have to null
the form ourself, as documented by FormAssociatedElement.

(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::willChangeForm):
(WebCore::HTMLFormControlElement::didChangeForm):
(WebCore::HTMLFormControlElement::updateValidity):
Update the owner form when any of the associated form element changes
to invalid.

* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::matchesValidPseudoClass):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass):
This is very similar to the code of fieldset, but we have much weaker
invariants due to the insane way FormAssociatedElement initializes.

* html/HTMLFormElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::initializeInputType):
For completeness, we should always validate when changing the type.
The code was only doing that when the element was inserted into the tree,
that was too fragile.

LayoutTests:

The style update tests are largely based on the fieldset test suite.
The other tests are for various aspects of the patch.

* fast/css/pseudo-invalid-form-and-fieldset-basics-expected.html: Added.
* fast/css/pseudo-invalid-form-and-fieldset-basics.html: Added.
* fast/css/pseudo-invalid-form-basics-expected.html: Added.
* fast/css/pseudo-invalid-form-basics.html: Added.
* fast/css/pseudo-invalid-form-dynamically-created-basics-expected.html: Added.
* fast/css/pseudo-invalid-form-dynamically-created-basics.html: Added.
* fast/css/pseudo-invalid-form-invalidation-optimization-expected.txt: Added.
* fast/css/pseudo-invalid-form-invalidation-optimization.html: Added.
* fast/css/pseudo-valid-form-and-fieldset-basics-expected.html: Added.
* fast/css/pseudo-valid-form-and-fieldset-basics.html: Added.
* fast/css/pseudo-valid-form-basics-expected.html: Added.
* fast/css/pseudo-valid-form-basics.html: Added.
* fast/css/pseudo-valid-form-dynamically-created-basics-expected.html: Added.
* fast/css/pseudo-valid-form-dynamically-created-basics.html: Added.
* fast/css/pseudo-valid-form-invalidation-optimization-expected.txt: Added.
* fast/css/pseudo-valid-form-invalidation-optimization.html: Added.
* fast/selectors/invalid-form-style-update-1-expected.txt: Added.
* fast/selectors/invalid-form-style-update-1.html: Added.
* fast/selectors/invalid-form-style-update-2-expected.txt: Added.
* fast/selectors/invalid-form-style-update-2.html: Added.
* fast/selectors/invalid-form-style-update-3-expected.txt: Added.
* fast/selectors/invalid-form-style-update-3.html: Added.
* fast/selectors/valid-form-style-update-1-expected.txt: Added.
* fast/selectors/valid-form-style-update-1.html: Added.
* fast/selectors/valid-form-style-update-2-expected.txt: Added.
* fast/selectors/valid-form-style-update-2.html: Added.
* fast/selectors/valid-form-style-update-3-expected.txt: Added.
* fast/selectors/valid-form-style-update-3.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</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="#trunkSourceWebCorehtmlHTMLFormElementcpp">trunk/Source/WebCore/html/HTMLFormElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementh">trunk/Source/WebCore/html/HTMLFormElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidformandfieldsetbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidformandfieldsetbasicshtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidformbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidformbasicshtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidformdynamicallycreatedbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidformdynamicallycreatedbasicshtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidforminvalidationoptimizationexpectedtxt">trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudoinvalidforminvalidationoptimizationhtml">trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidformandfieldsetbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidformandfieldsetbasicshtml">trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidformbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-valid-form-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidformbasicshtml">trunk/LayoutTests/fast/css/pseudo-valid-form-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidformdynamicallycreatedbasicsexpectedhtml">trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidformdynamicallycreatedbasicshtml">trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics.html</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidforminvalidationoptimizationexpectedtxt">trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsspseudovalidforminvalidationoptimizationhtml">trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidformstyleupdate1expectedtxt">trunk/LayoutTests/fast/selectors/invalid-form-style-update-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidformstyleupdate1html">trunk/LayoutTests/fast/selectors/invalid-form-style-update-1.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidformstyleupdate2expectedtxt">trunk/LayoutTests/fast/selectors/invalid-form-style-update-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidformstyleupdate2html">trunk/LayoutTests/fast/selectors/invalid-form-style-update-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidformstyleupdate3expectedtxt">trunk/LayoutTests/fast/selectors/invalid-form-style-update-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsinvalidformstyleupdate3html">trunk/LayoutTests/fast/selectors/invalid-form-style-update-3.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidformstyleupdate1expectedtxt">trunk/LayoutTests/fast/selectors/valid-form-style-update-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidformstyleupdate1html">trunk/LayoutTests/fast/selectors/valid-form-style-update-1.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidformstyleupdate2expectedtxt">trunk/LayoutTests/fast/selectors/valid-form-style-update-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidformstyleupdate2html">trunk/LayoutTests/fast/selectors/valid-form-style-update-2.html</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidformstyleupdate3expectedtxt">trunk/LayoutTests/fast/selectors/valid-form-style-update-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsvalidformstyleupdate3html">trunk/LayoutTests/fast/selectors/valid-form-style-update-3.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/LayoutTests/ChangeLog        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-12-22  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        Form elements should match :valid and :invalid based on their associated elements
+        https://bugs.webkit.org/show_bug.cgi?id=139850
+
+        Reviewed by Darin Adler.
+
+        The style update tests are largely based on the fieldset test suite.
+        The other tests are for various aspects of the patch.
+
+        * fast/css/pseudo-invalid-form-and-fieldset-basics-expected.html: Added.
+        * fast/css/pseudo-invalid-form-and-fieldset-basics.html: Added.
+        * fast/css/pseudo-invalid-form-basics-expected.html: Added.
+        * fast/css/pseudo-invalid-form-basics.html: Added.
+        * fast/css/pseudo-invalid-form-dynamically-created-basics-expected.html: Added.
+        * fast/css/pseudo-invalid-form-dynamically-created-basics.html: Added.
+        * fast/css/pseudo-invalid-form-invalidation-optimization-expected.txt: Added.
+        * fast/css/pseudo-invalid-form-invalidation-optimization.html: Added.
+        * fast/css/pseudo-valid-form-and-fieldset-basics-expected.html: Added.
+        * fast/css/pseudo-valid-form-and-fieldset-basics.html: Added.
+        * fast/css/pseudo-valid-form-basics-expected.html: Added.
+        * fast/css/pseudo-valid-form-basics.html: Added.
+        * fast/css/pseudo-valid-form-dynamically-created-basics-expected.html: Added.
+        * fast/css/pseudo-valid-form-dynamically-created-basics.html: Added.
+        * fast/css/pseudo-valid-form-invalidation-optimization-expected.txt: Added.
+        * fast/css/pseudo-valid-form-invalidation-optimization.html: Added.
+        * fast/selectors/invalid-form-style-update-1-expected.txt: Added.
+        * fast/selectors/invalid-form-style-update-1.html: Added.
+        * fast/selectors/invalid-form-style-update-2-expected.txt: Added.
+        * fast/selectors/invalid-form-style-update-2.html: Added.
+        * fast/selectors/invalid-form-style-update-3-expected.txt: Added.
+        * fast/selectors/invalid-form-style-update-3.html: Added.
+        * fast/selectors/valid-form-style-update-1-expected.txt: Added.
+        * fast/selectors/valid-form-style-update-1.html: Added.
+        * fast/selectors/valid-form-style-update-2-expected.txt: Added.
+        * fast/selectors/valid-form-style-update-2.html: Added.
+        * fast/selectors/valid-form-style-update-3-expected.txt: Added.
+        * fast/selectors/valid-form-style-update-3.html: Added.
+
</ins><span class="cx"> 2014-12-22  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         compositing/rtl/rtl-fixed-overflow-scrolled.html had a 1600x1200 expected PNG
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidformandfieldsetbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics-expected.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics-expected.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form, fieldset {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        /* Pack them to fit everything in 800*600 */
+        body &gt; :not(p) {
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :invalid with the &amp;lt;form&amp;gt; and &amp;lt;fieldset&amp;gt; elements.&lt;/p&gt;
+
+    &lt;!-- Empty stuff. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input1&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;basic_input1&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input form=&quot;basic_input2&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: red&quot;&gt;
+        &lt;fieldset style=&quot;background-color: red&quot;&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input1&quot; style=&quot;background-color: red&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset style=&quot;background-color: red&quot;&gt;
+            &lt;input form=&quot;required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;required_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;required_input2&quot; style=&quot;background-color: red&quot;&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input1&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;valid_required_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidformandfieldsetbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-and-fieldset-basics.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form, fieldset {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        :matches(form, fieldset):invalid {
+            background-color: red;
+        }
+        :matches(form, fieldset):not(:invalid) {
+            background-color: green;
+        }
+        /* Pack them to fit everything in 800*600 */
+        body &gt; :not(p) {
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :invalid with the &amp;lt;form&amp;gt; and &amp;lt;fieldset&amp;gt; elements.&lt;/p&gt;
+
+    &lt;!-- Empty stuff. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input1&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;basic_input1&quot;&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input2&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset&gt;
+            &lt;input form=&quot;basic_input2&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input1&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset&gt;
+            &lt;input form=&quot;required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;required_input2&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;required_input2&quot;&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input1&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset&gt;
+            &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input2&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;valid_required_input2&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidformbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-basics-expected.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-basics-expected.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :invalid with the &amp;lt;form&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Empty form --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;basic_input&quot;&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: red&quot;&gt;
+        &lt;input required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input&quot; style=&quot;background-color: red&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;required_input&quot; required&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input value=&quot;WebKit!&quot; required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input&quot; required&gt;
+    &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidformbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-basics.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-basics.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        form:invalid {
+            background-color: red;
+        }
+        form:not(:invalid) {
+            background-color: green;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :invalid with the &amp;lt;form&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Empty form --&gt;
+    &lt;form&gt;&lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;input&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;basic_input&quot;&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;input required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;required_input&quot; required&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;input value=&quot;WebKit!&quot; required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input&quot;&gt;&lt;/form&gt;
+        &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input&quot; required&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidformdynamicallycreatedbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics-expected.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics-expected.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :invalid with the &amp;lt;form&amp;gt; element. This test creates the test DOM with JavaScript.&lt;/p&gt;
+
+    &lt;!-- Empty form --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;basic_input&quot;&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: red&quot;&gt;
+        &lt;input required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input&quot; style=&quot;background-color: red&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;required_input&quot; required&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input value=&quot;WebKit!&quot; required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input&quot; required&gt;
+    &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidformdynamicallycreatedbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-dynamically-created-basics.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        form:invalid {
+            background-color: red;
+        }
+        form:not(:invalid) {
+            background-color: green;
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        function createTestDOM() {
+            var body = document.body;
+
+            {
+                body.appendChild(document.createElement(&quot;form&quot;));
+            }
+            {
+                var form = document.createElement(&quot;form&quot;);
+                form.appendChild(document.createElement(&quot;input&quot;));
+                body.appendChild(form);
+            }
+            {
+                var container = document.createElement(&quot;div&quot;);
+                var form = document.createElement(&quot;form&quot;);
+                form.setAttribute(&quot;id&quot;, &quot;basic_input&quot;);
+                container.appendChild(form);
+
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;form&quot;, &quot;basic_input&quot;);
+                container.appendChild(input);
+
+                body.appendChild(container);
+            }
+            {
+                var form = document.createElement(&quot;form&quot;);
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                form.appendChild(input);
+                body.appendChild(form);
+            }
+            {
+                var container = document.createElement(&quot;div&quot;);
+                var form = document.createElement(&quot;form&quot;);
+                form.setAttribute(&quot;id&quot;, &quot;required_input&quot;);
+                container.appendChild(form);
+
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;form&quot;, &quot;required_input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                container.appendChild(input);
+
+                body.appendChild(container);
+            }
+            {
+                var form = document.createElement(&quot;form&quot;);
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                input.value = &quot;WebKit!&quot;;
+                form.appendChild(input);
+                body.appendChild(form);
+            }
+            {
+                var container = document.createElement(&quot;div&quot;);
+                var form = document.createElement(&quot;form&quot;);
+                form.setAttribute(&quot;id&quot;, &quot;valid_required_input&quot;);
+                container.appendChild(form);
+
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;form&quot;, &quot;valid_required_input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                input.value = &quot;WebKit!&quot;;
+                container.appendChild(input);
+
+                body.appendChild(container);
+            }
+        }
+        window.addEventListener(&quot;load&quot;, createTestDOM);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :invalid with the &amp;lt;form&amp;gt; element. This test creates the test DOM with JavaScript.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidforminvalidationoptimizationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+Test that we do not invalidate the style of &lt;form&gt; excessively when matching :invalid based on the associated elements.
+
+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;form1-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+     
+      
+     
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudoinvalidforminvalidationoptimizationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-invalid-form-invalidation-optimization.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,121 @@
</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;
+form {
+    color: black;
+}
+form:invalid {
+    color: rgb(0, 1, 2);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;form id=&quot;form1-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;/form&gt;
+        &lt;form id=&quot;form2-with-renderer&quot;&gt;
+            &lt;input class=&quot;input5&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input6&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input7&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input8&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/form&gt;
+        &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+        &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+        &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+        &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;form id=&quot;form1-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;/form&gt;
+        &lt;form id=&quot;form2-without-renderer&quot;&gt;
+            &lt;input class=&quot;input5&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input6&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input7&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input8&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/form&gt;
+        &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+        &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+        &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+        &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+
+description('Test that we do not invalidate the style of &amp;lt;form&amp;gt; excessively when matching :invalid based on the associated elements.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;))');
+}
+
+function checkStyle(expectedColor) {
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form2-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 form should also become invalid.
+var inputs3 = document.querySelectorAll('.input3');
+for (var i = 0; i &lt; inputs3.length; ++i)
+    inputs3[i].value = '';
+
+shouldNeedStyleRecalc(true);
+checkStyle('rgb(0, 1, 2)');
+
+// Making more fields invalid should not invalidate the form'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, form 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, form 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;form1-without-renderer&quot;).style.display = 'none';
+document.getElementById(&quot;form2-without-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="trunkLayoutTestsfastcsspseudovalidformandfieldsetbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics-expected.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics-expected.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form, fieldset {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        /* Pack them to fit everything in 800*600 */
+        body &gt; :not(p) {
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :valid with the &amp;lt;form&amp;gt; and &amp;lt;fieldset&amp;gt; elements.&lt;/p&gt;
+
+    &lt;!-- Empty stuff. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input1&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;basic_input1&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input form=&quot;basic_input2&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: red&quot;&gt;
+        &lt;fieldset style=&quot;background-color: red&quot;&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input1&quot; style=&quot;background-color: red&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset style=&quot;background-color: red&quot;&gt;
+            &lt;input form=&quot;required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;required_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;required_input2&quot; style=&quot;background-color: red&quot;&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input1&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset style=&quot;background-color: green&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;fieldset style=&quot;background-color: green&quot;&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;valid_required_input2&quot; style=&quot;background-color: green&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidformandfieldsetbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-and-fieldset-basics.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form, fieldset {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        :matches(form, fieldset):valid {
+            background-color: green;
+        }
+        :matches(form, fieldset):not(:valid) {
+            background-color: red;
+        }
+        /* Pack them to fit everything in 800*600 */
+        body &gt; :not(p) {
+            float: left;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :valid with the &amp;lt;form&amp;gt; and &amp;lt;fieldset&amp;gt; elements.&lt;/p&gt;
+
+    &lt;!-- Empty stuff. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;&lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input1&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;basic_input1&quot;&gt;
+            &lt;input&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input2&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset&gt;
+            &lt;input form=&quot;basic_input2&quot;&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input1&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset&gt;
+            &lt;input form=&quot;required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;div&gt;
+        &lt;form id=&quot;required_input2&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;required_input2&quot;&gt;
+            &lt;input required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;fieldset&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input1&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset&gt;
+            &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input1&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input2&quot;&gt;
+            &lt;fieldset&gt;&lt;/fieldset&gt;
+        &lt;/form&gt;
+        &lt;fieldset form=&quot;valid_required_input2&quot;&gt;
+            &lt;input value=&quot;WebKit!&quot; required&gt;
+        &lt;/fieldset&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidformbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-basics-expected.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-basics-expected.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :valid with the &amp;lt;form&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Empty form --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;basic_input&quot;&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: red&quot;&gt;
+        &lt;input required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input&quot; style=&quot;background-color: red&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;required_input&quot; required&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input value=&quot;WebKit!&quot; required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input&quot; required&gt;
+    &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidformbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-basics.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-basics.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        form:valid {
+            background-color: green;
+        }
+        form:not(:valid) {
+            background-color: red;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :valid with the &amp;lt;form&amp;gt; element.&lt;/p&gt;
+
+    &lt;!-- Empty form --&gt;
+    &lt;form&gt;&lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;input&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;basic_input&quot;&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;input required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;required_input&quot; required&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form&gt;
+        &lt;input value=&quot;WebKit!&quot; required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input&quot;&gt;&lt;/form&gt;
+        &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input&quot; required&gt;
+    &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidformdynamicallycreatedbasicsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics-expected.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics-expected.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :valid with the &amp;lt;form&amp;gt; element. This test creates the test DOM with JavaScript.&lt;/p&gt;
+
+    &lt;!-- Empty form --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+
+    &lt;!-- Basic input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Basic input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;basic_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;basic_input&quot;&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: red&quot;&gt;
+        &lt;input required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;required_input&quot; style=&quot;background-color: red&quot;&gt;&lt;/form&gt;
+        &lt;input form=&quot;required_input&quot; required&gt;
+    &lt;/div&gt;
+
+    &lt;!-- Valid required input as a descendant. --&gt;
+    &lt;form style=&quot;background-color: green&quot;&gt;
+        &lt;input value=&quot;WebKit!&quot; required&gt;
+    &lt;/form&gt;
+
+    &lt;!-- Valid required input associated. --&gt;
+    &lt;div&gt;
+        &lt;form id=&quot;valid_required_input&quot; style=&quot;background-color: green&quot;&gt;&lt;/form&gt;
+        &lt;input value=&quot;WebKit!&quot; form=&quot;valid_required_input&quot; required&gt;
+    &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidformdynamicallycreatedbasicshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-dynamically-created-basics.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        form {
+            padding: 5px;
+            margin: 2px;
+            border: 1px solid black;
+        }
+        form:valid {
+            background-color: green;
+        }
+        form:not(:valid) {
+            background-color: red;
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        function createTestDOM() {
+            var body = document.body;
+
+            {
+                body.appendChild(document.createElement(&quot;form&quot;));
+            }
+            {
+                var form = document.createElement(&quot;form&quot;);
+                form.appendChild(document.createElement(&quot;input&quot;));
+                body.appendChild(form);
+            }
+            {
+                var container = document.createElement(&quot;div&quot;);
+                var form = document.createElement(&quot;form&quot;);
+                form.setAttribute(&quot;id&quot;, &quot;basic_input&quot;);
+                container.appendChild(form);
+
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;form&quot;, &quot;basic_input&quot;);
+                container.appendChild(input);
+
+                body.appendChild(container);
+            }
+            {
+                var form = document.createElement(&quot;form&quot;);
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                form.appendChild(input);
+                body.appendChild(form);
+            }
+            {
+                var container = document.createElement(&quot;div&quot;);
+                var form = document.createElement(&quot;form&quot;);
+                form.setAttribute(&quot;id&quot;, &quot;required_input&quot;);
+                container.appendChild(form);
+
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;form&quot;, &quot;required_input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                container.appendChild(input);
+
+                body.appendChild(container);
+            }
+            {
+                var form = document.createElement(&quot;form&quot;);
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                input.value = &quot;WebKit!&quot;;
+                form.appendChild(input);
+                body.appendChild(form);
+            }
+            {
+                var container = document.createElement(&quot;div&quot;);
+                var form = document.createElement(&quot;form&quot;);
+                form.setAttribute(&quot;id&quot;, &quot;valid_required_input&quot;);
+                container.appendChild(form);
+
+                var input = document.createElement(&quot;input&quot;);
+                input.setAttribute(&quot;form&quot;, &quot;valid_required_input&quot;);
+                input.setAttribute(&quot;required&quot;, &quot;&quot;);
+                input.value = &quot;WebKit!&quot;;
+                container.appendChild(input);
+
+                body.appendChild(container);
+            }
+        }
+        window.addEventListener(&quot;load&quot;, createTestDOM);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;p&gt;Test the basics of the pseudo class :valid with the &amp;lt;form&amp;gt; element. This test creates the test DOM with JavaScript.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidforminvalidationoptimizationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+Test that we do not invalidate the style of &lt;form&gt; excessively when matching :valid based on the associated elements.
+
+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;form1-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is false
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 0, 0)&quot;
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;)) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;)) is true
+PASS getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS getComputedStyle(document.getElementById(&quot;form2-without-renderer&quot;)).color is &quot;rgb(0, 1, 2)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+     
+      
+     
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsspseudovalidforminvalidationoptimizationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/pseudo-valid-form-invalidation-optimization.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,121 @@
</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;
+form {
+    color: black;
+}
+form:valid {
+    color: rgb(0, 1, 2);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div&gt;
+        &lt;!-- With renderer --&gt;
+        &lt;form id=&quot;form1-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;/form&gt;
+        &lt;form id=&quot;form2-with-renderer&quot;&gt;
+            &lt;input class=&quot;input5&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input6&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input7&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input8&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/form&gt;
+        &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+        &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+        &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+        &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot; form=&quot;form2-with-renderer&quot;&gt;
+    &lt;/div&gt;
+    &lt;div style=&quot;display:none;&quot;&gt;
+        &lt;!-- Without renderer --&gt;
+        &lt;form id=&quot;form1-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;/form&gt;
+        &lt;form id=&quot;form2-without-renderer&quot;&gt;
+            &lt;input class=&quot;input5&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input6&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input7&quot; required value=&quot;Valid&quot;&gt;
+            &lt;input class=&quot;input8&quot; required value=&quot;Valid&quot;&gt;
+        &lt;/form&gt;
+        &lt;input class=&quot;input1&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+        &lt;input class=&quot;input2&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+        &lt;input class=&quot;input3&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+        &lt;input class=&quot;input4&quot; required value=&quot;Valid&quot; form=&quot;form2-without-renderer&quot;&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+
+description('Test that we do not invalidate the style of &amp;lt;form&amp;gt; excessively when matching :valid based on the associated elements.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-with-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-with-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form1-without-renderer&quot;))');
+    testFunction('window.internals.nodeNeedsStyleRecalc(document.getElementById(&quot;form2-without-renderer&quot;))');
+}
+
+function checkStyle(expectedColor) {
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form1-with-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form2-with-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form1-without-renderer&quot;)).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.getElementById(&quot;form2-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 form should also become invalid.
+var inputs3 = document.querySelectorAll('.input3');
+for (var i = 0; i &lt; inputs3.length; ++i)
+    inputs3[i].value = '';
+
+shouldNeedStyleRecalc(true);
+checkStyle('rgb(0, 0, 0)');
+
+// Making more fields invalid should not invalidate the form'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, form 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, form 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;form1-without-renderer&quot;).style.display = 'none';
+document.getElementById(&quot;form2-without-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="trunkLayoutTestsfastselectorsinvalidformstyleupdate1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-form-style-update-1-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-form-style-update-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-form-style-update-1-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,259 @@
</span><ins>+Test style update for :invalid applied on a form.
+
+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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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 form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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 fieldset1 inside div3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&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;.fieldset1&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;.form1&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;.form2&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;.fieldset1&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;.form1&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;.form2&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;.fieldset1&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;.form1&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;.form2&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;.fieldset1&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="trunkLayoutTestsfastselectorsinvalidformstyleupdate1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-form-style-update-1.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-form-style-update-1.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-form-style-update-1.html        2014-12-23 00:38:52 UTC (rev 177664)
</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;form class=&quot;form1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset1&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;/form&gt;
+        &lt;form class=&quot;form2&quot;&gt;
+            &lt;div class=&quot;div3&quot;&gt;
+            &lt;/div&gt;
+        &lt;/form&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 form.');
+
+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(['form1', '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(['form1', 'textarea1']);
+
+
+debug('');
+debug(&quot;Move the invalid text area into form2.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var form2 = root.querySelector('.form2');
+    form2.appendChild(textArea);
+});
+testStyle(['form2', '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(['form1', 'fieldset1', 'input1']);
+
+debug('');
+debug(&quot;Move text area as a child of form1.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var form1 = root.querySelector('.form1');
+    form1.appendChild(textArea);
+});
+testStyle(['form1', 'fieldset1', '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(['form1', 'fieldset1', 'input1']);
+
+debug('');
+debug(&quot;Make the text area invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;&quot;;
+});
+testStyle(['form1', 'fieldset1', 'input1', 'textarea1']);
+
+debug('');
+debug(&quot;Make the input valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;Valid&quot;;
+});
+testStyle(['form1', '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(['form1', 'fieldset1', 'input1']);
+
+
+debug('');
+debug(&quot;Move fieldset1 inside div3&quot;);
+modifyTree(function(root) {
+    var fieldset1 = root.querySelector('.fieldset1');
+    var div3 = root.querySelector('.div3');
+    div3.appendChild(fieldset1);
+});
+testStyle(['form2', 'fieldset1', '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="trunkLayoutTestsfastselectorsinvalidformstyleupdate2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-form-style-update-2-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-form-style-update-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-form-style-update-2-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,369 @@
</span><ins>+Test style update for :invalid applied on a form.
+
+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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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="trunkLayoutTestsfastselectorsinvalidformstyleupdate2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-form-style-update-2.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-form-style-update-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-form-style-update-2.html        2014-12-23 00:38:52 UTC (rev 177664)
</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;form class=&quot;form1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset1&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;/form&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 form.');
+
+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(['form1', '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(['form1', '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(['form1', '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(['form1', '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(['form1', 'textarea1', 'input6', 'input7', 'input10']);
+
+// Change everything in the second half of controls without validation, eventually, form1 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(['form1', '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(['form1', '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(['form1', '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="trunkLayoutTestsfastselectorsinvalidformstyleupdate3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-form-style-update-3-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-form-style-update-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-form-style-update-3-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,225 @@
</span><ins>+Test style update for :invalid applied on a form.
+
+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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input1 to form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input2 to form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input3 to form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+
+Add input4 to form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;
+
+Add the disabled attribute on form1 (forms can't be disabled).
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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(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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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(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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsinvalidformstyleupdate3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/invalid-form-style-update-3.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/invalid-form-style-update-3.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/invalid-form-style-update-3.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,185 @@
</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;form class=&quot;form1&quot;&gt;
+        &lt;/form&gt;
+        &lt;form class=&quot;form2&quot;&gt;
+            &lt;fieldset class=&quot;form2-disabled-fieldset&quot; disabled&gt;
+            &lt;/fieldset&gt;
+        &lt;/form&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 form.');
+
+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 form1.&quot;);
+modifyTree(function(root) {
+    var input1 = document.createElement('input');
+    input1.className = 'input1';
+    root.querySelector('.form1').appendChild(input1);
+});
+testStyle([]);
+
+debug('');
+debug(&quot;Add input2 to form1.&quot;);
+modifyTree(function(root) {
+    var input2 = document.createElement('input');
+    input2.className = 'input2';
+    input2.setAttribute('required', '');
+    root.querySelector('.form1').appendChild(input2);
+});
+testStyle(['form1', 'input2']);
+
+debug('');
+debug(&quot;Add input3 to form1.&quot;);
+modifyTree(function(root) {
+    var input3 = document.createElement('input');
+    input3.className = 'input3';
+    input3.setAttribute('required', '');
+    input3.value = &quot;valid&quot;;
+    root.querySelector('.form1').appendChild(input3);
+});
+testStyle(['form1', 'input2']);
+
+debug('');
+debug(&quot;Add input4 to form2.&quot;);
+modifyTree(function(root) {
+    var input4 = document.createElement('input');
+    input4.className = 'input4';
+    root.querySelector('.form2-disabled-fieldset').appendChild(input4);
+});
+testStyle(['form1', 'input2']);
+
+debug('');
+debug(&quot;Add input5 to form2.&quot;);
+modifyTree(function(root) {
+    var input5 = document.createElement('input');
+    input5.className = 'input5';
+    input5.setAttribute('required', '');
+    root.querySelector('.form2-disabled-fieldset').appendChild(input5);
+});
+testStyle(['form1', 'input2']);
+
+debug('');
+debug(&quot;Add input6 to form2.&quot;);
+modifyTree(function(root) {
+    var input6 = document.createElement('input');
+    input6.className = 'input6';
+    input6.setAttribute('required', '');
+    input6.value = &quot;valid&quot;
+    root.querySelector('.form2-disabled-fieldset').appendChild(input6);
+});
+testStyle(['form1', 'input2']);
+
+debug('');
+debug(&quot;Enable form2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.form2-disabled-fieldset').removeAttribute('disabled');
+});
+testStyle(['form1', 'input2', 'form2', 'form2-disabled-fieldset', 'input5']);
+
+debug('');
+debug(&quot;Add the disabled attribute on form1 (forms can't be disabled).&quot;);
+modifyTree(function(root) {
+    root.querySelector('.form1').setAttribute('disabled', '');
+});
+testStyle(['form1', 'input2', 'form2', 'form2-disabled-fieldset', 'input5']);
+
+debug('');
+debug(&quot;Remove input1&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input1');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form1', 'input2', 'form2', 'form2-disabled-fieldset', 'input5']);
+
+debug('');
+debug(&quot;Remove input2&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input2');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form2', 'form2-disabled-fieldset', 'input5']);
+
+debug('');
+debug(&quot;Remove input3&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input3');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form2', 'form2-disabled-fieldset', 'input5']);
+
+debug('');
+debug(&quot;Remove input4&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input4');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form2', 'form2-disabled-fieldset', '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="trunkLayoutTestsfastselectorsvalidformstyleupdate1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-form-style-update-1-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-form-style-update-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-form-style-update-1-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,259 @@
</span><ins>+Test style update for :valid applied on a form.
+
+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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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 form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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;.form1&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;.fieldset1&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;.form2&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 fieldset1 inside div3
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&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;.fieldset1&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;.form1&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;.form2&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;.fieldset1&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;.form1&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;.form2&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;.fieldset1&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;.form1&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;.form2&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;.fieldset1&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="trunkLayoutTestsfastselectorsvalidformstyleupdate1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-form-style-update-1.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-form-style-update-1.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-form-style-update-1.html        2014-12-23 00:38:52 UTC (rev 177664)
</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;form class=&quot;form1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset1&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;/form&gt;
+        &lt;form class=&quot;form2&quot;&gt;
+            &lt;div class=&quot;div3&quot;&gt;
+            &lt;/div&gt;
+        &lt;/form&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 form.');
+
+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', 'input1', 'form2']);
+
+debug('');
+debug(&quot;Make the text area valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle(['form1', 'fieldset1', 'input1', 'form2', '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(['fieldset1', 'input1', 'form2']);
+
+
+debug('');
+debug(&quot;Move the invalid text area into form2.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var form2 = root.querySelector('.form2');
+    form2.appendChild(textArea);
+});
+testStyle(['form1', 'fieldset1', 'input1']);
+
+debug('');
+debug(&quot;Make the text area valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle(['form1', 'fieldset1', 'input1', 'form2', 'textarea1']);
+
+debug('');
+debug(&quot;Make the input invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;&quot;;
+});
+testStyle(['form2', 'textarea1']);
+
+debug('');
+debug(&quot;Move text area as a child of form1.&quot;);
+modifyTree(function(root) {
+    var textArea = root.querySelector('.textarea1');
+    var form1 = root.querySelector('.form1');
+    form1.appendChild(textArea);
+});
+testStyle(['textarea1', 'form2']);
+
+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', 'form2']);
+
+debug('');
+debug(&quot;Make the text area invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;&quot;;
+});
+testStyle(['form2']);
+
+debug('');
+debug(&quot;Make the input valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;Valid&quot;;
+});
+testStyle(['fieldset1', 'input1', 'form2']);
+
+debug('');
+debug(&quot;Make the text area valid, everything should be valid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').value = &quot;Valid&quot;;
+});
+testStyle(['form1', 'fieldset1', 'input1', 'textarea1', 'form2']);
+
+debug('');
+debug(&quot;Make the input invalid.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.input1').value = &quot;&quot;;
+});
+testStyle(['form2', 'textarea1']);
+
+
+debug('');
+debug(&quot;Move fieldset1 inside div3&quot;);
+modifyTree(function(root) {
+    var fieldset1 = root.querySelector('.fieldset1');
+    var div3 = root.querySelector('.div3');
+    div3.appendChild(fieldset1);
+});
+testStyle(['form1', 'textarea1']);
+
+debug('');
+debug(&quot;Destroy the content of div2&quot;);
+modifyTree(function(root) {
+    root.querySelector('.div2').textContent = '';
+});
+testStyle(['form1', 'textarea1', 'form2', '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="trunkLayoutTestsfastselectorsvalidformstyleupdate2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-form-style-update-2-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-form-style-update-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-form-style-update-2-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,369 @@
</span><ins>+Test style update for :valid applied on a form.
+
+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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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;.form1&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;.fieldset1&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="trunkLayoutTestsfastselectorsvalidformstyleupdate2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-form-style-update-2.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-form-style-update-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-form-style-update-2.html        2014-12-23 00:38:52 UTC (rev 177664)
</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;form class=&quot;form1&quot;&gt;
+            &lt;div class=&quot;div1&quot;&gt;
+                &lt;fieldset class=&quot;fieldset1&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;/form&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 form.');
+
+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', '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(['fieldset1', '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(['fieldset1', '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(['fieldset1', '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(['fieldset1', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+// Change everything in the second half of controls without validation, eventually, form1 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', '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(['fieldset1', '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(['fieldset1', 'input1', 'input3', 'input4', 'button1', 'button2', 'button3', 'button4']);
+
+debug('');
+debug(&quot;Disable the text area.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.textarea1').setAttribute('disabled', '');
+});
+testStyle(['form1', 'fieldset1', '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="trunkLayoutTestsfastselectorsvalidformstyleupdate3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-form-style-update-3-expected.txt (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-form-style-update-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-form-style-update-3-expected.txt        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,225 @@
</span><ins>+Test style update for :valid applied on a form.
+
+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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input1 to form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input2 to form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input3 to form1.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+
+Add input4 to form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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 form2.
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;
+
+Add the disabled attribute on form1 (forms can't be disabled).
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&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(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(1, 2, 3)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&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;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;with-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form1&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS getComputedStyle(document.getElementById(&quot;without-renderer&quot;).querySelector(&quot;.form2-disabled-fieldset&quot;)).backgroundColor is &quot;rgb(4, 5, 6)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastselectorsvalidformstyleupdate3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/selectors/valid-form-style-update-3.html (0 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/valid-form-style-update-3.html                                (rev 0)
+++ trunk/LayoutTests/fast/selectors/valid-form-style-update-3.html        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -0,0 +1,185 @@
</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;form class=&quot;form1&quot;&gt;
+        &lt;/form&gt;
+        &lt;form class=&quot;form2&quot;&gt;
+            &lt;fieldset class=&quot;form2-disabled-fieldset&quot; disabled&gt;
+            &lt;/fieldset&gt;
+        &lt;/form&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 form.');
+
+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(['form1', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Add input1 to form1.&quot;);
+modifyTree(function(root) {
+    var input1 = document.createElement('input');
+    input1.className = 'input1';
+    root.querySelector('.form1').appendChild(input1);
+});
+testStyle(['form1', 'input1', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Add input2 to form1.&quot;);
+modifyTree(function(root) {
+    var input2 = document.createElement('input');
+    input2.className = 'input2';
+    input2.setAttribute('required', '');
+    root.querySelector('.form1').appendChild(input2);
+});
+testStyle(['input1', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Add input3 to form1.&quot;);
+modifyTree(function(root) {
+    var input3 = document.createElement('input');
+    input3.className = 'input3';
+    input3.setAttribute('required', '');
+    input3.value = &quot;valid&quot;;
+    root.querySelector('.form1').appendChild(input3);
+});
+testStyle(['input1', 'input3', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Add input4 to form2.&quot;);
+modifyTree(function(root) {
+    var input4 = document.createElement('input');
+    input4.className = 'input4';
+    root.querySelector('.form2-disabled-fieldset').appendChild(input4);
+});
+testStyle(['input1', 'input3', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Add input5 to form2.&quot;);
+modifyTree(function(root) {
+    var input5 = document.createElement('input');
+    input5.className = 'input5';
+    input5.setAttribute('required', '');
+    root.querySelector('.form2-disabled-fieldset').appendChild(input5);
+});
+testStyle(['input1', 'input3', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Add input6 to form2.&quot;);
+modifyTree(function(root) {
+    var input6 = document.createElement('input');
+    input6.className = 'input6';
+    input6.setAttribute('required', '');
+    input6.value = &quot;valid&quot;
+    root.querySelector('.form2-disabled-fieldset').appendChild(input6);
+});
+testStyle(['input1', 'input3', 'form2', 'form2-disabled-fieldset']);
+
+debug('');
+debug(&quot;Enable form2.&quot;);
+modifyTree(function(root) {
+    root.querySelector('.form2-disabled-fieldset').removeAttribute('disabled');
+});
+testStyle(['input1', 'input3', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Add the disabled attribute on form1 (forms can't be disabled).&quot;);
+modifyTree(function(root) {
+    root.querySelector('.form1').setAttribute('disabled', '');
+});
+testStyle(['input1', 'input3', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input1&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input1');
+    input.parentNode.removeChild(input);
+});
+testStyle(['input1', 'input3', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input2&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input2');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form1', 'input1', 'input3', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input3&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input3');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form1', 'input4', 'input6']);
+
+debug('');
+debug(&quot;Remove input4&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input4');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form1', 'input6']);
+
+debug('');
+debug(&quot;Remove input5&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input5');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form1', 'form2', 'form2-disabled-fieldset', 'input6']);
+
+debug('');
+debug(&quot;Remove input6&quot;);
+modifyTree(function(root) {
+    var input = root.querySelector('.input6');
+    input.parentNode.removeChild(input);
+});
+testStyle(['form1', 'form2', 'form2-disabled-fieldset']);
+
+
+// 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 (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/ChangeLog        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -1,3 +1,74 @@
</span><ins>+2014-12-22  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        Form elements should match :valid and :invalid based on their associated elements
+        https://bugs.webkit.org/show_bug.cgi?id=139850
+
+        Reviewed by Darin Adler.
+
+        In the latest HTML spec, form elements can match :valid or :invalid based
+        on their associated element.
+
+        The tricky part is that object lifetime is a mess. When elements are associated
+        with forms by the parser, the form is set by the constructor of HTMLFormControlElement.
+        At that point, the real object has not been initialized yet which
+        makes it impossible to find its validity.
+
+        To work around the lifetime problem, the code of HTMLFormControlElement::didChangeForm()
+        uses m_willValidateInitialized and m_willValidate direclty instead
+        of invoking willValidate(). That way we don't try to validate an incomplete object.
+
+        When the object really validates, HTMLFormControlElement::setNeedsWillValidateCheck()
+        takes care of updating the form.
+
+        Tests: fast/css/pseudo-invalid-form-and-fieldset-basics.html
+               fast/css/pseudo-invalid-form-basics.html
+               fast/css/pseudo-invalid-form-dynamically-created-basics.html
+               fast/css/pseudo-invalid-form-invalidation-optimization.html
+               fast/css/pseudo-valid-form-and-fieldset-basics.html
+               fast/css/pseudo-valid-form-basics.html
+               fast/css/pseudo-valid-form-dynamically-created-basics.html
+               fast/css/pseudo-valid-form-invalidation-optimization.html
+               fast/selectors/invalid-form-style-update-1.html
+               fast/selectors/invalid-form-style-update-2.html
+               fast/selectors/invalid-form-style-update-3.html
+               fast/selectors/valid-form-style-update-1.html
+               fast/selectors/valid-form-style-update-2.html
+               fast/selectors/valid-form-style-update-3.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::canShareStyleWithControl):
+        (WebCore::StyleResolver::canShareStyleWithElement):
+        HTMLFormElement is not a FormControl, we have to generalize the test
+        for :valid/:invalid with style sharing.
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::~HTMLFormControlElement):
+        Since we now have willChangeForm(), didChangeForm(), we have to null
+        the form ourself, as documented by FormAssociatedElement.
+
+        (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
+        (WebCore::HTMLFormControlElement::willChangeForm):
+        (WebCore::HTMLFormControlElement::didChangeForm):
+        (WebCore::HTMLFormControlElement::updateValidity):
+        Update the owner form when any of the associated form element changes
+        to invalid.
+
+        * html/HTMLFormControlElement.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
+        (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
+        (WebCore::HTMLFormElement::matchesValidPseudoClass):
+        (WebCore::HTMLFormElement::matchesInvalidPseudoClass):
+        This is very similar to the code of fieldset, but we have much weaker
+        invariants due to the insane way FormAssociatedElement initializes.
+
+        * html/HTMLFormElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::initializeInputType):
+        For completeness, we should always validate when changing the type.
+        The code was only doing that when the element was inserted into the tree,
+        that was too fragile.
+
</ins><span class="cx"> 2014-12-22  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Try to fix the Windows build.
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -520,12 +520,6 @@
</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 (element-&gt;matchesValidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
-        return false;
-
-    if (element-&gt;matchesInvalidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
-        return false;
-
</del><span class="cx">     if (element-&gt;isInRange() != state.element()-&gt;isInRange())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -652,6 +646,12 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (element-&gt;matchesValidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
+        return false;
+
+    if (element-&gt;matchesInvalidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
+        return false;
+
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     // Deny sharing styles between WebVTT and non-WebVTT nodes.
</span><span class="cx">     if (is&lt;WebVTTElement&gt;(*state.element()))
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx"> 
</span><span class="cx"> HTMLFormControlElement::~HTMLFormControlElement()
</span><span class="cx"> {
</span><ins>+    // The calls willChangeForm() and didChangeForm() are virtual, we want the
+    // form to be reset while this object still exists.
+    setForm(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String HTMLFormControlElement::formEnctype() const
</span><span class="lines">@@ -417,8 +420,11 @@
</span><span class="cx">     updateValidity();
</span><span class="cx">     setNeedsStyleRecalc();
</span><span class="cx"> 
</span><del>-    if (!m_willValidate &amp;&amp; !wasValid)
</del><ins>+    if (!m_willValidate &amp;&amp; !wasValid) {
</ins><span class="cx">         removeInvalidElementToAncestorFromInsertionPoint(*this, parentNode());
</span><ins>+        if (HTMLFormElement* form = this-&gt;form())
+            form-&gt;removeInvalidAssociatedFormControlIfNeeded(*this);
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (!m_willValidate)
</span><span class="cx">         hideVisibleValidationMessage();
</span><span class="lines">@@ -464,6 +470,22 @@
</span><span class="cx">     return m_isValid;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void HTMLFormControlElement::willChangeForm()
+{
+    if (HTMLFormElement* form = this-&gt;form())
+        form-&gt;removeInvalidAssociatedFormControlIfNeeded(*this);
+    FormAssociatedElement::willChangeForm();
+}
+
+void HTMLFormControlElement::didChangeForm()
+{
+    FormAssociatedElement::didChangeForm();
+    if (HTMLFormElement* form = this-&gt;form()) {
+        if (m_willValidateInitialized &amp;&amp; m_willValidate &amp;&amp; !isValidFormControlElement())
+            form-&gt;registerInvalidAssociatedFormControl(*this);
+    }
+}
+
</ins><span class="cx"> void HTMLFormControlElement::updateValidity()
</span><span class="cx"> {
</span><span class="cx">     bool willValidate = this-&gt;willValidate();
</span><span class="lines">@@ -475,10 +497,15 @@
</span><span class="cx">         // Update style for pseudo classes such as :valid :invalid.
</span><span class="cx">         setNeedsStyleRecalc();
</span><span class="cx"> 
</span><del>-        if (!m_isValid)
</del><ins>+        if (!m_isValid) {
</ins><span class="cx">             addInvalidElementToAncestorFromInsertionPoint(*this, parentNode());
</span><del>-        else
</del><ins>+            if (HTMLFormElement* form = this-&gt;form())
+                form-&gt;registerInvalidAssociatedFormControl(*this);
+        } else {
</ins><span class="cx">             removeInvalidElementToAncestorFromInsertionPoint(*this, parentNode());
</span><ins>+            if (HTMLFormElement* form = this-&gt;form())
+                form-&gt;removeInvalidAssociatedFormControlIfNeeded(*this);
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Updates only if this control already has a validtion message.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -146,6 +146,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool validationMessageShadowTreeContains(const Node&amp;) const;
</span><span class="cx"> 
</span><ins>+    virtual void willChangeForm() override;
+    virtual void didChangeForm() override;
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual void refFormAssociatedElement() override { ref(); }
</span><span class="cx">     virtual void derefFormAssociatedElement() override { deref(); }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.cpp        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -622,6 +622,24 @@
</span><span class="cx">     removeFromVector(m_associatedElements, e);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void HTMLFormElement::registerInvalidAssociatedFormControl(const HTMLFormControlElement&amp; formControlElement)
+{
+    ASSERT_WITH_MESSAGE(!is&lt;HTMLFieldSetElement&gt;(formControlElement), &quot;FieldSet are never candidates for constraint validation.&quot;);
+    ASSERT(static_cast&lt;const Element&amp;&gt;(formControlElement).matchesInvalidPseudoClass());
+
+    if (m_invalidAssociatedFormControls.isEmpty())
+        setNeedsStyleRecalc();
+    m_invalidAssociatedFormControls.add(&amp;formControlElement);
+}
+
+void HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded(const HTMLFormControlElement&amp; formControlElement)
+{
+    if (m_invalidAssociatedFormControls.remove(&amp;formControlElement)) {
+        if (m_invalidAssociatedFormControls.isEmpty())
+            setNeedsStyleRecalc();
+    }
+}
+
</ins><span class="cx"> bool HTMLFormElement::isURLAttribute(const Attribute&amp; attribute) const
</span><span class="cx"> {
</span><span class="cx">     return attribute.name() == actionAttr || HTMLElement::isURLAttribute(attribute);
</span><span class="lines">@@ -787,6 +805,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLFormElement::matchesValidPseudoClass() const
+{
+    return m_invalidAssociatedFormControls.isEmpty();
+}
+
+bool HTMLFormElement::matchesInvalidPseudoClass() const
+{
+    return !m_invalidAssociatedFormControls.isEmpty();
+}
+
</ins><span class="cx"> bool HTMLFormElement::hasNamedElement(const AtomicString&amp; name)
</span><span class="cx"> {
</span><span class="cx">     return elements()-&gt;hasNamedItem(name) || elementFromPastNamesMap(name);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.h (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.h        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/html/HTMLFormElement.h        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -78,6 +78,9 @@
</span><span class="cx">     void registerFormElement(FormAssociatedElement*);
</span><span class="cx">     void removeFormElement(FormAssociatedElement*);
</span><span class="cx"> 
</span><ins>+    void registerInvalidAssociatedFormControl(const HTMLFormControlElement&amp;);
+    void removeInvalidAssociatedFormControlIfNeeded(const HTMLFormControlElement&amp;);
+
</ins><span class="cx">     void registerImgElement(HTMLImageElement*);
</span><span class="cx">     void removeImgElement(HTMLImageElement*);
</span><span class="cx"> 
</span><span class="lines">@@ -173,6 +176,9 @@
</span><span class="cx">     void assertItemCanBeInPastNamesMap(FormNamedItem*) const;
</span><span class="cx">     void removeFromPastNamesMap(FormNamedItem*);
</span><span class="cx"> 
</span><ins>+    virtual bool matchesValidPseudoClass() const override;
+    virtual bool matchesInvalidPseudoClass() const override;
+
</ins><span class="cx">     typedef HashMap&lt;RefPtr&lt;AtomicStringImpl&gt;, FormNamedItem*&gt; PastNamesMap;
</span><span class="cx"> 
</span><span class="cx">     FormSubmission::Attributes m_attributes;
</span><span class="lines">@@ -184,6 +190,7 @@
</span><span class="cx">     unsigned m_associatedElementsAfterIndex;
</span><span class="cx">     Vector&lt;FormAssociatedElement*&gt; m_associatedElements;
</span><span class="cx">     Vector&lt;HTMLImageElement*&gt; m_imageElements;
</span><ins>+    HashSet&lt;const HTMLFormControlElement*&gt; m_invalidAssociatedFormControls;
</ins><span class="cx"> 
</span><span class="cx">     bool m_wasUserSubmitted;
</span><span class="cx">     bool m_isSubmittingOrPreparingForSubmission;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (177663 => 177664)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2014-12-23 00:02:45 UTC (rev 177663)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2014-12-23 00:38:52 UTC (rev 177664)
</span><span class="lines">@@ -616,12 +616,14 @@
</span><span class="cx">     if (type.isNull()) {
</span><span class="cx">         m_inputType = InputType::createText(*this);
</span><span class="cx">         ensureUserAgentShadowRoot();
</span><ins>+        setNeedsWillValidateCheck();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_hasType = true;
</span><span class="cx">     m_inputType = InputType::create(*this, type);
</span><span class="cx">     ensureUserAgentShadowRoot();
</span><ins>+    setNeedsWillValidateCheck();
</ins><span class="cx">     registerForSuspensionCallbackIfNeeded();
</span><span class="cx">     runPostTypeUpdateTasks();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>