Chromium Code Reviews| Index: Source/core/inspector/InspectorOverlayPage.html |
| diff --git a/Source/core/inspector/InspectorOverlayPage.html b/Source/core/inspector/InspectorOverlayPage.html |
| index 36697b06934c80165ed4c47792f2377e61d46173..a598d607b20fe28ae30be1dcc0adc5b319f9cba9 100644 |
| --- a/Source/core/inspector/InspectorOverlayPage.html |
| +++ b/Source/core/inspector/InspectorOverlayPage.html |
| @@ -146,6 +146,12 @@ body.platform-linux { |
| color: rgb(153, 69, 0); |
| } |
| +.editor-anchor { |
| + height: 12px; |
| + width: 12px; |
| + position: absolute; |
| +} |
| + |
| </style> |
| <script> |
| const lightGridColor = "rgba(0,0,0,0.2)"; |
| @@ -340,6 +346,9 @@ function reset(resetData) |
| window._controlsVisible = false; |
| document.querySelector(".controls-line").style.visibility = "hidden"; |
| document.getElementById("element-title").style.visibility = "hidden"; |
| + var editor = document.getElementById("editor"); |
| + editor.style.visibility = "hidden"; |
| + editor.textContent = ""; |
| document.body.classList.remove("dimmed"); |
| window._gridPainted = false; |
| } |
| @@ -564,7 +573,9 @@ function drawHighlight(highlight) |
| if (highlight.elementInfo) |
| _drawElementTitle(highlight.elementInfo, bounds); |
| } |
| - context.restore(); |
|
dgozman
2015/06/23 14:00:30
Bring it back!
sergeyv
2015/06/23 16:36:52
Done.
|
| + |
| + if (highlight.wysiwygInfo) |
| + showWYSIWYGEditor(highlight.wysiwygInfo); |
| } |
| function setPlatform(platform) |
| @@ -617,6 +628,36 @@ function onDocumentKeyDown(event) |
| InspectorOverlayHost.stepOver(); |
| } |
| +function showWYSIWYGEditor(info) |
| +{ |
| + var editorElement = document.getElementById("editor"); |
| + editorElement.style.visibility = "visible"; |
| + var anchors = info.anchors; |
| + for (var i = 0; i < anchors.length; ++i) |
| + editorElement.appendChild(createAnchor(anchors[i])); |
| +} |
| + |
| +function createAnchor(anchorInfo) |
| +{ |
| + var handleWidth = 5; |
| + context.save(); |
| + context.shadowColor = "black"; |
| + context.shadowBlur = 2; |
| + context.strokeStyle = "rgb(0, 0, 128)"; |
| + context.fillStyle = "rgb(0, 0, 128)"; |
| + context.beginPath(); |
| + context.arc(anchorInfo.x, anchorInfo.y, handleWidth, 0, 2 * Math.PI); |
| + context.fill(); |
| + context.stroke(); |
| + context.restore(); |
| + |
| + var anchorElement = document.createElement("div"); |
| + anchorElement.className = "editor-anchor"; |
| + anchorElement.style.left = anchorInfo.x - handleWidth + "px"; |
| + anchorElement.style.top = anchorInfo.y - handleWidth + "px"; |
| + return anchorElement; |
| +} |
| + |
| window.addEventListener("DOMContentLoaded", onLoaded); |
| document.addEventListener("keydown", onDocumentKeyDown); |
| @@ -634,5 +675,6 @@ document.addEventListener("keydown", onDocumentKeyDown); |
| <span id="tag-name"></span><span id="node-id"></span><span id="class-name"></span> |
| <span id="node-width"></span><span class="px">px</span><span class="px"> × </span><span id="node-height"></span><span class="px">px</span> |
| </div> |
| +<div id="editor"></div> |
|
dgozman
2015/06/23 14:00:30
Let's make it class=fill.
sergeyv
2015/06/23 16:36:52
Done.
|
| <div id="log"></div> |
| </html> |