[Render Tree Mutation] First letter should not mutate the render tree while in layout.
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2017 07:10:17 +0000 (07:10 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Aug 2017 07:10:17 +0000 (07:10 +0000)
commit7487d67ea93b660e34ab68542744ff9ebcb407d6
tree7f656fa35e17d051782d68a0a6bc820e4da200c7
parent3395a5a98499fae76540003725ef531097fcbfed
[Render Tree Mutation] First letter should not mutate the render tree while in layout.
https://bugs.webkit.org/show_bug.cgi?id=163848
Source/WebCore:

Reviewed by Zalan Bujtas.

RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should
be invoked by the RenderTreeUpdater.

With this future patches can move updateFirstLetter() and the related functions
completely out of the render tree.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layout):

    No more updateFirstLetter calls during layout...

(WebCore::RenderBlock::computePreferredLogicalWidths):

    ...or preferred width computation.

(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter):
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter):
* rendering/RenderTable.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter):
* rendering/svg/RenderSVGText.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::popParent):

    Call updateFirstLetter when closing the element. All of of descedant renderers are known here
    so this can be resolved correctly.

LayoutTests:

<rdar://problem/33402718>

Reviewed by Zalan Bujtas.

* fast/text-autosizing/ios/first-letter-expected.html: Added.

    Turn into reftest for easier debugging and robustness.

* imported/blink/fast/css/first-letter-range-insert-expected.txt:

    This is crash-or-assert test and the output change here doesn't matter.

* platform/ios/fast/text-autosizing/ios/first-letter-expected.txt: Removed.
* platform/mac/fast/text-autosizing/ios/first-letter-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text-autosizing/ios/first-letter-expected.html [new file with mode: 0644]
LayoutTests/imported/blink/fast/css/first-letter-range-insert-expected.txt
LayoutTests/platform/ios/fast/text-autosizing/ios/first-letter-expected.txt [deleted file]
LayoutTests/platform/mac/fast/text-autosizing/ios/first-letter-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderRubyRun.cpp
Source/WebCore/rendering/RenderRubyRun.h
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTextFragment.cpp
Source/WebCore/rendering/TextAutoSizing.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h
Source/WebCore/style/RenderTreeUpdater.cpp