Call openUILink with named parameters

RESOLVED FIXED in Firefox 15

Status

()

Firefox
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dao, Assigned: raymondlee)

Tracking

Trunk
Firefox 15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
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)

Updated

5 years ago
Assignee: nobody → raymond
Status: NEW → ASSIGNED
(Assignee)

Comment 1

5 years ago
Created attachment 623009 [details] [diff] [review]
v1
Attachment #623009 - Flags: review?(dao)
(Reporter)

Comment 2

5 years ago
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+
(Assignee)

Comment 3

5 years ago
Created attachment 623220 [details] [diff] [review]
v2
Attachment #623009 - Attachment is obsolete: true
Attachment #623220 - Flags: review?(dao)
(Reporter)

Updated

5 years ago
Attachment #623220 - Flags: review?(dao) → review+
(Reporter)

Updated

5 years ago
Keywords: checkin-needed
(Reporter)

Comment 4

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/c216e50bdc0d
Keywords: checkin-needed
Target Milestone: --- → Firefox 15
https://hg.mozilla.org/mozilla-central/rev/c216e50bdc0d
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.