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

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 640953004: DevTools: Fix elements panel search in shadow host. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « LayoutTests/inspector/elements/elements-panel-search-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 977
978 // Then traverse siblings of the node itself and its ancestors. 978 // Then traverse siblings of the node itself and its ancestors.
979 const Node* node = &current; 979 const Node* node = &current;
980 do { 980 do {
981 if (node == stayWithin) 981 if (node == stayWithin)
982 return 0; 982 return 0;
983 if (node->isShadowRoot()) { 983 if (node->isShadowRoot()) {
984 const ShadowRoot* shadowRoot = toShadowRoot(node); 984 const ShadowRoot* shadowRoot = toShadowRoot(node);
985 if (shadowRoot->olderShadowRoot()) 985 if (shadowRoot->olderShadowRoot())
986 return shadowRoot->olderShadowRoot(); 986 return shadowRoot->olderShadowRoot();
987 Node* host = shadowRoot->host();
988 if (host && host->hasChildren())
989 return host->firstChild();
987 } 990 }
988 if (node->nextSibling()) 991 if (node->nextSibling())
989 return node->nextSibling(); 992 return node->nextSibling();
990 node = node->isShadowRoot() ? toShadowRoot(node)->host() : node->parentN ode(); 993 node = node->isShadowRoot() ? toShadowRoot(node)->host() : node->parentN ode();
991 } while (node); 994 } while (node);
992 995
993 return 0; 996 return 0;
994 } 997 }
995 998
996 void InspectorDOMAgent::performSearch(ErrorString*, const String& whitespaceTrim medQuery, const bool* optionalIncludeUserAgentShadowDOM, String* searchId, int* resultCount) 999 void InspectorDOMAgent::performSearch(ErrorString*, const String& whitespaceTrim medQuery, const bool* optionalIncludeUserAgentShadowDOM, String* searchId, int* resultCount)
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 visitor->trace(m_searchResults); 2194 visitor->trace(m_searchResults);
2192 #endif 2195 #endif
2193 visitor->trace(m_history); 2196 visitor->trace(m_history);
2194 visitor->trace(m_domEditor); 2197 visitor->trace(m_domEditor);
2195 visitor->trace(m_listener); 2198 visitor->trace(m_listener);
2196 InspectorBaseAgent::trace(visitor); 2199 InspectorBaseAgent::trace(visitor);
2197 } 2200 }
2198 2201
2199 } // namespace blink 2202 } // namespace blink
2200 2203
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/elements-panel-search-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698