Bug 1409183: Don't consider anonymous checkboxes as part of the document radio group. r=smaug

Summary: In this case the radiobox is in a SVG <use> subtree.

Reviewers: smaug

Bug #: 1409183

Differential Revision: https://phabricator.services.mozilla.com/D741

MozReview-Commit-ID: Abkg7ahST5t
This commit is contained in:
Emilio Cobos Álvarez
2018-03-16 19:05:42 +01:00
parent 3370a80065
commit a76d4ae5b0
3 changed files with 21 additions and 1 deletions

View File

@@ -3213,6 +3213,10 @@ HTMLInputElement::GetRadioGroupContainer() const
return mForm;
}
if (IsInAnonymousSubtree()) {
return nullptr;
}
//XXXsmaug It isn't clear how this should work in Shadow DOM.
return static_cast<nsDocument*>(GetUncomposedDoc());
}
@@ -6680,7 +6684,7 @@ HTMLInputElement::AddedToRadioGroup()
{
// If the element is neither in a form nor a document, there is no group so we
// should just stop here.
if (!mForm && !IsInUncomposedDoc()) {
if (!mForm && (!IsInUncomposedDoc() || IsInAnonymousSubtree())) {
return;
}