Diff
Modified: trunk/LayoutTests/ChangeLog (283894 => 283895)
--- trunk/LayoutTests/ChangeLog 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/ChangeLog 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,3 +1,20 @@
+2021-10-11 Antti Koivisto <[email protected]>
+
+ Remove inline box decoration painting quirk
+ https://bugs.webkit.org/show_bug.cgi?id=231510
+
+ Reviewed by Alan Bujtas.
+
+ * fast/backgrounds/quirks-mode-line-box-backgrounds-expected-mismatch.html: Added.
+ * fast/backgrounds/quirks-mode-line-box-backgrounds.html:
+ * platform/glib/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt: Removed.
+ * platform/gtk/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png: Removed.
+ * platform/ios/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt: Removed.
+ * platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png: Removed.
+ * platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt: Removed.
+ * platform/win/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt: Removed.
+ * platform/wincairo/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt: Removed.
+
2021-10-11 Tim Nguyen <[email protected]>
Import new top layer WPTs
Added: trunk/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds-expected-mismatch.html (0 => 283895)
--- trunk/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds-expected-mismatch.html (rev 0)
+++ trunk/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds-expected-mismatch.html 2021-10-11 15:43:25 UTC (rev 283895)
@@ -0,0 +1,6 @@
+<div>This test verifies the inline box decoration painting quirk has been removed.</div>
+<div>
+<span style="background-color: red; font-size: 10px;"><img style="width: 10px; height: 10px"></span>
+</div>
+
+
Modified: trunk/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds.html (283894 => 283895)
--- trunk/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds.html 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/fast/backgrounds/quirks-mode-line-box-backgrounds.html 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,12 +1,4 @@
-The following two lines should be visible without the white background clipping any of the text:
-
-<p>
-<span style="background-color: white; font-size: 20px;">
-<span style="font-size: small; ">FOOBARBAZ<br>BAZBARFOO</span></span>
-</p>
-
-The background below should be 10x10 and snugly fit the image:
-
-<p>
-<span style="background-color: red; font-size: 40px;"><img style="width: 10px; height: 10px;"></span>
-</p>
+<div>This test verifies the inline box decoration painting quirk has been removed.</div>
+<div>
+<span style="background-color: red; font-size: 40px;"><img style="width: 10px; height: 10px"></span>
+</div>
Deleted: trunk/LayoutTests/platform/glib/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt (283894 => 283895)
--- trunk/LayoutTests/platform/glib/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/platform/glib/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,25 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock (anonymous) at (0,0) size 784x18
- RenderText {#text} at (0,0) size 607x17
- text run at (0,0) width 607: "The following two lines should be visible without the white background clipping any of the text:"
- RenderBlock {P} at (0,34) size 784x32
- RenderInline {SPAN} at (0,0) size 78x38 [bgcolor=#FFFFFF]
- RenderText {#text} at (0,0) size 0x0
- RenderInline {SPAN} at (0,0) size 78x31
- RenderText {#text} at (0,0) size 78x15
- text run at (0,0) width 78: "FOOBARBAZ"
- RenderBR {BR} at (78,0) size 0x15
- RenderText {#text} at (0,16) size 78x15
- text run at (0,16) width 78: "BAZBARFOO"
- RenderText {#text} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,82) size 784x18
- RenderText {#text} at (0,0) size 415x17
- text run at (0,0) width 415: "The background below should be 10x10 and snugly fit the image:"
- RenderBlock {P} at (0,116) size 784x10
- RenderInline {SPAN} at (0,0) size 10x45 [bgcolor=#FF0000]
- RenderImage {IMG} at (0,0) size 10x10
- RenderText {#text} at (0,0) size 0x0
Deleted: trunk/LayoutTests/platform/gtk/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/ios/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt (283894 => 283895)
--- trunk/LayoutTests/platform/ios/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/platform/ios/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,25 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock (anonymous) at (0,0) size 784x20
- RenderText {#text} at (0,0) size 619x19
- text run at (0,0) width 619: "The following two lines should be visible without the white background clipping any of the text:"
- RenderBlock {P} at (0,36) size 784x32
- RenderInline {SPAN} at (0,0) size 79x39 [bgcolor=#FFFFFF]
- RenderText {#text} at (0,0) size 0x0
- RenderInline {SPAN} at (0,0) size 79x31
- RenderText {#text} at (0,0) size 79x15
- text run at (0,0) width 79: "FOOBARBAZ"
- RenderBR {BR} at (78,0) size 1x15
- RenderText {#text} at (0,16) size 79x15
- text run at (0,16) width 79: "BAZBARFOO"
- RenderText {#text} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,84) size 784x20
- RenderText {#text} at (0,0) size 421x19
- text run at (0,0) width 421: "The background below should be 10x10 and snugly fit the image:"
- RenderBlock {P} at (0,120) size 784x10
- RenderInline {SPAN} at (0,0) size 10x45 [bgcolor=#FF0000]
- RenderImage {IMG} at (0,0) size 10x10
- RenderText {#text} at (0,0) size 0x0
Deleted: trunk/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt (283894 => 283895)
--- trunk/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/platform/mac/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,25 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock (anonymous) at (0,0) size 784x18
- RenderText {#text} at (0,0) size 619x18
- text run at (0,0) width 619: "The following two lines should be visible without the white background clipping any of the text:"
- RenderBlock {P} at (0,34) size 784x30
- RenderInline {SPAN} at (0,0) size 79x38 [bgcolor=#FFFFFF]
- RenderText {#text} at (0,0) size 0x0
- RenderInline {SPAN} at (0,0) size 79x30
- RenderText {#text} at (0,0) size 79x15
- text run at (0,0) width 79: "FOOBARBAZ"
- RenderBR {BR} at (78,0) size 1x15
- RenderText {#text} at (0,15) size 79x15
- text run at (0,15) width 79: "BAZBARFOO"
- RenderText {#text} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,80) size 784x18
- RenderText {#text} at (0,0) size 420x18
- text run at (0,0) width 420: "The background below should be 10x10 and snugly fit the image:"
- RenderBlock {P} at (0,114) size 784x10
- RenderInline {SPAN} at (0,0) size 10x46 [bgcolor=#FF0000]
- RenderImage {IMG} at (0,0) size 10x10
- RenderText {#text} at (0,0) size 0x0
Deleted: trunk/LayoutTests/platform/win/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt (283894 => 283895)
--- trunk/LayoutTests/platform/win/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/platform/win/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,25 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock (anonymous) at (0,0) size 784x18
- RenderText {#text} at (0,0) size 607x18
- text run at (0,0) width 607: "The following two lines should be visible without the white background clipping any of the text:"
- RenderBlock {P} at (0,34) size 784x30
- RenderInline {SPAN} at (0,0) size 78x38 [bgcolor=#FFFFFF]
- RenderText {#text} at (0,0) size 0x0
- RenderInline {SPAN} at (0,0) size 78x30
- RenderText {#text} at (0,0) size 78x15
- text run at (0,0) width 78: "FOOBARBAZ"
- RenderBR {BR} at (78,12) size 0x0
- RenderText {#text} at (0,15) size 78x15
- text run at (0,15) width 78: "BAZBARFOO"
- RenderText {#text} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,80) size 784x18
- RenderText {#text} at (0,0) size 415x18
- text run at (0,0) width 415: "The background below should be 10x10 and snugly fit the image:"
- RenderBlock {P} at (0,114) size 784x10
- RenderInline {SPAN} at (0,0) size 10x46 [bgcolor=#FF0000]
- RenderImage {IMG} at (0,0) size 10x10
- RenderText {#text} at (0,0) size 0x0
Deleted: trunk/LayoutTests/platform/wincairo/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt (283894 => 283895)
--- trunk/LayoutTests/platform/wincairo/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/LayoutTests/platform/wincairo/fast/backgrounds/quirks-mode-line-box-backgrounds-expected.txt 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,25 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x576
- RenderBlock (anonymous) at (0,0) size 784x20
- RenderText {#text} at (0,0) size 565x19
- text run at (0,0) width 565: "The following two lines should be visible without the white background clipping any of the text:"
- RenderBlock {P} at (0,36) size 784x32
- RenderInline {SPAN} at (0,0) size 77x38 [bgcolor=#FFFFFF]
- RenderText {#text} at (0,0) size 0x0
- RenderInline {SPAN} at (0,0) size 77x31
- RenderText {#text} at (0,0) size 77x15
- text run at (0,0) width 77: "FOOBARBAZ"
- RenderBR {BR} at (77,12) size 0x0
- RenderText {#text} at (0,16) size 77x15
- text run at (0,16) width 77: "BAZBARFOO"
- RenderText {#text} at (0,0) size 0x0
- RenderBlock (anonymous) at (0,84) size 784x20
- RenderText {#text} at (0,0) size 391x19
- text run at (0,0) width 391: "The background below should be 10x10 and snugly fit the image:"
- RenderBlock {P} at (0,120) size 784x10
- RenderInline {SPAN} at (0,0) size 10x46 [bgcolor=#FF0000]
- RenderImage {IMG} at (0,0) size 10x10
- RenderText {#text} at (0,0) size 0x0
Modified: trunk/Source/WebCore/ChangeLog (283894 => 283895)
--- trunk/Source/WebCore/ChangeLog 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/Source/WebCore/ChangeLog 2021-10-11 15:43:25 UTC (rev 283895)
@@ -1,5 +1,25 @@
2021-10-11 Antti Koivisto <[email protected]>
+ Remove inline box decoration painting quirk
+ https://bugs.webkit.org/show_bug.cgi?id=231510
+
+ Reviewed by Alan Bujtas.
+
+ This quirk implemented in InlineBoxPainter::constrainToLineTopAndBottomIfNeeded constraints
+ painting of inline box decorations under certain narrow conditions in quirks mode.
+ It has been removed from Chrome so removing it is likely web compatible.
+
+ The quirk originated from https://trac.webkit.org/changeset/53200/webkit
+
+ * rendering/InlineBoxPainter.cpp:
+ (WebCore::InlineBoxPainter::paintMask):
+ (WebCore::InlineBoxPainter::paintDecorations):
+ (WebCore::InlineBoxPainter::paintFillLayer):
+ (WebCore::InlineBoxPainter::constrainToLineTopAndBottomIfNeeded const): Deleted.
+ * rendering/InlineBoxPainter.h:
+
+2021-10-11 Antti Koivisto <[email protected]>
+
[LFC][Integration] paintFillLayerExtended should use inline iterator
https://bugs.webkit.org/show_bug.cgi?id=231502
Modified: trunk/Source/WebCore/rendering/InlineBoxPainter.cpp (283894 => 283895)
--- trunk/Source/WebCore/rendering/InlineBoxPainter.cpp 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/Source/WebCore/rendering/InlineBoxPainter.cpp 2021-10-11 15:43:25 UTC (rev 283895)
@@ -128,11 +128,8 @@
if (!m_paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style().visibility() != Visibility::Visible || m_paintInfo.phase != PaintPhase::Mask)
return;
- LayoutRect frameRect(m_inlineBox.rect());
- constrainToLineTopAndBottomIfNeeded(frameRect);
-
// Move x/y to our coordinates.
- LayoutRect localRect(frameRect);
+ LayoutRect localRect(m_inlineBox.rect());
m_inlineBox.line()->containingBlock().flipForWritingMode(localRect);
LayoutPoint adjustedPaintOffset = m_paintOffset + localRect.location();
@@ -156,7 +153,7 @@
}
}
- LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
+ LayoutRect paintRect = LayoutRect(adjustedPaintOffset, localRect.size());
paintFillLayers(Color(), renderer().style().maskLayers(), paintRect, compositeOp);
@@ -169,7 +166,7 @@
bool hasSingleLine = !m_inlineBox.previousInlineBox() && !m_inlineBox.nextInlineBox();
if (hasSingleLine)
- renderer().paintNinePieceImage(m_paintInfo.context(), LayoutRect(adjustedPaintOffset, frameRect.size()), renderer().style(), maskNinePieceImage, compositeOp);
+ renderer().paintNinePieceImage(m_paintInfo.context(), LayoutRect(adjustedPaintOffset, localRect.size()), renderer().style(), maskNinePieceImage, compositeOp);
else {
// We have a mask image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
@@ -181,8 +178,8 @@
totalLogicalWidth += box->logicalWidth();
LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0_lu);
LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0_lu : logicalOffsetOnLine);
- LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
- LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
+ LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : localRect.width();
+ LayoutUnit stripHeight = isHorizontal() ? localRect.height() : totalLogicalWidth;
LayoutRect clipRect = clipRectForNinePieceImageStrip(m_inlineBox, maskNinePieceImage, paintRect);
GraphicsContextStateSaver stateSaver(m_paintInfo.context());
@@ -208,16 +205,13 @@
if (m_isRootInlineBox && (!m_isFirstLine || &style == &renderer().style()))
return;
- LayoutRect frameRect(m_inlineBox.rect());
- constrainToLineTopAndBottomIfNeeded(frameRect);
-
// Move x/y to our coordinates.
- LayoutRect localRect(frameRect);
+ LayoutRect localRect(m_inlineBox.rect());
m_inlineBox.line()->containingBlock().flipForWritingMode(localRect);
LayoutPoint adjustedPaintoffset = m_paintOffset + localRect.location();
GraphicsContext& context = m_paintInfo.context();
- LayoutRect paintRect = LayoutRect(adjustedPaintoffset, frameRect.size());
+ LayoutRect paintRect = LayoutRect(adjustedPaintoffset, localRect.size());
// Shadow comes first and is behind the background and border.
if (!renderer().boxShadowShouldBeAppliedToBackground(adjustedPaintoffset, BackgroundBleedNone, m_inlineBox))
paintBoxShadow(ShadowStyle::Normal, paintRect);
@@ -265,8 +259,8 @@
LayoutUnit stripX = adjustedPaintoffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0_lu);
LayoutUnit stripY = adjustedPaintoffset.y() - (isHorizontal() ? 0_lu : logicalOffsetOnLine);
- LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
- LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
+ LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : localRect.width();
+ LayoutUnit stripHeight = isHorizontal() ? localRect.height() : totalLogicalWidth;
LayoutRect clipRect = clipRectForNinePieceImageStrip(m_inlineBox, borderImage, paintRect);
GraphicsContextStateSaver stateSaver(context);
@@ -350,30 +344,6 @@
renderer().paintBoxShadow(m_paintInfo, paintRect, style(), shadowStyle, hasClosedLeftEdge, hasClosedRightEdge);
}
-void InlineBoxPainter::constrainToLineTopAndBottomIfNeeded(LayoutRect& rect) const
-{
- if (renderer().document().inNoQuirksMode())
- return;
- if (m_inlineBox.legacyInlineBox()->hasTextChildren())
- return;
- if (m_inlineBox.legacyInlineBox()->descendantsHaveSameLineHeightAndBaseline() && m_inlineBox.legacyInlineBox()->hasTextDescendants())
- return;
-
- LayoutUnit logicalTop = isHorizontal() ? rect.y() : rect.x();
- LayoutUnit logicalHeight = isHorizontal() ? rect.height() : rect.width();
-
- LayoutUnit bottom = std::min(m_inlineBox.line()->bottom(), logicalTop + logicalHeight);
- logicalTop = std::max(m_inlineBox.line()->top(), logicalTop);
- logicalHeight = bottom - logicalTop;
- if (isHorizontal()) {
- rect.setY(logicalTop);
- rect.setHeight(logicalHeight);
- } else {
- rect.setX(logicalTop);
- rect.setWidth(logicalHeight);
- }
-}
-
const RenderStyle& InlineBoxPainter::style() const
{
return m_isFirstLine ? renderer().firstLineStyle() : renderer().style();
Modified: trunk/Source/WebCore/rendering/InlineBoxPainter.h (283894 => 283895)
--- trunk/Source/WebCore/rendering/InlineBoxPainter.h 2021-10-11 15:30:15 UTC (rev 283894)
+++ trunk/Source/WebCore/rendering/InlineBoxPainter.h 2021-10-11 15:43:25 UTC (rev 283895)
@@ -53,8 +53,6 @@
void paintFillLayer(const Color&, const FillLayer&, const LayoutRect& paintRect, CompositeOperator);
void paintBoxShadow(ShadowStyle, const LayoutRect& paintRect);
- void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const;
-
const RenderStyle& style() const;
// FIXME: Make RenderBoxModelObject functions const.
RenderBoxModelObject& renderer() const { return const_cast<RenderBoxModelObject&>(m_renderer); }