Closed Bug 1456169 Opened 6 years ago Closed 6 years ago

Get rid of some useless methods on nsITextControlElement

Categories

(Core :: Layout: Form Controls, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(3 files)

Bug 1401706 moved some members over to text control frame, so we no longer need the indirection of having the frame ask the element which asks the editor state which asks the frame.
MozReview-Commit-ID: 6DYEtQMTCRF
Attachment #8970241 - Flags: review?(emilio)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
MozReview-Commit-ID: FcVbeHEwkMz
Attachment #8970244 - Flags: review?(emilio)
MozReview-Commit-ID: 3goF5VXvQap
Attachment #8970245 - Flags: review?(emilio)
Comment on attachment 8970241 [details] [diff] [review]
part 1.  Remove the now-unnecessary nsITextControlElement::GetRootEditorNode

Review of attachment 8970241 [details] [diff] [review]:
-----------------------------------------------------------------

Nice one, should've done this as part of the other bug :)

::: layout/forms/nsTextControlFrame.cpp
@@ +1340,5 @@
>  
>  UniquePtr<PresState>
>  nsTextControlFrame::SaveState()
>  {
>    nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());

Remove this variable, or make debug-only?

@@ +1360,5 @@
>  nsTextControlFrame::RestoreState(PresState* aState)
>  {
>    NS_ENSURE_ARG_POINTER(aState);
>  
>    nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());

ditto.
Attachment #8970241 - Flags: review?(emilio) → review+
Attachment #8970244 - Flags: review?(emilio) → review+
Comment on attachment 8970245 [details] [diff] [review]
part 3.  Remove the now-unnecessary nsITextControlElement::GetPreviewNode

Review of attachment 8970245 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, thank you!
Attachment #8970245 - Flags: review?(emilio) → review+
> Remove this variable, or make debug-only?

Good catch, removed.  The static analysis builds caught this too:

  error: Unused "kungFuDeathGrip" 'nsCOMPtr<nsITextControlElement>' objects constructed from temporary values are prohibited
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f2d4b3a4823e
part 1.  Remove the now-unnecessary nsITextControlElement::GetRootEditorNode.  r=emilio
https://hg.mozilla.org/integration/mozilla-inbound/rev/d1adc574c805
part 2.  Remove the now-unnecessary nsITextControlElement::GetPlaceholderNode.  r=emilio
https://hg.mozilla.org/integration/mozilla-inbound/rev/2d7531046934
part 3.  Remove the now-unnecessary nsITextControlElement::GetPreviewNode.  r=emilio
https://hg.mozilla.org/mozilla-central/rev/f2d4b3a4823e
https://hg.mozilla.org/mozilla-central/rev/d1adc574c805
https://hg.mozilla.org/mozilla-central/rev/2d7531046934
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.