Changeset 292685 in webkit
- Timestamp:
- Apr 9, 2022 7:59:35 PM (2 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r292684 r292685 1 2022-04-09 Alan Bujtas <zalan@apple.com> 2 3 [Text autosizing] Remove redundant lineCountForTextAutosizing member function 4 https://bugs.webkit.org/show_bug.cgi?id=239034 5 6 Reviewed by Antti Koivisto. 7 8 * rendering/RenderBlockFlow.cpp: 9 (WebCore::RenderBlockFlow::adjustComputedFontSizes): stop walking the list item children when we see multiple lines. 10 (WebCore::RenderBlockFlow::lineCountForTextAutosizing): Deleted. 11 * rendering/RenderBlockFlow.h: 12 1 13 2022-04-09 Khem Raj <raj.khem@gmail.com> 2 14 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r292679 r292685 3772 3772 } 3773 3773 3774 int RenderBlockFlow::lineCountForTextAutosizing()3775 {3776 if (style().visibility() != Visibility::Visible)3777 return 0;3778 if (childrenInline())3779 return lineCount();3780 // Only descend into list items.3781 int count = 0;3782 for (auto& listItem : childrenOfType<RenderListItem>(*this))3783 count += listItem.lineCount();3784 return count;3785 }3786 3787 3774 static bool isNonBlocksOrNonFixedHeightListItems(const RenderObject& renderer) 3788 3775 { … … 3816 3803 return; 3817 3804 3818 unsigned lineCount; 3819 if (m_lineCountForTextAutosizing == NOT_SET) { 3820 int count = lineCountForTextAutosizing(); 3821 if (!count) 3805 unsigned lineCount = m_lineCountForTextAutosizing; 3806 if (lineCount == NOT_SET) { 3807 if (style().visibility() != Visibility::Visible) 3822 3808 lineCount = NO_LINE; 3823 else if (count == 1) 3824 lineCount = ONE_LINE; 3825 else 3826 lineCount = MULTI_LINE; 3827 } else 3828 lineCount = m_lineCountForTextAutosizing; 3829 3809 else { 3810 size_t lineCountInBlock = 0; 3811 if (childrenInline()) 3812 lineCountInBlock = this->lineCount(); 3813 else { 3814 for (auto& listItem : childrenOfType<RenderListItem>(*this)) { 3815 lineCountInBlock += listItem.lineCount(); 3816 if (lineCountInBlock > 1) 3817 break; 3818 } 3819 } 3820 lineCount = !lineCountInBlock ? NO_LINE : lineCountInBlock == 1 ? ONE_LINE : MULTI_LINE; 3821 } 3822 } 3823 3830 3824 ASSERT(lineCount != NOT_SET); 3831 3825 if (lineCount == NO_LINE) -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r291312 r292685 547 547 548 548 #if ENABLE(TEXT_AUTOSIZING) 549 int lineCountForTextAutosizing();550 549 void adjustComputedFontSizes(float size, float visibleWidth); 551 550 void resetComputedFontSize()
Note: See TracChangeset
for help on using the changeset viewer.