Handle border-image with fill and zero-width borders
Before this patch we require at least one border dimension (top, left,
bottom, right) to be non-zero to trigger the border painting.
This misses the case when we have a zero width border all around but a
border image and border-image-slice: <numbers> fill. The center part
of the border-image should be painted, regardless of the
border-widths.
See https://bugs.webkit.org/show_bug.cgi?id=142650 and related commit.
It's not an exact port but this patch is heavily inspired by
​sabouhallawa's fix.
BUG=493088
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=196489
https://codereview.chromium.org/1159773005/diff/80001/Source/core/layout/LayoutObject.cpp File Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/1159773005/diff/80001/Source/core/layout/LayoutObject.cpp#newcode1671 Source/core/layout/LayoutObject.cpp:1671: if (style()->hasBorderDecoration() || style()->hasOutline() On 2015/06/02 03:07:56, pdr wrote: ...
4 years, 11 months ago
(2015-06-03 06:56:01 UTC)
#4
https://codereview.chromium.org/1159773005/diff/80001/Source/core/layout/Layo...
File Source/core/layout/LayoutObject.cpp (right):
https://codereview.chromium.org/1159773005/diff/80001/Source/core/layout/Layo...
Source/core/layout/LayoutObject.cpp:1671: if (style()->hasBorderDecoration() ||
style()->hasOutline()
On 2015/06/02 03:07:56, pdr wrote:
> I think this may be correct as just hasBorder because the decoration won't
> depend on the color. If the color property changes we need to check if a
border
> exists because border-color can use the 'color' due to css weirdism.
Ah, sounds reasonable. Thanks.
https://codereview.chromium.org/1159773005/diff/80001/Source/core/style/Compu...
File Source/core/style/ComputedStyle.h (right):
https://codereview.chromium.org/1159773005/diff/80001/Source/core/style/Compu...
Source/core/style/ComputedStyle.h:395: bool hasBorderDecoration() const { return
hasBorder() || hasBorderFill(); }
On 2015/06/02 03:07:56, pdr wrote:
> Can the hasBorder and image check in ComputedStyle::borderObscuresBackground
be
> replaced with hasBorderDecoration?
You mean replacing
if (!hasBorder())
return false;
// Bail if we have any border-image for now. We could look at the image
alpha to improve this.
if (borderImage().image())
return false;
...
with:
if (!hasBorderDecoration())
return false;
...
Such a change would mean that we would go on to inspect edges for the
case when all border widths are zero but there still is a border-image
to draw. Since we don't inspect the alpha channel of the border-image,
I think border-image should mean we always bail.
pdr.
LGTM
4 years, 11 months ago
(2015-06-04 03:50:31 UTC)
#5
LGTM
davve
The CQ bit was checked by davve@opera.com
4 years, 11 months ago
(2015-06-04 07:23:49 UTC)
#6
Try jobs failed on following builders: win_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/65245)
4 years, 11 months ago
(2015-06-04 09:47:20 UTC)
#9
Issue 1159773005: Handle border-image with fill and zero-width borders
(Closed)
Created 4 years, 11 months ago by davve
Modified 4 years, 11 months ago
Reviewers: pdr.
Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Comments: 6