Title: [239504] trunk
- Revision
- 239504
- Author
- [email protected]
- Date
- 2018-12-21 09:33:14 -0800 (Fri, 21 Dec 2018)
Log Message
Repeated background images with zero size should display the background color
https://bugs.webkit.org/show_bug.cgi?id=192962
Reviewed by Antti Koivisto.
Source/WebCore:
Test: fast/backgrounds/background-repeat-with-zero-size.html
* platform/LengthSize.h:
(WebCore::LengthSize::isEmpty const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::isEmpty const):
LayoutTests:
Fix a rendering bug exposed by the CSS Variable wpt tests where repeated backgrounds with zero size
not draw the background colour underneath.
* fast/backgrounds/background-repeat-with-zero-size-expected.html: Added.
* fast/backgrounds/background-repeat-with-zero-size.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (239503 => 239504)
--- trunk/LayoutTests/ChangeLog 2018-12-21 16:20:03 UTC (rev 239503)
+++ trunk/LayoutTests/ChangeLog 2018-12-21 17:33:14 UTC (rev 239504)
@@ -1,3 +1,16 @@
+2018-12-21 Justin Michaud <[email protected]>
+
+ Repeated background images with zero size should display the background color
+ https://bugs.webkit.org/show_bug.cgi?id=192962
+
+ Reviewed by Antti Koivisto.
+
+ Fix a rendering bug exposed by the CSS Variable wpt tests where repeated backgrounds with zero size
+ not draw the background colour underneath.
+
+ * fast/backgrounds/background-repeat-with-zero-size-expected.html: Added.
+ * fast/backgrounds/background-repeat-with-zero-size.html: Added.
+
2018-12-20 Brent Fulgham <[email protected]>
Show punycode if URL contains Latin small letter dotless i
Added: trunk/LayoutTests/fast/backgrounds/background-repeat-with-zero-size-expected.html (0 => 239504)
--- trunk/LayoutTests/fast/backgrounds/background-repeat-with-zero-size-expected.html (rev 0)
+++ trunk/LayoutTests/fast/backgrounds/background-repeat-with-zero-size-expected.html 2018-12-21 17:33:14 UTC (rev 239504)
@@ -0,0 +1,17 @@
+<style>
+.el {
+ width: 150px;
+ height: 150px;
+ background-color: green;
+}
+</style>
+
+<div class="el el1">
+</div>
+
+<div class="el el2" >
+</div>
+
+<div class="el el3" style="position: relative;">
+<div style="background: red; width: 10px; height: 10px; position: absolute; top: 0; left: 0;"></div>
+</div>
Added: trunk/LayoutTests/fast/backgrounds/background-repeat-with-zero-size.html (0 => 239504)
--- trunk/LayoutTests/fast/backgrounds/background-repeat-with-zero-size.html (rev 0)
+++ trunk/LayoutTests/fast/backgrounds/background-repeat-with-zero-size.html 2018-12-21 17:33:14 UTC (rev 239504)
@@ -0,0 +1,31 @@
+<style>
+.el {
+ width: 150px;
+ height: 150px;
+ background-color: green;
+ background-image: linear-gradient(red,red);
+ background-size: 0 0;
+}
+
+.el1 {
+ background-repeat: repeat;
+}
+
+.el2 {
+ background-repeat: no-repeat;
+}
+
+.el3 {
+ background-repeat: no-repeat;
+ background-size: 10px 10px;
+}
+</style>
+
+<div class="el el1">
+</div>
+
+<div class="el el2">
+</div>
+
+<div class="el el3">
+</div>
Modified: trunk/Source/WebCore/ChangeLog (239503 => 239504)
--- trunk/Source/WebCore/ChangeLog 2018-12-21 16:20:03 UTC (rev 239503)
+++ trunk/Source/WebCore/ChangeLog 2018-12-21 17:33:14 UTC (rev 239504)
@@ -1,3 +1,19 @@
+2018-12-21 Justin Michaud <[email protected]>
+
+ Repeated background images with zero size should display the background color
+ https://bugs.webkit.org/show_bug.cgi?id=192962
+
+ Reviewed by Antti Koivisto.
+
+ Test: fast/backgrounds/background-repeat-with-zero-size.html
+
+ * platform/LengthSize.h:
+ (WebCore::LengthSize::isEmpty const):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+ * rendering/style/FillLayer.h:
+ (WebCore::FillLayer::isEmpty const):
+
2018-12-21 Manuel Rego Casasnovas <[email protected]>
[css-grid] Fix percentages in relative offsets for grid items
Modified: trunk/Source/WebCore/platform/LengthSize.h (239503 => 239504)
--- trunk/Source/WebCore/platform/LengthSize.h 2018-12-21 16:20:03 UTC (rev 239503)
+++ trunk/Source/WebCore/platform/LengthSize.h 2018-12-21 17:33:14 UTC (rev 239504)
@@ -26,6 +26,8 @@
struct LengthSize {
Length width;
Length height;
+
+ bool isEmpty() const { return width.isZero() || height.isZero(); }
};
ALWAYS_INLINE bool operator==(const LengthSize& a, const LengthSize& b)
Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (239503 => 239504)
--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2018-12-21 16:20:03 UTC (rev 239503)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2018-12-21 17:33:14 UTC (rev 239504)
@@ -950,7 +950,7 @@
if (!bgLayer.next()) {
LayoutRect backgroundRect(scrolledPaintRect);
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(rect.location(), bleedAvoidance, box);
- if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer.hasOpaqueImage(*this) || !bgLayer.hasRepeatXY()) {
+ if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer.hasOpaqueImage(*this) || !bgLayer.hasRepeatXY() || bgLayer.isEmpty()) {
if (!boxShadowShouldBeAppliedToBackground)
backgroundRect.intersect(paintInfo.rect);
Modified: trunk/Source/WebCore/rendering/style/FillLayer.h (239503 => 239504)
--- trunk/Source/WebCore/rendering/style/FillLayer.h 2018-12-21 16:20:03 UTC (rev 239503)
+++ trunk/Source/WebCore/rendering/style/FillLayer.h 2018-12-21 17:33:14 UTC (rev 239504)
@@ -101,6 +101,8 @@
bool isSizeSet() const { return static_cast<FillSizeType>(m_sizeType) != FillSizeType::None; }
bool isMaskSourceTypeSet() const { return m_maskSourceTypeSet; }
+ bool isEmpty() const { return (sizeType() == FillSizeType::Size && m_sizeLength.isEmpty()) || sizeType() == FillSizeType::None; }
+
void setImage(RefPtr<StyleImage>&& image) { m_image = WTFMove(image); m_imageSet = true; }
void setXPosition(Length length) { m_xPosition = WTFMove(length); m_xPosSet = true; }
void setYPosition(Length length) { m_yPosition = WTFMove(length); m_yPosSet = true; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes