OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
36 #include "core/html/HTMLDivElement.h" | 36 #include "core/html/HTMLDivElement.h" |
37 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 class HTMLInputElement; | 41 class HTMLInputElement; |
42 class Event; | 42 class Event; |
43 class TouchEvent; | 43 class TouchEvent; |
| 44 class PointerEvent; |
44 | 45 |
45 class SliderThumbElement final : public HTMLDivElement { | 46 class SliderThumbElement final : public HTMLDivElement { |
46 public: | 47 public: |
47 static SliderThumbElement* create(Document&); | 48 static SliderThumbElement* create(Document&); |
48 | 49 |
49 void setPositionFromValue(); | 50 void setPositionFromValue(); |
50 | 51 |
51 void dragFrom(const LayoutPoint&); | 52 void dragFrom(const PointerEvent*); |
52 void defaultEventHandler(Event*) override; | 53 void defaultEventHandler(Event*) override; |
53 bool willRespondToMouseMoveEvents() override; | 54 bool willRespondToMouseMoveEvents() override; |
54 bool willRespondToMouseClickEvents() override; | 55 bool willRespondToMouseClickEvents() override; |
55 void detachLayoutTree(const AttachContext& = AttachContext()) override; | 56 void detachLayoutTree(const AttachContext& = AttachContext()) override; |
56 const AtomicString& shadowPseudoId() const override; | 57 const AtomicString& shadowPseudoId() const override; |
57 HTMLInputElement* hostInput() const; | 58 HTMLInputElement* hostInput() const; |
58 void setPositionFromPoint(const LayoutPoint&); | 59 void setPositionFromPoint(const LayoutPoint&); |
59 void stopDragging(); | 60 void releasePointerCapture(); |
60 | 61 |
61 private: | 62 private: |
62 SliderThumbElement(Document&); | 63 SliderThumbElement(Document&); |
63 LayoutObject* createLayoutObject(const ComputedStyle&) override; | 64 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
64 Element* cloneElementWithoutAttributesAndChildren() override; | 65 Element* cloneElementWithoutAttributesAndChildren() override; |
65 bool isDisabledFormControl() const override; | 66 bool isDisabledFormControl() const override; |
66 bool matchesReadOnlyPseudoClass() const override; | 67 bool matchesReadOnlyPseudoClass() const override; |
67 bool matchesReadWritePseudoClass() const override; | 68 bool matchesReadWritePseudoClass() const override; |
68 Node* focusDelegate() override; | 69 Node* focusDelegate() override; |
| 70 void requestPointerCapture(int pointerId); |
| 71 void stopDragging(); |
69 void startDragging(); | 72 void startDragging(); |
70 | 73 |
71 bool m_inDragMode; | 74 bool m_inDragMode; |
| 75 int m_requestedPointerIdToCapture; |
72 }; | 76 }; |
73 | 77 |
74 inline Element* SliderThumbElement::cloneElementWithoutAttributesAndChildren() { | 78 inline Element* SliderThumbElement::cloneElementWithoutAttributesAndChildren() { |
75 return create(document()); | 79 return create(document()); |
76 } | 80 } |
77 | 81 |
78 // FIXME: There are no ways to check if a node is a SliderThumbElement. | 82 // FIXME: There are no ways to check if a node is a SliderThumbElement. |
79 DEFINE_ELEMENT_TYPE_CASTS(SliderThumbElement, isHTMLElement()); | 83 DEFINE_ELEMENT_TYPE_CASTS(SliderThumbElement, isHTMLElement()); |
80 | 84 |
81 class SliderContainerElement final : public HTMLDivElement { | 85 class SliderContainerElement final : public HTMLDivElement { |
(...skipping 21 matching lines...) Expand all Loading... |
103 | 107 |
104 bool m_hasTouchEventHandler; | 108 bool m_hasTouchEventHandler; |
105 bool m_touchStarted; | 109 bool m_touchStarted; |
106 Direction m_slidingDirection; | 110 Direction m_slidingDirection; |
107 LayoutPoint m_startPoint; | 111 LayoutPoint m_startPoint; |
108 }; | 112 }; |
109 | 113 |
110 } // namespace blink | 114 } // namespace blink |
111 | 115 |
112 #endif | 116 #endif |
OLD | NEW |