Closed
Bug 463104
Opened 16 years ago
Closed 14 years ago
elementFromPoint should take floating-point coords
Categories
(Core :: DOM: CSS Object Model, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a4
People
(Reporter: bzbarsky, Assigned: emk)
Details
Attachments
(1 file, 2 obsolete files)
10.19 KB,
patch
|
emk
:
review+
|
Details | Diff | Splinter Review |
As things stand, elementFromPoint can lie about the element when something other than a DOM event is used to determine the point. This could be fixed by changing to floating-point coords, which would allow sub-CSS-px points.
Assignee | ||
Comment 1•14 years ago
|
||
This method is no longer a Mozilla Extension. It's defined in CSSOM View working draft. Per CSSOM View, elementFromPoint should take floating-point coordinates. http://www.w3.org/TR/cssom-view/#the-documentview-interface Moreover, getBoundingClientRect() already returns floating-point coordinates. Therefore var rect = elem.getBoundingClientRect(); elem === document.elementFromPoint(rect.left, rect.top); will return false incorrectly if the element has sub-CSS-px points.
Component: DOM: Mozilla Extensions → DOM: CSS Object Model
OS: Mac OS X → All
Assignee | ||
Comment 2•14 years ago
|
||
changing elementFromPoint arguments to float
Assignee | ||
Comment 3•14 years ago
|
||
Forgotten to add a test file to Makefile.in
Attachment #436835 -
Attachment is obsolete: true
Attachment #436836 -
Flags: review?(bzbarsky)
Attachment #436835 -
Flags: review?(bzbarsky)
Reporter | ||
Comment 4•14 years ago
|
||
Comment on attachment 436836 [details] [diff] [review] patch v1.1 The test strings should be "a shouldn't be found" and "a should be found". With that, r=bzbarsky.
Attachment #436836 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•14 years ago
|
||
Fixed test strings. Carrying forward r+.
Attachment #436836 -
Attachment is obsolete: true
Attachment #436838 -
Flags: review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/50b933e7db8e
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a4
The test had: isnot(a, document.elementFromPoint(5.5, 5.5), "a should be found"); isnot(a, document.elementFromPoint(5.75, 5.75), "a should be found"); I believe these are incorrect, they should both return "a". I fixed that in bug 646757.
Sorry, the original test lines were of course isnot(a, document.elementFromPoint(5.5, 5.5), "a shouldn't be found"); isnot(a, document.elementFromPoint(5.75, 5.75), "a shouldn't be found");
You need to log in
before you can comment on or make changes to this bug.
Description
•