Closed Bug 753308 Opened 9 years ago Closed 9 years ago

Call openUILink with named parameters

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 15

People

(Reporter: dao, Assigned: raymondlee)

References

Details

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

Attachments

(1 file, 1 obsolete file)

http://mxr.mozilla.org/mozilla-central/search?string=openUILink%28&filter=,%20%28true|false|null%29

openUILink(url, event, x, y, z, ...);

should be replaced with:

openUILink(url, event, {
           ignoreButton: x,
           ignoreAlt: y,
           allowThirdPartyFixup: z,
           ...});
Assignee: nobody → raymond
Status: NEW → ASSIGNED
Attached patch v1 (obsolete) — Splinter Review
Attachment #623009 - Flags: review?(dao)
Comment on attachment 623009 [details] [diff] [review]
v1

>--- a/browser/base/content/browser-places.js
>+++ b/browser/base/content/browser-places.js

>   _onCommand: function HM__onCommand(aEvent) {
>     let placesNode = aEvent.target._placesNode;
>     if (placesNode) {
>       PlacesUIUtils.markPageAsTyped(placesNode.uri);
>-      openUILink(placesNode.uri, aEvent, false, true);
>+      openUILink(placesNode.uri, aEvent, { ignoreButton: false,
>+                                           ignoreAlt: true });

"ignoreButton: false" can be removed, it's the default behavior

>--- a/browser/base/content/browser.js
>+++ b/browser/base/content/browser.js

>   loadFeed: function(href, event) {
>     var feeds = gBrowser.selectedBrowser.feeds;
>     try {
>-      openUILink(href, event, false, true, false, null);
>+      openUILink(href, event, { ignoreButton: false,
>+                                ignoreAlt: true,
>+                                allowThirdPartyFixup: false,
>+                                postData: null });
>     }

ditto for ignoreButton, allowThirdPartyFixup and postData.

>--- a/browser/base/content/pageinfo/feeds.js
>+++ b/browser/base/content/pageinfo/feeds.js

> function onSubscribeFeed()
> {
>   var listbox = document.getElementById("feedListbox");
>-  openUILink(listbox.selectedItem.getAttribute("feedURL"),
>-             null, false, true, false, null);
>+  openUILink(listbox.selectedItem.getAttribute("feedURL"), null, {
>+             ignoreButton: false,
>+             ignoreAlt: true,
>+             allowThirdPartyFixup: false,
>+             postData: null });
> }

Passing a null event seems strange. It looks like this should be using openUILinkIn.
Attachment #623009 - Flags: review?(dao) → feedback+
Attached patch v2Splinter Review
Attachment #623009 - Attachment is obsolete: true
Attachment #623220 - Flags: review?(dao)
Attachment #623220 - Flags: review?(dao) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c216e50bdc0d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.