| 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 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 | 2096 |
| 2096 // Elements with non-auto touch-action will send a SetTouchAction message | 2097 // Elements with non-auto touch-action will send a SetTouchAction message |
| 2097 // on touchstart in EventHandler::handleTouchEvent, and so effectively have | 2098 // on touchstart in EventHandler::handleTouchEvent, and so effectively have |
| 2098 // a touchstart handler that must be reported. | 2099 // a touchstart handler that must be reported. |
| 2099 // | 2100 // |
| 2100 // Since a CSS property cannot be applied directly to a text node, a | 2101 // Since a CSS property cannot be applied directly to a text node, a |
| 2101 // handler will have already been added for its parent so ignore it. | 2102 // handler will have already been added for its parent so ignore it. |
| 2102 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; | 2103 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; |
| 2103 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { | 2104 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { |
| 2104 if (newStyle.touchAction() != TouchActionAuto) | 2105 if (newStyle.touchAction() != TouchActionAuto) |
| 2105 document().didAddTouchEventHandler(node()); | 2106 EventHandlerRegistry::from(document())->didAddEventHandler(*node(),
EventHandlerRegistry::TouchEvent); |
| 2106 else | 2107 else |
| 2107 document().didRemoveTouchEventHandler(node()); | 2108 EventHandlerRegistry::from(document())->didRemoveEventHandler(*node(
), EventHandlerRegistry::TouchEvent); |
| 2108 } | 2109 } |
| 2109 } | 2110 } |
| 2110 | 2111 |
| 2111 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) | 2112 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderSt
yle* b) |
| 2112 { | 2113 { |
| 2113 ASSERT(a->cursors() != b->cursors()); | 2114 ASSERT(a->cursors() != b->cursors()); |
| 2114 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); | 2115 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); |
| 2115 } | 2116 } |
| 2116 | 2117 |
| 2117 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) | 2118 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b) |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 // this renderer had no parent at the time remove() was called. | 2627 // this renderer had no parent at the time remove() was called. |
| 2627 | 2628 |
| 2628 if (hasCounterNodeMap()) | 2629 if (hasCounterNodeMap()) |
| 2629 RenderCounter::destroyCounterNodes(*this); | 2630 RenderCounter::destroyCounterNodes(*this); |
| 2630 | 2631 |
| 2631 // Remove the handler if node had touch-action set. Don't call when | 2632 // Remove the handler if node had touch-action set. Don't call when |
| 2632 // document is being destroyed as all handlers will have been cleared | 2633 // document is being destroyed as all handlers will have been cleared |
| 2633 // previously. Handlers are not added for text nodes so don't try removing | 2634 // previously. Handlers are not added for text nodes so don't try removing |
| 2634 // for one too. Need to check if m_style is null in cases of partial constru
ction. | 2635 // for one too. Need to check if m_style is null in cases of partial constru
ction. |
| 2635 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style
&& m_style->touchAction() != TouchActionAuto) | 2636 if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style
&& m_style->touchAction() != TouchActionAuto) |
| 2636 document().didRemoveTouchEventHandler(node()); | 2637 EventHandlerRegistry::from(document())->didRemoveEventHandler(*node(), E
ventHandlerRegistry::TouchEvent); |
| 2637 | 2638 |
| 2638 setAncestorLineBoxDirty(false); | 2639 setAncestorLineBoxDirty(false); |
| 2639 | 2640 |
| 2640 clearLayoutRootIfNeeded(); | 2641 clearLayoutRootIfNeeded(); |
| 2641 } | 2642 } |
| 2642 | 2643 |
| 2643 void RenderObject::insertedIntoTree() | 2644 void RenderObject::insertedIntoTree() |
| 2644 { | 2645 { |
| 2645 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. | 2646 // FIXME: We should ASSERT(isRooted()) here but generated content makes some
out-of-order insertion. |
| 2646 | 2647 |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3375 { | 3376 { |
| 3376 if (object1) { | 3377 if (object1) { |
| 3377 const WebCore::RenderObject* root = object1; | 3378 const WebCore::RenderObject* root = object1; |
| 3378 while (root->parent()) | 3379 while (root->parent()) |
| 3379 root = root->parent(); | 3380 root = root->parent(); |
| 3380 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3381 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3381 } | 3382 } |
| 3382 } | 3383 } |
| 3383 | 3384 |
| 3384 #endif | 3385 #endif |
| OLD | NEW |