<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>74914</bug_id>
          
          <creation_ts>2011-12-19 22:05:28 -0800</creation_ts>
          <short_desc>:invalid style is not applied when a checked radio button is removed from its radio group</short_desc>
          <delta_ts>2012-01-24 18:07:35 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>74909</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kent Tamura">tkent</reporter>
          <assigned_to name="Kent Tamura">tkent</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>524439</commentid>
    <comment_count>0</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-12-19 22:05:28 -0800</bug_when>
    <thetext>Repro:

&lt;style&gt;
:valid {
  border: solid 2px lime;
}
:invalid {
  border: solid 2px red;
}
input[type=&quot;radio&quot;] {
 -webkit-appearance: none;
 width: 16px;
 height: 16px;
}
input[type=&quot;radio&quot;]:checked {
  background-color: blue;
}
&lt;/style&gt;
&lt;body&gt;
&lt;form id=f&gt;
&lt;input type=radio name=n1 value=a id=a required&gt;
&lt;input type=radio name=n1 value=b id=b checked&gt;
&lt;/form&gt;
&lt;script&gt;
function $(id) { return document.getElementById(id); }

$(&apos;b&apos;).parentNode.removeChild($(&apos;b&apos;));

&lt;/script&gt;
&lt;/body&gt;


This HTML causes an assertion failure with a debug build:

ASSERTION FAILED: m_isValid == validity()-&gt;valid()
/Volumes/d2/WebKit/Source/WebCore/html/HTMLFormControlElement.cpp(433) : virtual bool WebCore::HTMLFormControlElement::isValidFormControlElement()
1   0x102fab0d8 WebCore::HTMLFormControlElement::isValidFormControlElement()
2   0x102b32304 WebCore::SelectorChecker::checkOneSelector(WebCore::CSSSelector*, WebCore::Element*, WebCore::PseudoId&amp;, bool, WebCore::SelectorChecker::VisitedMatchType, WebCore::RenderStyle*, WebCore::RenderStyle*) const
3   0x102b2fcfb WebCore::SelectorChecker::checkSelector(WebCore::CSSSelector*, WebCore::Element*, WebCore::PseudoId&amp;, bool, WebCore::SelectorChecker::VisitedMatchType, WebCore::RenderStyle*, WebCore::RenderStyle*) const
4   0x102c16ff0 WebCore::CSSStyleSelector::checkSelector(WebCore::RuleData const&amp;)
5   0x102bf5a82 WebCore::CSSStyleSelector::matchRulesForList(WTF::Vector&lt;WebCore::RuleData, 0ul&gt; const*, int&amp;, int&amp;, bool)
6   0x102bf5fca WebCore::CSSStyleSelector::matchRules(WebCore::RuleSet*, int&amp;, int&amp;, bool)
7   0x102bf6f55 WebCore::CSSStyleSelector::matchAllRules(WebCore::CSSStyleSelector::MatchResult&amp;)
8   0x102bf8809 WebCore::CSSStyleSelector::styleForElement(WebCore::Element*, WebCore::RenderStyle*, bool, bool, WebCore::RenderRegion*)
9   0x102e3afb9 WebCore::Element::styleForRenderer()
10  0x102e3b44d WebCore::Element::recalcStyle(WebCore::Node::StyleChange)
11 ...

We need to call HTMLInputElement::updateCheckedRadioButtons() when a checked radio button is removed from the group.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>524441</commentid>
    <comment_count>1</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-12-19 22:10:59 -0800</bug_when>
    <thetext>This happens when the &quot;name&quot; attribute value of the checked radio button is changed, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>541928</commentid>
    <comment_count>2</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-01-24 18:07:35 -0800</bug_when>
    <thetext>This was fixed by http://trac.webkit.org/changeset/105710</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>