Text bounding box computation for simple line layout is wrong
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Apr 2014 17:43:54 +0000 (17:43 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Apr 2014 17:43:54 +0000 (17:43 +0000)
commitf45caa68187c7bed985ad8af6e10da2d7bbe9300
treedededa311e3316b08eb0c0767783c9be16fbd66d
parentf52eb22852dd011ff737f4142194d7570ae2581c
Text bounding box computation for simple line layout is wrong
https://bugs.webkit.org/show_bug.cgi?id=131912

Reviewed by Andreas Kling.

Source/WebCore:

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):

LayoutTests:

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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/repaint/reflection-redraw-expected.txt
LayoutTests/platform/mac/fast/table/dynamic-caption-add-remove-before-child-expected.txt
LayoutTests/platform/mac/fast/table/multiple-captions-display-expected.txt
LayoutTests/platform/mac/tables/mozilla/marvin/body_col-expected.txt
LayoutTests/platform/mac/tables/mozilla/marvin/x_th_valign_baseline-expected.txt
LayoutTests/platform/mac/tables/mozilla/other/body_col-expected.txt
LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10140-expected.txt
LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug10216-expected.txt
LayoutTests/platform/mac/tables/mozilla_expected_failures/core/captions3-expected.txt
LayoutTests/platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderText.h
Source/WebCore/rendering/RenderTextLineBoxes.cpp
Source/WebCore/rendering/RenderTextLineBoxes.h
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.h
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
Source/WebKit/mac/WebView/WebRenderNode.mm
Source/WebKit2/Shared/WebRenderObject.cpp