Diff
Modified: trunk/LayoutTests/ChangeLog (167567 => 167568)
--- trunk/LayoutTests/ChangeLog 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/ChangeLog 2014-04-20 17:43:54 UTC (rev 167568)
@@ -1,3 +1,23 @@
+2014-04-20 Antti Koivisto <[email protected]>
+
+ Text bounding box computation for simple line layout is wrong
+ https://bugs.webkit.org/show_bug.cgi?id=131912
+
+ Reviewed by Andreas Kling.
+
+ Some dumped RenderText sizes change in table related test. These are progressions,
+ the new results match the contained lines. There are no visual changes.
+
+ * platform/mac/fast/table/dynamic-caption-add-remove-before-child-expected.txt:
+ * platform/mac/fast/table/multiple-captions-display-expected.txt:
+ * platform/mac/tables/mozilla/marvin/body_col-expected.txt:
+ * platform/mac/tables/mozilla/marvin/x_th_valign_baseline-expected.txt:
+ * platform/mac/tables/mozilla/other/body_col-expected.txt:
+ * platform/mac/tables/mozilla_expected_failures/bugs/bug10140-expected.txt:
+ * platform/mac/tables/mozilla_expected_failures/bugs/bug10216-expected.txt:
+ * platform/mac/tables/mozilla_expected_failures/core/captions3-expected.txt:
+ * platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt:
+
2014-04-20 Commit Queue <[email protected]>
Unreviewed, rolling out r167501.
Modified: trunk/LayoutTests/platform/mac/fast/repaint/reflection-redraw-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/fast/repaint/reflection-redraw-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/fast/repaint/reflection-redraw-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -7,28 +7,28 @@
layer at (293,130) size 150x100
RenderBlock (positioned) {DIV} at (285,10) size 150x100 [bgcolor=#808080] [border: (1px solid #000000)]
RenderBlock {P} at (11,27) size 128x54 [color=#008000]
- RenderText {#text} at (12,0) size 125x54
+ RenderText {#text} at (12,0) size 126x54
text run at (12,0) width 104: "The color of this"
text run at (1,18) width 126: "text in the reflection"
text run at (14,36) width 100: "should be green"
layer at (218,240) size 150x100
RenderBlock (positioned) {DIV} at (210,120) size 150x100 [bgcolor=#808080] [border: (1px solid #000000)]
RenderBlock {P} at (11,27) size 128x54 [color=#008000]
- RenderText {#text} at (12,0) size 125x54
+ RenderText {#text} at (12,0) size 126x54
text run at (12,0) width 104: "The color of this"
text run at (1,18) width 126: "text in the reflection"
text run at (14,36) width 100: "should be green"
layer at (368,240) size 150x100
RenderBlock (positioned) {DIV} at (360,120) size 150x100 [bgcolor=#808080] [border: (1px solid #000000)]
RenderBlock {P} at (11,27) size 128x54 [color=#008000]
- RenderText {#text} at (12,0) size 125x54
+ RenderText {#text} at (12,0) size 126x54
text run at (12,0) width 104: "The color of this"
text run at (1,18) width 126: "text in the reflection"
text run at (14,36) width 100: "should be green"
layer at (293,350) size 150x100
RenderBlock (positioned) {DIV} at (285,230) size 150x100 [bgcolor=#808080] [border: (1px solid #000000)]
RenderBlock {P} at (11,27) size 128x54 [color=#008000]
- RenderText {#text} at (12,0) size 125x54
+ RenderText {#text} at (12,0) size 126x54
text run at (12,0) width 104: "The color of this"
text run at (1,18) width 126: "text in the reflection"
text run at (14,36) width 100: "should be green"
Modified: trunk/LayoutTests/platform/mac/fast/table/dynamic-caption-add-remove-before-child-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/fast/table/dynamic-caption-add-remove-before-child-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/fast/table/dynamic-caption-add-remove-before-child-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -5,7 +5,7 @@
RenderBody {body} at (8,8) size 784x72
RenderTable {table} at (0,0) size 46x72
RenderBlock {caption} at (0,0) size 46x72
- RenderText {#text} at (1,0) size 47x72
+ RenderText {#text} at (1,0) size 46x72
text run at (1,0) width 44: "PASS:"
text run at (0,18) width 46: "Text in"
text run at (0,36) width 46: "caption"
Modified: trunk/LayoutTests/platform/mac/fast/table/multiple-captions-display-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/fast/table/multiple-captions-display-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/fast/table/multiple-captions-display-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -36,7 +36,7 @@
RenderBlock {caption} at (0,126) size 126x0
layer at (8,218) size 126x54
RenderBlock {caption} at (0,210) size 126x54
- RenderText {#text} at (25,0) size 117x54
+ RenderText {#text} at (25,0) size 116x54
text run at (25,0) width 76: "PASS: First"
text run at (5,18) width 116: "Caption aligned to"
text run at (29,36) width 68: "the bottom"
@@ -46,7 +46,7 @@
text run at (0,0) width 230: "PASS: Caption with a fixed position"
layer at (8,8) size 126x36
RenderBlock {caption} at (0,0) size 126x36
- RenderText {#text} at (14,0) size 103x36
+ RenderText {#text} at (14,0) size 102x36
text run at (14,0) width 98: "PASS: Caption"
text run at (12,18) width 102: "with opacity 0.7"
layer at (10,196) size 331x18
Modified: trunk/LayoutTests/platform/mac/tables/mozilla/marvin/body_col-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla/marvin/body_col-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla/marvin/body_col-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -10,7 +10,7 @@
RenderTableSection {TBODY} at (2,2) size 155x152
RenderTableRow {TR} at (0,2) size 155x40
RenderTableCell {TH} at (2,2) size 49x40 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
- RenderText {#text} at (15,2) size 36x36
+ RenderText {#text} at (15,2) size 37x36
text run at (15,2) width 19: "La"
text run at (6,20) width 37: "Mesa"
RenderTableCell {TD} at (53,11) size 100x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
@@ -18,7 +18,7 @@
text run at (2,2) width 12: "X"
RenderTableRow {TR} at (0,44) size 155x40
RenderTableCell {TH} at (2,44) size 49x40 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
- RenderText {#text} at (17,2) size 42x36
+ RenderText {#text} at (17,2) size 43x36
text run at (17,2) width 15: "El"
text run at (3,20) width 43: "Cajon"
RenderTableCell {TD} at (53,53) size 100x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
Modified: trunk/LayoutTests/platform/mac/tables/mozilla/marvin/x_th_valign_baseline-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla/marvin/x_th_valign_baseline-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla/marvin/x_th_valign_baseline-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -10,7 +10,7 @@
RenderTableSection (anonymous) at (1,1) size 782x238
RenderTableRow {tr} at (0,2) size 782x234
RenderTableCell {th} at (2,24) size 214x94 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
- RenderText {#text} at (12,2) size 207x90
+ RenderText {#text} at (12,2) size 206x90
text run at (12,2) width 190: "Compare the baseline of the"
text run at (4,20) width 76: "first line of "
text run at (80,20) width 130: "text in this cell with"
Modified: trunk/LayoutTests/platform/mac/tables/mozilla/other/body_col-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla/other/body_col-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla/other/body_col-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -10,7 +10,7 @@
RenderTableSection {TBODY} at (2,2) size 155x152
RenderTableRow {TR} at (0,2) size 155x40
RenderTableCell {TH} at (2,2) size 49x40 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
- RenderText {#text} at (15,2) size 36x36
+ RenderText {#text} at (15,2) size 37x36
text run at (15,2) width 19: "La"
text run at (6,20) width 37: "Mesa"
RenderTableCell {TD} at (53,11) size 100x22 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
@@ -18,7 +18,7 @@
text run at (2,2) width 12: "X"
RenderTableRow {TR} at (0,44) size 155x40
RenderTableCell {TH} at (2,44) size 49x40 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
- RenderText {#text} at (17,2) size 42x36
+ RenderText {#text} at (17,2) size 43x36
text run at (17,2) width 15: "El"
text run at (3,20) width 43: "Cajon"
RenderTableCell {TD} at (53,53) size 100x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
Modified: trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10140-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10140-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10140-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -185,7 +185,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (0,1196) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (20,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
@@ -206,7 +206,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (0,1322) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (20,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
@@ -355,7 +355,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (0,2290) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (0,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
@@ -376,7 +376,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (15,2416) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (0,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
Modified: trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10216-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10216-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10216-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -97,7 +97,7 @@
text run at (2,2) width 30: "Data"
RenderTable {TABLE} at (0,572) size 87x107 [border: (1px outset #808080)]
RenderBlock {CAPTION} at (0,0) size 87x54
- RenderText {#text} at (9,0) size 88x54
+ RenderText {#text} at (9,0) size 87x54
text run at (9,0) width 69: "The table's"
text run at (2,18) width 83: "caption, with"
text run at (0,36) width 87: "align=\"right\"."
Modified: trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/core/captions3-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/core/captions3-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/core/captions3-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -185,7 +185,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (0,1196) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (20,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
@@ -206,7 +206,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (0,1322) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (20,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
@@ -355,7 +355,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (0,2290) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (0,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
@@ -376,7 +376,7 @@
text run at (1,1) width 30: "Data"
RenderTable {TABLE} at (15,2416) size 90x127 [border: (10px solid #008000)]
RenderBlock {CAPTION} at (0,0) size 70x60 [border: (3px solid #800080)]
- RenderText {#text} at (22,3) size 51x54
+ RenderText {#text} at (22,3) size 50x54
text run at (22,3) width 26: "The"
text run at (15,21) width 40: "table's"
text run at (10,39) width 50: "caption."
Modified: trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt (167567 => 167568)
--- trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/LayoutTests/platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt 2014-04-20 17:43:54 UTC (rev 167568)
@@ -141,7 +141,7 @@
text run at (0,18) width 4: " "
RenderTable {TABLE} at (0,602) size 252x175 [border: (1px none #808080)]
RenderBlock {CAPTION} at (0,120) size 252x54
- RenderText {#text} at (11,0) size 239x54
+ RenderText {#text} at (11,0) size 240x54
text run at (11,0) width 230: "Table 4 has this bottom caption. The"
text run at (6,18) width 240: "table has specified column widths and"
text run at (66,36) width 120: "collapsing borders."
Modified: trunk/Source/WebCore/ChangeLog (167567 => 167568)
--- trunk/Source/WebCore/ChangeLog 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/ChangeLog 2014-04-20 17:43:54 UTC (rev 167568)
@@ -1,3 +1,47 @@
+2014-04-20 Antti Koivisto <[email protected]>
+
+ Text bounding box computation for simple line layout is wrong
+ https://bugs.webkit.org/show_bug.cgi?id=131912
+
+ Reviewed by Andreas Kling.
+
+ Top-left is currently the first line top-left which is not always correct.
+
+ * WebCore.exp.in:
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::firstRunLocation):
+ (WebCore::RenderText::firstRunOrigin): Deleted.
+ (WebCore::RenderText::firstRunX): Deleted.
+ (WebCore::RenderText::firstRunY): Deleted.
+
+ Keep just one accessor and rename it.
+ Encapsulate the line box and simple line versions.
+
+ * rendering/RenderText.h:
+ * rendering/RenderTextLineBoxes.cpp:
+ (WebCore::RenderTextLineBoxes::firstRunLocation):
+
+ Line box version.
+
+ * rendering/RenderTextLineBoxes.h:
+ * rendering/RenderTreeAsText.cpp:
+
+ Simplify RenderText dumping.
+
+ (WebCore::RenderTreeAsText::writeRenderObject):
+ * rendering/SimpleLineLayoutFunctions.cpp:
+ (WebCore::SimpleLineLayout::computeTextBoundingBox):
+
+ Return the correct x position.
+
+ (WebCore::SimpleLineLayout::computeTextFirstRunLocation):
+
+ Simple line version.
+
+ * rendering/SimpleLineLayoutFunctions.h:
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::writeSVGInlineText):
+
2014-04-19 Zalan Bujtas <[email protected]>
Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
Modified: trunk/Source/WebCore/WebCore.exp.in (167567 => 167568)
--- trunk/Source/WebCore/WebCore.exp.in 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-04-20 17:43:54 UTC (rev 167568)
@@ -1479,9 +1479,8 @@
__ZNK7WebCore10FloatPointcv7CGPointEv
__ZNK7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj
__ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringENS0_18AllowedPluginTypesE
+__ZNK7WebCore10RenderText16firstRunLocationEv
__ZNK7WebCore10RenderText16linesBoundingBoxEv
-__ZNK7WebCore10RenderText9firstRunXEv
-__ZNK7WebCore10RenderText9firstRunYEv
__ZNK7WebCore10RenderView12documentRectEv
__ZNK7WebCore10RenderView20unscaledDocumentRectEv
__ZNK7WebCore10ScrollView12contentsSizeEv
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (167567 => 167568)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2014-04-20 17:43:54 UTC (rev 167568)
@@ -937,21 +937,14 @@
return currPos >= (from + len);
}
-FloatPoint RenderText::firstRunOrigin() const
+IntPoint RenderText::firstRunLocation() const
{
- return IntPoint(firstRunX(), firstRunY());
-}
+ if (auto* layout = simpleLineLayout())
+ return SimpleLineLayout::computeTextFirstRunLocation(*this, *layout);
-float RenderText::firstRunX() const
-{
- return firstTextBox() ? firstTextBox()->x() : 0;
+ return m_lineBoxes.firstRunLocation();
}
-float RenderText::firstRunY() const
-{
- return firstTextBox() ? firstTextBox()->y() : 0;
-}
-
void RenderText::setSelectionState(SelectionState state)
{
if (state != SelectionNone)
Modified: trunk/Source/WebCore/rendering/RenderText.h (167567 => 167568)
--- trunk/Source/WebCore/rendering/RenderText.h 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/RenderText.h 2014-04-20 17:43:54 UTC (rev 167568)
@@ -99,9 +99,7 @@
virtual IntRect linesBoundingBox() const;
LayoutRect linesVisualOverflowBoundingBox() const;
- FloatPoint firstRunOrigin() const;
- float firstRunX() const;
- float firstRunY() const;
+ IntPoint firstRunLocation() const;
virtual void setText(const String&, bool force = false);
void setTextWithOffset(const String&, unsigned offset, unsigned len, bool force = false);
Modified: trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp (167567 => 167568)
--- trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp 2014-04-20 17:43:54 UTC (rev 167568)
@@ -169,6 +169,13 @@
return enclosingIntRect(FloatRect(x, y, width, height));
}
+IntPoint RenderTextLineBoxes::firstRunLocation() const
+{
+ if (!m_first)
+ return IntPoint();
+ return IntPoint(m_first->topLeft());
+}
+
LayoutRect RenderTextLineBoxes::visualOverflowBoundingBox(const RenderText& renderer) const
{
if (!m_first)
Modified: trunk/Source/WebCore/rendering/RenderTextLineBoxes.h (167567 => 167568)
--- trunk/Source/WebCore/rendering/RenderTextLineBoxes.h 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/RenderTextLineBoxes.h 2014-04-20 17:43:54 UTC (rev 167568)
@@ -70,6 +70,7 @@
LayoutRect selectionRectForRange(unsigned start, unsigned end);
IntRect boundingBox(const RenderText&) const;
+ IntPoint firstRunLocation() const;
LayoutRect visualOverflowBoundingBox(const RenderText&) const;
Vector<IntRect> absoluteRects(const LayoutPoint& accumulatedOffset) const;
Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (167567 => 167568)
--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2014-04-20 17:43:54 UTC (rev 167568)
@@ -200,15 +200,8 @@
// FIXME: Would be better to dump the bounding box x and y rather than the first run's x and y, but that would involve updating
// many test results.
const RenderText& text = toRenderText(o);
- IntRect linesBox = text.linesBoundingBox();
- if (text.simpleLineLayout()) {
- int y = linesBox.y();
- if (text.containingBlock()->isTableCell())
- y -= toRenderTableCell(o.containingBlock())->intrinsicPaddingBefore();
- r = IntRect(linesBox.x(), y, linesBox.width(), linesBox.height());
- } else
- r = IntRect(text.firstRunX(), text.firstRunY(), linesBox.width(), linesBox.height());
- if (adjustForTableCells && !text.firstTextBox())
+ r = IntRect(text.firstRunLocation(), text.linesBoundingBox().size());
+ if (!text.firstTextBox() && !text.simpleLineLayout())
adjustForTableCells = false;
} else if (o.isBR()) {
const RenderLineBreak& br = toRenderLineBreak(o);
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (167567 => 167568)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp 2014-04-20 17:43:54 UTC (rev 167568)
@@ -160,13 +160,22 @@
if (rect.maxY() > bottom)
bottom = rect.maxY();
}
- float x = firstLineRect.x();
+ float x = left;
float y = firstLineRect.y();
float width = right - left;
float height = bottom - y;
return enclosingIntRect(FloatRect(x, y, width, height));
}
+IntPoint computeTextFirstRunLocation(const RenderText& textRenderer, const Layout& layout)
+{
+ auto resolver = runResolver(toRenderBlockFlow(*textRenderer.parent()), layout);
+ auto begin = resolver.begin();
+ if (begin == resolver.end())
+ return IntPoint();
+ return flooredIntPoint((*begin).rect().location());
+}
+
Vector<IntRect> collectTextAbsoluteRects(const RenderText& textRenderer, const Layout& layout, const LayoutPoint& accumulatedOffset)
{
Vector<IntRect> rects;
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h (167567 => 167568)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h 2014-04-20 17:43:54 UTC (rev 167568)
@@ -55,6 +55,7 @@
unsigned findTextCaretMinimumOffset(const RenderText&, const Layout&);
unsigned findTextCaretMaximumOffset(const RenderText&, const Layout&);
IntRect computeTextBoundingBox(const RenderText&, const Layout&);
+IntPoint computeTextFirstRunLocation(const RenderText&, const Layout&);
Vector<IntRect> collectTextAbsoluteRects(const RenderText&, const Layout&, const LayoutPoint& accumulatedOffset);
Vector<FloatQuad> collectTextAbsoluteQuads(const RenderText&, const Layout&, bool* wasFixed);
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (167567 => 167568)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2014-04-20 17:43:54 UTC (rev 167568)
@@ -582,7 +582,7 @@
void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, int indent)
{
writeStandardPrefix(ts, text, indent);
- ts << " " << enclosingIntRect(FloatRect(text.firstRunOrigin(), text.floatLinesBoundingBox().size())) << "\n";
+ ts << " " << enclosingIntRect(FloatRect(text.firstRunLocation(), text.floatLinesBoundingBox().size())) << "\n";
writeResources(ts, text, indent);
writeSVGInlineTextBoxes(ts, text, indent);
}
Modified: trunk/Source/WebKit/mac/WebView/WebRenderNode.mm (167567 => 167568)
--- trunk/Source/WebKit/mac/WebView/WebRenderNode.mm 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebKit/mac/WebView/WebRenderNode.mm 2014-04-20 17:43:54 UTC (rev 167568)
@@ -114,8 +114,9 @@
} else if (node->isText()) {
// FIXME: Preserve old behavior even though it's strange.
RenderText* text = toRenderText(node);
- x = text->firstRunX();
- y = text->firstRunY();
+ IntPoint firstRunLocation = text->firstRunLocation();
+ x = firstRunLocation.x();
+ y = firstRunLocation.y();
IntRect box = text->linesBoundingBox();
width = box.width();
height = box.height();
Modified: trunk/Source/WebKit2/Shared/WebRenderObject.cpp (167567 => 167568)
--- trunk/Source/WebKit2/Shared/WebRenderObject.cpp 2014-04-20 17:40:40 UTC (rev 167567)
+++ trunk/Source/WebKit2/Shared/WebRenderObject.cpp 2014-04-20 17:43:54 UTC (rev 167568)
@@ -90,8 +90,7 @@
m_frameRect = toRenderBox(renderer)->pixelSnappedFrameRect();
else if (renderer->isText()) {
m_frameRect = toRenderText(renderer)->linesBoundingBox();
- m_frameRect.setX(toRenderText(renderer)->firstRunX());
- m_frameRect.setY(toRenderText(renderer)->firstRunY());
+ m_frameRect.setLocation(toRenderText(renderer)->firstRunLocation());
} else if (renderer->isRenderInline())
m_frameRect = toRenderBoxModelObject(renderer)->borderBoundingBox();