Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Aug 2017 13:15:20 +0000 (13:15 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Aug 2017 13:15:20 +0000 (13:15 +0000)
commit5cb99da832539f9759e968807b6348edb7ee874d
tree09731691ffa0d0d4f311d4d90926dd511fd41436
parent9f22fb4acc1b385217f9d99f78978ae1af4c18e9
Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=175627

Reviewed by Andreas Kling.

Render tree should not mutate itself. We already fixed this for first-letter, supporting code
can now move to RenderTreeUpdater too.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter): Deleted.
(WebCore::isPunctuationForFirstLetter): Deleted.
(WebCore::shouldSkipForFirstLetter): Deleted.
(WebCore::RenderBlock::updateFirstLetterStyle): Deleted.
(WebCore::RenderBlock::createFirstLetterRenderer): Deleted.
(WebCore::RenderBlock::updateFirstLetter): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter): Deleted.
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter): Deleted.
* rendering/RenderTable.h:

    Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via
    supportsFirstLetter test in the first letter updater.

* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustTextNodeSizes):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter): Deleted.
* rendering/svg/RenderSVGText.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::popParent):
* style/RenderTreeUpdater.h:
* style/RenderTreeUpdaterFirstLetter.cpp: Added.
(WebCore::styleForFirstLetter):
(WebCore::isPunctuationForFirstLetter):
(WebCore::shouldSkipForFirstLetter):
(WebCore::updateFirstLetterStyle):
(WebCore::createFirstLetterRenderer):
(WebCore::supportsFirstLetter):
(WebCore::RenderTreeUpdater::FirstLetter::update):
* style/RenderTreeUpdaterFirstLetter.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
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/TextAutoSizing.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h
Source/WebCore/style/RenderTreeUpdater.cpp
Source/WebCore/style/RenderTreeUpdater.h
Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp [new file with mode: 0644]
Source/WebCore/style/RenderTreeUpdaterFirstLetter.h [new file with mode: 0644]