Bug 1752651 - Clone indeterminateness of input elements. r=smaug

Matches other browsers and makes sense.

Differential Revision: https://phabricator.services.mozilla.com/D137442
This commit is contained in:
Emilio Cobos Álvarez
2022-01-31 13:14:46 +00:00
parent f020b76cd8
commit 7817a9157e
2 changed files with 14 additions and 2 deletions

View File

@@ -1130,6 +1130,8 @@ nsresult HTMLInputElement::Clone(dom::NodeInfo* aNodeInfo,
it->mShouldInitChecked = false;
}
it->mIndeterminate = mIndeterminate;
it->DoneCreatingElement();
it->SetLastValueChangeWasInteractive(mLastValueChangeWasInteractive);
@@ -1445,8 +1447,9 @@ void HTMLInputElement::SetIndeterminateInternal(bool aValue,
if (aShouldInvalidate) {
// Repaint the frame
nsIFrame* frame = GetPrimaryFrame();
if (frame) frame->InvalidateFrameSubtree();
if (nsIFrame* frame = GetPrimaryFrame()) {
frame->InvalidateFrameSubtree();
}
}
UpdateState(true);