[webkit-changes] cvs commit: WebCore/khtml/rendering bidi.cpp
David
harrison at opensource.apple.com
Mon Aug 15 17:38:13 PDT 2005
harrison 05/08/15 17:38:13
Modified: . Tag: Safari-2-0-branch ChangeLog
khtml/rendering Tag: Safari-2-0-branch bidi.cpp
Log:
Merged fix from TOT to Safari-2-0-branch
<rdar://problem/4202641> Line breaks do not happen inside whitespace:pre; word-wrap: break-word
Test cases added: fast/text/whitespace/tab-character-basics.html
Refined Dave's earlier patch for this bug to handle whitespace:pre that is not at the beginning of a line.
* khtml/rendering/bidi.cpp:
(khtml::RenderBlock::findNextLineBreak):
* layout-tests/fast/text/whitespace/tab-character-basics-expected.txt: Added.
* layout-tests/fast/text/whitespace/tab-character-basics.html: Added.
Revision Changes Path
No revision
No revision
1.4104.2.117 +14 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4104.2.116
retrieving revision 1.4104.2.117
diff -u -r1.4104.2.116 -r1.4104.2.117
--- ChangeLog 13 Aug 2005 20:23:00 -0000 1.4104.2.116
+++ ChangeLog 16 Aug 2005 00:38:05 -0000 1.4104.2.117
@@ -1,3 +1,17 @@
+2005-08-15 David Harrison <harrison at apple.com>
+
+ Merged fix from TOT to Safari-2-0-branch
+ <rdar://problem/4202641> Line breaks do not happen inside whitespace:pre; word-wrap: break-word
+
+ Test cases added: fast/text/whitespace/tab-character-basics.html
+
+ Refined Dave's earlier patch for this bug to handle whitespace:pre that is not at the beginning of a line.
+
+ * khtml/rendering/bidi.cpp:
+ (khtml::RenderBlock::findNextLineBreak):
+ * layout-tests/fast/text/whitespace/tab-character-basics-expected.txt: Added.
+ * layout-tests/fast/text/whitespace/tab-character-basics.html: Added.
+
=== Safari-416.1 ===
2005-08-13 Adele Peterson <adele at apple.com>
No revision
No revision
1.125.8.6 +6 -6 WebCore/khtml/rendering/bidi.cpp
Index: bidi.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/bidi.cpp,v
retrieving revision 1.125.8.5
retrieving revision 1.125.8.6
diff -u -r1.125.8.5 -r1.125.8.6
--- bidi.cpp 13 Aug 2005 17:13:18 -0000 1.125.8.5
+++ bidi.cpp 16 Aug 2005 00:38:12 -0000 1.125.8.6
@@ -2061,7 +2061,7 @@
bool previousCharacterIsSpace = currentCharacterIsSpace;
bool previousCharacterIsWS = currentCharacterIsWS;
const QChar c = str[pos];
- currentCharacterIsSpace = c == ' ' || (!isPre && (c == '\n' || c == '\t'));
+ currentCharacterIsSpace = c == ' ' || c == '\t' || (!isPre && (c == '\n'));
if (isPre || !currentCharacterIsSpace)
isLineEmpty = false;
@@ -2094,13 +2094,13 @@
bool applyWordSpacing = false;
bool isNormal = o->style()->whiteSpace() == NORMAL;
bool breakNBSP = isNormal && o->style()->nbspMode() == SPACE;
- bool breakWords = w == 0 && isNormal && o->style()->wordWrap() == BREAK_WORD;
+ bool breakWords = o->style()->wordWrap() == BREAK_WORD && ((isNormal && w == 0) || o->style()->whiteSpace() == PRE);
currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c.unicode() == nonBreakingSpace);
if (breakWords)
wrapW += t->width(pos, 1, f, w+wrapW);
- if (c == '\n' || (!isPre && isBreakable(str, pos, strlen, breakNBSP)) || (breakWords && wrapW > width)) {
+ if (c == '\n' || (!isPre && isBreakable(str, pos, strlen, breakNBSP)) || (breakWords && (w + wrapW > width))) {
if (ignoringSpaces) {
if (!currentCharacterIsSpace) {
// Stop ignoring spaces and begin at this
@@ -2150,7 +2150,7 @@
}
}
- if (o->style()->whiteSpace() == NORMAL) {
+ if (o->style()->whiteSpace() == NORMAL || breakWords) {
// In AFTER_WHITE_SPACE mode, consider the current character
// as candidate width for this line.
int charWidth = o->style()->khtmlLineBreak() == AFTER_WHITE_SPACE ? t->width(pos, 1, f, w+tmpW) : 0;
@@ -2161,7 +2161,7 @@
// If the line needs the extra whitespace to be too long,
// then move the line break to the space and skip all
// additional whitespace.
- if (w + tmpW < width) {
+ if (w + tmpW <= width) {
lBreak.obj = o;
lBreak.pos = pos;
skipWhitespace(lBreak, bidi);
@@ -2265,7 +2265,7 @@
int strlen = nextText->stringLength();
QChar *str = nextText->text();
if (strlen &&
- ((str[0].unicode() == ' ') ||
+ (str[0].unicode() == ' ' || str[0].unicode() == '\t' ||
(next->style()->whiteSpace() != PRE && str[0] == '\n')))
// If the next item on the line is text, and if we did not end with
// a space, then the next text run continues our word (and so it needs to
More information about the webkit-changes
mailing list