Bug 74914
| Summary: | :invalid style is not applied when a checked radio button is removed from its radio group | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kent Tamura <tkent> |
| Component: | Forms | Assignee: | Kent Tamura <tkent> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 74909 | ||
| Bug Blocks: | |||
Kent Tamura
Repro:
<style>
:valid {
border: solid 2px lime;
}
:invalid {
border: solid 2px red;
}
input[type="radio"] {
-webkit-appearance: none;
width: 16px;
height: 16px;
}
input[type="radio"]:checked {
background-color: blue;
}
</style>
<body>
<form id=f>
<input type=radio name=n1 value=a id=a required>
<input type=radio name=n1 value=b id=b checked>
</form>
<script>
function $(id) { return document.getElementById(id); }
$('b').parentNode.removeChild($('b'));
</script>
</body>
This HTML causes an assertion failure with a debug build:
ASSERTION FAILED: m_isValid == validity()->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&, bool, WebCore::SelectorChecker::VisitedMatchType, WebCore::RenderStyle*, WebCore::RenderStyle*) const
3 0x102b2fcfb WebCore::SelectorChecker::checkSelector(WebCore::CSSSelector*, WebCore::Element*, WebCore::PseudoId&, bool, WebCore::SelectorChecker::VisitedMatchType, WebCore::RenderStyle*, WebCore::RenderStyle*) const
4 0x102c16ff0 WebCore::CSSStyleSelector::checkSelector(WebCore::RuleData const&)
5 0x102bf5a82 WebCore::CSSStyleSelector::matchRulesForList(WTF::Vector<WebCore::RuleData, 0ul> const*, int&, int&, bool)
6 0x102bf5fca WebCore::CSSStyleSelector::matchRules(WebCore::RuleSet*, int&, int&, bool)
7 0x102bf6f55 WebCore::CSSStyleSelector::matchAllRules(WebCore::CSSStyleSelector::MatchResult&)
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Kent Tamura
This happens when the "name" attribute value of the checked radio button is changed, too.
Kent Tamura
This was fixed by http://trac.webkit.org/changeset/105710