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

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

Issue 750013004: Added experimental tilt and tiltDirection to the Touch interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added basic layout-tests for tilt, tiltDirection Created 5 years, 10 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
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 5109 matching lines...) Expand 10 before | Expand all | Expand 10 after
5120 m_scriptedAnimationController->cancelCallback(id); 5120 m_scriptedAnimationController->cancelCallback(id);
5121 } 5121 }
5122 5122
5123 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) 5123 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime)
5124 { 5124 {
5125 if (!m_scriptedAnimationController) 5125 if (!m_scriptedAnimationController)
5126 return; 5126 return;
5127 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS tartTime); 5127 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS tartTime);
5128 } 5128 }
5129 5129
5130 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 5130 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, float tilt, float tiltDirection) const
5131 { 5131 {
5132 // Match behavior from when these types were integers, and avoid surprises f rom someone explicitly 5132 // Match behavior from when these types were integers, and avoid surprises f rom someone explicitly
5133 // passing Infinity/NaN. 5133 // passing Infinity/NaN.
5134 if (!std::isfinite(pageX)) 5134 if (!std::isfinite(pageX))
5135 pageX = 0; 5135 pageX = 0;
5136 if (!std::isfinite(pageY)) 5136 if (!std::isfinite(pageY))
5137 pageY = 0; 5137 pageY = 0;
5138 if (!std::isfinite(screenX)) 5138 if (!std::isfinite(screenX))
5139 screenX = 0; 5139 screenX = 0;
5140 if (!std::isfinite(screenY)) 5140 if (!std::isfinite(screenY))
5141 screenY = 0; 5141 screenY = 0;
5142 if (!std::isfinite(radiusX)) 5142 if (!std::isfinite(radiusX))
5143 radiusX = 0; 5143 radiusX = 0;
5144 if (!std::isfinite(radiusY)) 5144 if (!std::isfinite(radiusY))
5145 radiusY = 0; 5145 radiusY = 0;
5146 if (!std::isfinite(rotationAngle)) 5146 if (!std::isfinite(rotationAngle))
5147 rotationAngle = 0; 5147 rotationAngle = 0;
5148 if (!std::isfinite(force)) 5148 if (!std::isfinite(force))
5149 force = 0; 5149 force = 0;
5150 if (!std::isfinite(tilt))
5151 tilt = 0;
Rick Byers 2015/02/13 08:48:05 you wanted to preserve NaN, right? This adjusting
d.pikalov 2015/02/13 13:31:17 Right. I have new patchset, with NaN support (I'll
5152 if (!std::isfinite(tiltDirection))
5153 tiltDirection = 0;
5150 5154
5151 // FIXME: It's not clear from the documentation at 5155 // FIXME: It's not clear from the documentation at
5152 // http://developer.apple.com/library/safari/#documentation/UserExperience/R eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html 5156 // http://developer.apple.com/library/safari/#documentation/UserExperience/R eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
5153 // 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 5157 // 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
5154 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781 9 5158 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781 9
5155 LocalFrame* frame = window && window->isLocalDOMWindow() ? toLocalDOMWindow( window)->frame() : this->frame(); 5159 LocalFrame* frame = window && window->isLocalDOMWindow() ? toLocalDOMWindow( window)->frame() : this->frame();
5156 return Touch::create(frame, target, identifier, FloatPoint(screenX, screenY) , FloatPoint(pageX, pageY), FloatSize(radiusX, radiusY), rotationAngle, force); 5160 return Touch::create(frame, target, identifier, FloatPoint(screenX, screenY) , FloatPoint(pageX, pageY), FloatSize(radiusX, radiusY), rotationAngle, force, t ilt, tiltDirection);
5157 } 5161 }
5158 5162
5159 PassRefPtrWillBeRawPtr<TouchList> Document::createTouchList(WillBeHeapVector<Ref PtrWillBeMember<Touch>>& touches) const 5163 PassRefPtrWillBeRawPtr<TouchList> Document::createTouchList(WillBeHeapVector<Ref PtrWillBeMember<Touch>>& touches) const
5160 { 5164 {
5161 return TouchList::adopt(touches); 5165 return TouchList::adopt(touches);
5162 } 5166 }
5163 5167
5164 DocumentLoader* Document::loader() const 5168 DocumentLoader* Document::loader() const
5165 { 5169 {
5166 if (!m_frame) 5170 if (!m_frame)
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
5773 #ifndef NDEBUG 5777 #ifndef NDEBUG
5774 using namespace blink; 5778 using namespace blink;
5775 void showLiveDocumentInstances() 5779 void showLiveDocumentInstances()
5776 { 5780 {
5777 WeakDocumentSet& set = liveDocumentSet(); 5781 WeakDocumentSet& set = liveDocumentSet();
5778 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5782 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5779 for (Document* document : set) 5783 for (Document* document : set)
5780 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5784 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5781 } 5785 }
5782 #endif 5786 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698