[webkit-changes] cvs commit: WebCore/layout-tests/editing/style
create-block-for-style-004-expected.txt
David
harrison at opensource.apple.com
Tue Jun 28 09:22:05 PDT 2005
harrison 05/06/28 09:22:04
Modified: . ChangeLog
khtml/rendering render_text.cpp
layout-tests/editing/style
create-block-for-style-004-expected.txt
Log:
Reviewed by Chris Blumenberg.
Test cases added: (NONE)
(continued) <rdar://problem/4140688> assertion failure double-clicking text to select
Fixed my checkin from yesterday.
* khtml/rendering/render_text.cpp:
(InlineTextBox::paintMarkedTextBackground):
(InlineTextBox::positionForOffset):
Changed tabs to spaces.
(RenderText::positionForCoordinates):
Make sure affinity is downstream when in mid-line.
Changed tabs to spaces.
(RenderText::caretRect):
(RenderText::cacheWidths):
(RenderText::trimmedMinMaxWidth):
(RenderText::minXPos):
(RenderText::width):
(RenderText::caretMaxOffset):
Changed tabs to spaces.
* layout-tests/editing/style/create-block-for-style-004-expected.txt:
Expected ending selection affinity is downstream.
Revision Changes Path
1.4321 +31 -2 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4320
retrieving revision 1.4321
diff -u -r1.4320 -r1.4321
--- ChangeLog 28 Jun 2005 05:47:22 -0000 1.4320
+++ ChangeLog 28 Jun 2005 16:22:01 -0000 1.4321
@@ -1,3 +1,32 @@
+2005-06-28 David Harrison <harrison at apple.com>
+
+ Reviewed by Chris Blumenberg.
+
+ Test cases added: (NONE)
+
+ (continued) <rdar://problem/4140688> assertion failure double-clicking text to select
+ Fixed my checkin from yesterday.
+
+ * khtml/rendering/render_text.cpp:
+ (InlineTextBox::paintMarkedTextBackground):
+ (InlineTextBox::positionForOffset):
+ Changed tabs to spaces.
+
+ (RenderText::positionForCoordinates):
+ Make sure affinity is downstream when in mid-line.
+ Changed tabs to spaces.
+
+ (RenderText::caretRect):
+ (RenderText::cacheWidths):
+ (RenderText::trimmedMinMaxWidth):
+ (RenderText::minXPos):
+ (RenderText::width):
+ (RenderText::caretMaxOffset):
+ Changed tabs to spaces.
+
+ * layout-tests/editing/style/create-block-for-style-004-expected.txt:
+ Expected ending selection affinity is downstream.
+
2005-06-27 Maciej Stachowiak <mjs at apple.com>
Remove accidentally committed code that breaks the build. Oops!
@@ -38,11 +67,11 @@
Test cases added: None because this relies on mouse clicking.
- <rdar://problem/4140688> assertion failure double-clicking text to select
+ <rdar://problem/4140688> assertion failure double-clicking text to select
* khtml/rendering/render_text.cpp:
(RenderText::positionForCoordinates):
- Use setAffinityUsingLinePosition.
+ Use setAffinityUsingLinePosition.
2005-06-25 Darin Adler <darin at apple.com>
1.184 +36 -35 WebCore/khtml/rendering/render_text.cpp
Index: render_text.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_text.cpp,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- render_text.cpp 27 Jun 2005 19:12:34 -0000 1.183
+++ render_text.cpp 28 Jun 2005 16:22:04 -0000 1.184
@@ -553,7 +553,7 @@
int y = r->selectionTop();
int h = r->selectionHeight();
f->drawHighlightForText(p, x, y + ty, h, textObject()->str->s, textObject()->str->l, m_start, m_len,
- m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, style->visuallyOrdered(), sPos, ePos, c);
+ m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR, style->visuallyOrdered(), sPos, ePos, c);
p->restore();
}
@@ -741,13 +741,13 @@
int left;
if (m_reversed) {
- long len = m_start + m_len - offset;
- QString string(text->str->s + offset, len);
- left = m_x + fm.boundingRect(string, len).right();
+ long len = m_start + m_len - offset;
+ QString string(text->str->s + offset, len);
+ left = m_x + fm.boundingRect(string, len).right();
} else {
- long len = offset - m_start;
- QString string(text->str->s + m_start, len);
- left = m_x + fm.boundingRect(string, len).right();
+ long len = offset - m_start;
+ QString string(text->str->s + m_start, len);
+ left = m_x + fm.boundingRect(string, len).right();
}
// FIXME: Do we need to add rightBearing here?
return left;
@@ -954,9 +954,10 @@
// check to see if position goes in this box
int offset = box->offsetForPosition(_x - absx);
if (offset != -1) {
- VisiblePosition result = VisiblePosition(element(), offset + box->m_start, UPSTREAM);
- setAffinityUsingLinePosition(result);
- return result;
+ EAffinity affinity = offset >= box->m_len && !box->nextOnLine() ? UPSTREAM : DOWNSTREAM;
+ VisiblePosition result = VisiblePosition(element(), offset + box->m_start, affinity);
+ setAffinityUsingLinePosition(result);
+ return result;
}
}
else if (!box->prevOnLine() && _x < absx + box->m_x) {
@@ -968,9 +969,9 @@
// box is last on line
// and the x coordinate is to the right of the last text box right edge
VisiblePosition result = VisiblePosition(element(), box->m_start + box->m_len, UPSTREAM);
- setAffinityUsingLinePosition(result);
- return result;
- }
+ setAffinityUsingLinePosition(result);
+ return result;
+ }
}
}
@@ -1049,18 +1050,18 @@
return object->caretRect(0, affinity);
}
} else {
- InlineTextBox *prevBox = box->prevTextBox();
- if (offset == box->m_start && affinity == UPSTREAM && prevBox && !box->prevOnLine()) {
- if (prevBox) {
- box = prevBox;
- offset = box->m_start + box->m_len;
- } else {
- RenderObject *object = lastRendererOnPrevLine(box);
- if (object)
- return object->caretRect(0, affinity);
- }
- }
- }
+ InlineTextBox *prevBox = box->prevTextBox();
+ if (offset == box->m_start && affinity == UPSTREAM && prevBox && !box->prevOnLine()) {
+ if (prevBox) {
+ box = prevBox;
+ offset = box->m_start + box->m_len;
+ } else {
+ RenderObject *object = lastRendererOnPrevLine(box);
+ if (object)
+ return object->caretRect(0, affinity);
+ }
+ }
+ }
break;
}
}
@@ -1147,7 +1148,7 @@
{
const Font *f = htmlFont( false );
- if (shouldUseMonospaceCache(f)){
+ if (shouldUseMonospaceCache(f)){
float fw;
QChar c(' ');
f->floatCharacterWidths( &c, 1, 0, 1, 0, &fw);
@@ -1255,11 +1256,11 @@
beginMaxW = 0;
firstLine = false;
}
-
- if (i == len-1)
- // A <pre> run that ends with a newline, as in, e.g.,
- // <pre>Some text\n\n<span>More text</pre>
- endMaxW = 0;
+
+ if (i == len-1)
+ // A <pre> run that ends with a newline, as in, e.g.,
+ // <pre>Some text\n\n<span>More text</pre>
+ endMaxW = 0;
}
}
}
@@ -1421,7 +1422,7 @@
if (!m_firstTextBox) return 0;
int retval=6666666;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- retval = kMin(retval, (int)box->m_x);
+ retval = kMin(retval, (int)box->m_x);
return retval;
}
@@ -1674,13 +1675,13 @@
int w;
if ( f == &style()->htmlFont() && from == 0 && len == str->l )
- w = m_maxWidth;
+ w = m_maxWidth;
#if APPLE_CHANGES
else if (f == &style()->htmlFont())
w = widthFromCache (f, from, len);
#endif
else
- w = f->width(str->s, str->l, from, len );
+ w = f->width(str->s, str->l, from, len );
//kdDebug( 6040 ) << "RenderText::width(" << from << ", " << len << ") = " << w << endl;
return w;
@@ -1785,7 +1786,7 @@
return str->l;
int maxOffset = box->m_start + box->m_len;
for (box = box->prevTextBox(); box; box = box->prevTextBox())
- maxOffset = kMax(maxOffset,box->m_start + box->m_len);
+ maxOffset = kMax(maxOffset,box->m_start + box->m_len);
return maxOffset;
}
1.6 +1 -1 WebCore/layout-tests/editing/style/create-block-for-style-004-expected.txt
Index: create-block-for-style-004-expected.txt
===================================================================
RCS file: /cvs/root/WebCore/layout-tests/editing/style/create-block-for-style-004-expected.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- create-block-for-style-004-expected.txt 14 Jun 2005 22:37:00 -0000 1.5
+++ create-block-for-style-004-expected.txt 28 Jun 2005 16:22:04 -0000 1.6
@@ -21,4 +21,4 @@
RenderText {TEXT} at (361,14) size 34x28
text run at (361,14) width 34: "baz"
RenderBlock (anonymous) at (14,98) size 756x0
-caret: position 3 of child 0 {TEXT} of child 2 {DIV} of child 2 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document (upstream affinity)
+caret: position 3 of child 0 {TEXT} of child 2 {DIV} of child 2 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
More information about the webkit-changes
mailing list