Bug 62145 - Convert nodeAtPoint to IntPoint
Summary: Convert nodeAtPoint to IntPoint
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Emil A Eklund
URL:
Keywords:
Depends on: 62144
Blocks: 60318
  Show dependency treegraph
 
Reported: 2011-06-06 13:42 PDT by Emil A Eklund
Modified: 2011-06-07 20:12 PDT (History)
6 users (show)

See Also:


Attachments
Patch (61.30 KB, patch)
2011-06-06 16:56 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch (61.71 KB, patch)
2011-06-06 17:30 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch for landing (61.21 KB, patch)
2011-06-07 19:51 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emil A Eklund 2011-06-06 13:42:50 PDT
Ongoing tx, ty removal.
Comment 1 Emil A Eklund 2011-06-06 16:56:09 PDT
Created attachment 96153 [details]
Patch
Comment 2 WebKit Review Bot 2011-06-06 17:16:30 PDT
Comment on attachment 96153 [details]
Patch

Attachment 96153 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/8744012
Comment 3 Emil A Eklund 2011-06-06 17:30:04 PDT
Created attachment 96163 [details]
Patch
Comment 4 Eric Seidel (no email) 2011-06-06 17:33:17 PDT
Comment on attachment 96153 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=96153&action=review

The more I see of these, the less I like "accumulatedOffset".  I conveys about as much meaning as "addedInt".  I think we need a better name.  I am entertained that this patch had some (in my view) at least slightly better names for these values prior to this change.  r-, but only because of the red bots.

> Source/WebCore/rendering/svg/RenderSVGModelObject.h:70
> -    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction);
> +    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);

Again, more attempts by me to describe what I thought was going on as I wrote RenderSVGModelObject. :)

> Source/WebCore/rendering/svg/RenderSVGRoot.cpp:-442
> -    IntPoint pointInParent = pointInContainer - containerToParentOffset;

This was my understanding at the time, was that this offset was from the container (of whatever form that is) to our parent.  I actually kinda think containerToParentOffset is more descriptive than accumulatedOffset. :)  I wish we had dug up this code earlier.

We can always of course rename accumulatedOffset everywhere now that we're slowly understanding what this is all doing.
Comment 5 Emil A Eklund 2011-06-06 17:40:51 PDT
The name containerToParentOffset is much more descriptive than accumulatedOffset. How about I change it to containerToParentOffset in this patch and then go back and replace the existing uses of accumulatedOffset?
Comment 6 Eric Seidel (no email) 2011-06-06 17:42:05 PDT
I think you should run any naming by Simon since he's had opinions in the past.

But I'm OK with "containerToParentOffset" used in this or other places.
Comment 7 Eric Seidel (no email) 2011-06-06 17:42:26 PDT
Please let the EWSes have their say.
Comment 8 Emil A Eklund 2011-06-07 13:53:34 PDT
Simon, what's your take on this? Do you prefer accumulatedOffset, containerToParentOffset or something else entirely?
Comment 9 Simon Fraser (smfr) 2011-06-07 13:55:02 PDT
(In reply to comment #8)
> Simon, what's your take on this? Do you prefer accumulatedOffset, containerToParentOffset or something else entirely?

accumulatedOffset is more accurate than containerToParentOffset, but I'm not sure that 'accumulated' adds much.
Comment 10 Emil A Eklund 2011-06-07 13:58:18 PDT
> accumulatedOffset is more accurate than containerToParentOffset, but I'm not sure that 'accumulated' adds much.

True, naming is hard. Just calling it offset seems confusing though.
Comment 11 Eric Seidel (no email) 2011-06-07 14:48:47 PDT
(In reply to comment #9)
> (In reply to comment #8)
> > Simon, what's your take on this? Do you prefer accumulatedOffset, containerToParentOffset or something else entirely?
> 
> accumulatedOffset is more accurate than containerToParentOffset, but I'm not sure that 'accumulated' adds much.

containerToParentOffset is just describing what I thought the offset meant, when I wrote RenderSVGModelObject 2 years ago.

If we actually know what these offsets do... then we can name them better. :)  I still don't understand what they mean.
Comment 12 Emil A Eklund 2011-06-07 16:18:20 PDT
I plan to land this with accumulatedOffset. I'll change it here and elsewhere if and when we come up with a better name.
Comment 13 Emil A Eklund 2011-06-07 19:51:38 PDT
Created attachment 96364 [details]
Patch for landing
Comment 14 WebKit Review Bot 2011-06-07 20:12:21 PDT
Comment on attachment 96364 [details]
Patch for landing

Clearing flags on attachment: 96364

Committed r88319: <http://trac.webkit.org/changeset/88319>
Comment 15 WebKit Review Bot 2011-06-07 20:12:27 PDT
All reviewed patches have been landed.  Closing bug.