Closed
Bug 759993
Opened 13 years ago
Closed 12 years ago
Can't select options in a select list whose parent is translated with a transform
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
VERIFIED
FIXED
mozilla19
People
(Reporter: bzbarsky, Assigned: roc)
References
Details
Attachments
(3 files, 2 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
See attached testcase. Seems a lot like bug 664707 but is totally happening in current builds.
Comment 1•13 years ago
|
||
Hmm, weird, the highlight follows the mouse correctly, but mouse clicks don't seem to get through properly.
Updated•13 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
This looks like it's still what I reported on bug 747081 and got closed as a duplicate of bug 664707. The bug I opened contains a link to a jsfiddle that lets you programatically check the existence of this bug.
Comment 4•12 years ago
|
||
Here it is as a jsfiddle http://jsfiddle.net/fGMG7/ if it helps.
Comment 5•12 years ago
|
||
Here's a simplified test case from me: http://jsfiddle.net/xawDt/
This bug affects Leaflet JS maps library http://leaflet.cloudmade.com/ (since popups are positioned with transforms for smoother animations).
I'm on the Google Maps API team, and we've disabled the use of CSS transforms in Firefox because of this bug, which unfortunately degrades the experience (by disabling continuous zoom). Thanks for making improvements in the past, but until transformed select elements work perfectly, it unfortunately isn't much use.
For consistency, here's the fiddle I referenced in the above comment: http://jsfiddle.net/gonchuki/vxS3L/1/
For anyone with this issue, be sure to check against this bug using this snippet instead of doing browser sniffing. As I found out, this is still the most reliable way to detect if a browser pesents this bug (and can come handy as a unit test for whoever is fixing it in Firefox itself)
Comment 8•12 years ago
|
||
(In reply to gonchuki from comment #7)
> For consistency, here's the fiddle I referenced in the above comment:
> http://jsfiddle.net/gonchuki/vxS3L/1/
>
> For anyone with this issue, be sure to check against this bug using this
> snippet instead of doing browser sniffing. As I found out, this is still the
> most reliable way to detect if a browser pesents this bug (and can come
> handy as a unit test for whoever is fixing it in Firefox itself)
The fix for this bug is most likely not going to change the value of offsetTop. So this check is not a reliable way to probe for this bug existing.
The fix should change it, as the offsetTop for the transformed option *matches* the invisible hit area that it's taking (and not the visible rendered part of it).
Check it with firebug on http://jsfiddle.net/xawDt/, if you open the select and go into the HTML pane and hover the <option> tags you will see that the options themselves got translated again, using the same transform that their parent had (thus, the transform is applied twice, and the first option element is for example at 100px left instead of the 50px the select has.)
To be clear: the offsetTop of each option element is currently incorrect, and that's what my snippet asserts. Fixing the hit area MUST also fix the reported offsetTop of each option element, else Firefox will remain broken.
Comment 10•12 years ago
|
||
(In reply to gonchuki from comment #9)
> The fix should change it, as the offsetTop for the transformed option
> *matches* the invisible hit area that it's taking (and not the visible
> rendered part of it).
>
> Check it with firebug on http://jsfiddle.net/xawDt/, if you open the select
> and go into the HTML pane and hover the <option> tags you will see that the
> options themselves got translated again, using the same transform that their
> parent had (thus, the transform is applied twice, and the first option
> element is for example at 100px left instead of the 50px the select has.)
>
> To be clear: the offsetTop of each option element is currently incorrect,
> and that's what my snippet asserts. Fixing the hit area MUST also fix the
> reported offsetTop of each option element, else Firefox will remain broken.
I think this is a separate issue. Please file a new bug on it.
Comment 11•12 years ago
|
||
It's one single bug, I can't understand why you insist on the fact that fixing this bug will somehow keep reporting incorrect coordinates for the option element.
The option element *is* at an incorrect offset, and that's not something that you simply measure with code or the mouse pointer not working on the visible area, you can actually SEE the thing at the incorrect offset with the aid of firebug: http://sandbox.gonchuki.com/files/highlight_broken_hit_area.png
Now, this area is an exact match of the coordinates reported via offsetLeft and offsetTop. It's not a coincidence or a "different bug", it's simply measuring a fact, the fact that this element is positioned wrong.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → roc
Assignee | ||
Comment 12•12 years ago
|
||
I think the problem is in nsLayoutUtils::GetTransformToAncestor, combined with the fix for bug 599938. In bug 599938 we set the popup frame's offset to a destination that includes translation transforms from its ancestors in the page. But nsLayoutUtils::GetTransformToAncestor called on the popup frame will add up the popup frame's offset along with the ancestor translations, effectively applying the ancestor translations twice. This causes event coordinates to be miscalculated.
Assignee | ||
Comment 13•12 years ago
|
||
Attachment #674626 -
Flags: review?(tnikkel)
Assignee | ||
Comment 14•12 years ago
|
||
Attachment #674628 -
Flags: review?(tnikkel)
Assignee | ||
Updated•12 years ago
|
Attachment #674626 -
Attachment is obsolete: true
Attachment #674626 -
Flags: review?(tnikkel)
Comment 15•12 years ago
|
||
I wonder why the coordinates of mouse moves are interpreted fine (the selection correctly follows your mouse as you mouse over) but mouse clicks aren't.
Assignee | ||
Comment 16•12 years ago
|
||
I think because GetFrameForPoint works, so the correct elements are targeted by events, but nsLayoutUtils::GetDOMEventCoordinatesRelativeTo doesn't work because it relies on nsIFrame::GetTransformMatrix.
Comment 17•12 years ago
|
||
Comment on attachment 674628 [details] [diff] [review]
v2, slightly more robust to popups without widgets
>+ gfx3DMatrix result;
>+ result._41 = translation.x;
>+ result._42 = translation.y;
>+ *aOutAncestor = nullptr;
>+ return result;
Hmm, shouldn't aOutAncestor be the root root frame here and not null?
Assignee | ||
Comment 18•12 years ago
|
||
Yes, OK.
Assignee | ||
Comment 19•12 years ago
|
||
Attachment #674628 -
Attachment is obsolete: true
Attachment #674628 -
Flags: review?(tnikkel)
Attachment #677285 -
Flags: review?(tnikkel)
Updated•12 years ago
|
Attachment #677285 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 20•12 years ago
|
||
This patch causes numerous test failures, e.g.
https://tbpl.mozilla.org/php/getParsedLog.php?id=16682640&tree=Try&full=1#error0
Lots of
###!!! ASSERTION: Ancestors for popups not supported: '!aStopAtAncestor', file ../../../layout/generic/nsFrame.cpp, line 4767
Assignee | ||
Comment 21•12 years ago
|
||
This patch should help prevent those assertions.
Attachment #680422 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 22•12 years ago
|
||
Assignee | ||
Comment 23•12 years ago
|
||
Updated•12 years ago
|
Attachment #680422 -
Flags: review?(matt.woodrow) → review+
Assignee | ||
Comment 24•12 years ago
|
||
Unfortunately this patch causes failures in test_arrowpanel.xul because in some cases getBoundingClientRect is called right after we've created and positioned a popup, but before widget changes have been flushed.
Because of the delayed widget positioning, I think the approach of this patch is pretty much wrong.
Comment 25•12 years ago
|
||
Do we actually move XUL popups based on CSS transforms? Can we just handle select dropdowns here?
Assignee | ||
Comment 26•12 years ago
|
||
Yeah, let's do that for now.
Assignee | ||
Comment 27•12 years ago
|
||
Comment 28•12 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #27)
> https://tbpl.mozilla.org/?tree=Try&rev=5487de940465
Looking at that patch you might want to update the condition in the while at the bottom of the patch to limit it to selects as well as the if at the top.
Assignee | ||
Comment 29•12 years ago
|
||
Assignee | ||
Comment 30•12 years ago
|
||
(In reply to Timothy Nikkel (:tn) from comment #28)
> Looking at that patch you might want to update the condition in the while at
> the bottom of the patch to limit it to selects as well as the if at the top.
I think it's actually fine to stop wherever we want there.
Assignee | ||
Comment 31•12 years ago
|
||
Comment 32•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cf1080d1f8b3
https://hg.mozilla.org/mozilla-central/rev/342ebbbb736b
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 33•12 years ago
|
||
Just attempted to use the attached testcase, and this does not work in Nightly 21.0a1 (2013-01-11). Re-opening. This is pretty nasty.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 34•12 years ago
|
||
Hmm, it seems the patch has fixed the problem for Windows and Linux, but not Mac. I think we should file a new bug for that.
Comment 35•12 years ago
|
||
I filed bug 829886 for that.
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•