Closed Bug 1126781 Opened 9 years ago Closed 9 years ago

browser-search-autocomplete-result-popup's popupshowing handler shouldn't clobber the popup's style attribute

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 38

People

(Reporter: dao, Assigned: gioyik, Mentored)

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(1 file)

browser-search-autocomplete-result-popup's popupshowing handler sets the min-width on the popup like this:

  panel.setAttribute("style", "min-width: " + minWidth + "px");

(http://hg.mozilla.org/mozilla-central/annotate/b2b10231606b/browser/base/content/urlbarBindings.xml#l1176)

Instead, it should set panel.style.minWidth directly.
The solution could be:

panel.style.minWidth(minWidth);

or should I add the "px" too? Something like:

panel.style.minWidth(minWidth + "px");
Flags: needinfo?(dao)
minWidth isn't a function, it's a property that needs to be set like foo.minWidth = ...;

And yes, "px" needs to be added.
Flags: needinfo?(dao)
So, the correct way could be:

panel.minWidth = minWidth + "px";

I ask before send a patch to be sure. :)
Flags: needinfo?(dao)
panel.style.minWidth, not panel.minWidth
Flags: needinfo?(dao)
Attached patch 1126781.patchSplinter Review
Patch
Attachment #8556817 - Flags: review?(dao)
Comment on attachment 8556817 [details] [diff] [review]
1126781.patch

Thanks!
Attachment #8556817 - Flags: review?(dao) → review+
https://hg.mozilla.org/mozilla-central/rev/93a250d4877c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: