Closed Bug 274885 Opened 20 years ago Closed 20 years ago

JS errors Ctrl/Shift+Left Clicking and Right Clicking links in P3P summary

Categories

(SeaMonkey :: Page Info, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neil, Assigned: iannbugzilla)

Details

Attachments

(1 file, 3 obsolete files)

We need to decide whether or not to handle these clicks; currently they generate
an error that XPCNativeWrapper is not defined; adding XPCNativeWrapper generates
an error that getBrowser() doesn't support addTab. The latter was caused by the
patch to bug 265683 renaming getSummaryBrowser() to getBrowser().
Note that the 1.4 and 1.7 branches have had XPCNativeWrapper added.
Also happens on Shift+left click and right click. Updating summary.
Summary: JS errors Ctrl+Clicking links in P3P summary → JS errors Ctr/Shiftl+Left Clicking and Right Clicking links in P3P summary
From bug 265683
* Renames getSummaryBrowser back to getBrowser so Text Zoom works

One of the questions we should ask is do we assume that sites that have a P3P
summary will write them in such a way that links that need to open a new window
are targetted correctly?

The captureContentClick function could be used if we wanted to screen out all
but simple left clicks with something like the following inserted:

  if (aEvent.type != "click" || aEvent.button != 0 ||
      aEvent.ctrlKey || aEvent.metaKey || aEvent.shiftKey)
    return true;
The above still allowed left clicks on non-links to generate a JS error, the
following fixes that but we may want to replicate some of the code in the
hrefForClickEvent function in contentAreaClick.js for a proper fix:

  if ((aEvent.type == "click" && aEvent.target.localName.toLowerCase() != "link") ||
      aEvent.type != "click" || aEvent.button != 0 ||
      aEvent.ctrlKey || aEvent.metaKey || aEvent.shiftKey)
    return true;
(In reply to comment #2)
> From bug 265683
> * Renames getSummaryBrowser back to getBrowser so Text Zoom works
The other way to fix this would be to redefine getMarkupDocumentViewer currently
defined by browser.js (why do we have browser.js?)

>One of the questions we should ask is do we assume that sites that have a P3P
>summary will write them in such a way that links that need to open a new
>window are targetted correctly?
We can add a URIContentListener to the docShell to fix this, a bit like the one
in help, but for all links, not based on the target href.
Summary: JS errors Ctr/Shiftl+Left Clicking and Right Clicking links in P3P summary → JS errors Ctrl/Shift+Left Clicking and Right Clicking links in P3P summary
It looks like we're using browser.js for Find and possibly ToolTips
Well, we don't appear to have any tooltips, but we need it for Find; it looks as
if we'd be better off not handling modified clicks at all...
Something like this?
Comment on attachment 168894 [details] [diff] [review]
NativeWrapper and clicks patch v0.1

>+  if (!(aEvent.target instanceof HTMLAnchorElement) || aEvent.button != 0 ||
>+      aEvent.altKey || aEvent.ctrlKey || aEvent.metaKey || aEvent.shiftKey)
>+    return true;
This doesn't seem to leave anything for contentAreaClick to do (note that
contentAreaClick does not handle unmodified left clicks). If that's the intent
then we can remove the relevant code (including XPCNativeWrapper).
Attachment #168894 - Attachment is obsolete: true
Comment on attachment 168905 [details] [diff] [review]
Simple left click only patch v0.2

OK, so can we clean up the .xul too?
Removing contentAreaClick.js and the DragAndDrop stuff?
(In reply to comment #11)
>Removing contentAreaClick.js and the DragAndDrop stuff?
Good point, that doesn't belong either.
Assignee: db48x → bugzilla
Attachment #168905 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #169048 - Flags: review?(db48x)
Comment on attachment 169048 [details] [diff] [review]
Left click and XUL tidyup patch v0.2a

looks good, r=db48x
Attachment #169048 - Flags: review?(db48x) → review+
Attachment #169048 - Flags: superreview?(neil.parkwaycc.co.uk)
Comment on attachment 169048 [details] [diff] [review]
Left click and XUL tidyup patch v0.2a

Seems to me that contentAreaUtils.js can go too.
Attachment #169048 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
OK, so in fact we could reimplement Find the way Mail does it (see MsgFind in
mailWindowOverlay.js) which would allows us to get rid of browser.js and thus
getBrowser(), should anyone really want to be able to ctrl+click a link.

Note that the .xsl used to generate the policy viewer content automatically
generates target="_blank" on external links.
contentAreaUtils.js is used by p3pSummarySavePage function in p3pSummary.js
(saveDocument).
I will investigate removing browser.js
(In reply to comment #17)
>contentAreaUtils.js is used by p3pSummarySavePage function in p3pSummary.js
>(saveDocument).
I only see persistor.saveDocument
>I will investigate removing browser.js
No point, the comment was only for someone wanting to restore ctrl+clicks.
Carrying forward r/sr
Attachment #169048 - Attachment is obsolete: true
Attachment #169212 - Flags: superreview+
Attachment #169212 - Flags: review+
Comment on attachment 169212 [details] [diff] [review]
Left click and more XUL tidyup patch v0.2b

Checking in p3pSummary.xul;
/cvsroot/mozilla/extensions/p3p/resources/content/p3pSummary.xul,v  <-- 
p3pSummary.xul
new revision: 1.4; previous revision: 1.3
done
Checking in p3pSummary.js;
/cvsroot/mozilla/extensions/p3p/resources/content/p3pSummary.js,v  <-- 
p3pSummary.js
new revision: 1.9; previous revision: 1.8
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: