Closed Bug 385536 Opened 17 years ago Closed 17 years ago

a tree inside a panel doesn't respond to clicks

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: asaf, Assigned: sharparrow1)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

a tree inside a panel doesn't respond to clicks (mac only?).
Flags: blocking1.9?
Attached file testcase (deleted) —
I see this on windows as well.
OS: Mac OS X → All
Hardware: PC → All
roc and I aren't the right people to triage the blocking1.9? flag here.  Not sure how to fix that...
Depends on: 385535
Flags: blocking1.9? → blocking1.9+
Attached patch use right coordinates (deleted) — Splinter Review
Assignee: jag → enndeakin
Status: NEW → ASSIGNED
This bug occurs because clientX and clientY are 'unusual' when inside popups, and even more so when the popup contains a child with a widget, to the point where different values are returned for the same location just because a <deck> exists elsewhere inside a popup.

This patch makes it so that clientX/clientY within popups returns a value relative to the popup's topleft corner. Another possibility is to return the values relative to the document.

I don't really understand if this is the right patch, but it seems to work ok.

Thoughts?

Attached patch Fix clientX/Y (deleted) — Splinter Review
Here's a possibility.  I'd need approval to land this for 1.9, though.
I guess I ought to say a bit more.  The original reason for this mess of client coordinates was that the popup code used clientX/Y in a lot of places, and expected it to be in this funny not-quite-client-coordinate system.  With the popup rewrite, that's no longer the case, so it's probably safe to just make it behave the way you'd expect even if there are popups.

There is some chance that content using popups expects the old behavior, though, so fixing it properly is potentially a breaking change.
(In reply to comment #7)
>I guess I ought to say a bit more.  The original reason for this mess of client
>coordinates was that the popup code used clientX/Y in a lot of places, and
>expected it to be in this funny not-quite-client-coordinate system.  With the
>popup rewrite, that's no longer the case, so it's probably safe to just make it
>behave the way you'd expect even if there are popups.
Which is? I'm hoping that event.clientX == event.screenX - event.target.ownerDocument.documentElement.boxObject.screenX
as per the XXXbz comment in mailWidgets.xml :-)
(In reply to comment #6)
> Created an attachment (id=274069) [details]
> Fix clientX/Y
> 
> Here's a possibility.  I'd need approval to land this for 1.9, though.
> 

Yes, this is probably a better idea.
(In reply to comment #8)
> (In reply to comment #7)
> Which is? I'm hoping that event.clientX == event.screenX -
> event.target.ownerDocument.documentElement.boxObject.screenX
> as per the XXXbz comment in mailWidgets.xml :-)

My patch makes that true.
Correction: my patch makes that true except in situations where zoom is involved.  (See the discussion in m.d.t.layout.)
I am so totally in favor of Eli's patch.  I do worry about extensions that might depend on the client* in popups like that, but since it would be broken pretty much whatever they tried to do with it (c.f. mailwidgets.xml), I think there aren't many, if any.
Comment on attachment 274069 [details] [diff] [review]
Fix clientX/Y

If we're going to get this in, I should ask for review.
Attachment #274069 - Flags: review?(roc)
Assignee: enndeakin → sharparrow1
Status: ASSIGNED → NEW
Checked in.  (Might be a little difficult to write tests with popups; I guess we can do it with mochitests.)
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
One thing I thought of belatedly: getBoundingClientRect for an element inside an SVG foreignobject uses the nearest foreignobject as the root of its coordinate system. Event client coordinates probably should do.
(In reply to comment #18)
> One thing I thought of belatedly: getBoundingClientRect for an element inside
> an SVG foreignobject uses the nearest foreignobject as the root of its
> coordinate system. Event client coordinates probably should do.

Maybe... what exactly was the justification for getBoundingClientRect returning coordinates relative to the nearest foreignobject?  I don't think we want to force web authors to check whether the target content has a foreignobject parent before using clientX/Y.
The justification was that the obvious alternative behaviour --- taking the bounding rect of the SVG-transformed element(s) --- would confuse most uses of getBoundingClientRect.

I'm not sure what to do here.
Depends on: 391024
Attached patch automated test (deleted) — Splinter Review
Attachment #278844 - Flags: review?(gavin.sharp)
Attachment #278844 - Flags: review?(gavin.sharp) → review+
Checked in the test
Flags: in-testsuite? → in-testsuite+
Blocks: 296007
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: