OLD | NEW |
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. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
31 #include "core/accessibility/AXObjectCache.h" | 31 #include "core/accessibility/AXObjectCache.h" |
32 #include "core/css/resolver/StyleResolver.h" | 32 #include "core/css/resolver/StyleResolver.h" |
33 #include "core/dom/ElementTraversal.h" | 33 #include "core/dom/ElementTraversal.h" |
34 #include "core/dom/shadow/ShadowRoot.h" | 34 #include "core/dom/shadow/ShadowRoot.h" |
35 #include "core/editing/EditingBoundary.h" | 35 #include "core/editing/EditingBoundary.h" |
36 #include "core/editing/FrameSelection.h" | 36 #include "core/editing/FrameSelection.h" |
37 #include "core/editing/htmlediting.h" | 37 #include "core/editing/htmlediting.h" |
38 #include "core/fetch/ResourceLoadPriorityOptimizer.h" | 38 #include "core/fetch/ResourceLoadPriorityOptimizer.h" |
39 #include "core/fetch/ResourceLoader.h" | 39 #include "core/fetch/ResourceLoader.h" |
| 40 #include "core/frame/EventHandlerRegistry.h" |
40 #include "core/frame/FrameView.h" | 41 #include "core/frame/FrameView.h" |
41 #include "core/frame/LocalFrame.h" | 42 #include "core/frame/LocalFrame.h" |
42 #include "core/html/HTMLAnchorElement.h" | 43 #include "core/html/HTMLAnchorElement.h" |
43 #include "core/html/HTMLElement.h" | 44 #include "core/html/HTMLElement.h" |
44 #include "core/html/HTMLHtmlElement.h" | 45 #include "core/html/HTMLHtmlElement.h" |
45 #include "core/html/HTMLTableCellElement.h" | 46 #include "core/html/HTMLTableCellElement.h" |
46 #include "core/html/HTMLTableElement.h" | 47 #include "core/html/HTMLTableElement.h" |
47 #include "core/page/AutoscrollController.h" | 48 #include "core/page/AutoscrollController.h" |
48 #include "core/page/EventHandler.h" | 49 #include "core/page/EventHandler.h" |
49 #include "core/page/Page.h" | 50 #include "core/page/Page.h" |
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 } | 2147 } |
2147 | 2148 |
2148 // Elements with non-auto touch-action will send a SetTouchAction message | 2149 // Elements with non-auto touch-action will send a SetTouchAction message |
2149 // on touchstart in EventHandler::handleTouchEvent, and so effectively have | 2150 // on touchstart in EventHandler::handleTouchEvent, and so effectively have |
2150 // a touchstart handler that must be reported. | 2151 // a touchstart handler that must be reported. |
2151 // | 2152 // |
2152 // Since a CSS property cannot be applied directly to a text node, a | 2153 // Since a CSS property cannot be applied directly to a text node, a |
2153 // handler will have already been added for its parent so ignore it. | 2154 // handler will have already been added for its parent so ignore it. |
2154 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; | 2155 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; |
2155 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { | 2156 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { |
| 2157 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); |
2156 if (newStyle.touchAction() != TouchActionAuto) | 2158 if (newStyle.touchAction() != TouchActionAuto) |
2157 document().didAddTouchEventHandler(node()); | 2159 registry.didAddEventHandler(*node(), EventHandlerRegistry::TouchEven
t); |
2158 else | 2160 else |
2159 document().didRemoveTouchEventHandler(node()); | 2161 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
vent); |
2160 } | 2162 } |
2161 } | 2163 } |
2162 | 2164 |
2163 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) | 2165 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) |
2164 { | 2166 { |
2165 ASSERT(a->cursors() != b->cursors()); | 2167 ASSERT(a->cursors() != b->cursors()); |
2166 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); | 2168 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); |
2167 } | 2169 } |
2168 | 2170 |
2169 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) | 2171 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2667 // this renderer had no parent at the time remove() was called. | 2669 // this renderer had no parent at the time remove() was called. |
2668 | 2670 |
2669 if (hasCounterNodeMap()) | 2671 if (hasCounterNodeMap()) |
2670 RenderCounter::destroyCounterNodes(*this); | 2672 RenderCounter::destroyCounterNodes(*this); |
2671 | 2673 |
2672 // Remove the handler if node had touch-action set. Don't call when | 2674 // Remove the handler if node had touch-action set. Don't call when |
2673 // document is being destroyed as all handlers will have been cleared | 2675 // document is being destroyed as all handlers will have been cleared |
2674 // previously. Handlers are not added for text nodes so don't try removing | 2676 // previously. Handlers are not added for text nodes so don't try removing |
2675 // for one too. Need to check if m_style is null in cases of partial constru
ction. | 2677 // for one too. Need to check if m_style is null in cases of partial constru
ction. |
2676 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style
&& m_style->touchAction() != TouchActionAuto) | 2678 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style
&& m_style->touchAction() != TouchActionAuto) |
2677 document().didRemoveTouchEventHandler(node()); | 2679 document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*no
de(), EventHandlerRegistry::TouchEvent); |
2678 | 2680 |
2679 setAncestorLineBoxDirty(false); | 2681 setAncestorLineBoxDirty(false); |
2680 | 2682 |
2681 clearLayoutRootIfNeeded(); | 2683 clearLayoutRootIfNeeded(); |
2682 } | 2684 } |
2683 | 2685 |
2684 void RenderObject::insertedIntoTree() | 2686 void RenderObject::insertedIntoTree() |
2685 { | 2687 { |
2686 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. | 2688 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. |
2687 | 2689 |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3431 { | 3433 { |
3432 if (object1) { | 3434 if (object1) { |
3433 const WebCore::RenderObject* root = object1; | 3435 const WebCore::RenderObject* root = object1; |
3434 while (root->parent()) | 3436 while (root->parent()) |
3435 root = root->parent(); | 3437 root = root->parent(); |
3436 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3438 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3437 } | 3439 } |
3438 } | 3440 } |
3439 | 3441 |
3440 #endif | 3442 #endif |
OLD | NEW |