Closed Bug 305158 Opened 19 years ago Closed 19 years ago

Checkin for bug 304739 broke contentAreaClick()

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: iannbugzilla)

References

Details

(Keywords: fixed1.8, regression)

Attachments

(1 file)

STEPS TO REPRODUCE:  Try to middle-mouse-paste a URL into the content area. 
Watch nothing happen other than an error that the empty string url was blocked
by security in the JS console.

The problem is that the patch for bug 304739 changed contentAreaClick() as follows:

-    var ceParams = {event: event, href: "", linkNode: null};
-    hrefAndLinkNodeForClickEvent(ceParams);
-    var href = ceParams.href;
-    if (href) {
+    var ceParams = hrefAndLinkNodeForClickEvent(event);
+    if (ceParams) {

The problem is that |ceParams| is NEVER null here, because the code at
http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/contentAreaClick.js#152
guarantees that linkNode is never null at the end of
hrefAndLinkNodeForClickEvent().  So we end up taking the "link" click path even
if no link was actually clicked instead of doing what we're supposed to be doing...
In fact, I suspect all other callers of hrefAndLinkNodeForClickEvent() got
broken too, reading over the patch in bug 304739.
Blocks: 304739
This patch:
* Checks for href as was originally done after calls to
hrefAndLinkNodeForClickEvent instead of linkNode.
Attachment #193115 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #193115 - Flags: review?(cbiesinger)
Status: NEW → ASSIGNED
Keywords: regression
OS: Linux → All
Hardware: PC → All
Attachment #193115 - Flags: review?(cbiesinger) → review+
Attachment #193115 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Comment on attachment 193115 [details] [diff] [review]
Bustage fix v0.1 (Checked in)

Checking in
contentAreaClick.js;
new revision: 1.52; previous revision: 1.51
done
Attachment #193115 - Attachment description: Bustage fix v0.1 → Bustage fix v0.1 (Checked in)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: