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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: add cstdlib Created 3 years, 7 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #include "core/page/Page.h" 78 #include "core/page/Page.h"
79 #include "core/paint/ObjectPaintInvalidator.h" 79 #include "core/paint/ObjectPaintInvalidator.h"
80 #include "core/paint/PaintLayer.h" 80 #include "core/paint/PaintLayer.h"
81 #include "core/paint/RarePaintData.h" 81 #include "core/paint/RarePaintData.h"
82 #include "core/style/ContentData.h" 82 #include "core/style/ContentData.h"
83 #include "core/style/CursorData.h" 83 #include "core/style/CursorData.h"
84 #include "platform/InstanceCounters.h" 84 #include "platform/InstanceCounters.h"
85 #include "platform/RuntimeEnabledFeatures.h" 85 #include "platform/RuntimeEnabledFeatures.h"
86 #include "platform/geometry/TransformState.h" 86 #include "platform/geometry/TransformState.h"
87 #include "platform/graphics/GraphicsLayer.h" 87 #include "platform/graphics/GraphicsLayer.h"
88 #include "platform/graphics/TouchAction.h"
88 #include "platform/graphics/paint/PropertyTreeState.h" 89 #include "platform/graphics/paint/PropertyTreeState.h"
89 #include "platform/instrumentation/tracing/TracedValue.h" 90 #include "platform/instrumentation/tracing/TracedValue.h"
90 #include "platform/wtf/allocator/Partitions.h" 91 #include "platform/wtf/allocator/Partitions.h"
91 #include "platform/wtf/text/StringBuilder.h" 92 #include "platform/wtf/text/StringBuilder.h"
92 #include "platform/wtf/text/WTFString.h" 93 #include "platform/wtf/text/WTFString.h"
93 #ifndef NDEBUG 94 #ifndef NDEBUG
94 #include <stdio.h> 95 #include <stdio.h>
95 #endif 96 #endif
96 97
97 namespace blink { 98 namespace blink {
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 } 1811 }
1811 1812
1812 // Elements with non-auto touch-action will send a SetTouchAction message 1813 // Elements with non-auto touch-action will send a SetTouchAction message
1813 // on touchstart in EventHandler::handleTouchEvent, and so effectively have 1814 // on touchstart in EventHandler::handleTouchEvent, and so effectively have
1814 // a touchstart handler that must be reported. 1815 // a touchstart handler that must be reported.
1815 // 1816 //
1816 // Since a CSS property cannot be applied directly to a text node, a 1817 // Since a CSS property cannot be applied directly to a text node, a
1817 // handler will have already been added for its parent so ignore it. 1818 // handler will have already been added for its parent so ignore it.
1818 // TODO: Remove this blocking event handler; crbug.com/318381 1819 // TODO: Remove this blocking event handler; crbug.com/318381
1819 TouchAction old_touch_action = 1820 TouchAction old_touch_action =
1820 style_ ? style_->GetTouchAction() : kTouchActionAuto; 1821 style_ ? style_->GetTouchAction() : TouchAction::kTouchActionAuto;
1821 if (GetNode() && !GetNode()->IsTextNode() && 1822 if (GetNode() && !GetNode()->IsTextNode() &&
1822 (old_touch_action == kTouchActionAuto) != 1823 (old_touch_action == TouchAction::kTouchActionAuto) !=
1823 (new_style.GetTouchAction() == kTouchActionAuto)) { 1824 (new_style.GetTouchAction() == TouchAction::kTouchActionAuto)) {
1824 EventHandlerRegistry& registry = 1825 EventHandlerRegistry& registry =
1825 GetDocument().GetPage()->GetEventHandlerRegistry(); 1826 GetDocument().GetPage()->GetEventHandlerRegistry();
1826 if (new_style.GetTouchAction() != kTouchActionAuto) 1827 if (new_style.GetTouchAction() != TouchAction::kTouchActionAuto)
1827 registry.DidAddEventHandler( 1828 registry.DidAddEventHandler(
1828 *GetNode(), EventHandlerRegistry::kTouchStartOrMoveEventBlocking); 1829 *GetNode(), EventHandlerRegistry::kTouchStartOrMoveEventBlocking);
1829 else 1830 else
1830 registry.DidRemoveEventHandler( 1831 registry.DidRemoveEventHandler(
1831 *GetNode(), EventHandlerRegistry::kTouchStartOrMoveEventBlocking); 1832 *GetNode(), EventHandlerRegistry::kTouchStartOrMoveEventBlocking);
1832 } 1833 }
1833 } 1834 }
1834 1835
1835 void LayoutObject::ClearBaseComputedStyle() { 1836 void LayoutObject::ClearBaseComputedStyle() {
1836 if (!GetNode()) 1837 if (!GetNode())
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 // case when this layoutObject had no parent at the time remove() was called. 2639 // case when this layoutObject had no parent at the time remove() was called.
2639 2640
2640 if (HasCounterNodeMap()) 2641 if (HasCounterNodeMap())
2641 LayoutCounter::DestroyCounterNodes(*this); 2642 LayoutCounter::DestroyCounterNodes(*this);
2642 2643
2643 // Remove the handler if node had touch-action set. Handlers are not added 2644 // Remove the handler if node had touch-action set. Handlers are not added
2644 // for text nodes so don't try removing for one too. Need to check if 2645 // for text nodes so don't try removing for one too. Need to check if
2645 // m_style is null in cases of partial construction. Any handler we added 2646 // m_style is null in cases of partial construction. Any handler we added
2646 // previously may have already been removed by the Document independently. 2647 // previously may have already been removed by the Document independently.
2647 if (GetNode() && !GetNode()->IsTextNode() && style_ && 2648 if (GetNode() && !GetNode()->IsTextNode() && style_ &&
2648 style_->GetTouchAction() != kTouchActionAuto) { 2649 style_->GetTouchAction() != TouchAction::kTouchActionAuto) {
2649 EventHandlerRegistry& registry = 2650 EventHandlerRegistry& registry =
2650 GetDocument().GetPage()->GetEventHandlerRegistry(); 2651 GetDocument().GetPage()->GetEventHandlerRegistry();
2651 if (registry 2652 if (registry
2652 .EventHandlerTargets( 2653 .EventHandlerTargets(
2653 EventHandlerRegistry::kTouchStartOrMoveEventBlocking) 2654 EventHandlerRegistry::kTouchStartOrMoveEventBlocking)
2654 ->Contains(GetNode())) 2655 ->Contains(GetNode()))
2655 registry.DidRemoveEventHandler( 2656 registry.DidRemoveEventHandler(
2656 *GetNode(), EventHandlerRegistry::kTouchStartOrMoveEventBlocking); 2657 *GetNode(), EventHandlerRegistry::kTouchStartOrMoveEventBlocking);
2657 } 2658 }
2658 2659
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
3645 const blink::LayoutObject* root = object1; 3646 const blink::LayoutObject* root = object1;
3646 while (root->Parent()) 3647 while (root->Parent())
3647 root = root->Parent(); 3648 root = root->Parent();
3648 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); 3649 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0);
3649 } else { 3650 } else {
3650 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3651 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3651 } 3652 }
3652 } 3653 }
3653 3654
3654 #endif 3655 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/TouchEventManager.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698