Changeset 268806 in webkit
- Timestamp:
- Oct 21, 2020, 11:07:09 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
layout/integration/LayoutIntegrationRunIterator.cpp (modified) (2 diffs)
-
rendering/RenderText.cpp (modified) (2 diffs)
-
rendering/RenderText.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r268805 r268806 1 2020-10-21 Antti Koivisto <antti@apple.com> 2 3 [LFC][Integration] Use LineLayout::containing() in more places 4 https://bugs.webkit.org/show_bug.cgi?id=218029 5 6 Reviewed by Zalan Bujtas. 7 8 * layout/integration/LayoutIntegrationRunIterator.cpp: 9 (WebCore::LayoutIntegration::firstTextRunFor): 10 (WebCore::LayoutIntegration::runFor): 11 (WebCore::LayoutIntegration::lineLayoutSystemFlowForRenderer): Deleted. 12 * rendering/RenderText.cpp: 13 (WebCore::RenderText::usesComplexLineLayoutPath const): 14 (WebCore::RenderText::layoutFormattingContextLineLayout const): Deleted. 15 * rendering/RenderText.h: 16 1 17 2020-10-21 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationRunIterator.cpp
r268329 r268806 161 161 } 162 162 163 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)164 static const RenderBlockFlow* lineLayoutSystemFlowForRenderer(const RenderObject& renderer)165 {166 // In currently supported cases the renderer is always direct child of the flow.167 if (!is<RenderBlockFlow>(renderer.parent()))168 return nullptr;169 return downcast<RenderBlockFlow>(renderer.parent());170 }171 #endif172 173 163 TextRunIterator firstTextRunFor(const RenderText& text) 174 164 { 175 165 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 176 if (auto* flow = lineLayoutSystemFlowForRenderer(text)) { 177 if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout()) 178 return layoutFormattingContextLineLayout->textRunsFor(text); 179 } 166 if (auto* lineLayout = LineLayout::containing(text)) 167 return lineLayout->textRunsFor(text); 180 168 #endif 181 169 … … 202 190 } 203 191 204 RunIterator runFor(const RenderLineBreak& renderElement) 205 { 206 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 207 if (auto* flow = lineLayoutSystemFlowForRenderer(renderElement)) { 208 if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout()) 209 return layoutFormattingContextLineLayout->runFor(renderElement); 210 } 211 #endif 212 return { RunIteratorLegacyPath(renderElement.inlineBoxWrapper()) }; 213 } 214 215 RunIterator runFor(const RenderBox& renderElement) 216 { 217 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 218 if (auto* flow = lineLayoutSystemFlowForRenderer(renderElement)) { 219 if (auto* layoutFormattingContextLineLayout = flow->layoutFormattingContextLineLayout()) 220 return layoutFormattingContextLineLayout->runFor(renderElement); 221 } 222 #endif 223 return { RunIteratorLegacyPath(renderElement.inlineBoxWrapper()) }; 192 RunIterator runFor(const RenderLineBreak& renderer) 193 { 194 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 195 if (auto* lineLayout = LineLayout::containing(renderer)) 196 return lineLayout->runFor(renderer); 197 #endif 198 return { RunIteratorLegacyPath(renderer.inlineBoxWrapper()) }; 199 } 200 201 RunIterator runFor(const RenderBox& renderer) 202 { 203 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 204 if (auto* lineLayout = LineLayout::containing(renderer)) 205 return lineLayout->runFor(renderer); 206 #endif 207 return { RunIteratorLegacyPath(renderer.inlineBoxWrapper()) }; 224 208 } 225 209 -
trunk/Source/WebCore/rendering/RenderText.cpp
r268195 r268806 39 39 #include "InlineTextBox.h" 40 40 #include "LayoutIntegrationLineIterator.h" 41 #include "LayoutIntegrationLineLayout.h" 41 42 #include "LayoutIntegrationRunIterator.h" 42 43 #include "Range.h" … … 1465 1466 } 1466 1467 1468 bool RenderText::usesComplexLineLayoutPath() const 1469 { 1467 1470 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 1468 const LayoutIntegration::LineLayout* RenderText::layoutFormattingContextLineLayout() const 1469 { 1470 if (!is<RenderBlockFlow>(*parent())) 1471 return nullptr; 1472 return downcast<RenderBlockFlow>(*parent()).layoutFormattingContextLineLayout(); 1473 } 1471 return !LayoutIntegration::LineLayout::containing(*this); 1472 #else 1473 return true; 1474 1474 #endif 1475 1476 bool RenderText::usesComplexLineLayoutPath() const1477 {1478 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)1479 if (layoutFormattingContextLineLayout())1480 return false;1481 #endif1482 return true;1483 1475 } 1484 1476 -
trunk/Source/WebCore/rendering/RenderText.h
r267565 r268806 169 169 170 170 void ensureLineBoxes(); 171 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)172 const LayoutIntegration::LineLayout* layoutFormattingContextLineLayout() const;173 #endif174 171 bool usesComplexLineLayoutPath() const; 175 172
Note:
See TracChangeset
for help on using the changeset viewer.