Commit bac741c4 authored by justing's avatar justing
Browse files

LayoutTests:

        Reviewed by darin
        
        http://bugs.webkit.org/show_bug.cgi?id=13804
        REGRESSION(r21611): Several new layout test pixel failures (misspelling markers)

        * editing/selection/13804-expected.checksum: Added.
        * editing/selection/13804-expected.png: Added.
        * editing/selection/13804-expected.txt: Added.
        * editing/selection/13804.html: Added.
        These were missing:
        * editing/selection/5076323-1-expected.png: Added.
        * editing/selection/5076323-2-expected.png: Added.
        * editing/selection/5076323-3-expected.png: Added.

WebCore:

        Reviewed by darin, who found the fix independently.

        http://bugs.webkit.org/show_bug.cgi?id=13804
        REGRESSION(r21611): Several new layout test pixel failures (misspelling markers)
        
        r21611 exposed a bug in the way removeMarkers computes
        the end of the range to remove markers from.  It also
        introduced a bug: removeMarkers expects a startOffset
        and a length, not a startOffset and an endOffset (added 
        a layout test).

        * dom/Document.cpp:
        (WebCore::Document::removeMarkers): The other removeMarkers
        expects a startOffset and a length, not a startOffset and
        an endOffset.
        (WebCore::Document::removeMarkers): Fixed the endOffset
        from length and startOffset calculation.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bb21e287
2007-05-22 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
http://bugs.webkit.org/show_bug.cgi?id=13804
REGRESSION(r21611): Several new layout test pixel failures (misspelling markers)
* editing/selection/13804-expected.checksum: Added.
* editing/selection/13804-expected.png: Added.
* editing/selection/13804-expected.txt: Added.
* editing/selection/13804.html: Added.
These were missing:
* editing/selection/5076323-1-expected.png: Added.
* editing/selection/5076323-2-expected.png: Added.
* editing/selection/5076323-3-expected.png: Added.
2007-05-22 Darin Adler <darin@apple.com>
 
Reviewed by Geoff.
2fe1f359aa300d99ded1d40eeba0c04c
\ 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 784x584
RenderBlock {P} at (0,0) size 784x36
RenderText {#text} at (0,0) size 778x36
text run at (0,0) width 778: "This tests for a bug when moving the caret backward through a misspelled word. Once the caret is no longer adjacent to it it"
text run at (0,18) width 203: "should be marked as misspelled."
RenderBlock {DIV} at (0,52) size 784x18
RenderText {#text} at (0,0) size 298x18
text run at (0,0) width 298: "This sentence ends with a misspelled word asd."
caret: position 40 of child 0 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests for a bug when moving the caret backward through a misspelled word. Once the caret is no longer adjacent to it it should be marked as misspelled.</p>
<div id="div" contenteditable="true"><br></div>
<script>
var div = document.getElementById("div");
div.focus();
document.execCommand("InsertText", false, "This sentence ends with a misspelled word asd.");
var selection = window.getSelection();
selection.modify("move", "backward", "character");
selection.modify("move", "backward", "character");
selection.modify("move", "backward", "character");
selection.modify("move", "backward", "character");
selection.modify("move", "backward", "character");
selection.modify("move", "backward", "character");
</script>
2007-05-22 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin, who found the fix independently.
http://bugs.webkit.org/show_bug.cgi?id=13804
REGRESSION(r21611): Several new layout test pixel failures (misspelling markers)
r21611 exposed a bug in the way removeMarkers computes
the end of the range to remove markers from. It also
introduced a bug: removeMarkers expects a startOffset
and a length, not a startOffset and an endOffset (added
a layout test).
* dom/Document.cpp:
(WebCore::Document::removeMarkers): The other removeMarkers
expects a startOffset and a length, not a startOffset and
an endOffset.
(WebCore::Document::removeMarkers): Fixed the endOffset
from length and startOffset calculation.
2007-05-22 David Hyatt <hyatt@apple.com>
 
Fix for bug 13802, background colors can't be reset to default
......@@ -2768,16 +2768,15 @@ void Document::removeMarkers(Range* range, DocumentMarker::MarkerType markerType
ExceptionCode ec = 0;
Node* startContainer = range->startContainer(ec);
int startOffset = range->startOffset(ec);
Node* endContainer = range->endContainer(ec);
int endOffset = range->endOffset(ec);
Node* pastEndNode = range->pastEndNode();
for (Node* node = range->startNode(); node != pastEndNode; node = node->traverseNextNode())
removeMarkers(node,
node == startContainer ? startOffset : 0,
node == endContainer ? endOffset : INT_MAX,
markerType);
for (Node* node = range->startNode(); node != pastEndNode; node = node->traverseNextNode()) {
int startOffset = node == startContainer ? range->startOffset(ec) : 0;
int endOffset = node == endContainer ? range->endOffset(ec) : INT_MAX;
int length = endOffset - startOffset;
removeMarkers(node, startOffset, length, markerType);
}
}
// Markers are stored in order sorted by their location.
......@@ -2891,12 +2890,12 @@ void Document::removeMarkers(Node* node, unsigned startOffset, int length, Docum
Vector<IntRect>& rects = vectorPair->second;
ASSERT(markers.size() == rects.size());
bool docDirty = false;
unsigned endOffset = startOffset + length - 1;
unsigned endOffset = startOffset + length;
for (size_t i = 0; i < markers.size();) {
DocumentMarker marker = markers[i];
// markers are returned in order, so stop if we are now past the specified range
if (marker.startOffset > endOffset)
if (marker.startOffset >= endOffset)
break;
// skip marker that is wrong type or before target
......
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