Cleanup: Consolidate non-selection background painting code for text
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 18:12:50 +0000 (18:12 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 18:12:50 +0000 (18:12 +0000)
commitacef4f5d823184ac014466df61d739d47a29b392
treefd7f9080315750e517cefad892a464950365f679
parentc4ce7a543c2380c1c17d20a254692805af9a114f
Cleanup: Consolidate non-selection background painting code for text
https://bugs.webkit.org/show_bug.cgi?id=177490

Reviewed by Zalan Bujtas.

Share code to paint the background of a text subrange instead of duplicating
it for text match markers and composition underlines.

Additionally standardize the argument order for various paint functions and
make more paint functions private.

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Updated code as needed for changes below.
(WebCore::InlineTextBox::paintSelection): Add FIXME comment to fix up this code for
combined text while I am in this file.
(WebCore::InlineTextBox::paintTextSubrangeBackground): Added. Extracted from the common code of
paintCompositionBackground() and paintTextMatchMarker().
(WebCore::InlineTextBox::paintCompositionBackground): Modified to use paintTextSubrangeBackground().
(WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
(WebCore::InlineTextBox::paintDocumentMarker): Add FIXME comment to fix up this code for
combined and hyphenated text while I am here.
(WebCore::InlineTextBox::paintDocumentMarkers): Update code as needed for changes
above.
* rendering/InlineTextBox.h: Change visibility of paintCompositionBackground(),
paintDocumentMarkers() and paintCompositionUnderline() from protected to private
as no derived class makes use of these functions. Group related functions to
improve readability.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h