Closed
Bug 385536
Opened 18 years ago
Closed 18 years ago
a tree inside a panel doesn't respond to clicks
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: asaf, Assigned: sharparrow1)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
1.07 KB,
application/vnd.mozilla.xul+xml
|
Details | |
7.39 KB,
patch
|
Details | Diff | Splinter Review | |
4.00 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
3.75 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
a tree inside a panel doesn't respond to clicks (mac only?).
Flags: blocking1.9?
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
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...
Flags: blocking1.9? → blocking1.9+
Comment 4•18 years ago
|
||
Assignee: jag → enndeakin
Status: NEW → ASSIGNED
Comment 5•18 years ago
|
||
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?
Assignee | ||
Comment 6•18 years ago
|
||
Here's a possibility. I'd need approval to land this for 1.9, though.
Assignee | ||
Comment 7•18 years ago
|
||
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.
Comment 8•18 years ago
|
||
(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 :-)
Comment 9•18 years ago
|
||
(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.
Assignee | ||
Comment 10•18 years ago
|
||
(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.
Assignee | ||
Comment 11•18 years ago
|
||
Correction: my patch makes that true except in situations where zoom is involved. (See the discussion in m.d.t.layout.)
![]() |
||
Comment 12•18 years ago
|
||
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.
Seconded.
Assignee | ||
Comment 14•18 years ago
|
||
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)
Updated•18 years ago
|
Assignee: enndeakin → sharparrow1
Status: ASSIGNED → NEW
Attachment #274069 -
Flags: superreview+
Attachment #274069 -
Flags: review?(roc)
Attachment #274069 -
Flags: review+
Assignee | ||
Comment 15•18 years ago
|
||
Checked in. (Might be a little difficult to write tests with popups; I guess we can do it with mochitests.)
Status: NEW → RESOLVED
Closed: 18 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Comment 16•18 years ago
|
||
So does this mean we can remove all bz's hacks such as this one:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/base/resources/content/mailWidgets.xml&rev=1.76&root=/cvsroot&mark=1711-1713#1705
I think so!
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.
Assignee | ||
Comment 19•18 years ago
|
||
(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.
Comment 21•18 years ago
|
||
Please see bug 391024.
Comment 22•17 years ago
|
||
Attachment #278844 -
Flags: review?(gavin.sharp)
Updated•17 years ago
|
Attachment #278844 -
Flags: review?(gavin.sharp) → review+
Comment 23•17 years ago
|
||
Checked in the test
Updated•17 years ago
|
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•