Address Sam's post-landing review of r246234.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Jun 2019 21:04:41 +0000 (21:04 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Jun 2019 21:04:41 +0000 (21:04 +0000)
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246486 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp

index fba9f47..beb707a 100644 (file)
@@ -1,5 +1,12 @@
 2019-06-16  Zalan Bujtas  <zalan@apple.com>
 
 2019-06-16  Zalan Bujtas  <zalan@apple.com>
 
+        Address Sam's post-landing review of r246234.
+
+        * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
+        (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
+
+2019-06-16  Zalan Bujtas  <zalan@apple.com>
+
         [LFC][IFC] Decouple baseline ascent/descent and baseline offset.
         https://bugs.webkit.org/show_bug.cgi?id=198901
         <rdar://problem/51782393>
         [LFC][IFC] Decouple baseline ascent/descent and baseline offset.
         https://bugs.webkit.org/show_bug.cgi?id=198901
         <rdar://problem/51782393>
index ebf64fb..b5a34b3 100644 (file)
@@ -314,8 +314,8 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
 
     if (lineContent.isEmpty()) {
         // Spec tells us to create a zero height, empty line box.
 
     if (lineContent.isEmpty()) {
         // Spec tells us to create a zero height, empty line box.
-        auto lineBox = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0 , 0 };
-        m_formattingState.addLineBox({ lineBox, lineContent.baseline(), lineContent.baselineOffset() });
+        auto lineBoxRect = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0 , 0 };
+        m_formattingState.addLineBox({ lineBoxRect, lineContent.baseline(), lineContent.baselineOffset() });
         return;
     }
 
         return;
     }
 
@@ -325,7 +325,7 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
     // A line box is always tall enough for all of the boxes it contains.
 
     // Ignore the initial strut.
     // A line box is always tall enough for all of the boxes it contains.
 
     // Ignore the initial strut.
-    auto lineBox = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, lineContent.logicalHeight()};
+    auto lineBoxRect = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, lineContent.logicalHeight()};
     // Create final display runs.
     auto& lineRuns = lineContent.runs();
     for (unsigned index = 0; index < lineRuns.size(); ++index) {
     // Create final display runs.
     auto& lineRuns = lineContent.runs();
     for (unsigned index = 0; index < lineRuns.size(); ++index) {
@@ -350,7 +350,7 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
             if (layoutBox.isInFlowPositioned())
                 topLeft += Geometry::inFlowPositionedPositionOffset(layoutState(), layoutBox);
             displayBox.setTopLeft(topLeft);
             if (layoutBox.isInFlowPositioned())
                 topLeft += Geometry::inFlowPositionedPositionOffset(layoutState(), layoutBox);
             displayBox.setTopLeft(topLeft);
-            lineBox.expandHorizontally(logicalRect.width());
+            lineBoxRect.expandHorizontally(logicalRect.width());
             m_formattingState.addInlineRun(std::make_unique<Display::Run>(logicalRect));
             continue;
         }
             m_formattingState.addInlineRun(std::make_unique<Display::Run>(logicalRect));
             continue;
         }
@@ -358,7 +358,7 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
         // Inline level container start (<span>)
         if (inlineItem.isContainerStart()) {
             displayBox.setTopLeft(logicalRect.topLeft());
         // Inline level container start (<span>)
         if (inlineItem.isContainerStart()) {
             displayBox.setTopLeft(logicalRect.topLeft());
-            lineBox.expandHorizontally(logicalRect.width());
+            lineBoxRect.expandHorizontally(logicalRect.width());
             continue;
         }
 
             continue;
         }
 
@@ -374,7 +374,7 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
             // FIXME fix it for multiline.
             displayBox.setContentBoxWidth(contentBoxWidth);
             displayBox.setContentBoxHeight(logicalRect.height());
             // FIXME fix it for multiline.
             displayBox.setContentBoxWidth(contentBoxWidth);
             displayBox.setContentBoxHeight(logicalRect.height());
-            lineBox.expandHorizontally(logicalRect.width());
+            lineBoxRect.expandHorizontally(logicalRect.width());
             continue;
         }
 
             continue;
         }
 
@@ -391,7 +391,7 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
                 lastDisplayRun->expandHorizontally(logicalRect.width());
                 lastDisplayRun->textContext()->expand(lineRun->textContext->length);
             }
                 lastDisplayRun->expandHorizontally(logicalRect.width());
                 lastDisplayRun->textContext()->expand(lineRun->textContext->length);
             }
-            lineBox.expandHorizontally(logicalRect.width());
+            lineBoxRect.expandHorizontally(logicalRect.width());
         }
         // FIXME take content breaking into account when part of the layout box is on the previous line.
         auto firstInlineRunForLayoutBox = !previousLineRun || &previousLineRun->inlineItem.layoutBox() != &layoutBox;
         }
         // FIXME take content breaking into account when part of the layout box is on the previous line.
         auto firstInlineRunForLayoutBox = !previousLineRun || &previousLineRun->inlineItem.layoutBox() != &layoutBox;
@@ -406,7 +406,7 @@ void InlineFormattingContext::LineLayout::createDisplayRuns(const Line::Content&
         }
     }
     // FIXME linebox needs to be ajusted after content alignment.
         }
     }
     // FIXME linebox needs to be ajusted after content alignment.
-    m_formattingState.addLineBox({ lineBox, lineContent.baseline(), lineContent.baselineOffset() });
+    m_formattingState.addLineBox({ lineBoxRect, lineContent.baseline(), lineContent.baselineOffset() });
     alignRuns(m_formattingRoot.style().textAlign(), previousLineLastRunIndex.valueOr(-1) + 1, widthConstraint - lineContent.logicalWidth());
 }
 
     alignRuns(m_formattingRoot.style().textAlign(), previousLineLastRunIndex.valueOr(-1) + 1, widthConstraint - lineContent.logicalWidth());
 }