Remove TextRun::setCharactersLength() and TextRun::charactersLength()
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Sep 2017 23:08:27 +0000 (23:08 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Sep 2017 23:08:27 +0000 (23:08 +0000)
commit01f3c4cf5dede2a630197d77557610ce62791c3e
tree26567449767a16be13f0bce508dc89a9faba58d6
parentd1762efdc7fec0d7511a077bf4c019750c89b87b
Remove TextRun::setCharactersLength() and TextRun::charactersLength()
https://bugs.webkit.org/show_bug.cgi?id=177620

Reviewed by Zalan Bujtas.

The purpose of TextRun::setCharactersLength() and TextRun::charactersLength() predate the
use of WidthIterator to safely iterate over characters in a TextRun that may contain
surrogate halves due to how it was created (without thought of surrogate pairs). Historically
TextRun::charactersLength() complemented TextRun::length() and represented the length of the
text to render ignoring and respecting truncation, respectively. We not longer need either
of these member functions with the advent of WidthIterator.

No functionality changed. So, no new tests.

* platform/graphics/ComplexTextController.cpp:
(WebCore::TextLayout::constructTextRun):
* platform/graphics/TextRun.cpp: Remove one unsigned field from ExpectedTextRunSize as we
reduced the size of TextRun with the removal of TextRun::m_charactersLength.
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
(WebCore::TextRun::charactersLength const): Deleted.
(WebCore::TextRun::setCharactersLength): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::constructTextRun const):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::constructTextRun): Deleted overload that took const RenderStyle& style
and StringView.
* rendering/RenderText.cpp:
(WebCore::RenderText::widthFromCache const):
(WebCore::maxWordFragmentWidth):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::width const):
* rendering/line/BreakingContext.h:
(WebCore::textWidth):
(WebCore::tryHyphenating):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::constructTextRun const):
* rendering/svg/SVGTextMetrics.cpp:
(WebCore::SVGTextMetrics::constructTextRun):
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair const): Use TextRun::length().
(WebCore::SVGTextMetricsBuilder::advance): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ComplexTextController.cpp
Source/WebCore/platform/graphics/TextRun.cpp
Source/WebCore/platform/graphics/TextRun.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/line/BreakingContext.h
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGTextMetrics.cpp
Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp