OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/inspector/InspectorHighlight.h" | 5 #include "core/inspector/InspectorHighlight.h" |
6 | 6 |
7 #include "core/dom/ClientRect.h" | 7 #include "core/dom/ClientRect.h" |
8 #include "core/dom/PseudoElement.h" | 8 #include "core/dom/PseudoElement.h" |
9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 std::unique_ptr<protocol::DictionaryValue> buildElementInfo(Element* element) { | 178 std::unique_ptr<protocol::DictionaryValue> buildElementInfo(Element* element) { |
179 std::unique_ptr<protocol::DictionaryValue> elementInfo = | 179 std::unique_ptr<protocol::DictionaryValue> elementInfo = |
180 protocol::DictionaryValue::create(); | 180 protocol::DictionaryValue::create(); |
181 Element* realElement = element; | 181 Element* realElement = element; |
182 PseudoElement* pseudoElement = nullptr; | 182 PseudoElement* pseudoElement = nullptr; |
183 if (element->isPseudoElement()) { | 183 if (element->isPseudoElement()) { |
184 pseudoElement = toPseudoElement(element); | 184 pseudoElement = toPseudoElement(element); |
185 realElement = element->parentOrShadowHostElement(); | 185 realElement = element->parentOrShadowHostElement(); |
186 } | 186 } |
187 bool isXHTML = realElement->document().isXHTMLDocument(); | 187 bool isXHTML = realElement->document().isXHTMLDocument(); |
188 elementInfo->setString("tagName", isXHTML ? realElement->nodeName() | 188 elementInfo->setString( |
189 : realElement->nodeName().lower()); | 189 "tagName", |
| 190 isXHTML ? realElement->nodeName() : realElement->nodeName().lower()); |
190 elementInfo->setString("idValue", realElement->getIdAttribute()); | 191 elementInfo->setString("idValue", realElement->getIdAttribute()); |
191 StringBuilder classNames; | 192 StringBuilder classNames; |
192 if (realElement->hasClass() && realElement->isStyledElement()) { | 193 if (realElement->hasClass() && realElement->isStyledElement()) { |
193 HashSet<AtomicString> usedClassNames; | 194 HashSet<AtomicString> usedClassNames; |
194 const SpaceSplitString& classNamesString = realElement->classNames(); | 195 const SpaceSplitString& classNamesString = realElement->classNames(); |
195 size_t classNameCount = classNamesString.size(); | 196 size_t classNameCount = classNamesString.size(); |
196 for (size_t i = 0; i < classNameCount; ++i) { | 197 for (size_t i = 0; i < classNameCount; ++i) { |
197 const AtomicString& className = classNamesString[i]; | 198 const AtomicString& className = classNamesString[i]; |
198 if (!usedClassNames.insert(className).isNewEntry) | 199 if (!usedClassNames.insert(className).isNewEntry) |
199 continue; | 200 continue; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 config.shape = Color(0, 0, 0, 0); | 522 config.shape = Color(0, 0, 0, 0); |
522 config.shapeMargin = Color(128, 128, 128, 0); | 523 config.shapeMargin = Color(128, 128, 128, 0); |
523 config.showInfo = true; | 524 config.showInfo = true; |
524 config.showRulers = true; | 525 config.showRulers = true; |
525 config.showExtensionLines = true; | 526 config.showExtensionLines = true; |
526 config.displayAsMaterial = false; | 527 config.displayAsMaterial = false; |
527 return config; | 528 return config; |
528 } | 529 } |
529 | 530 |
530 } // namespace blink | 531 } // namespace blink |
OLD | NEW |