nsIRadioGroupContainer can use HTMLInputElement

RESOLVED FIXED in mozilla26

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: dzbarsky, Assigned: dzbarsky)

Tracking

unspecified
mozilla26
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Comment 1

5 years ago
Created attachment 785908 [details] [diff] [review]
Patch
Assignee: nobody → dzbarsky
Status: NEW → ASSIGNED
Attachment #785908 - Flags: review?(Ms2ger)
Comment on attachment 785908 [details] [diff] [review]
Patch

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

::: content/base/src/nsDocument.cpp
@@ +1669,5 @@
>      static_cast<nsCycleCollectionTraversalCallback*>(aClosure);
>  
>    NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*cb,
>                                     "mRadioGroups entry->mSelectedRadioButton");
> +  cb->NoteXPCOMChild(static_cast<nsIContent*>(aData->mSelectedRadioButton));

ToSupports().

(Though it'd be nice if this could somehow use the macros...)

@@ +7297,5 @@
>  
>  NS_IMETHODIMP
>  nsDocument::GetNextRadioButton(const nsAString& aName,
>                                 const bool aPrevious,
> +                               HTMLInputElement*  aFocusedRadio,

Fix the extra space, please

@@ +7336,5 @@
>      }
>      else if (++index >= numRadios) {
>        index = 0;
>      }
> +    NS_ASSERTION(static_cast<nsGenericHTMLFormElement*>(radioGroup->mRadioButtons[index])->IsHTML(nsGkAtoms::input),

Ugh.

@@ +7344,2 @@
>  
>    NS_IF_ADDREF(*aRadioOut = radio);

Use forget() here.

::: content/base/src/nsDocument.h
@@ +727,5 @@
>                              nsIRadioVisitor* aVisitor,
>                              bool aFlushContent) MOZ_OVERRIDE;
>    virtual void SetCurrentRadioButton(const nsAString& aName,
> +                                     mozilla::dom::HTMLInputElement* aRadio) MOZ_OVERRIDE;
> +  virtual mozilla::dom::HTMLInputElement* GetCurrentRadioButton(const nsAString& aName) MOZ_OVERRIDE;

Fix any cases where you go over the 80-column limit

::: content/html/content/src/HTMLFormElement.cpp
@@ +287,5 @@
>  
>  // nsISupports
>  
>  static PLDHashOperator
> +ElementTraverser(const nsAString& key, HTMLInputElement* element,

I wonder if there's a macro for this already...

@@ +295,3 @@
>      static_cast<nsCycleCollectionTraversalCallback*>(userArg);
> +
> +  cb->NoteXPCOMChild(static_cast<nsIContent*>(element));

ToSupports

@@ +2137,5 @@
>  
>  NS_IMETHODIMP
>  HTMLFormElement::GetNextRadioButton(const nsAString& aName,
>                                      const bool aPrevious,
> +                                    HTMLInputElement*  aFocusedRadio,

Spaces

@@ +2182,4 @@
>      if (!radio)
>        continue;
>  
>      // XXXbz why is this formControl check needed, exactly?

formControl is gone

::: content/html/content/src/HTMLFormElement.h
@@ +81,3 @@
>    NS_IMETHOD GetNextRadioButton(const nsAString& aName,
>                                  const bool aPrevious,
> +                                HTMLInputElement*  aFocusedRadio,

Spaces

::: content/html/content/src/HTMLInputElement.cpp
@@ +3123,5 @@
>                      nsMouseEvent event(aVisitor.mEvent->mFlags.mIsTrusted,
>                                         NS_MOUSE_CLICK, nullptr,
>                                         nsMouseEvent::eReal);
>                      event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD;
> +                    rv = nsEventDispatcher::Dispatch(static_cast<nsIContent*>(selectedRadioButton),

ToSupports()
Attachment #785908 - Flags: review?(Ms2ger) → review+
Comment on attachment 785908 [details] [diff] [review]
Patch

>From: David Zbarsky <dzbarsky@gmail.com>
>nsidomhttlinput things...try: -b d -p linux64

Here too.
https://hg.mozilla.org/mozilla-central/rev/803d0a3d5307
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26

Updated

3 years ago
Depends on: 1059030
You need to log in before you can comment on or make changes to this bug.