WebKit Bugzilla
Attachment 357917 Details for
Bug 192962
: Repeated background images with zero size should display the background color
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192962-20181220191711.patch (text/plain), 5.75 KB, created by
Justin Michaud
on 2018-12-20 19:17:18 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2018-12-20 19:17:18 PST
Size:
5.75 KB
patch
obsolete
>Subversion Revision: 239490 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3bf53c33d337d3114582326f8faa39bb1a0c77fc..4fcbc92f8f5e5a4cdaecd5d8b5d0ffff70327e9d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-12-20 Justin Michaud <justin_michaud@apple.com> >+ >+ Repeated background images with zero size should display the background color >+ https://bugs.webkit.org/show_bug.cgi?id=192962 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-20 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, remove stray #pragma once added to .cpp file >diff --git a/Source/WebCore/platform/LengthSize.h b/Source/WebCore/platform/LengthSize.h >index 03b2775b30a2e54f3070658545398867a81c849c..22a81bff03b00e0cdba6c0c23fc0f27e73a2824a 100644 >--- a/Source/WebCore/platform/LengthSize.h >+++ b/Source/WebCore/platform/LengthSize.h >@@ -26,6 +26,8 @@ namespace WebCore { > struct LengthSize { > Length width; > Length height; >+ >+ bool isEmpty() const { return width.isZero() || height.isZero(); } > }; > > ALWAYS_INLINE bool operator==(const LengthSize& a, const LengthSize& b) >diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp >index 96052ea1b3aaf790db3c9d3d3d49b0479b789ce0..ca6fa2a9e8c3e51fd33dfb39653950fe52f1a2c3 100644 >--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp >+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp >@@ -933,7 +933,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co > 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); > >diff --git a/Source/WebCore/rendering/style/FillLayer.h b/Source/WebCore/rendering/style/FillLayer.h >index e2be9583b610312602747878cc672dfc2bbacef7..57ddd879938e8baf6560c3c997d0504527ce65b8 100644 >--- a/Source/WebCore/rendering/style/FillLayer.h >+++ b/Source/WebCore/rendering/style/FillLayer.h >@@ -101,6 +101,8 @@ public: > 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; } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 95c657fc9ddae7b3c09e652cc515aa34594a5ea4..8a0ec512f6afddade067e0b8b3b3c3e0dd21a3f8 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-20 Justin Michaud <justin_michaud@apple.com> >+ >+ Repeated background images with zero size should display the background color >+ https://bugs.webkit.org/show_bug.cgi?id=192962 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Some layout tests are failing after r239441 >diff --git a/LayoutTests/fast/backgrounds/background-repeat-with-zero-size-expected.html b/LayoutTests/fast/backgrounds/background-repeat-with-zero-size-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e7f5dd5bf5c98323a7e5cb1b354e8d445c3d119e >--- /dev/null >+++ b/LayoutTests/fast/backgrounds/background-repeat-with-zero-size-expected.html >@@ -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> >diff --git a/LayoutTests/fast/backgrounds/background-repeat-with-zero-size.html b/LayoutTests/fast/backgrounds/background-repeat-with-zero-size.html >new file mode 100644 >index 0000000000000000000000000000000000000000..956fa5d7b7a70a3ff683cb16cfaeffbed210d4ab >--- /dev/null >+++ b/LayoutTests/fast/backgrounds/background-repeat-with-zero-size.html >@@ -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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192962
: 357917