Reviewed by levi
* editing/selection/designmode-no-caret-expected.checksum: Added.
* editing/selection/designmode-no-caret-expected.png: Added.
* editing/selection/designmode-no-caret-expected.txt: Added.
* editing/selection/designmode-no-caret.html: Added.
WebCore:
Reviewed by levi
<rdar://problem/
4549610> REGRESSION: No initial cursor in Mail reply or Blot document
<rdar://problem/
4560698> Mail is very crashy in Leopard9A182, WebCore::Range::compareBoundaryPoints(WebCore::Node*, int, WebCore::Node*, int)
* page/Frame.cpp:
(WebCore::Frame::setSelectionFromNone): Find the body and stick a caret
in it.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14578
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-05-24 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by levi
+
+ * editing/selection/designmode-no-caret-expected.checksum: Added.
+ * editing/selection/designmode-no-caret-expected.png: Added.
+ * editing/selection/designmode-no-caret-expected.txt: Added.
+ * editing/selection/designmode-no-caret.html: Added.
+
2006-05-24 Geoffrey Garen <ggaren@apple.com>
- Layout test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9095
--- /dev/null
+3b1c405abdef2c706783a17104ea2231
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 1 of HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x70
+ RenderBlock {HTML} at (0,0) size 800x70
+ RenderBody {BODY} at (8,8) size 784x54
+ RenderText {#text} at (0,0) size 784x54
+ text run at (0,0) width 759: "This tests to see that a caret is placed inside an editable document that is entirely editable even when no caret is requested"
+ text run at (0,18) width 118: "programmatically. "
+ text run at (118,18) width 187: "We do this as a convenience. "
+ text run at (305,18) width 479: "Right now, we only do this convenience when a document's frame becomes"
+ text run at (0,36) width 378: "first responder or when a document's window becomes key."
+caret: position 0 of child 0 {#text} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+This tests to see that a caret is placed inside an editable document that is entirely editable even when no caret is requested programmatically. We do this as a convenience. Right now, we only do this convenience when a document's frame becomes first responder or when a document's window becomes key.
+<script>
+document.designMode = "on";
+if (window.layoutTestController) {
+ window.layoutTestController.waitUntilDone();
+ window.layoutTestController.setMainFrameIsFirstResponder(false);
+ window.layoutTestController.setMainFrameIsFirstResponder(true);
+ window.layoutTestController.notifyDone();
+}
+</script>
\ No newline at end of file
+2006-05-24 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by levi
+
+ <rdar://problem/4549610> REGRESSION: No initial cursor in Mail reply or Blot document
+ <rdar://problem/4560698> Mail is very crashy in Leopard9A182, WebCore::Range::compareBoundaryPoints(WebCore::Node*, int, WebCore::Node*, int)
+
+ * page/Frame.cpp:
+ (WebCore::Frame::setSelectionFromNone): Find the body and stick a caret
+ in it.
+
2006-05-24 Geoffrey Garen <ggaren@apple.com>
Rubber stamped by Anders.
void Frame::setSelectionFromNone()
{
- // Put the caret someplace if the selection is empty and the part is editable.
- // This has the effect of flashing the caret in a contentEditable view automatically
- // without requiring the programmer to set a selection explicitly.
+ // Put a caret inside the body if the entire frame is editable (either the
+ // entire WebView is editable or designMode is on for this document).
Document *doc = document();
- if (doc && selection().isNone() && isContentEditable()) {
- Node *node = doc->documentElement();
- while (node) {
- // Look for a block flow, but skip over the HTML element, since we really
- // want to get at least as far as the the BODY element in a document.
- if (node->isBlockFlow() && node->hasTagName(htmlTag))
- break;
- node = node->traverseNextNode();
- }
- if (node)
- setSelection(SelectionController(Position(node, 0), DOWNSTREAM));
- }
+ if (!doc || !selection().isNone() || !isContentEditable())
+ return;
+
+ Node* node = doc->documentElement();
+ while (node && !node->hasTagName(bodyTag))
+ node = node->traverseNextNode();
+ if (node)
+ setSelection(SelectionController(Position(node, 0), DOWNSTREAM));
}
bool Frame::displaysWithFocusAttributes() const