Closed Bug 888365 Opened 11 years ago Closed 11 years ago

Use CSSIntPoint for client/page coordinates in events

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch v1Splinter Review
      No description provided.
Attachment #769024 - Flags: review?(bugs)
This one makes me happy and sad. Happy because you did this, sad because I spent the last two days doing something very similar. I will upload my WIP so far.
Attachment #769024 - Flags: feedback?(bugmail.mozilla)
Attached patch My current WIP (obsolete) — Splinter Review
I started at the opposite end in the widget code and propagated from there. I'm not sure if all of this is correct. I'm more than happy to let Ms2ger's patch land first and rebase on top of that as it will make my patch much simpler.

I would still like feedback on my changes in nsIDOMTouchEvent.idl because the way nsIDOMTouch::mRefPoint was previously being used made very little sense to me.
Attachment #769087 - Flags: feedback?(wjohnston)
Attachment #769087 - Flags: feedback?(bugs)
Attachment #769024 - Flags: feedback?(bugmail.mozilla) → feedback+
Comment on attachment 769024 [details] [diff] [review]
Patch v1


>   // If there is some scrolling, add scroll info to client point.
>   if (aPresContext && aPresContext->GetPresShell()) {
>     nsIPresShell* shell = aPresContext->GetPresShell();
>     nsIScrollableFrame* scrollframe = shell->GetRootScrollFrameAsScrollable();
>     if (scrollframe) {
>-      nsPoint pt = scrollframe->GetScrollPosition();
>-      pagePoint += nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
>-                              nsPresContext::AppUnitsToIntCSSPixels(pt.y));
>+      pagePoint += CSSIntPoint::FromAppUnitsRounded(scrollframe->GetScrollPosition());
scrollframe->GetScrollPositionCSSPixels() ?
Attachment #769024 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #3)
> Comment on attachment 769024 [details] [diff] [review]
> Patch v1
> 
> 
> >   // If there is some scrolling, add scroll info to client point.
> >   if (aPresContext && aPresContext->GetPresShell()) {
> >     nsIPresShell* shell = aPresContext->GetPresShell();
> >     nsIScrollableFrame* scrollframe = shell->GetRootScrollFrameAsScrollable();
> >     if (scrollframe) {
> >-      nsPoint pt = scrollframe->GetScrollPosition();
> >-      pagePoint += nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
> >-                              nsPresContext::AppUnitsToIntCSSPixels(pt.y));
> >+      pagePoint += CSSIntPoint::FromAppUnitsRounded(scrollframe->GetScrollPosition());
> scrollframe->GetScrollPositionCSSPixels() ?

Makes sense, but GetScrollPositionCSSPixels currently returns nsIntPoint, so I'll do that in another bug.
Ms2ger, are you landing this?
Flags: needinfo?(Ms2ger)
Comment on attachment 769087 [details] [diff] [review]
My current WIP

I'm gonna obsolete this WIP. I have figured out some things since then and from talking to smaug on IRC and have a better idea of what needs to be done.
Attachment #769087 - Attachment is obsolete: true
Attachment #769087 - Flags: feedback?(wjohnston)
Attachment #769087 - Flags: feedback?(bugs)
https://hg.mozilla.org/mozilla-central/rev/2a2adc41af9b
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Flags: needinfo?(Ms2ger)
Are you working on the refpoint stuff?
Flags: needinfo?(bugmail.mozilla)
Not at the moment. If you want it you're welcome to have it.
Flags: needinfo?(bugmail.mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: