+2006-07-13 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Hyatt.
+
+ - test and updated results for http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
+ REGRESSION: RTL white-space:pre-wrap text is offset to the right
+
+ * editing/deleting/delete-to-select-table-expected.txt:
+ * editing/execCommand/boldSelection-expected.txt:
+ * editing/execCommand/italicizeByCharacter-expected.txt:
+ * editing/execCommand/modifyForeColorByCharacter-expected.txt:
+ * editing/execCommand/print-expected.txt:
+ * editing/execCommand/selectAll-expected.txt:
+ * editing/execCommand/strikethroughSelection-expected.txt:
+ * editing/inserting/insert-div-027-expected.txt:
+ * editing/selection/after-line-wrap-expected.txt:
+ * editing/selection/mixed-editability-1-expected.txt:
+ * editing/selection/select-all-001-expected.txt:
+ * editing/selection/select-all-002-expected.txt:
+ * editing/selection/select-all-003-expected.txt:
+ * fast/clip/outline-overflowClip-expected.txt:
+ * fast/text/international/rtl-white-space-pre-wrap-expected.checksum: Added.
+ * fast/text/international/rtl-white-space-pre-wrap-expected.png: Added.
+ * fast/text/international/rtl-white-space-pre-wrap-expected.txt: Added.
+ * fast/text/international/rtl-white-space-pre-wrap.html: Added.
+ * fast/text/whitespace/pre-wrap-overflow-selection-expected.txt:
+ * fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt:
+
2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
Reviewed by Geoffrey.
RenderTableRow {TR} at (0,24) size 80x20
RenderTableCell {TD} at (2,24) size 27x20 [r=1 c=0 rs=1 cs=1]
RenderText {#text} at (1,1) size 25x18
- text run at (1,1) width 25: "bar "
+ text run at (1,1) width 24: "bar "
+ text run at (25,1) width 1: " "
RenderTableCell {TD} at (31,24) size 47x20 [r=1 c=1 rs=1 cs=1]
RenderText {#text} at (1,1) size 45x18
text run at (1,1) width 45: "buffalo"
text run at (510,56) width 190: "you can quote then,"
text run at (0,84) width 197: "disagree with them, "
text run at (197,84) width 218: "glorify or vilify them, "
- text run at (415,84) width 341: "about the only thing you can't do is "
+ text run at (415,84) width 340: "about the only thing you can't do is"
+ text run at (755,84) width 1: " "
text run at (0,112) width 129: "ignore them. "
text run at (129,112) width 281: "Because they change things. "
- text run at (410,112) width 346: "They push the human race forward. "
+ text run at (410,112) width 344: "They push the human race forward."
+ text run at (754,112) width 2: " "
text run at (0,140) width 481: "And while some may see them as the crazy ones, "
text run at (481,140) width 146: "we see genius. "
text run at (627,140) width 123: "Because the "
text run at (510,56) width 190: "you can quote then,"
text run at (0,84) width 197: "disagree with them, "
text run at (197,84) width 218: "glorify or vilify them, "
- text run at (415,84) width 341: "about the only thing you can't do is "
+ text run at (415,84) width 340: "about the only thing you can't do is"
+ text run at (755,84) width 1: " "
text run at (0,112) width 129: "ignore them. "
text run at (129,112) width 281: "Because they change things. "
- text run at (410,112) width 346: "They push the human race forward. "
+ text run at (410,112) width 344: "They push the human race forward."
+ text run at (754,112) width 2: " "
text run at (0,140) width 481: "And while some may see them as the crazy ones, "
text run at (481,140) width 146: "we see genius. "
text run at (627,140) width 123: "Because the "
text run at (510,56) width 190: "you can quote then,"
text run at (0,84) width 197: "disagree with them, "
text run at (197,84) width 218: "glorify or vilify them, "
- text run at (415,84) width 341: "about the only thing you can't do is "
+ text run at (415,84) width 340: "about the only thing you can't do is"
+ text run at (755,84) width 1: " "
text run at (0,112) width 129: "ignore them. "
text run at (129,112) width 281: "Because they change things. "
- text run at (410,112) width 346: "They push the human race forward. "
+ text run at (410,112) width 344: "They push the human race forward."
+ text run at (754,112) width 2: " "
text run at (0,140) width 481: "And while some may see them as the crazy ones, "
text run at (481,140) width 146: "we see genius. "
text run at (627,140) width 123: "Because the "
text run at (510,56) width 190: "you can quote then,"
text run at (0,84) width 197: "disagree with them, "
text run at (197,84) width 218: "glorify or vilify them, "
- text run at (415,84) width 341: "about the only thing you can't do is "
+ text run at (415,84) width 340: "about the only thing you can't do is"
+ text run at (755,84) width 1: " "
text run at (0,112) width 129: "ignore them. "
text run at (129,112) width 281: "Because they change things. "
- text run at (410,112) width 346: "They push the human race forward. "
+ text run at (410,112) width 344: "They push the human race forward."
+ text run at (754,112) width 2: " "
text run at (0,140) width 481: "And while some may see them as the crazy ones, "
text run at (481,140) width 146: "we see genius. "
text run at (627,140) width 123: "Because the "
text run at (510,56) width 190: "you can quote then,"
text run at (0,84) width 197: "disagree with them, "
text run at (197,84) width 218: "glorify or vilify them, "
- text run at (415,84) width 341: "about the only thing you can't do is "
+ text run at (415,84) width 340: "about the only thing you can't do is"
+ text run at (755,84) width 1: " "
text run at (0,112) width 129: "ignore them. "
text run at (129,112) width 281: "Because they change things. "
- text run at (410,112) width 346: "They push the human race forward. "
+ text run at (410,112) width 344: "They push the human race forward."
+ text run at (754,112) width 2: " "
text run at (0,140) width 481: "And while some may see them as the crazy ones, "
text run at (481,140) width 146: "we see genius. "
text run at (627,140) width 123: "Because the "
text run at (510,56) width 190: "you can quote then,"
text run at (0,84) width 197: "disagree with them, "
text run at (197,84) width 218: "glorify or vilify them, "
- text run at (415,84) width 341: "about the only thing you can't do is "
+ text run at (415,84) width 340: "about the only thing you can't do is"
+ text run at (755,84) width 1: " "
text run at (0,112) width 129: "ignore them. "
text run at (129,112) width 281: "Because they change things. "
- text run at (410,112) width 346: "They push the human race forward. "
+ text run at (410,112) width 344: "They push the human race forward."
+ text run at (754,112) width 2: " "
text run at (0,140) width 481: "And while some may see them as the crazy ones, "
text run at (481,140) width 146: "we see genius. "
text run at (627,140) width 123: "Because the "
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x56
RenderText {#text} at (0,0) size 784x56
- text run at (0,0) width 784: "Test inserting paragraphs: should see two blue boxes, where the second blue box "
+ text run at (0,0) width 781: "Test inserting paragraphs: should see two blue boxes, where the second blue box"
+ text run at (781,0) width 3: " "
text run at (0,28) width 245: "starts with an empty line."
RenderBlock {DIV} at (0,56) size 784x36
RenderBlock {DIV} at (0,92) size 784x112 [border: (2px solid #0000FF)]
RenderBlock {P} at (0,104) size 784x0
RenderBlock {DIV} at (16,104) size 752x38 [border: (1px solid #000000)]
RenderText {#text} at (1,1) size 750x18
- text run at (1,1) width 750: "don't select me "
+ text run at (1,1) width 749: "don't select me "
+ text run at (750,1) width 1: " "
RenderInline {I} at (0,0) size 150x18
RenderText {#text} at (1,19) size 150x18
text run at (1,19) width 150: "try to select just this text"
text run at (0,0) width 20: "On"
RenderText {#text} at (20,0) size 784x36
text run at (20,0) width 464: "ly the first two letters of the first word in this sentence should be selected. "
- text run at (484,0) width 300: "To run this test manually, double click between "
+ text run at (484,0) width 298: "To run this test manually, double click between"
+ text run at (782,0) width 2: " "
text run at (0,18) width 351: "the first two letters of the first word of the first sentence."
RenderText {#text} at (0,0) size 0x0
selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {BODY} of child 0 {HTML} of document
text run at (0,10) width 558: "Four score and seven years ago our fathers brought forth, "
text run at (0,58) width 589: "upon this continent, a new nation, conceived in Liberty, and "
text run at (0,106) width 577: "dedicated to the proposition that all men are created equal. "
- text run at (0,154) width 600: "Now we are engaged in a great civil war, testing whether that "
+ text run at (0,154) width 596: "Now we are engaged in a great civil war, testing whether that"
+ text run at (596,154) width 4: " "
text run at (0,202) width 565: "nation, or any nation, so conceived, and so dedicated, can "
text run at (0,250) width 571: "long endure. We are met here on a great battlefield of that "
text run at (0,298) width 545: "war. We have come to dedicate a portion of it as a final "
text run at (0,346) width 557: "resting place for those who here gave their lives that that "
text run at (0,394) width 579: "nation might live. It is altogether fitting and proper that we "
text run at (0,442) width 565: "should do this. Four score and seven years ago our fathers "
- text run at (0,490) width 600: "brought forth, upon this continent, a new nation, conceived in "
+ text run at (0,490) width 598: "brought forth, upon this continent, a new nation, conceived in"
+ text run at (598,490) width 2: " "
text run at (0,538) width 560: "Liberty, and dedicated to the proposition that all men are "
text run at (0,586) width 136: "created equal."
selection start: position 1 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
text run at (0,250) width 569: "so dedicated, can long endure. We are met here on a great "
RenderBR {BR} at (569,272) size 0x0
RenderText {#text} at (0,298) size 600x172
- text run at (0,298) width 600: "battlefield of that war. We have come to dedicate a portion of "
+ text run at (0,298) width 600: "battlefield of that war. We have come to dedicate a portion of"
+ text run at (600,298) width 0: " "
text run at (0,346) width 585: "it as a final resting place for those who here gave their lives "
text run at (0,394) width 588: "that that nation might live. It is altogether fitting and proper "
text run at (0,442) width 224: "that we should do this. "
text run at (0,106) width 558: "Four score and seven years ago our fathers brought forth, "
text run at (0,154) width 589: "upon this continent, a new nation, conceived in Liberty, and "
text run at (0,202) width 577: "dedicated to the proposition that all men are created equal. "
- text run at (0,250) width 600: "Now we are engaged in a great civil war, testing whether that "
+ text run at (0,250) width 596: "Now we are engaged in a great civil war, testing whether that"
+ text run at (596,250) width 4: " "
text run at (0,298) width 565: "nation, or any nation, so conceived, and so dedicated, can "
text run at (0,346) width 571: "long endure. We are met here on a great battlefield of that "
text run at (0,394) width 545: "war. We have come to dedicate a portion of it as a final "
text run at (0,442) width 557: "resting place for those who here gave their lives that that "
text run at (0,490) width 579: "nation might live. It is altogether fitting and proper that we "
text run at (0,538) width 565: "should do this. Four score and seven years ago our fathers "
- text run at (0,586) width 600: "brought forth, upon this continent, a new nation, conceived in "
+ text run at (0,586) width 598: "brought forth, upon this continent, a new nation, conceived in"
+ text run at (598,586) width 2: " "
text run at (0,634) width 560: "Liberty, and dedicated to the proposition that all men are "
text run at (0,682) width 142: "created equal. "
RenderBR {BR} at (142,704) size 0x0
layer at (60,64) size 105x24 backgroundClip at (83,64) size 82x24 clip at (83,67) size 79x18 outlineClip at (83,44) size 229x204 scrollWidth 100
RenderBlock (positioned) {DIV} at (52,20) size 105x24 [bgcolor=#EEEEEE] [border: (3px solid #FF0000)]
RenderText {#text} at (3,3) size 99x18
- text run at (3,3) width 99: "text in inner div "
+ text run at (3,3) width 99: "text in inner div"
+ text run at (102,3) width 0: " "
--- /dev/null
+2216646e5a2b89e72ff44940587ff867
\ No newline at end of file
--- /dev/null
+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 104x18
+ text run at (0,0) width 104: "This is a test for "
+ RenderInline {I} at (0,0) size 749x36
+ RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+ RenderText {#text} at (104,0) size 348x18
+ text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9670"
+ RenderText {#text} at (452,0) size 749x36
+ text run at (452,0) width 4: " "
+ text run at (456,0) width 293: "http://bugzilla.opendarwin.org/show_bug.cgi?"
+ text run at (0,18) width 55: "id=9670"
+ RenderText {#text} at (55,18) size 4x18
+ text run at (55,18) width 4: "."
+ RenderBlock {P} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 543x18
+ text run at (0,0) width 543: "All text should be aligned with the right edge of its container and should not overflow."
+ RenderBlock {HR} at (0,86) size 784x2 [border: (1px inset #000000)]
+ RenderBlock {DIV} at (0,96) size 191x56 [bgcolor=#FFFF00]
+ RenderText {#text} at (0,0) size 191x56
+ text run at (0,0) width 0 RTL: " "
+ text run at (0,0) width 191 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4}"
+ text run at (147,28) width 44 RTL: "\x{5DE}\x{5D9}\x{5E5}!"
+ RenderBlock (anonymous) at (0,152) size 784x84
+ RenderBR {BR} at (0,0) size 0x18
+ RenderTextField {TEXTAREA} at (0,20) size 199x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+ RenderText {#text} at (199,66) size 4x18
+ text run at (199,66) width 4: " "
+ RenderBR {BR} at (0,0) size 0x0
+ RenderBlock {DIV} at (0,236) size 191x56 [bgcolor=#FFFF00]
+ RenderText {#text} at (0,0) size 191x56
+ text run at (0,0) width 0 RTL: " "
+ text run at (0,0) width 191 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4}"
+ text run at (147,28) width 44 RTL: "\x{5DE}\x{5D9}\x{5E5}!"
+layer at (9,181) size 197x56
+ RenderBlock {DIV} at (1,1) size 197x56
+ RenderText {#text} at (3,0) size 191x56
+ text run at (3,0) width 0 RTL: " "
+ text run at (3,0) width 191 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4}"
+ text run at (150,28) width 44 RTL: "\x{5DE}\x{5D9}\x{5E5}!"
RenderBlock {HR} at (0,197) size 784x2 [border: (1px inset #000000)]
RenderBlock {PRE} at (0,212) size 108x83 [border: (4px solid #0000FF)]
RenderText {#text} at (4,4) size 100x75
- text run at (4,4) width 100: "This text "
+ text run at (4,4) width 96: "This text "
+ text run at (100,4) width 4: " "
text run at (4,19) width 72: "will wrap"
text run at (76,19) width 0: " "
text run at (4,34) width 96: "and fit "
layer at (8,109) size 108x83 clip at (12,113) size 100x75
RenderBlock {PRE} at (0,101) size 108x83 [border: (4px solid #A52A2A)]
RenderText {#text} at (4,4) size 100x75
- text run at (4,4) width 100: "This text "
+ text run at (4,4) width 96: "This text "
+ text run at (100,4) width 4: " "
text run at (4,19) width 72: "will wrap"
text run at (76,19) width 0: " "
text run at (4,34) width 96: "and fit "
text run at (225,0) width 4: ":"
RenderBlock {PRE} at (0,104) size 51x30 [bgcolor=#C0C0C0]
RenderText {#text} at (0,0) size 51x30
- text run at (0,0) width 51: "foo "
+ text run at (0,0) width 48: "foo "
+ text run at (48,0) width 3: " "
text run at (0,15) width 24: "bar"
RenderBlock {P} at (0,150) size 769x18
RenderText {#text} at (0,0) size 35x18
RenderText {#text} at (0,15) size 48x15
text run at (0,15) width 48: " bar"
RenderBlock {PRE} at (0,227) size 51x30 [bgcolor=#C0C0C0]
- RenderText {#text} at (0,0) size 51x15
+ RenderText {#text} at (0,0) size 56x15
text run at (0,0) width 48: "foo "
- text run at (48,0) width 3: " "
- RenderBR {BR} at (51,12) size 0x0
+ text run at (48,0) width 8: " "
+ RenderBR {BR} at (56,12) size 0x0
RenderText {#text} at (0,15) size 48x15
text run at (0,15) width 48: " bar"
RenderBlock {PRE} at (0,270) size 51x30 [bgcolor=#C0C0C0]
+2006-07-13 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Hyatt.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
+ REGRESSION: RTL white-space:pre-wrap text is offset to the right
+
+ Test: fast/text/international/rtl-white-space-pre-wrap.html
+
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
+ of clipping the caret position to the text box when the caret is after
+ the trailing space of an autowrapped line.
+ * rendering/bidi.cpp:
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
+ to-fit the logically last text box if it contains the trailing spaces of an
+ autowrapped line.
+ (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
+ In the case of autowrapped text with white space that overflows beyond the line,
+ the last text run is the one containing the overflowing white space.
+ (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
+ line that autowraps only after white space into a separate text run.
+
2006-07-13 David Harrison <harrison@apple.com>
Reviewed by Dave Hyatt.
top += absy;
RenderBlock *cb = containingBlock();
- int availableWidth = cb->lineWidth(top);
- if (style()->autoWrap())
- left = min(left, absx + box->m_x + availableWidth - 1);
-
+ if (style()->autoWrap()) {
+ int availableWidth = cb->lineWidth(top);
+ if (!box->m_reversed)
+ left = min(left, absx + availableWidth - 1);
+ else
+ left = max(left, absx + box->m_x);
+ }
+
return IntRect(left, top, 1, height);
}
// Used to track a list of chained bidi runs.
static BidiRun* sFirstBidiRun;
static BidiRun* sLastBidiRun;
+static BidiRun* sLogicallyLastBidiRun;
static int sBidiRunCount;
static BidiRun* sCompactFirstBidiRun;
static BidiRun* sCompactLastBidiRun;
// correct static x position. They have no effect on the width.
// Similarly, line break boxes have no effect on the width.
if (r->obj->isText()) {
- RenderText *rt = static_cast<RenderText *>(r->obj);
+ RenderText* rt = static_cast<RenderText*>(r->obj);
int textWidth = rt->width(r->start, r->stop-r->start, totWidth, m_firstLine);
int effectiveWidth = textWidth;
int rtLength = rt->length();
effectiveWidth += rt->font(m_firstLine)->wordSpacing();
needsWordSpacing = !DeprecatedChar(rt->text()[r->stop-1]).isSpace() && r->stop == rtLength;
}
- if (!r->compact) {
- RenderStyle *style = r->obj->style();
- if (style->autoWrap() && style->breakOnlyAfterWhiteSpace()) {
- // shrink the box as needed to keep the line from overflowing the available width
- textWidth = min(effectiveWidth, availableWidth - totWidth);
- }
- }
r->box->setWidth(textWidth);
} else if (!r->obj->isInlineFlow()) {
r->obj->calcWidth();
totWidth += r->box->width();
}
+ if (totWidth > availableWidth && sLogicallyLastBidiRun->obj->style(m_firstLine)->autoWrap() &&
+ sLogicallyLastBidiRun->obj->style(m_firstLine)->breakOnlyAfterWhiteSpace() &&
+ !sLogicallyLastBidiRun->compact) {
+ sLogicallyLastBidiRun->box->setWidth(sLogicallyLastBidiRun->box->width() - totWidth + availableWidth);
+ totWidth = availableWidth;
+ }
+
// Armed with the total width of the line (without justification),
// we now examine our text-align property in order to determine where to position the
// objects horizontally. The total width of the line can be increased if we end up
}
}
+ sLogicallyLastBidiRun = sLastBidiRun;
+
// reorder line according to run structure...
// do not reverse for visually ordered web sites
if (!style()->visuallyOrdered()) {
if (w + tmpW <= width) {
lBreak.obj = o;
lBreak.pos = pos;
+ if (pos > 0) {
+ // Separate the trailing space into its own box, which we will
+ // resize to fit on the line in computeHorizontalPositionsForLine().
+ BidiIterator midpoint(0, o, pos);
+ addMidpoint(BidiIterator(0, o, pos-1)); // Stop
+ addMidpoint(BidiIterator(0, o, pos)); // Start
+ }
skipWhitespace(lBreak, bidi);
}
}