Modified: trunk/Source/WebCore/ChangeLog (216848 => 216849)
--- trunk/Source/WebCore/ChangeLog 2017-05-14 20:10:23 UTC (rev 216848)
+++ trunk/Source/WebCore/ChangeLog 2017-05-14 21:16:42 UTC (rev 216849)
@@ -1,3 +1,16 @@
+2017-05-14 Zalan Bujtas <za...@apple.com>
+
+ Remove unused lambda in TextFragmentIterator::TextFragment::split() and cleanup dependencies.
+ https://bugs.webkit.org/show_bug.cgi?id=172089
+
+ Reviewed by David Kilzer.
+
+ * rendering/SimpleLineLayout.cpp:
+ (WebCore::SimpleLineLayout::splitFragmentToFitLine):
+ * rendering/SimpleLineLayoutTextFragmentIterator.h:
+ (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
+ (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
+
2017-05-13 David Kilzer <ddkil...@apple.com>
Unused lambda in JSWebKitSubtleCrypto::wrapKey()
Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (216848 => 216849)
--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp 2017-05-14 20:10:23 UTC (rev 216848)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp 2017-05-14 21:16:42 UTC (rev 216849)
@@ -696,8 +696,8 @@
auto rightSideWidth = fragmentToSplit.width() - splitFragmentData.width;
if (rightSideWidth < 2 * availableWidth)
rightSideWidth = textFragmentIterator.textWidth(splitFragmentData.position, fragmentToSplit.end(), 0);
- return hyphenPosition ? fragmentToSplit.splitWithHyphen(splitFragmentData.position, splitFragmentData.width, rightSideWidth, textFragmentIterator) :
- fragmentToSplit.split(splitFragmentData.position, splitFragmentData.width, rightSideWidth, textFragmentIterator);
+ return hyphenPosition ? fragmentToSplit.splitWithHyphen(splitFragmentData.position, textFragmentIterator.style().hyphenStringWidth,
+ splitFragmentData.width, rightSideWidth) : fragmentToSplit.split(splitFragmentData.position, splitFragmentData.width, rightSideWidth);
}
enum PreWrapLineBreakRule { Preserve, Ignore };
Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h (216848 => 216849)
--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h 2017-05-14 20:10:23 UTC (rev 216848)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h 2017-05-14 21:16:42 UTC (rev 216849)
@@ -69,8 +69,8 @@
bool hasHyphen() const { return m_hasHyphen; }
bool isEmpty() const { return start() == end() && !isLineBreak(); }
- TextFragment split(unsigned splitPosition, float leftSideWidth, float rightSideWidth, const TextFragmentIterator&);
- TextFragment splitWithHyphen(unsigned hyphenPosition, float leftSideWidth, float rightSideWidth, const TextFragmentIterator&);
+ TextFragment split(unsigned splitPosition, float leftSideWidth, float rightSideWidth);
+ TextFragment splitWithHyphen(unsigned hyphenPosition, float hyphenStringWidth, float leftSideWidth, float rightSideWidth);
bool operator==(const TextFragment& other) const
{
return m_start == other.m_start
@@ -143,10 +143,9 @@
bool m_atEndOfSegment { false };
};
-inline TextFragmentIterator::TextFragment TextFragmentIterator::TextFragment::split(unsigned splitPosition, float leftSideWidth,
- float rightSideWidth, const TextFragmentIterator& textFragmentIterator)
+inline TextFragmentIterator::TextFragment TextFragmentIterator::TextFragment::split(unsigned splitPosition, float leftSideWidth, float rightSideWidth)
{
- auto updateFragmentProperties = [&textFragmentIterator] (TextFragment& fragment, unsigned start, unsigned end, float width)
+ auto updateFragmentProperties = [] (TextFragment& fragment, unsigned start, unsigned end, float width)
{
fragment.m_start = start;
fragment.m_end = end;
@@ -162,13 +161,12 @@
return rightSide;
}
-inline TextFragmentIterator::TextFragment TextFragmentIterator::TextFragment::splitWithHyphen(unsigned hyphenPosition, float leftSideWidth,
- float rightSideWidth, const TextFragmentIterator& textFragmentIterator)
+inline TextFragmentIterator::TextFragment TextFragmentIterator::TextFragment::splitWithHyphen(unsigned hyphenPosition, float hyphenStringWidth,
+ float leftSideWidth, float rightSideWidth)
{
- ASSERT(textFragmentIterator.style().shouldHyphenate);
- auto rightSide = split(hyphenPosition, leftSideWidth, rightSideWidth, textFragmentIterator);
+ auto rightSide = split(hyphenPosition, leftSideWidth, rightSideWidth);
m_hasHyphen = true;
- m_width += textFragmentIterator.style().hyphenStringWidth;
+ m_width += hyphenStringWidth;
return rightSide;
}