Title: [253915] trunk/Source/WebCore
- Revision
- 253915
- Author
- [email protected]
- Date
- 2019-12-26 08:01:43 -0800 (Thu, 26 Dec 2019)
Log Message
[LFC][IFC] When align the inline content we need to align the line as well
https://bugs.webkit.org/show_bug.cgi?id=205596
<rdar://problem/58197300>
Reviewed by Antti Koivisto.
Horizontal alignment means that we not only adjust the runs but also make sure the line box is aligned as well.
<div style="text-align: center; width: 100px;">centered text</div>
The line box will also be centered as opposed to start at 0px all the way to [centered text] run's right edge.
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::alignHorizontally):
(WebCore::Layout::LineBuilder::alignContentHorizontally const): Deleted.
* layout/inlineformatting/InlineLineBuilder.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (253914 => 253915)
--- trunk/Source/WebCore/ChangeLog 2019-12-26 10:12:24 UTC (rev 253914)
+++ trunk/Source/WebCore/ChangeLog 2019-12-26 16:01:43 UTC (rev 253915)
@@ -1,3 +1,22 @@
+2019-12-26 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] When align the inline content we need to align the line as well
+ https://bugs.webkit.org/show_bug.cgi?id=205596
+ <rdar://problem/58197300>
+
+ Reviewed by Antti Koivisto.
+
+ Horizontal alignment means that we not only adjust the runs but also make sure the line box is aligned as well.
+
+ <div style="text-align: center; width: 100px;">centered text</div>
+ The line box will also be centered as opposed to start at 0px all the way to [centered text] run's right edge.
+
+ * layout/inlineformatting/InlineLineBuilder.cpp:
+ (WebCore::Layout::LineBuilder::close):
+ (WebCore::Layout::LineBuilder::alignHorizontally):
+ (WebCore::Layout::LineBuilder::alignContentHorizontally const): Deleted.
+ * layout/inlineformatting/InlineLineBuilder.h:
+
2019-12-25 Zalan Bujtas <[email protected]>
Run with offset from the content box's logical left paint its tab stop at wrong position.
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp (253914 => 253915)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2019-12-26 10:12:24 UTC (rev 253914)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2019-12-26 16:01:43 UTC (rev 253915)
@@ -238,7 +238,7 @@
m_lineBox.resetDescent();
}
alignContentVertically(runList);
- alignContentHorizontally(runList, isLastLineWithInlineContent);
+ alignHorizontally(runList, isLastLineWithInlineContent);
}
return runList;
}
@@ -330,7 +330,7 @@
}
}
-void LineBuilder::alignContentHorizontally(RunList& runList, IsLastLineWithInlineContent lastLine) const
+void LineBuilder::alignHorizontally(RunList& runList, IsLastLineWithInlineContent lastLine)
{
ASSERT(!m_isIntrinsicSizing);
auto availableWidth = this->availableWidth() + m_hangingContent.width();
@@ -368,7 +368,11 @@
auto adjustment = adjustmentForAlignment();
if (!adjustment)
return;
-
+ // Horizontal alignment means that we not only adjust the runs but also make sure
+ // that the line box is aligned as well
+ // e.g. <div style="text-align: center; width: 100px;">centered text</div> : the line box will also be centered
+ // as opposed to start at 0px all the way to [centered text] run's right edge.
+ m_lineBox.moveHorizontally(*adjustment);
for (auto& run : runList)
run.moveHorizontally(*adjustment);
}
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.h (253914 => 253915)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.h 2019-12-26 10:12:24 UTC (rev 253914)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.h 2019-12-26 16:01:43 UTC (rev 253915)
@@ -141,7 +141,7 @@
void removeTrailingCollapsibleContent();
void collectHangingContent(IsLastLineWithInlineContent);
- void alignContentHorizontally(RunList&, IsLastLineWithInlineContent) const;
+ void alignHorizontally(RunList&, IsLastLineWithInlineContent);
void alignContentVertically(RunList&);
void adjustBaselineAndLineHeight(const Run&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes