Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: Source/core/dom/Document.cpp

Issue 298133003: Expose fractional TouchEvent coordinates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make layout test output stable across platforms Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5204 matching lines...) Expand 10 before | Expand all | Expand 10 after
5215 m_scriptedAnimationController->cancelCallback(id); 5215 m_scriptedAnimationController->cancelCallback(id);
5216 } 5216 }
5217 5217
5218 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) 5218 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime)
5219 { 5219 {
5220 if (!m_scriptedAnimationController) 5220 if (!m_scriptedAnimationController)
5221 return; 5221 return;
5222 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS tartTime); 5222 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS tartTime);
5223 } 5223 }
5224 5224
5225 PassRefPtrWillBeRawPtr<Touch> Document::createTouch(DOMWindow* window, EventTarg et* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force) const 5225 PassRefPtrWillBeRawPtr<Touch> Document::createTouch(DOMWindow* window, EventTarg et* target, int identifier, double pageX, double pageY, double screenX, double s creenY, double radiusX, double radiusY, float rotationAngle, float force) const
5226 { 5226 {
5227 // Match behavior from when these types were integers, and avoid surprises f rom someone explicitly
5228 // passing Infinity/NaN.
5229 if (!std::isfinite(pageX))
5230 pageX = 0;
5231 if (!std::isfinite(pageY))
5232 pageY = 0;
5233 if (!std::isfinite(screenX))
5234 screenX = 0;
5235 if (!std::isfinite(screenY))
5236 screenY = 0;
5237 if (!std::isfinite(radiusX))
5238 radiusX = 0;
5239 if (!std::isfinite(radiusY))
5240 radiusY = 0;
5241 if (!std::isfinite(rotationAngle))
5242 rotationAngle = 0;
5243 if (!std::isfinite(force))
5244 force = 0;
5245
5227 // FIXME: It's not clear from the documentation at 5246 // FIXME: It's not clear from the documentation at
5228 // http://developer.apple.com/library/safari/#documentation/UserExperience/R eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html 5247 // http://developer.apple.com/library/safari/#documentation/UserExperience/R eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
5229 // when this method should throw and nor is it by inspection of iOS behavior . It would be nice to verify any cases where it throws under iOS 5248 // when this method should throw and nor is it by inspection of iOS behavior . It would be nice to verify any cases where it throws under iOS
5230 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781 9 5249 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781 9
5231 LocalFrame* frame = window ? window->frame() : this->frame(); 5250 LocalFrame* frame = window ? window->frame() : this->frame();
5232 return Touch::create(frame, target, identifier, screenX, screenY, pageX, pag eY, radiusX, radiusY, rotationAngle, force); 5251 return Touch::create(frame, target, identifier, FloatPoint(screenX, screenY) , FloatPoint(pageX, pageY), FloatSize(radiusX, radiusY), rotationAngle, force);
5233 } 5252 }
5234 5253
5235 PassRefPtrWillBeRawPtr<TouchList> Document::createTouchList(WillBeHeapVector<Ref PtrWillBeMember<Touch> >& touches) const 5254 PassRefPtrWillBeRawPtr<TouchList> Document::createTouchList(WillBeHeapVector<Ref PtrWillBeMember<Touch> >& touches) const
5236 { 5255 {
5237 return TouchList::create(touches); 5256 return TouchList::create(touches);
5238 } 5257 }
5239 5258
5240 void Document::didAddTouchEventHandler(Node* handler) 5259 void Document::didAddTouchEventHandler(Node* handler)
5241 { 5260 {
5242 // The node should either be in this document, or be the Document node of a child 5261 // The node should either be in this document, or be the Document node of a child
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
5812 visitor->trace(m_compositorPendingAnimations); 5831 visitor->trace(m_compositorPendingAnimations);
5813 visitor->trace(m_contextDocument); 5832 visitor->trace(m_contextDocument);
5814 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5833 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5815 DocumentSupplementable::trace(visitor); 5834 DocumentSupplementable::trace(visitor);
5816 TreeScope::trace(visitor); 5835 TreeScope::trace(visitor);
5817 ContainerNode::trace(visitor); 5836 ContainerNode::trace(visitor);
5818 ExecutionContext::trace(visitor); 5837 ExecutionContext::trace(visitor);
5819 } 5838 }
5820 5839
5821 } // namespace WebCore 5840 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698