| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/inspector/InspectorHighlight.h" | 6 #include "core/inspector/InspectorHighlight.h" |
| 7 | 7 |
| 8 #include "core/dom/ClientRect.h" | 8 #include "core/dom/ClientRect.h" |
| 9 #include "core/dom/PseudoElement.h" | 9 #include "core/dom/PseudoElement.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 FrameView* containingView = element->document().view(); | 258 FrameView* containingView = element->document().view(); |
| 259 if (!layoutObject || !containingView) | 259 if (!layoutObject || !containingView) |
| 260 return elementInfo; | 260 return elementInfo; |
| 261 | 261 |
| 262 // layoutObject the getBoundingClientRect() data in the tooltip | 262 // layoutObject the getBoundingClientRect() data in the tooltip |
| 263 // to be consistent with the rulers (see http://crbug.com/262338). | 263 // to be consistent with the rulers (see http://crbug.com/262338). |
| 264 ClientRect* boundingBox = element->getBoundingClientRect(); | 264 ClientRect* boundingBox = element->getBoundingClientRect(); |
| 265 elementInfo->setString("nodeWidth", String::number(boundingBox->width())); | 265 elementInfo->setString("nodeWidth", String::number(boundingBox->width())); |
| 266 elementInfo->setString("nodeHeight", String::number(boundingBox->height())); | 266 elementInfo->setString("nodeHeight", String::number(boundingBox->height())); |
| 267 | 267 |
| 268 if (layoutObject->isBox()) { |
| 269 LayoutBox* layoutBox = toLayoutBox(layoutObject); |
| 270 int marginLeft = (layoutBox->marginLeft().toInt()); |
| 271 printf("bbb1 %d\n", marginLeft); |
| 272 elementInfo->setString("marginLeft", String::number(marginLeft)); |
| 273 |
| 274 } else { |
| 275 LayoutInline* layoutInline = toLayoutInline(layoutObject); |
| 276 int marginLeft = (layoutInline->marginLeft().toInt()); |
| 277 printf("bbb %d\n", marginLeft); |
| 278 elementInfo->setString("marginLeft", String::number(marginLeft)); |
| 279 } |
| 280 |
| 281 |
| 268 return elementInfo; | 282 return elementInfo; |
| 269 } | 283 } |
| 270 | 284 |
| 271 } // namespace | 285 } // namespace |
| 272 | 286 |
| 273 InspectorHighlight::InspectorHighlight() | 287 InspectorHighlight::InspectorHighlight() |
| 274 : m_highlightPaths(JSONArray::create()) | 288 : m_highlightPaths(JSONArray::create()) |
| 275 , m_showRulers(false) | 289 , m_showRulers(false) |
| 276 , m_showExtensionLines(false) | 290 , m_showExtensionLines(false) |
| 277 { | 291 { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 config.eventTarget = Color(128, 128, 128, 0); | 439 config.eventTarget = Color(128, 128, 128, 0); |
| 426 config.shape = Color(0, 0, 0, 0); | 440 config.shape = Color(0, 0, 0, 0); |
| 427 config.shapeMargin = Color(128, 128, 128, 0); | 441 config.shapeMargin = Color(128, 128, 128, 0); |
| 428 config.showInfo = true; | 442 config.showInfo = true; |
| 429 config.showRulers = true; | 443 config.showRulers = true; |
| 430 config.showExtensionLines = true; | 444 config.showExtensionLines = true; |
| 431 return config; | 445 return config; |
| 432 } | 446 } |
| 433 | 447 |
| 434 } // namespace blink | 448 } // namespace blink |
| OLD | NEW |