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 14 matching lines...) Expand all Loading... |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/rendering/RenderObject.h" | 28 #include "core/rendering/RenderObject.h" |
29 | 29 |
30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
31 #include "RuntimeEnabledFeatures.h" | 31 #include "RuntimeEnabledFeatures.h" |
32 #include "core/accessibility/AXObjectCache.h" | 32 #include "core/accessibility/AXObjectCache.h" |
33 #include "core/animation/ActiveAnimations.h" | 33 #include "core/animation/ActiveAnimations.h" |
34 #include "core/css/resolver/StyleResolver.h" | 34 #include "core/css/resolver/StyleResolver.h" |
| 35 #include "core/dom/EventHandlerRegistry.h" |
35 #include "core/editing/EditingBoundary.h" | 36 #include "core/editing/EditingBoundary.h" |
36 #include "core/editing/FrameSelection.h" | 37 #include "core/editing/FrameSelection.h" |
37 #include "core/editing/htmlediting.h" | 38 #include "core/editing/htmlediting.h" |
38 #include "core/fetch/ResourceLoadPriorityOptimizer.h" | 39 #include "core/fetch/ResourceLoadPriorityOptimizer.h" |
39 #include "core/fetch/ResourceLoader.h" | 40 #include "core/fetch/ResourceLoader.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" |
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 | 2089 |
2089 // Elements with non-auto touch-action will send a SetTouchAction message | 2090 // Elements with non-auto touch-action will send a SetTouchAction message |
2090 // on touchstart in EventHandler::handleTouchEvent, and so effectively have | 2091 // on touchstart in EventHandler::handleTouchEvent, and so effectively have |
2091 // a touchstart handler that must be reported. | 2092 // a touchstart handler that must be reported. |
2092 // | 2093 // |
2093 // Since a CSS property cannot be applied directly to a text node, a | 2094 // Since a CSS property cannot be applied directly to a text node, a |
2094 // handler will have already been added for its parent so ignore it. | 2095 // handler will have already been added for its parent so ignore it. |
2095 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; | 2096 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; |
2096 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { | 2097 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { |
2097 if (newStyle.touchAction() != TouchActionAuto) | 2098 if (newStyle.touchAction() != TouchActionAuto) |
2098 document().didAddTouchEventHandler(node()); | 2099 EventHandlerRegistry::from(document())->didAddEventHandler(*node(),
EventHandlerRegistry::TouchEvent); |
2099 else | 2100 else |
2100 document().didRemoveTouchEventHandler(node()); | 2101 EventHandlerRegistry::from(document())->didRemoveEventHandler(*node(
), EventHandlerRegistry::TouchEvent); |
2101 } | 2102 } |
2102 } | 2103 } |
2103 | 2104 |
2104 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) | 2105 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) |
2105 { | 2106 { |
2106 ASSERT(a->cursors() != b->cursors()); | 2107 ASSERT(a->cursors() != b->cursors()); |
2107 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); | 2108 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); |
2108 } | 2109 } |
2109 | 2110 |
2110 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) | 2111 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 // this renderer had no parent at the time remove() was called. | 2620 // this renderer had no parent at the time remove() was called. |
2620 | 2621 |
2621 if (hasCounterNodeMap()) | 2622 if (hasCounterNodeMap()) |
2622 RenderCounter::destroyCounterNodes(*this); | 2623 RenderCounter::destroyCounterNodes(*this); |
2623 | 2624 |
2624 // Remove the handler if node had touch-action set. Don't call when | 2625 // Remove the handler if node had touch-action set. Don't call when |
2625 // document is being destroyed as all handlers will have been cleared | 2626 // document is being destroyed as all handlers will have been cleared |
2626 // previously. Handlers are not added for text nodes so don't try removing | 2627 // previously. Handlers are not added for text nodes so don't try removing |
2627 // for one too. Need to check if m_style is null in cases of partial constru
ction. | 2628 // for one too. Need to check if m_style is null in cases of partial constru
ction. |
2628 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style
&& m_style->touchAction() != TouchActionAuto) | 2629 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style
&& m_style->touchAction() != TouchActionAuto) |
2629 document().didRemoveTouchEventHandler(node()); | 2630 EventHandlerRegistry::from(document())->didRemoveEventHandler(*node(), E
ventHandlerRegistry::TouchEvent); |
2630 | 2631 |
2631 setAncestorLineBoxDirty(false); | 2632 setAncestorLineBoxDirty(false); |
2632 | 2633 |
2633 clearLayoutRootIfNeeded(); | 2634 clearLayoutRootIfNeeded(); |
2634 } | 2635 } |
2635 | 2636 |
2636 void RenderObject::insertedIntoTree() | 2637 void RenderObject::insertedIntoTree() |
2637 { | 2638 { |
2638 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. | 2639 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. |
2639 | 2640 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3368 { | 3369 { |
3369 if (object1) { | 3370 if (object1) { |
3370 const WebCore::RenderObject* root = object1; | 3371 const WebCore::RenderObject* root = object1; |
3371 while (root->parent()) | 3372 while (root->parent()) |
3372 root = root->parent(); | 3373 root = root->parent(); |
3373 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3374 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3374 } | 3375 } |
3375 } | 3376 } |
3376 | 3377 |
3377 #endif | 3378 #endif |
OLD | NEW |