+2013-02-07 Andrey Lushnikov <lushnikov@chromium.org>
+
+ Web Inspector: home button behaviour is wrong in DTE
+ https://bugs.webkit.org/show_bug.cgi?id=109154
+
+ Reviewed by Vsevolod Vlasov.
+
+ Add layout test to verify home button behaviour. Exclude this test on
+ platforms that do not have eventSender object in test shell.
+
+ * inspector/editor/text-editor-home-button-expected.txt: Added.
+ * inspector/editor/text-editor-home-button.html: Added.
+ * platform/efl/TestExpectations:
+ * platform/mac/TestExpectations:
+ * platform/qt/TestExpectations:
+
2013-02-07 Allan Sandfeld Jensen <allan.jensen@digia.com>
Scrollbars misplaced with accelerated compositing for overflow scroll
--- /dev/null
+This test verifies that home button triggers selection between first symbol of the line and first non-blank symbol of the line.
+
+function foo()
+{
+ return 42;
+}
+
+Running: testFirstNonBlankCharacter
+{"startLine":2,"startColumn":8,"endLine":2,"endColumn":8}
+{"startLine":2,"startColumn":4,"endLine":2,"endColumn":4}
+
+Running: testFirstNonBlankCharacterFromWhitespace
+{"startLine":2,"startColumn":2,"endLine":2,"endColumn":2}
+{"startLine":2,"startColumn":4,"endLine":2,"endColumn":4}
+
+Running: testHomeButtonTriggering
+{"startLine":2,"startColumn":2,"endLine":2,"endColumn":2}
+{"startLine":2,"startColumn":4,"endLine":2,"endColumn":4}
+{"startLine":2,"startColumn":0,"endLine":2,"endColumn":0}
+{"startLine":2,"startColumn":4,"endLine":2,"endColumn":4}
+
+Running: testHomeButtonDoesNotChangeCursor
+{"startLine":0,"startColumn":2,"endLine":0,"endColumn":2}
+{"startLine":0,"startColumn":0,"endLine":0,"endColumn":0}
+{"startLine":0,"startColumn":0,"endLine":0,"endColumn":0}
+
+Running: testHomeButtonWithShift
+{"startLine":0,"startColumn":0,"endLine":2,"endColumn":8}
+{"startLine":0,"startColumn":0,"endLine":2,"endColumn":4}
+{"startLine":0,"startColumn":0,"endLine":2,"endColumn":0}
+{"startLine":0,"startColumn":0,"endLine":2,"endColumn":4}
+
+Running: testHomeButtonWithShiftInversed
+{"startLine":3,"startColumn":1,"endLine":2,"endColumn":8}
+{"startLine":3,"startColumn":1,"endLine":2,"endColumn":4}
+{"startLine":3,"startColumn":1,"endLine":2,"endColumn":0}
+{"startLine":3,"startColumn":1,"endLine":2,"endColumn":4}
+
--- /dev/null
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="editor-test.js"></script>
+<script>
+
+function test()
+{
+function foo()
+{
+ return 42;
+}
+ var textEditor = InspectorTest.createTestEditor();
+ textEditor.overrideViewportForTest(0, undefined, 3);
+ textEditor.mimeType = "text/javascript";
+ textEditor.setReadOnly(false);
+ textEditor.element.focus();
+
+ textEditor.setText(foo.toString());
+
+ InspectorTest.addResult(textEditor.text());
+
+ InspectorTest.runTestSuite([
+ function testFirstNonBlankCharacter(next)
+ {
+ var selection = WebInspector.TextRange.createFromLocation(2, 8);
+ textEditor.setSelection(selection);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ next();
+ },
+
+ function testFirstNonBlankCharacterFromWhitespace(next)
+ {
+ var selection = WebInspector.TextRange.createFromLocation(2, 2);
+ textEditor.setSelection(selection);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ next();
+ },
+
+ function testHomeButtonTriggering(next)
+ {
+ var selection = WebInspector.TextRange.createFromLocation(2, 2);
+ textEditor.setSelection(selection);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ next();
+ },
+
+ function testHomeButtonDoesNotChangeCursor(next)
+ {
+ var selection = WebInspector.TextRange.createFromLocation(0, 2);
+ textEditor.setSelection(selection);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", []);
+ InspectorTest.addResult(textEditor.selection());
+ next();
+ },
+
+ function testHomeButtonWithShift(next)
+ {
+ var selection = new WebInspector.TextRange(0, 0, 2, 8);
+ textEditor.setSelection(selection);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", ["shiftKey"]);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", ["shiftKey"]);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", ["shiftKey"]);
+ InspectorTest.addResult(textEditor.selection());
+ next();
+ },
+
+ function testHomeButtonWithShiftInversed(next)
+ {
+ var selection = new WebInspector.TextRange(3, 1, 2, 8);
+ textEditor.setSelection(selection);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", ["shiftKey"]);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", ["shiftKey"]);
+ InspectorTest.addResult(textEditor.selection());
+ eventSender.keyDown("home", ["shiftKey"]);
+ InspectorTest.addResult(textEditor.selection());
+ next();
+ }
+ ]);
+}
+
+</script>
+</head>
+
+<body onload="runTest();">
+<p>
+This test verifies that home button triggers selection between first symbol of the line
+and first non-blank symbol of the line.
+</p>
+
+</body>
+</html>
# https://bugs.webkit.org/show_bug.cgi?id=106883
inspector/editor/text-editor-formatter.html
inspector/editor/text-editor-word-jumps.html
+inspector/editor/text-editor-home-button.html
# Remove from list after enabling CANVAS_PATH
webkit.org/b/108508 fast/canvas/canvas-path-constructors.html [ Failure ]
# https://bugs.webkit.org/show_bug.cgi?id=106793
inspector/editor/text-editor-formatter.html [ Skip ]
inspector/editor/text-editor-word-jumps.html [ Skip ]
+inspector/editor/text-editor-home-button.html [ Skip ]
# https://bugs.webkit.org/show_bug.cgi?id=71120
inspector/debugger/selected-call-frame-after-formatting-source.html
# https://bugs.webkit.org/show_bug.cgi?id=106883
inspector/editor/text-editor-formatter.html
inspector/editor/text-editor-word-jumps.html
+inspector/editor/text-editor-home-button.html
# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=14664
webkit.org/b/107476 fast/block/float/024.html [ Failure ]
+2013-02-07 Andrey Lushnikov <lushnikov@chromium.org>
+
+ Web Inspector: home button behaviour is wrong in DTE
+ https://bugs.webkit.org/show_bug.cgi?id=109154
+
+ Reviewed by Vsevolod Vlasov.
+
+ Handle home key shortcut explicitly in TextEditorMainPanel.
+
+ New test: inspector/editor/text-editor-home-button.html
+
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.TextEditorMainPanel.prototype._registerShortcuts):
+ (WebInspector.TextEditorMainPanel.prototype._handleHomeKey):
+
2013-02-07 Gavin Peters <gavinp@chromium.org>
Unreviewed, rolling out r142112.
var handleShiftTabKey = this._handleTabKeyPress.bind(this, true);
this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Tab.code)] = handleTabKey;
this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Tab.code, modifiers.Shift)] = handleShiftTabKey;
+
+ this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Home.code, modifiers.None)] = this._handleHomeKey.bind(this, false);
+ this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Home.code, modifiers.Shift)] = this._handleHomeKey.bind(this, true);
+ },
+
+ /**
+ * @param {boolean} shift
+ */
+ _handleHomeKey: function(shift)
+ {
+ var selection = this.selection();
+
+ var line = this._textModel.line(selection.endLine);
+ var firstNonBlankCharacter = 0;
+ while (firstNonBlankCharacter < line.length) {
+ var char = line.charAt(firstNonBlankCharacter);
+ if (char === " " || char === "\t")
+ ++firstNonBlankCharacter;
+ else
+ break;
+ }
+ if (firstNonBlankCharacter >= line.length || selection.endColumn === firstNonBlankCharacter)
+ return false;
+
+ selection.endColumn = firstNonBlankCharacter;
+ if (!shift)
+ selection = selection.collapseToEnd();
+ this._restoreSelection(selection);
+ return true;
},
/**