5.65 KB, image/svg+xml
97.23 KB, patch
|Details | Diff | Splinter Review|
602 bytes, image/svg+xml
75.87 KB, application/octet-stream
Implementing the SVGScroll and SVGZoom events is essential for scale invariant features, such as the controls, label text and tacks in google maps for example. I think it's important we implement this for Firefox 1.5.
Created attachment 190469 [details] [diff] [review] snapshot Here's a snapshot of what I've got so far. Hopefully it's fairly close, but event handlers don't get called for some reason.
Created attachment 190581 [details] [diff] [review] updated snapshot Here's an updated snapshot. The new events are now being dispatched correctly and they're reaching the handlers. I've still got to figure out how to implement the 'onzoom' and 'onscroll' attributes though. This is tricky because the event attribute names don't match up with the names of the events (i.e. 'SVGZoom' and 'SVGScroll').
Attachment #190469 - Attachment is obsolete: true
Created attachment 190704 [details] [diff] [review] snapshot - 'onzoom' and 'onscroll' attributes now work
Attachment #190581 - Attachment is obsolete: true
Appart from the reasons I gave in comment 0, I think it's important to fix this now because we don't want things like svgDocEl.addEventListener('load', loadHandler, false); to be what works in Firefox 1.5, but then svgDocEl.addEventListener('SVGLoad', loadHandler, false); to be what works in later releases.
Status: NEW → ASSIGNED
Created attachment 191536 [details] [diff] [review] latest patch
Attachment #190704 - Attachment is obsolete: true
Created attachment 192076 [details] [diff] [review] patch for dispatching SVGLoad, SVGScroll and SVGZoom Links to the relevant parts of the spec are given below. Look at these points and below. http://www.w3.org/TR/SVG/script.html#InterfaceSVGEvent http://www.w3.org/TR/SVG/interact.html#LoadEvent http://www.w3.org/TR/SVG/interact.html#EnableZoomAndPanControls
(In reply to comment #6) > Created an attachment (id=192076)  > patch for dispatching SVGLoad, SVGScroll and SVGZoom nsDOMSVGZoomEvent::GetZoomRectScreen should be "implemented" with NS_NOTYETIMPLEMENTED and NS_ERROR_NOT_IMPLEMENTED. In nsSVGSVGElement, I'd like to see CurrentScale and CurrentTranslate use the same mechanism for recording the current translation/scale. The method you're using for scale now is clearly commented, but I don't think it saves enough to make it worthwhile. Pan/zoom will often change both scale and translate at once, which will send multiple events with the current path.
Created attachment 192194 [details] [diff] [review] patch to address tor's comments This patch adds two methods to nsISVGSVGElement to allow zoom and pan controls to modify currentScale *and* currentTranslate in a way that will only dispatch one DOM event.
Created attachment 192314 [details] [diff] [review] patch updated to address off-bug comments
Created attachment 192385 [details] [diff] [review] now initialising mZooming
Comment on attachment 192385 [details] [diff] [review] now initialising mZooming >--- mozilla/content/svg/content/src/nsSVGSVGElement.cpp 19 Feb 2005 10:31:24 -0000 1.50 >+++ mozilla/content/svg/content/src/nsSVGSVGElement.cpp 11 Aug 2005 15:50:32 -0000 >+ NS_IMETHOD_(float) GetPreviousTranslate_x(); >+ NS_IMETHOD_(float) GetPreviousTranslate_y(); >+ float mPreviousTranslate_x; >+ float mPreviousTranslate_y; These don't really follow the mozilla naming convention. Rest looks ok, though why the w3c called the currentTranslate event "SVGScroll" is a bit of a mystery.
Attachment #192385 - Flags: review?(tor) → review+
Comment on attachment 192385 [details] [diff] [review] now initialising mZooming sr=jst
Attachment #192385 - Flags: superreview?(jst) → superreview+
Attachment #192385 - Flags: approval1.8b4?
Created attachment 193945 [details] another testcase you will need the zoom and pan extension installed to test this...
from a first look at this, i'd say this works perfect, but i will do more extensive testing. great job jonathan, thanks a lot.
Please land this on the trunk and after it's verified we'll evaluate for branch inclusion.
Asa, I already landed on the trunk on 2005-08-25 14:31 PST as per shaver's request. We've requested testing of the trunk nightlies via tor's blog.
If it's fixed on trunk it should be marked fixed (and get the fixed1.8 keyword when it's fixed on branch).
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Anyone want to verify this is fixed on the trunk so we can land it on the branch?
Attached test case does not show text.
Comment on attachment 194275 [details] textPath test Hi Bruce. Thanks for the report, and especially for such a small testcase! Little testcases like that help a lot. Unfortunately you've attached to the wrong bug. Can you attach your testcase to https://bugzilla.mozilla.org/show_bug.cgi?id=282579 please?
Attachment #194275 - Attachment is obsolete: true
verifying fix, one thing though, in comment #9 you say there is a method to change currentTranslate and currentScale so the changes fire only one event. what is this method, how do i use it ? beside that it works great, i would say land it ASAP.
Holger, can you select "Mark bug as VERIFIED" to properly set the bug status. Unfortunately the method you mention is only available to internal code. Your extension can't use it I'm afraid.
unfortunatly, it seems i cant change the status of a bug, sorry.
Comment on attachment 192385 [details] [diff] [review] now initialising mZooming approved. holger, I updated your account to be able to resolve bugs.
Attachment #192385 - Flags: approval1.8b4? → approval1.8b4+
checked into trunk
err, I mean branch
Created attachment 194950 [details] Test Result: Zoom and Pan When zooming in repeatedly (more than 10 times), the svg rendered becomes bizarre. When zooming out, after about 6th time, memory is guzzled up, after 10th time, Browser stops responding. I would recommend having a maximum number of zoom ins and zoom outs. Johanne
Hi Johanne. :-) Oops, I just remembered I forgot to reply to your email. (I'll get to that next.) Regarding your suggestion, you're quite right. I found the same problem when messing with http://jwatt.org/svg/tests/zoom-and-pan-controls.svg I've opened bug 308734 for this issue.
Hello :) So I thought I would give a little debriefing on what I am currently implementing. As of right now I am implementing the zoomEventListener as well implementing controls and events to do native zooming and panning. I thought I would either implement a new listener for these events or use the current svg events listener. In my point of view a seperate listener would be better :) any suggestions are welcome.
Hi Hardeep. This bug was closed, fixed, about 3 years ago. Can you open a new bug report and start over there? I only pointed you to this bug since I thought you might find in useful to review the comments and patches here. Sorry if that wasn't clear.
You need to log in before you can comment on or make changes to this bug.