[webkit-changes] cvs commit: WebCore/layout-tests/editing/selection
extend-by-word-001-expected.txt extend-by-word-001.html
David
harrison at opensource.apple.com
Tue Aug 9 18:13:54 PDT 2005
harrison 05/08/09 18:13:54
Modified: . ChangeLog
khtml/editing visible_text.cpp
Added: layout-tests/editing/selection
extend-by-word-001-expected.txt
extend-by-word-001.html
Log:
Reviewed by Dave Hyatt.
<rdar://problem/4210906> Word selection wrong with tabs
Test cases added: selection/extend-by-word-001-html
* khtml/editing/visible_text.cpp:
(khtml::TextIterator::handleTextNode):
* layout-tests/editing/selection/extend-by-word-001-html: Added.
* layout-tests/editing/selection/extend-by-word-001-expected.txt: Added.
Revision Changes Path
1.4552 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4551
retrieving revision 1.4552
diff -u -r1.4551 -r1.4552
--- ChangeLog 9 Aug 2005 22:22:18 -0000 1.4551
+++ ChangeLog 10 Aug 2005 01:13:50 -0000 1.4552
@@ -1,3 +1,16 @@
+2005-08-09 David Harrison <harrison at apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ <rdar://problem/4210906> Word selection wrong with tabs
+
+ Test cases added: selection/extend-by-word-001-html
+
+ * khtml/editing/visible_text.cpp:
+ (khtml::TextIterator::handleTextNode):
+ * layout-tests/editing/selection/extend-by-word-001-html: Added.
+ * layout-tests/editing/selection/extend-by-word-001-expected.txt: Added.
+
2005-08-09 Justin Garcia <justin.garcia at apple.com>
Patch by Anders Carlsson <andersca at mac.com>
1.32 +3 -0 WebCore/khtml/editing/visible_text.cpp
Index: visible_text.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/visible_text.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- visible_text.cpp 30 Jul 2005 02:33:15 -0000 1.31
+++ visible_text.cpp 10 Aug 2005 01:13:54 -0000 1.32
@@ -229,6 +229,9 @@
long end = (m_node == m_endContainer) ? m_endOffset : LONG_MAX;
long runEnd = kMin(strLength, end);
+ if (runStart >= runEnd)
+ return true;
+
m_positionNode = m_node;
m_positionOffsetBaseNode = 0;
m_positionStartOffset = runStart;
1.1 WebCore/layout-tests/editing/selection/extend-by-word-001-expected.txt
Index: extend-by-word-001-expected.txt
===================================================================
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
RenderCanvas 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 {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
RenderBlock {DIV} at (14,14) size 756x28
RenderText {TEXT} at (0,0) size 32x28
text run at (0,0) width 32: "foo"
RenderInline {SPAN} at (0,0) size 16x28
RenderText {TEXT} at (32,0) size 16x28
text run at (32,0) width 16: "\x{9}"
RenderText {TEXT} at (48,0) size 31x28
text run at (48,0) width 31: "bar"
selection start: position 0 of child 2 {TEXT} of child 1 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
selection end: position 3 of child 2 {TEXT} of child 1 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
1.1 WebCore/layout-tests/editing/selection/extend-by-word-001.html
Index: extend-by-word-001.html
===================================================================
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
.cell {
padding: 12px;
font-size: 24px;
height: 48px;
}
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
function editingTest() {
for (i = 0; i < 4; i++)
moveSelectionForwardByCharacterCommand();
extendSelectionForwardByWordCommand();
}
</script>
<title>Editing Test</title>
</head>
<body>
<div contenteditable id="root" class="editing">
<div id="test">foo<span class="Apple-tab-span" style="white-space:pre"> </span>bar</div>
</div>
<!--
Specifically checks test case in bug:
<rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
-->
<script>
runEditingTest();
</script>
</body>
</html>
More information about the webkit-changes
mailing list