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

Side by Side Diff: third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h

Issue 2251303003: Implement position: sticky updates on compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and add unit test for impl side sticky position update. Created 4 years, 3 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef DeviceRotationRate_h 26 #ifndef WebLayerStickyPositionConstraint_h
27 #define DeviceRotationRate_h 27 #define WebLayerStickyPositionConstraint_h
28
29 #include "bindings/core/v8/ScriptWrappable.h"
30 #include "modules/device_orientation/DeviceMotionData.h"
31 #include "platform/heap/Handle.h"
32 28
33 namespace blink { 29 namespace blink {
34 30
35 class DeviceRotationRate final : public GarbageCollected<DeviceRotationRate>, pu blic ScriptWrappable { 31 // TODO(flackr): Combine with WebLayerPositionConstraint.
36 DEFINE_WRAPPERTYPEINFO(); 32 struct WebLayerStickyPositionConstraint {
37 public: 33 bool isSticky : 1;
38 static DeviceRotationRate* create(DeviceMotionData::RotationRate* rotationRa te) 34 bool isAnchoredLeft : 1;
35 bool isAnchoredRight : 1;
36 bool isAnchoredTop : 1;
37 bool isAnchoredBottom : 1;
38 float leftOffset;
39 float rightOffset;
40 float topOffset;
41 float bottomOffset;
42 WebRect absoluteStickyBoxRect;
43 WebRect absoluteContainingBlockRect;
44 WebLayerStickyPositionConstraint()
45 : isSticky(false)
46 , isAnchoredLeft(false)
47 , isAnchoredRight(false)
48 , isAnchoredTop(false)
49 , isAnchoredBottom(false)
50 , leftOffset(0.f)
51 , rightOffset(0.f)
52 , topOffset(0.f)
53 , bottomOffset(0.f)
39 { 54 {
40 return new DeviceRotationRate(rotationRate);
41 } 55 }
42 DECLARE_TRACE();
43
44 double alpha(bool& isNull) const;
45 double beta(bool& isNull) const;
46 double gamma(bool& isNull) const;
47
48 private:
49 explicit DeviceRotationRate(DeviceMotionData::RotationRate*);
50
51 Member<DeviceMotionData::RotationRate> m_rotationRate;
52 }; 56 };
53 57
54 } // namespace blink 58 } // namespace blink
55 59
56 #endif // DeviceRotationRate_h 60 #endif // WebLayerStickyPositionConstraint_h
61
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698