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

Unified Diff: LayoutTests/inspector/elements/styles/edit-value-inside-property.html

Issue 650123002: DevTools: [SSP] fix live edit of property values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/styles/edit-value-inside-property-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/elements/styles/edit-value-inside-property.html
diff --git a/LayoutTests/inspector/elements/styles/edit-value-inside-property.html b/LayoutTests/inspector/elements/styles/edit-value-inside-property.html
new file mode 100644
index 0000000000000000000000000000000000000000..d49767f5b864f8ac64b3bf5bfd6a1e7e94dd6904
--- /dev/null
+++ b/LayoutTests/inspector/elements/styles/edit-value-inside-property.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/elements-test.js"></script>
+<script>
+
+function test()
+{
+ InspectorTest.selectNodeAndWaitForStyles("inspected", testEmulateKeypress);
+
+ function testEmulateKeypress()
+ {
+ var treeElement = InspectorTest.getMatchedStylePropertyTreeItem("font-size");
+ treeElement.startEditing(treeElement.valueElement);
+ var selection = window.getSelection();
+ var range = selection.getRangeAt(0);
+ var newRange = document.createRange();
+ newRange.setStart(range.startContainer, 1);
+ newRange.setEnd(range.startContainer, 1);
+ selection.removeAllRanges();
+ selection.addRange(newRange);
+ // Use eventSender to emit "input" event.
+ eventSender.keyDown("1");
+ InspectorTest.waitForStyleApplied(onStyleApplied);
+ }
+
+ function onStyleApplied()
+ {
+ InspectorTest.nodeWithId("inspected", onNodeFound);
+ }
+
+ function onNodeFound(node)
+ {
+ WebInspector.cssModel.getInlineStylesAsync(node.id, onInlineStyle);
+ }
+
+ function onInlineStyle(inlineStyle)
+ {
+ if (!inlineStyle) {
+ InspectorTest.addResult("Failed to get inline styles.").
+ InspectorTest.completeTest();
+ return;
+ }
+ InspectorTest.addResult("font-size: " + inlineStyle.getPropertyValue("font-size"));
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Verifies that property value editing triggers style update in rendering engine.
+</p>
+
+<div id="inspected" style="font-size: 19px"></div>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/styles/edit-value-inside-property-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698