Closed
Bug 490003
Opened 15 years ago
Closed 14 years ago
Invalidation and hit testing does not account for border or patting on outer-<svg>
Categories
(Core :: SVG, defect, P2)
Core
SVG
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta1+ |
People
(Reporter: jwatt, Assigned: longsonr)
References
Details
Attachments
(4 files, 1 obsolete file)
943 bytes,
image/svg+xml
|
Details | |
681 bytes,
image/svg+xml
|
Details | |
2.38 KB,
patch
|
roc
:
review-
|
Details | Diff | Splinter Review |
8.77 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
Invalidation and hit testing does not account for border or patting on outer-<svg>.
Reporter | ||
Updated•15 years ago
|
Assignee: nobody → jwatt
Reporter | ||
Comment 1•15 years ago
|
||
Reporter | ||
Comment 2•15 years ago
|
||
Reporter | ||
Comment 3•15 years ago
|
||
I'm not sure how to create an automated test for the hit testing. I need a way to dispatch an event to a given point on the screen, not to a particular target.
Attachment #374491 -
Flags: review?(roc)
For hit-testing, use the elementFromPoint DOM API. + nsMargin bp = GetUsedBorderAndPadding(); + ApplySkipSides(bp); + const nsPoint point = aPoint - nsPoint(bp.left, bp.top); nsRect thisRect(nsPoint(0,0), GetSize()); - if (!thisRect.Contains(aPoint)) { + if (!thisRect.Contains(point)) { This can't be right, you're still using the size of the border-rect for your hit-test. Same goes for the other places.
Comment on attachment 374491 [details] [diff] [review] patch Patch needs to be updated per comment #4
Attachment #374491 -
Flags: review?(roc) → review-
Yes!
blocking2.0: ? → beta1+
Priority: -- → P2
Assignee | ||
Comment 9•14 years ago
|
||
jwatt, do you mind if I take this?
Assignee | ||
Comment 10•14 years ago
|
||
Attachment #444148 -
Flags: review?(roc)
Instead of calling GetUsedBorderAndPadding and ApplySkipSides, I advise you to just use GetContentRect - GetPosition. Otherwise looks good.
Assignee | ||
Comment 12•14 years ago
|
||
Attachment #444148 -
Attachment is obsolete: true
Attachment #444246 -
Flags: review?(roc)
Attachment #444148 -
Flags: review?(roc)
- nsRect thisRect(nsPoint(0,0), static_cast<nsSVGOuterSVGFrame*>(mFrame)->GetSize()); + nsRect thisRect(nsPoint(0,0), outerSVGFrame->GetSize()); if (!thisRect.Intersects(rectAtOrigin)) return; I'm not sure what this check is for, actually. Should we just take it out?
Assignee | ||
Comment 14•14 years ago
|
||
A check for the point being within the overall bounds for the outer svg element I guess. I guess that might not be valid in the case of overflow: visible but we have bug 378923 for that so how about leaving the code as it is and putting a note in bug 378923 to look more closely into this code as part of that bug. I might even take bug 378923 next.
Attachment #444246 -
Flags: review?(roc) → review+
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs landing]
Assignee: jwatt → longsonr
Comment 15•14 years ago
|
||
Pushed final patch on longsonr's behalf: http://hg.mozilla.org/mozilla-central/rev/fbca3a801c22
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Version: unspecified → Trunk
You need to log in
before you can comment on or make changes to this bug.
Description
•