Commit f37c81f9 authored by justing's avatar justing

LayoutTests:

        Reviewed by harrison
        
        <rdar://problem/4747450>
        Gmail Editor: Caret doesn't always position itself after list marker
        <rdar://problem/4917055>
        GMail Editor: A hang can occur when attempting to apply list styling to selected indented text

        Added:
        * editing/execCommand/4747450-expected.checksum: Added.
        * editing/execCommand/4747450-expected.png: Added.
        * editing/execCommand/4747450-expected.txt: Added.
        * editing/execCommand/4747450.html: Added.
        * editing/execCommand/4917055-expected.txt: Added.
        * editing/execCommand/4917055.html: Added.
        Fixed:
        * editing/execCommand/create-list-with-hr-expected.checksum:
        * editing/execCommand/create-list-with-hr-expected.png:
        * editing/execCommand/create-list-with-hr-expected.txt:

WebCore:

        Reviewed by harrison
        
        <rdar://problem/4747450>
        Gmail Editor: Caret doesn't always position itself after list marker
        <rdar://problem/4917055>
        GMail Editor: A hang can occur when attempting to apply list styling to selected indented text

        * editing/TextIterator.cpp:
        (WebCore::TextIterator::rangeFromLocationAndLength): Use VisiblePositions
        to compute the end of a run for emitted '\n's, because it's often wrong
        in that case.



