Title: [258070] trunk
- Revision
- 258070
- Author
- [email protected]
- Date
- 2020-03-07 08:06:35 -0800 (Sat, 07 Mar 2020)
Log Message
[LFC][IFC] Do not text-align: justify the runs on the current line if they are followed by a forced break
https://bugs.webkit.org/show_bug.cgi?id=208761
<rdar://problem/59825136>
Reviewed by Antti Koivisto.
Source/WebCore:
https://www.w3.org/TR/css-text-3/#text-align-property
"Text is justified according to the method specified by the text-justify property,
in order to exactly fill the line box. Unless otherwise specified by text-align-last,
the last line before a forced break or the end of the block is start-aligned."
Test: fast/text/text-align-justify-and-forced-line-break.html
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::alignHorizontally):
LayoutTests:
* fast/text/text-align-justify-and-forced-line-break-expected.html: Added.
* fast/text/text-align-justify-and-forced-line-break.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (258069 => 258070)
--- trunk/LayoutTests/ChangeLog 2020-03-07 09:28:06 UTC (rev 258069)
+++ trunk/LayoutTests/ChangeLog 2020-03-07 16:06:35 UTC (rev 258070)
@@ -1,3 +1,14 @@
+2020-03-07 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Do not text-align: justify the runs on the current line if they are followed by a forced break
+ https://bugs.webkit.org/show_bug.cgi?id=208761
+ <rdar://problem/59825136>
+
+ Reviewed by Antti Koivisto.
+
+ * fast/text/text-align-justify-and-forced-line-break-expected.html: Added.
+ * fast/text/text-align-justify-and-forced-line-break.html: Added.
+
2020-03-06 Rob Buis <[email protected]>
Fix original-crossorigin-applied.sub.html WPT test
Added: trunk/LayoutTests/fast/text/text-align-justify-and-forced-line-break-expected.html (0 => 258070)
--- trunk/LayoutTests/fast/text/text-align-justify-and-forced-line-break-expected.html (rev 0)
+++ trunk/LayoutTests/fast/text/text-align-justify-and-forced-line-break-expected.html 2020-03-07 16:06:35 UTC (rev 258070)
@@ -0,0 +1,11 @@
+<style>
+div {
+ width: 200px;
+ background-color: yellow;
+ font-size: 16px;
+}
+</style>
+<div style="text-align: justify">Unless otherwise specified by text-align-last, the</dov>
+<div>last line before a forced break</div>
+<div>or the end of the block</div>
+<div>is start-aligned.</divv>
Added: trunk/LayoutTests/fast/text/text-align-justify-and-forced-line-break.html (0 => 258070)
--- trunk/LayoutTests/fast/text/text-align-justify-and-forced-line-break.html (rev 0)
+++ trunk/LayoutTests/fast/text/text-align-justify-and-forced-line-break.html 2020-03-07 16:06:35 UTC (rev 258070)
@@ -0,0 +1,9 @@
+<style>
+div {
+ text-align: justify;
+ width: 200px;
+ background-color: yellow;
+ font-size: 16px;
+}
+</style>
+<div>Unless otherwise specified by text-align-last, the<br> last line before a forced break<br> or the end of the block<br> is start-aligned.</divv>
Modified: trunk/Source/WebCore/ChangeLog (258069 => 258070)
--- trunk/Source/WebCore/ChangeLog 2020-03-07 09:28:06 UTC (rev 258069)
+++ trunk/Source/WebCore/ChangeLog 2020-03-07 16:06:35 UTC (rev 258070)
@@ -1,3 +1,21 @@
+2020-03-07 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Do not text-align: justify the runs on the current line if they are followed by a forced break
+ https://bugs.webkit.org/show_bug.cgi?id=208761
+ <rdar://problem/59825136>
+
+ Reviewed by Antti Koivisto.
+
+ https://www.w3.org/TR/css-text-3/#text-align-property
+ "Text is justified according to the method specified by the text-justify property,
+ in order to exactly fill the line box. Unless otherwise specified by text-align-last,
+ the last line before a forced break or the end of the block is start-aligned."
+
+ Test: fast/text/text-align-justify-and-forced-line-break.html
+
+ * layout/inlineformatting/InlineLineBuilder.cpp:
+ (WebCore::Layout::LineBuilder::alignHorizontally):
+
2020-03-07 Konstantin Tokarev <[email protected]>
REGRESSION(r257975): [GTK][WPE] Build failure after a clean build
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp (258069 => 258070)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-03-07 09:28:06 UTC (rev 258069)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp 2020-03-07 16:06:35 UTC (rev 258070)
@@ -233,7 +233,7 @@
}
}
-void LineBuilder::alignHorizontally(const HangingContent& hangingContent, IsLastLineWithInlineContent lastLine)
+void LineBuilder::alignHorizontally(const HangingContent& hangingContent, IsLastLineWithInlineContent isLastLine)
{
ASSERT(!m_isIntrinsicSizing);
auto availableWidth = this->availableWidth() + hangingContent.width();
@@ -241,8 +241,9 @@
return;
if (isTextAlignJustify()) {
- // Do not justify align the last line.
- if (lastLine == IsLastLineWithInlineContent::No)
+ // Unless otherwise specified by text-align-last, the last line before a forced break or
+ // the end of the block is start-aligned.
+ if (!m_runs.last().isLineBreak() && isLastLine == IsLastLineWithInlineContent::No)
justifyRuns(availableWidth);
return;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes