- Revision
- 87026
- Author
- [email protected]
- Date
- 2011-05-21 21:44:27 -0700 (Sat, 21 May 2011)
Log Message
<rdar://problem/9479926> REGRESSION (r82144): Icon overlaps text in Twitter message dialog
https://bugs.webkit.org/show_bug.cgi?id=61241
Reviewed by Darin Adler.
Source/WebCore:
Test: fast/block/positioning/start-ignoring-before.html
* rendering/RenderBlockLineLayout.cpp:
(WebCore::TrailingObjects::updateMidpointsForTrailingBoxes): Added a boolean parameter saying
whether to merge the first trailing space with the line break.
(WebCore::RenderBlock::LineBreaker::nextLineBreak): When adding a midpoint behind the current
character, account for trailing positioned objects that occurred after the midpoint by calling
updateMidpointsForTrailingBoxes(), which adds midpoints for them.
LayoutTests:
* fast/block/positioning/start-ignoring-before-expected.png: Added.
* fast/block/positioning/start-ignoring-before-expected.txt: Added.
* fast/block/positioning/start-ignoring-before.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (87025 => 87026)
--- trunk/LayoutTests/ChangeLog 2011-05-22 03:08:24 UTC (rev 87025)
+++ trunk/LayoutTests/ChangeLog 2011-05-22 04:44:27 UTC (rev 87026)
@@ -1,3 +1,14 @@
+2011-05-21 Dan Bernstein <[email protected]>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/9479926> REGRESSION (r82144): Icon overlaps text in Twitter message dialog
+ https://bugs.webkit.org/show_bug.cgi?id=61241
+
+ * fast/block/positioning/start-ignoring-before-expected.png: Added.
+ * fast/block/positioning/start-ignoring-before-expected.txt: Added.
+ * fast/block/positioning/start-ignoring-before.html: Added.
+
2011-05-21 Justin Schuh <[email protected]>
Unreviewed.
Added: trunk/LayoutTests/fast/block/positioning/start-ignoring-before-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/block/positioning/start-ignoring-before-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/block/positioning/start-ignoring-before-expected.txt (0 => 87026)
--- trunk/LayoutTests/fast/block/positioning/start-ignoring-before-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/start-ignoring-before-expected.txt 2011-05-22 04:44:27 UTC (rev 87026)
@@ -0,0 +1,15 @@
+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 {DIV} at (0,0) size 784x50
+ RenderText {#text} at (0,0) size 100x50
+ text run at (0,0) width 100: "X "
+ RenderText {#text} at (0,0) size 0x0
+ RenderInline {SPAN} at (0,0) size 50x50 [color=#FF0000]
+ RenderText {#text} at (100,0) size 50x50
+ text run at (100,0) width 50: "Y"
+ RenderText {#text} at (0,0) size 0x0
+layer at (108,8) size 50x50
+ RenderImage {IMG} at (108,8) size 50x50 [bgcolor=#008000]
Added: trunk/LayoutTests/fast/block/positioning/start-ignoring-before.html (0 => 87026)
--- trunk/LayoutTests/fast/block/positioning/start-ignoring-before.html (rev 0)
+++ trunk/LayoutTests/fast/block/positioning/start-ignoring-before.html 2011-05-22 04:44:27 UTC (rev 87026)
@@ -0,0 +1,3 @@
+<div style="font: 50px ahem; -webkit-font-smoothing: none;">
+ X <img style="position: absolute; width: 50px; height: 50px; background-color: green;"> <span style="color: red;">Y</span>
+</div>
Modified: trunk/Source/WebCore/ChangeLog (87025 => 87026)
--- trunk/Source/WebCore/ChangeLog 2011-05-22 03:08:24 UTC (rev 87025)
+++ trunk/Source/WebCore/ChangeLog 2011-05-22 04:44:27 UTC (rev 87026)
@@ -1,3 +1,19 @@
+2011-05-21 Dan Bernstein <[email protected]>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/9479926> REGRESSION (r82144): Icon overlaps text in Twitter message dialog
+ https://bugs.webkit.org/show_bug.cgi?id=61241
+
+ Test: fast/block/positioning/start-ignoring-before.html
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::TrailingObjects::updateMidpointsForTrailingBoxes): Added a boolean parameter saying
+ whether to merge the first trailing space with the line break.
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak): When adding a midpoint behind the current
+ character, account for trailing positioned objects that occurred after the midpoint by calling
+ updateMidpointsForTrailingBoxes(), which adds midpoints for them.
+
2011-05-21 Jeremy Noble <[email protected]>
Reviewed by Eric Carlson.
Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (87025 => 87026)
--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2011-05-22 03:08:24 UTC (rev 87025)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2011-05-22 04:44:27 UTC (rev 87026)
@@ -1744,8 +1744,11 @@
void setTrailingWhitespace(RenderText*);
void clear();
void appendBoxIfNeeded(RenderBox*);
- void updateMidpointsForTrailingBoxes(LineMidpointState&, const InlineIterator& lBreak);
+ enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace };
+
+ void updateMidpointsForTrailingBoxes(LineMidpointState&, const InlineIterator& lBreak, CollapseFirstSpaceOrNot);
+
private:
RenderText* m_whitespace;
Vector<RenderBox*, 4> m_boxes;
@@ -1774,7 +1777,7 @@
m_boxes.append(box);
}
-void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState& lineMidpointState, const InlineIterator& lBreak)
+void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState& lineMidpointState, const InlineIterator& lBreak, CollapseFirstSpaceOrNot collapseFirstSpace)
{
if (!m_whitespace)
return;
@@ -1786,7 +1789,8 @@
int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1;
for ( ; trailingSpaceMidpoint >= 0 && lineMidpointState.midpoints[trailingSpaceMidpoint].m_obj != m_whitespace; --trailingSpaceMidpoint) { }
ASSERT(trailingSpaceMidpoint >= 0);
- lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
+ if (collapseFirstSpace == CollapseFirstSpace)
+ lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
// Now make sure every single trailingPositionedBox following the trailingSpaceMidpoint properly stops and starts
// ignoring spaces.
@@ -1805,6 +1809,7 @@
}
} else if (!lBreak.m_obj) {
ASSERT(m_whitespace->isText());
+ ASSERT(collapseFirstSpace == CollapseFirstSpace);
// Add a new end midpoint that stops right at the very end.
unsigned length = m_whitespace->textLength();
unsigned pos = length >= 2 ? length - 2 : UINT_MAX;
@@ -2212,6 +2217,7 @@
// spaces. Create a midpoint to terminate the run
// before the second space.
addMidpoint(lineMidpointState, ignoreStart);
+ trailingObjects.updateMidpointsForTrailingBoxes(lineMidpointState, InlineIterator(), TrailingObjects::DoNotCollapseFirstSpace);
}
}
} else if (ignoringSpaces) {
@@ -2360,7 +2366,7 @@
// Sanity check our midpoints.
checkMidpoints(lineMidpointState, lBreak);
- trailingObjects.updateMidpointsForTrailingBoxes(lineMidpointState, lBreak);
+ trailingObjects.updateMidpointsForTrailingBoxes(lineMidpointState, lBreak, TrailingObjects::CollapseFirstSpace);
// We might have made lBreak an iterator that points past the end
// of the object. Do this adjustment to make it point to the start