git-svn-id: svn://svn.chromium.org/blink/trunk@18895 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c00cbc17
2007-01-16 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<rdar://problem/4747450>
Gmail Editor: Caret doesn't always position itself after list marker
<rdar://problem/4917055>
GMail Editor: A hang can occur when attempting to apply list styling to selected indented text
Added:
* editing/execCommand/4747450-expected.checksum: Added.
* editing/execCommand/4747450-expected.png: Added.
* editing/execCommand/4747450-expected.txt: Added.
* editing/execCommand/4747450.html: Added.
* editing/execCommand/4917055-expected.txt: Added.
* editing/execCommand/4917055.html: Added.
Fixed:
* editing/execCommand/create-list-with-hr-expected.checksum:
* editing/execCommand/create-list-with-hr-expected.png:
* editing/execCommand/create-list-with-hr-expected.txt:
2007-01-16 Darin Adler <darin@apple.com> 2007-01-16 Darin Adler <darin@apple.com>
- updated one more test results affected by Rob's coordinates patch - updated one more test results affected by Rob's coordinates patch
dfeac0db17cc171ee1ec5fd6387e8329
\ No newline at end of file
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 784x576
RenderBlock {P} at (0,0) size 784x36
RenderText {#text} at (0,0) size 737x36
text run at (0,0) width 289: "This test for a bug in Insert{Un}OrderedList. "
text run at (289,0) width 448: "Inside an empty editable region, a new paragraph is added, then a list is"
text run at (0,18) width 53: "created. "
text run at (53,18) width 128: "The caret should be "
RenderInline {B} at (0,0) size 39x18
RenderText {#text} at (181,18) size 39x18
text run at (181,18) width 39: "inside"
RenderText {#text} at (220,18) size 123x18
text run at (220,18) width 123: " the empty list item."
RenderBlock {DIV} at (0,52) size 784x52
RenderBlock {DIV} at (0,0) size 784x18
RenderBR {BR} at (0,0) size 0x18
RenderBlock {DIV} at (0,34) size 784x18
RenderBlock {UL} at (0,0) size 784x18
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-17,0) size 7x18: bullet
RenderBlock (anonymous) at (0,34) size 784x0
caret: position 0 of child 0 {LI} of child 0 {UL} of child 1 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This test for a bug in Insert{Un}OrderedList. Inside an empty editable region, a new paragraph is added, then a list is created. The caret should be <b>inside</b> the empty list item.</p>
<div id="div" contenteditable="true"></div>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("InsertParagraph");
document.execCommand("InsertUnorderedList");
</script>
This tests for a hang when performing Insert{Un}OrderedList.
foo
bar
<p>This tests for a hang when performing Insert{Un}OrderedList.</p>
<div id="div" contenteditable="true">
<blockquote class="webkit-indent-blockquote">foo</blockquote>
<blockquote class="webkit-indent-blockquote">bar</blockquote>
<blockquote class="webkit-indent-blockquote"><br></blockquote>
<blockquote class="webkit-indent-blockquote"><br></blockquote>
<blockquote class="webkit-indent-blockquote"><br></blockquote>
</div>
<script>
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
var div = document.getElementById("div");
div.focus();
document.execCommand("SelectAll");
document.execCommand("InsertUnorderedList");
</script>
b2bf164df2a52ffb7be2056a5ec11b36 5bd26e2e0dce689ca35239482fd0eb60
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML ...@@ -2,7 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 83 of #text > P > BODY > HTML > #document to 83 of #text > P > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > UL > DIV > BODY > HTML > #document to 0 of LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600 layer at (0,0) size 800x600
...@@ -21,4 +21,4 @@ layer at (0,0) size 800x600 ...@@ -21,4 +21,4 @@ layer at (0,0) size 800x600
RenderBlock {HR} at (0,26) size 744x2 [border: (1px inset #000000)] RenderBlock {HR} at (0,26) size 744x2 [border: (1px inset #000000)]
RenderBlock (anonymous) at (0,36) size 744x0 RenderBlock (anonymous) at (0,36) size 744x0
RenderBlock (anonymous) at (0,44) size 784x0 RenderBlock (anonymous) at (0,44) size 784x0
caret: position 83 of child 0 {#text} of child 0 {P} of child 1 {BODY} of child 0 {HTML} of document caret: position 0 of child 0 {HR} of child 0 {LI} of child 0 {UL} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
2007-01-16 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<rdar://problem/4747450>
Gmail Editor: Caret doesn't always position itself after list marker
<rdar://problem/4917055>
GMail Editor: A hang can occur when attempting to apply list styling to selected indented text
* editing/TextIterator.cpp:
(WebCore::TextIterator::rangeFromLocationAndLength): Use VisiblePositions
to compute the end of a run for emitted '\n's, because it's often wrong
in that case.
2007-01-16 Darin Adler <darin@apple.com> 2007-01-16 Darin Adler <darin@apple.com>
- quick lame attempt to get Qt compiling again - quick lame attempt to get Qt compiling again
......
...@@ -1072,8 +1072,26 @@ PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element *scope, int r ...@@ -1072,8 +1072,26 @@ PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element *scope, int r
for (; !it.atEnd(); it.advance()) { for (; !it.atEnd(); it.advance()) {
int len = it.length(); int len = it.length();
textRunRange = it.range(); textRunRange = it.range();
bool foundStart = rangeLocation >= docTextPosition && rangeLocation <= docTextPosition + len;
bool foundEnd = rangeEnd >= docTextPosition && rangeEnd <= docTextPosition + len;
// Fix textRunRange->endPosition(), but only if foundStart || foundEnd, because it is only
// in those cases that textRunRange is used.
if (foundStart || foundEnd) {
// FIXME: This is a workaround for the fact that the end of a run is often at the wrong
// position for emitted '\n's.
if (len == 1 && it.characters()[0] == UChar('\n')) {
Position runStart = textRunRange->startPosition();
Position runEnd = VisiblePosition(runStart).next().deepEquivalent();
if (runEnd.isNotNull()) {
ExceptionCode ec = 0;
textRunRange->setEnd(runEnd.node(), runEnd.offset(), ec);
}
}
}
if (rangeLocation >= docTextPosition && rangeLocation <= docTextPosition + len) { if (foundStart) {
startRangeFound = true; startRangeFound = true;
int exception = 0; int exception = 0;
if (textRunRange->startContainer(exception)->isTextNode()) { if (textRunRange->startContainer(exception)->isTextNode()) {
...@@ -1087,7 +1105,7 @@ PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element *scope, int r ...@@ -1087,7 +1105,7 @@ PassRefPtr<Range> TextIterator::rangeFromLocationAndLength(Element *scope, int r
} }
} }
if (rangeEnd >= docTextPosition && rangeEnd <= docTextPosition + len) { if (foundEnd) {
int exception = 0; int exception = 0;
if (textRunRange->startContainer(exception)->isTextNode()) { if (textRunRange->startContainer(exception)->isTextNode()) {
int offset = rangeEnd - docTextPosition; int offset = rangeEnd - docTextPosition;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment