--- /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 784x576
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {I} at (0,0) size 731x36
+ RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+ RenderText {#text} at (53,0) size 301x18
+ text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13156"
+ RenderText {#text} at (354,0) size 731x36
+ text run at (354,0) width 4: " "
+ text run at (358,0) width 373: "REGRESSION (r19621): Pasting breakable content where"
+ text run at (0,18) width 492: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
+ RenderText {#text} at (492,18) size 4x18
+ text run at (492,18) width 4: "."
+ RenderBlock {P} at (0,52) size 784x36
+ RenderText {#text} at (0,0) size 780x36
+ text run at (0,0) width 780: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The behavior is"
+ text run at (0,18) width 619: "tested after breakable characters (question mark and hyphen), after a space and after a soft hyphen."
+ RenderBlock {P} at (0,104) size 784x18
+ RenderText {#text} at (0,0) size 261x18
+ text run at (0,0) width 261: "The following blocks should be identical."
+ RenderBlock (floating) {DIV} at (4,142) size 300x162 [bgcolor=#FFFFE0]
+ RenderText {#text} at (0,0) size 300x162
+ text run at (0,0) width 186: "Curabiturpretium,quamquiss?"
+ text run at (0,18) width 298: "empermalesuada,estliberofeugiatlibero,velfringi"
+ text run at (0,36) width 131: "llaorcinibhsedneque-"
+ text run at (0,54) width 300: "Quisqueeunullanonnisimolestieaccumsan.Etiam"
+ text run at (0,72) width 191: "tellusurna,laoreetac,laoreetnon"
+ text run at (0,90) width 298: "suscipitsed,sapien.Phasellusvehicula,sematposu"
+ text run at (0,108) width 221: "erevehicula,auguenibhmolestienisl\x{AD}"
+ text run at (0,126) width 298: "necullamcorperlacusantevulputatepede.Nascetu"
+ text run at (0,144) width 89: "rridiculusmus."
+ RenderBlock (floating) {DIV} at (312,142) size 300x162 [bgcolor=#FFFFE0]
+ RenderText {#text} at (0,0) size 186x18
+ text run at (0,0) width 186: "Curabiturpretium,quamquiss?"
+ RenderBR {BR} at (186,14) size 0x0
+ RenderText {#text} at (0,18) size 298x18
+ text run at (0,18) width 298: "empermalesuada,estliberofeugiatlibero,velfringi"
+ RenderBR {BR} at (298,32) size 0x0
+ RenderText {#text} at (0,36) size 131x18
+ text run at (0,36) width 131: "llaorcinibhsedneque-"
+ RenderBR {BR} at (131,50) size 0x0
+ RenderText {#text} at (0,54) size 300x18
+ text run at (0,54) width 300: "Quisqueeunullanonnisimolestieaccumsan.Etiam"
+ RenderBR {BR} at (300,68) size 0x0
+ RenderText {#text} at (0,72) size 191x18
+ text run at (0,72) width 191: "tellusurna,laoreetac,laoreetnon"
+ RenderBR {BR} at (191,86) size 0x0
+ RenderText {#text} at (0,90) size 298x18
+ text run at (0,90) width 298: "suscipitsed,sapien.Phasellusvehicula,sematposu"
+ RenderBR {BR} at (298,104) size 0x0
+ RenderText {#text} at (0,108) size 221x18
+ text run at (0,108) width 221: "erevehicula,auguenibhmolestienisl-"
+ RenderBR {BR} at (221,122) size 0x0
+ RenderText {#text} at (0,126) size 298x18
+ text run at (0,126) width 298: "necullamcorperlacusantevulputatepede.Nascetu"
+ RenderBR {BR} at (298,140) size 0x0
+ RenderText {#text} at (0,144) size 89x18
+ text run at (0,144) width 89: "rridiculusmus."
--- /dev/null
+<head>
+ <style>
+ div { margin: 4px; width: 300px; background: lightyellow; word-wrap: break-word; float: left; }
+ </style>
+</head>
+<body>
+ <p>
+ Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13156">http://bugs.webkit.org/show_bug.cgi?id=13156</a>
+ REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar</i>.
+ </p>
+ <p>
+ This tests that a line break will occur in the middle of the first word on a line if it’s too long to fit on the line. The behavior is tested after breakable characters (question mark and hyphen), after a space and after a soft hyphen.
+ </p>
+ <p>
+ The following blocks should be identical.
+ </p>
+ <div>
+ Curabiturpretium,quamquiss?empermalesuada,estliberofeugiatlibero,velfringillaorcinibhsedneque-Quisqueeunullanonnisimolestieaccumsan.Etiamtellusurna,laoreetac,laoreetnon suscipitsed,sapien.Phasellusvehicula,sematposuerevehicula,auguenibhmolestienisl­necullamcorperlacusantevulputatepede.Nasceturridiculusmus.
+ </div>
+ <div>
+ Curabiturpretium,quamquiss?<br>
+ empermalesuada,estliberofeugiatlibero,velfringi<br>
+ llaorcinibhsedneque-<br>
+ Quisqueeunullanonnisimolestieaccumsan.Etiam<br>
+ tellusurna,laoreetac,laoreetnon<br>
+ suscipitsed,sapien.Phasellusvehicula,sematposu<br>
+ erevehicula,auguenibhmolestienisl-<br>
+ necullamcorperlacusantevulputatepede.Nascetu<br>
+ rridiculusmus.
+ </div>
+</body>
RenderObject *last = o;
RenderObject *previous = o;
int pos = start.pos;
+ bool atStart = true;
bool prevLineBrokeCleanly = previousLineBrokeCleanly;
previousLineBrokeCleanly = false;
currentCharacterIsWS = currentCharacterIsSpace || (breakNBSP && c == noBreakSpace);
if (breakWords && !midWordBreak) {
- wrapW += t->width(pos, 1, f, w+wrapW);
+ wrapW += t->width(pos, 1, f, w + wrapW);
midWordBreak = w + wrapW > width;
}
- bool betweenWords = c == '\n' || (currWS != PRE && isBreakable(str, pos, strlen, nextBreakable, breakNBSP));
+ bool betweenWords = c == '\n' || (currWS != PRE && !atStart && isBreakable(str, pos, strlen, nextBreakable, breakNBSP));
if (betweenWords || midWordBreak) {
bool stoppedIgnoringSpaces = false;
pos++;
len--;
+ atStart = false;
}
// IMPORTANT: pos is > length here!
checkForBreak = true;
}
bool willFitOnLine = (w + tmpW <= width);
- bool canPlaceOnLine = willFitOnLine || !willFitOnLine && !autoWrapWasEverTrueOnLine;
+ bool canPlaceOnLine = willFitOnLine || !autoWrapWasEverTrueOnLine;
if (canPlaceOnLine && checkForBreak) {
w += tmpW;
tmpW = 0;
currentCharacterIsSpace = false;
pos = 0;
+ atStart = false;
}