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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 15932012: HitTestResult::innerElement should check its parent node for rendering and styling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 #include "core/dom/EventListener.h" 82 #include "core/dom/EventListener.h"
83 #include "core/dom/EventNames.h" 83 #include "core/dom/EventNames.h"
84 #include "core/dom/ExceptionCode.h" 84 #include "core/dom/ExceptionCode.h"
85 #include "core/dom/ExceptionCodePlaceholder.h" 85 #include "core/dom/ExceptionCodePlaceholder.h"
86 #include "core/dom/HashChangeEvent.h" 86 #include "core/dom/HashChangeEvent.h"
87 #include "core/dom/NameNodeList.h" 87 #include "core/dom/NameNodeList.h"
88 #include "core/dom/NamedFlowCollection.h" 88 #include "core/dom/NamedFlowCollection.h"
89 #include "core/dom/NodeFilter.h" 89 #include "core/dom/NodeFilter.h"
90 #include "core/dom/NodeIterator.h" 90 #include "core/dom/NodeIterator.h"
91 #include "core/dom/NodeRareData.h" 91 #include "core/dom/NodeRareData.h"
92 #include "core/dom/NodeRenderingTraversal.h"
92 #include "core/dom/NodeTraversal.h" 93 #include "core/dom/NodeTraversal.h"
93 #include "core/dom/NodeWithIndex.h" 94 #include "core/dom/NodeWithIndex.h"
94 #include "core/dom/PageTransitionEvent.h" 95 #include "core/dom/PageTransitionEvent.h"
95 #include "core/dom/PopStateEvent.h" 96 #include "core/dom/PopStateEvent.h"
96 #include "core/dom/ProcessingInstruction.h" 97 #include "core/dom/ProcessingInstruction.h"
97 #include "core/dom/QualifiedName.h" 98 #include "core/dom/QualifiedName.h"
98 #include "core/dom/RegisteredEventListener.h" 99 #include "core/dom/RegisteredEventListener.h"
99 #include "core/dom/RequestAnimationFrameCallback.h" 100 #include "core/dom/RequestAnimationFrameCallback.h"
100 #include "core/dom/ScopedEventQueue.h" 101 #include "core/dom/ScopedEventQueue.h"
101 #include "core/dom/ScriptElement.h" 102 #include "core/dom/ScriptElement.h"
(...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after
3103 nodeInSubtree = focusedNode->isDescendantOf(node); 3104 nodeInSubtree = focusedNode->isDescendantOf(node);
3104 else 3105 else
3105 nodeInSubtree = (focusedNode == node) || focusedNode->isDescendantOf(nod e); 3106 nodeInSubtree = (focusedNode == node) || focusedNode->isDescendantOf(nod e);
3106 3107
3107 if (nodeInSubtree) 3108 if (nodeInSubtree)
3108 document()->focusedNodeRemoved(); 3109 document()->focusedNodeRemoved();
3109 } 3110 }
3110 3111
3111 void Document::hoveredNodeDetached(Node* node) 3112 void Document::hoveredNodeDetached(Node* node)
3112 { 3113 {
3113 if (!m_hoverNode || (node != m_hoverNode && (!m_hoverNode->isTextNode() || n ode != m_hoverNode->parentNode()))) 3114 if (!m_hoverNode)
3114 return; 3115 return;
3115 3116
3116 m_hoverNode = node->parentNode(); 3117 NodeRenderingTraversal::ParentDetails details;
3118 if (node != m_hoverNode && (!m_hoverNode->isTextNode() || node != NodeRender ingTraversal::parent(m_hoverNode.get(), &details)))
3119 return;
3120
3121 m_hoverNode = NodeRenderingTraversal::parent(node, &details);
hayato 2013/06/05 01:47:43 It's optional, but we could use 'for' loop here ra
tasak 2013/06/07 09:55:36 Done.
3117 while (m_hoverNode && !m_hoverNode->renderer()) 3122 while (m_hoverNode && !m_hoverNode->renderer())
3118 m_hoverNode = m_hoverNode->parentNode(); 3123 m_hoverNode = NodeRenderingTraversal::parent(m_hoverNode.get(), &details );
3119 if (frame()) 3124 if (frame())
3120 frame()->eventHandler()->scheduleHoverStateUpdate(); 3125 frame()->eventHandler()->scheduleHoverStateUpdate();
3121 } 3126 }
3122 3127
3123 void Document::activeChainNodeDetached(Node* node) 3128 void Document::activeChainNodeDetached(Node* node)
3124 { 3129 {
3125 if (!m_activeElement || (node != m_activeElement && (!m_activeElement->isTex tNode() || node != m_activeElement->parentNode()))) 3130 if (!m_activeElement)
3126 return; 3131 return;
3127 3132
3128 m_activeElement = node->parentElement(); 3133 NodeRenderingTraversal::ParentDetails details;
3129 while (m_activeElement && !m_activeElement->renderer()) 3134 if (node != m_activeElement && (!m_activeElement->isTextNode() || node != No deRenderingTraversal::parent(m_activeElement.get(), &details)))
3130 m_activeElement = m_activeElement->parentElement(); 3135 return;
3136
3137 Node* activeNode = NodeRenderingTraversal::parent(node, &details);
3138 while (activeNode && activeNode->isElementNode() && !activeNode->renderer())
3139 activeNode = NodeRenderingTraversal::parent(activeNode, &details);
3140 m_activeElement = activeNode && activeNode->isElementNode() ? toElement(acti veNode) : 0;
3131 } 3141 }
3132 3142
3133 const Vector<AnnotatedRegionValue>& Document::annotatedRegions() const 3143 const Vector<AnnotatedRegionValue>& Document::annotatedRegions() const
3134 { 3144 {
3135 return m_annotatedRegions; 3145 return m_annotatedRegions;
3136 } 3146 }
3137 3147
3138 void Document::setAnnotatedRegions(const Vector<AnnotatedRegionValue>& regions) 3148 void Document::setAnnotatedRegions(const Vector<AnnotatedRegionValue>& regions)
3139 { 3149 {
3140 m_annotatedRegions = regions; 3150 m_annotatedRegions = regions;
(...skipping 2475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 return; 5626 return;
5617 5627
5618 Vector<RefPtr<Element> > associatedFormControls; 5628 Vector<RefPtr<Element> > associatedFormControls;
5619 copyToVector(m_associatedFormControls, associatedFormControls); 5629 copyToVector(m_associatedFormControls, associatedFormControls);
5620 5630
5621 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols); 5631 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC ontrols);
5622 m_associatedFormControls.clear(); 5632 m_associatedFormControls.clear();
5623 } 5633 }
5624 5634
5625 } // namespace WebCore 5635 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698