Closed
Bug 1119698
Opened 11 years ago
Closed 11 years ago
Mouse events firing on hidden <image> elements
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: atmd1983, Assigned: longsonr)
References
Details
(Keywords: regression)
Attachments
(1 file)
|
7.87 KB,
patch
|
jwatt
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150106233618
Steps to reproduce:
JSbin created to replicate
http://jsbin.com/focixu
please also see the stackoverflow question with more details.
Summary:
I have an svg' with visibility:hidden and mouse events bound to it.
The elements are invisible as per the css, however on mouse over and click those bound events are still firing.
Actual results:
both mouse over and click events fired on the hidden elements.
This only effects the svg <image> tag
Expected results:
The events should not fire, the elements are hidden and should be inactive
N.B. I have tested this in firefox 31 and the issue doesn't exist, however it DOES exist in firefox version 34, 35 beta and 36 dev edition.
Related stackoverflow question
http://stackoverflow.com/questions/27844884/d3-events-firing-on-a-hidden-svg-element
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → longsonr
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Mouse events firing on SVG hidden elements → Mouse events firing on hidden <image> elements
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8546697 -
Flags: review?(jwatt)
| Assignee | ||
Updated•11 years ago
|
Blocks: 1049256
Keywords: regression
| Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Comment on attachment 8546697 [details] [diff] [review]
image.txt
Review of attachment 8546697 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/svg/nsSVGImageFrame.cpp
@@ +411,5 @@
> nsSVGImageFrame::GetFrameForPoint(const gfxPoint& aPoint)
> {
> + if (!(GetStateBits() & NS_STATE_SVG_CLIPPATH_CHILD) && !GetHitTestFlags()) {
> + return nullptr;
> + }
I don't follow this logic. Why the requirement that the frame is not NS_STATE_SVG_CLIPPATH_CHILD?
| Assignee | ||
Comment 5•11 years ago
|
||
path has that logic.
http://mxr.mozilla.org/mozilla-central/source/layout/svg/nsSVGPathGeometryFrame.cpp#286
Though as far as I can tell text does not (though perhaps it should)
I imagine its to make PointIsInsideClipPath return whether or not we're in the clip path. So basically we don't support setting pointer-events on individual elements within clip-paths.
| Assignee | ||
Comment 6•11 years ago
|
||
Before bug 1049256 images called the path code for hit testing so all I'm doing is putting it back the way it was. We can have a follow up to determine what the right answer is for clip-paths if you want.
Comment 7•11 years ago
|
||
Comment on attachment 8546697 [details] [diff] [review]
image.txt
This function still seems like a bit of a mess to me, but this does fix the bug.
Attachment #8546697 -
Flags: review?(jwatt) → review+
Comment 8•11 years ago
|
||
Can you add an XXX/TODO comment noting that we should align with the nsSVGPathGeometryFrame code with regards to clipPath and the hit testing flags though?
Comment 9•11 years ago
|
||
Actually just land this as-is and I'll file another bug for the other changes that I want to make.
| Assignee | ||
Comment 10•11 years ago
|
||
| Assignee | ||
Comment 11•11 years ago
|
||
Flags: in-testsuite+
Comment 12•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
| Assignee | ||
Comment 13•11 years ago
|
||
Comment on attachment 8546697 [details] [diff] [review]
image.txt
Approval Request Comment
[Feature/regressing bug #]: bug 1049256
[User impact if declined]: hidden SVG images receive mouse events when they should not. There are a couple of stackoverflow questions about this.
[Describe test coverage new/current, TBPL]: includes a mochitest
[Risks and why]: pretty small, basically reinstates the codepath removed in bug 1049256
[String/UUID change made/needed]: none
Attachment #8546697 -
Flags: approval-mozilla-beta?
Attachment #8546697 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Attachment #8546697 -
Flags: approval-mozilla-beta?
Attachment #8546697 -
Flags: approval-mozilla-beta+
Attachment #8546697 -
Flags: approval-mozilla-aurora?
Attachment #8546697 -
Flags: approval-mozilla-aurora+
Comment 14•11 years ago
|
||
Updated•11 years ago
|
QA Whiteboard: [good first verify]
You need to log in
before you can comment on or make changes to this bug.
Description
•