<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[19944] trunk</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/19944">19944</a></dd>
<dt>Author</dt> <dd>justing</dd>
<dt>Date</dt> <dd>2007-03-02 11:53:42 -0800 (Fri, 02 Mar 2007)</dd>
</dl>
<h3>Log Message</h3>
<pre>LayoutTests:
Reviewed by john
<rdar://problem/5032095>
Gmail Editor: Copied text pastes on a new line instead of current line
* editing/pasteboard/5032095-expected.checksum: Added.
* editing/pasteboard/5032095-expected.png: Added.
* editing/pasteboard/5032095-expected.txt: Added.
* editing/pasteboard/5032095.html: Added.
WebCore:
Reviewed by john
<rdar://problem/5032095>
Gmail Editor: Copied text pastes on a new line instead of current line
Start merge failed to occur because positionAtStartOfInsertedContent
had a bug.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::positionAtStartOfInsertedContent):
Was failing when inserting <span><div>foo/div></span>. Return the
inserted content's first VisiblePosition.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreeditingReplaceSelectionCommandcpp">trunk/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestseditingpasteboard5032095expectedchecksum">trunk/LayoutTests/editing/pasteboard/5032095-expected.checksum</a></li>
<li><a href="#trunkLayoutTestseditingpasteboard5032095expectedpng">trunk/LayoutTests/editing/pasteboard/5032095-expected.png</a></li>
<li><a href="#trunkLayoutTestseditingpasteboard5032095expectedtxt">trunk/LayoutTests/editing/pasteboard/5032095-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingpasteboard5032095html">trunk/LayoutTests/editing/pasteboard/5032095.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (19943 => 19944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-03-02 17:42:20 UTC (rev 19943)
+++ trunk/LayoutTests/ChangeLog        2007-03-02 19:53:42 UTC (rev 19944)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2007-03-02 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by john
+
+ <rdar://problem/5032095>
+ Gmail Editor: Copied text pastes on a new line instead of current line
+
+ * editing/pasteboard/5032095-expected.checksum: Added.
+ * editing/pasteboard/5032095-expected.png: Added.
+ * editing/pasteboard/5032095-expected.txt: Added.
+ * editing/pasteboard/5032095.html: Added.
+
</ins><span class="cx"> 2007-03-01 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Reviewed by Maciej.
</span></span></pre></div>
<a id="trunkLayoutTestseditingpasteboard5032095expectedchecksum"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/5032095-expected.checksum (0 => 19944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/5032095-expected.checksum         (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/5032095-expected.checksum        2007-03-02 19:53:42 UTC (rev 19944)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+eb21c5b31da1ef86b182e333aa97a0e1
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestseditingpasteboard5032095expectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/editing/pasteboard/5032095-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/editing/pasteboard/5032095-expected.png
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:mime-type
</span><span class="cx"> + application/octet-stream
</span><a id="trunkLayoutTestseditingpasteboard5032095expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/5032095-expected.txt (0 => 19944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/5032095-expected.txt         (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/5032095-expected.txt        2007-03-02 19:53:42 UTC (rev 19944)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+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
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 764x36
+ text run at (0,0) width 690: "This tests for a bug where content pasted at the end of a paragraph would be inserted into the next paragraph. "
+ text run at (690,0) width 74: "You should"
+ text run at (0,18) width 145: "see 'helloworld' below."
+ RenderBlock {DIV} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 31x18
+ text run at (0,0) width 31: "hello"
+ RenderText {#text} at (31,0) size 37x18
+ text run at (31,0) width 37: "world"
+caret: position 5 of child 1 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
</ins></span></pre></div>
<a id="trunkLayoutTestseditingpasteboard5032095html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/5032095.html (0 => 19944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/5032095.html         (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/5032095.html        2007-03-02 19:53:42 UTC (rev 19944)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<p>This tests for a bug where content pasted at the end of a paragraph would be inserted into the next paragraph. You should see 'helloworld' below.</p>
+<div id="div" contenteditable="true">hello</div>
+
+<script>
+var div = document.getElementById("div");
+var sel = window.getSelection();
+sel.setPosition(div, 0);
+sel.modify("move", "forward", "word");
+document.execCommand("InsertHTML", false, "<span><div>world</div></span>");
+</script>
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (19943 => 19944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-03-02 17:42:20 UTC (rev 19943)
+++ trunk/WebCore/ChangeLog        2007-03-02 19:53:42 UTC (rev 19944)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2007-03-01 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by john
+
+ <rdar://problem/5032095>
+ Gmail Editor: Copied text pastes on a new line instead of current line
+
+ Start merge failed to occur because positionAtStartOfInsertedContent
+ had a bug.
+
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::ReplaceSelectionCommand::positionAtStartOfInsertedContent):
+ Was failing when inserting <span><div>foo/div></span>. Return the
+ inserted content's first VisiblePosition.
+
</ins><span class="cx"> 2007-03-02 Dave Hyatt <hyatt@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix crasher in glyph map code (buffer overrun).
</span></span></pre></div>
<a id="trunkWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/editing/ReplaceSelectionCommand.cpp (19943 => 19944)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/editing/ReplaceSelectionCommand.cpp        2007-03-02 17:42:20 UTC (rev 19943)
+++ trunk/WebCore/editing/ReplaceSelectionCommand.cpp        2007-03-02 19:53:42 UTC (rev 19944)
</span><span class="lines">@@ -461,7 +461,8 @@
</span><span class="cx">
</span><span class="cx"> VisiblePosition ReplaceSelectionCommand::positionAtStartOfInsertedContent()
</span><span class="cx"> {
</span><del>- return VisiblePosition(Position(m_firstNodeInserted.get(), 0));
</del><ins>+ // Return the inserted content's first VisiblePosition.
+ return VisiblePosition(nextCandidate(positionBeforeNode(m_firstNodeInserted.get())));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ReplaceSelectionCommand::doApply()
</span></span></pre>
</div>
</div>
</body>
</html>