Changeset 82144 in webkit
- Timestamp:
- Mar 28, 2011 12:44:19 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r82135 r82144 1 2011-03-28 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Simon Fraser and Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57221, memory corruption/crashes when positioned objects 6 occur at the end of a line. 7 8 The old code and new code for dealing with a trailing space object midpoint manipulated a raw 9 array instead of the Vector. Otherwise this corruption would have been caught prior to check-in. 10 11 I have patched the code to only go through the Vector and to make it handle the case that led to 12 the corruption. Trailing positioned objects can occur both prior to and following the trailing space 13 object's midpoint, so we have to be prepared to deal with both cases. 14 15 This is already tested by fast/block/positioning/052.html, and that test now properly progresses 16 like the other positioning tests did. 17 18 * platform/mac/fast/block/positioning/052-expected.txt: 19 1 20 2011-03-28 Sergio Villar Senin <svillar@igalia.com> 2 21 -
trunk/LayoutTests/platform/mac/fast/block/positioning/052-expected.txt
r25970 r82144 6 6 RenderBlock {DIV} at (0,0) size 784x18 7 7 RenderText {#text} at (0,0) size 0x0 8 layer at (108,8) size 3 9x189 RenderInline (relative positioned) {SPAN} at (0,0) size 3 9x1810 RenderText {#text} at (0,0) size 3 9x1811 text run at (0,0) width 3 9: "Hello"8 layer at (108,8) size 35x18 9 RenderInline (relative positioned) {SPAN} at (0,0) size 35x18 10 RenderText {#text} at (0,0) size 35x18 11 text run at (0,0) width 35: "Hello" 12 12 layer at (158,58) size 35x18 13 13 RenderBlock (positioned) {DIV} at (50,50) size 35x18 [color=#FFFFFF] [bgcolor=#008000] -
trunk/Source/WebCore/ChangeLog
r82138 r82144 1 2011-03-28 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Simon Fraser and Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57221, memory corruption/crashes when positioned objects 6 occur at the end of a line. 7 8 The old code and new code for dealing with a trailing space object midpoint manipulated a raw 9 array instead of the Vector. Otherwise this corruption would have been caught prior to check-in. 10 11 I have patched the code to only go through the Vector and to make it handle the case that led to 12 the corruption. Trailing positioned objects can occur both prior to and following the trailing space 13 object's midpoint, so we have to be prepared to deal with both cases. 14 15 This is already tested by fast/block/positioning/052.html, and that test now properly progresses 16 like the other positioning tests did. 17 18 * rendering/RenderBlockLineLayout.cpp: 19 (WebCore::RenderBlock::findNextLineBreak): 20 1 21 2011-03-28 Andrei Popescu <andreip@google.com> 2 22 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r82105 r82144 1639 1639 // then start ignoring spaces again. 1640 1640 if (isInlineType || o->container()->isRenderInline()) { 1641 ignoreStart.obj = o;1642 ignoreStart.pos = 0;1643 1641 if (ignoringSpaces) { 1642 ignoreStart.obj = o; 1643 ignoreStart.pos = 0; 1644 1644 addMidpoint(lineMidpointState, ignoreStart); // Stop ignoring spaces. 1645 1645 addMidpoint(lineMidpointState, ignoreStart); // Start ignoring again. … … 2118 2118 // exclude the space, allowing it to - in effect - collapse into the newline. 2119 2119 if (lineMidpointState.numMidpoints % 2) { 2120 InlineIterator* midpoints = lineMidpointState.midpoints.data(); 2121 midpoints[lineMidpointState.numMidpoints - trailingPositionedBoxes.size() * 2 - 1].pos--; 2120 // Find the trailing space object's midpoint. 2121 int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1; 2122 for ( ; trailingSpaceMidpoint >= 0 && lineMidpointState.midpoints[trailingSpaceMidpoint].obj != trailingSpaceObject; --trailingSpaceMidpoint) { } 2123 ASSERT(trailingSpaceMidpoint >= 0); 2124 lineMidpointState.midpoints[trailingSpaceMidpoint].pos--; 2125 2126 // Now make sure every single trailingPositionedBox following the trailingSpaceMidpoint properly stops and starts 2127 // ignoring spaces. 2128 size_t currentMidpoint = trailingSpaceMidpoint + 1; 2129 for (size_t i = 0; i < trailingPositionedBoxes.size(); ++i) { 2130 if (currentMidpoint >= lineMidpointState.numMidpoints) { 2131 // We don't have a midpoint for this box yet. 2132 InlineIterator ignoreStart(this, trailingPositionedBoxes[i], 0); 2133 addMidpoint(lineMidpointState, ignoreStart); // Stop ignoring. 2134 addMidpoint(lineMidpointState, ignoreStart); // Start ignoring again. 2135 } else { 2136 ASSERT(lineMidpointState.midpoints[currentMidpoint].obj == trailingPositionedBoxes[i]); 2137 ASSERT(lineMidpointState.midpoints[currentMidpoint + 1].obj == trailingPositionedBoxes[i]); 2138 } 2139 currentMidpoint += 2; 2140 } 2122 2141 } else if (!lBreak.obj && trailingSpaceObject->isText()) { 2123 2142 // Add a new end midpoint that stops right at the very end.
Note: See TracChangeset
for help on using the changeset viewer.