When the WebInspector.currentFocusElement changes, move the caret selection to be...
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Apr 2008 20:01:54 +0000 (20:01 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Apr 2008 20:01:54 +0000 (20:01 +0000)
commit222ddb5f5ffc61b6331642f6899e619e93323f34
treebbe605bc4655c9603784e7085b9a76e2c7c60f9d
parentcd5827614484dfd8f84c9ed5ec50b8337f88fe57
When the WebInspector.currentFocusElement changes, move the caret selection to be inside the focused element. This makes sure the caret moves in and out of the console when the focus changes.

Reviewed by Adam Roben.

* page/inspector/TextPrompt.js:
(TextPrompt.prototype.isCaretInsidePrompt): Just call isInsertionCaretInside.
* page/inspector/inspector.js:
(WebInspector.set currentFocusElement): Make a caret selection inside
the focused element if there isn't a range selection and there isn't
already a caret selection inside.
* page/inspector/utilities.js:
(Element.prototype.isInsertionCaretInside): Added. Tests if the
selection is collapsed and is inside the element.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/page/inspector/TextPrompt.js
WebCore/page/inspector/inspector.js
WebCore/page/inspector/utilities.js