LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Sep 2006 23:36:03 +0000 (23:36 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Sep 2006 23:36:03 +0000 (23:36 +0000)
        Reviewed by harrison

        * editing/selection/editable-links-expected.checksum: Added.
        * editing/selection/editable-links-expected.png: Added.
        * editing/selection/editable-links-expected.txt: Added.
        * editing/selection/editable-links.html: Added.

WebCore:

        Reviewed by harrison

        <rdar://problem/4735272>
        Can not click into link in programmatically editable content

        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::adjustRenderStyle): We stopped using
        userModify to implement document wide editability.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16456 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/selection/editable-links-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/editable-links-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/editable-links-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/editable-links.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/cssstyleselector.cpp

index 392f60889c9bfe75eb49f5ab5903281ac0950f44..f57a9217c427c0c09e10bb80be05b9f1d1df893c 100644 (file)
@@ -1,3 +1,12 @@
+2006-09-19  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by harrison
+
+        * editing/selection/editable-links-expected.checksum: Added.
+        * editing/selection/editable-links-expected.png: Added.
+        * editing/selection/editable-links-expected.txt: Added.
+        * editing/selection/editable-links.html: Added.
+
 2006-09-19  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/editing/selection/editable-links-expected.checksum b/LayoutTests/editing/selection/editable-links-expected.checksum
new file mode 100644 (file)
index 0000000..8540d91
--- /dev/null
@@ -0,0 +1 @@
+45cb384707d8032ac14fc8541fc17e72
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/editable-links-expected.png b/LayoutTests/editing/selection/editable-links-expected.png
new file mode 100644 (file)
index 0000000..0203a9e
Binary files /dev/null and b/LayoutTests/editing/selection/editable-links-expected.png differ
diff --git a/LayoutTests/editing/selection/editable-links-expected.txt b/LayoutTests/editing/selection/editable-links-expected.txt
new file mode 100644 (file)
index 0000000..877e2f2
--- /dev/null
@@ -0,0 +1,17 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 1 of HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > A > BODY > HTML > #document to 5 of #text > A > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (0,0) size 65x18
+        text run at (0,0) width 65: "This is an "
+      RenderInline {A} at (0,0) size 77x18 [color=#0000EE]
+        RenderText {#text} at (65,0) size 77x18
+          text run at (65,0) width 77: "editable link"
+      RenderText {#text} at (142,0) size 4x18
+        text run at (142,0) width 4: "."
+caret: position 5 of child 0 {#text} of child 3 {A} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/editable-links.html b/LayoutTests/editing/selection/editable-links.html
new file mode 100644 (file)
index 0000000..10302ba
--- /dev/null
@@ -0,0 +1,19 @@
+<body>
+<script>
+document.designMode = "on";
+// Write out the link instead of putting it in the source.  The changes necessary to make links accept a caret aren't made until a layout happens.  This is a bug.
+document.write("This is an <a id='link' href='http://www.google.com/'>editable link</a>.");
+
+if (window.layoutTestController) {
+    var link = document.getElementById("link");
+    var x = link.offsetLeft + link.offsetParent.offsetLeft + link.offsetWidth / 2;
+    var y = link.offsetTop + link.offsetParent.offsetTop + link.offsetHeight / 2;
+    
+    
+    
+    eventSender.mouseMoveTo(x, y);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
+</body>
\ No newline at end of file
index 39a70d254f7931c04308e98bcd9e73342ea81fc2..69dc03bf2b712ab10eacfb5ece64ea1c90a2e657 100644 (file)
@@ -1,3 +1,14 @@
+2006-09-19  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by harrison
+        
+        <rdar://problem/4735272>
+        Can not click into link in programmatically editable content
+
+        * css/cssstyleselector.cpp:
+        (WebCore::CSSStyleSelector::adjustRenderStyle): We stopped using
+        userModify to implement document wide editability.
+
 2006-09-19  MorganL  <morlmor@yahoo.com>
 
         Reviewed by Darin and landed by Brady
index 658764968f6f72eccbac9eef285c575dd55f5548..ba93c82079449242f6c746ad7cc32672c60ebfc2 100644 (file)
@@ -1096,7 +1096,7 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
     }
 
     // Links should be user selectable when content editable
-    if (e && e->isLink() && (style->userModify() == READ_WRITE || style->userModify() == READ_WRITE_PLAINTEXT_ONLY))
+    if (e && e->isLink() && (e->isContentEditable() || style->userModify() == READ_WRITE || style->userModify() == READ_WRITE_PLAINTEXT_ONLY))
         style->setUserSelect(SELECT_AUTO);
 
     // Cull out any useless layers and also repeat patterns into additional layers.