Bug 248346 - -webkit-mask-box-image-slice:initial is not the initial value
Summary: -webkit-mask-box-image-slice:initial is not the initial value
Status: RESOLVED DUPLICATE of bug 254063
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 248325
  Show dependency treegraph
 
Reported: 2022-11-25 09:04 PST by Oriol Brufau
Modified: 2023-03-17 14:10 PDT (History)
3 users (show)

See Also:


Attachments
testcase (1.05 KB, text/html)
2022-11-25 09:04 PST, Oriol Brufau
no flags Details
screenshot (8.45 KB, image/png)
2022-11-25 09:08 PST, Oriol Brufau
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oriol Brufau 2022-11-25 09:04:19 PST
Created attachment 463732 [details]
testcase

If no -webkit-mask-box-image-slice is provided, then https://searchfox.org/wubkat/rev/70230d10f272f17151f1e77d496553716b449cea/Source/WebCore/rendering/style/NinePieceImage.h uses

    data.imageSlices = LengthBox(0);

However, if you specify -webkit-mask-box-image-slice:initial, then https://searchfox.org/wubkat/rev/70230d10f272f17151f1e77d496553716b449cea/Source/WebCore/style/StyleBuilderCustom.h#536

    image.setImageSlices(LengthBox());

These are different:
 - LengthBox() has lengths of LengthType::Auto and in NinePieceImage::computeSlices they will behave like Length(100, LengthType::Percent).
 - LengthBox(0) has Length(0, LengthType::Fixed).

Using LengthBox() seems clearly wrong, I think there are 2 possibilities:
 - Switch both places to using LengthBox(0).
   This will match the current behavior when no -webkit-mask-box-image-slice is provided.
   This will obey https://www.w3.org/TR/2014/WD-css-masking-1-20140213/#the-mask-box-slice and https://drafts.fxtf.org/css-masking-1/#the-mask-border-slice
 - Switch both places to using LengthBox(Length(100, LengthType::Percent), Length(100, LengthType::Percent), Length(100, LengthType::Percent), Length(100, LengthType::Percent))
   This will match the current behavior when using -webkit-mask-box-image-slice:initial
   This will make it consistent with border-image-slice
Comment 1 Oriol Brufau 2022-11-25 09:08:15 PST
Created attachment 463733 [details]
screenshot
Comment 2 Oriol Brufau 2022-11-25 09:22:25 PST
CC Dave Hyatt since this seems to come from bug 67657.
Comment 3 Radar WebKit Bug Importer 2022-12-02 09:05:17 PST
<rdar://problem/102907368>
Comment 4 Darin Adler 2023-03-17 14:10:03 PDT
I was "forced" to fix this to resolve bug 254063.

*** This bug has been marked as a duplicate of bug 254063 ***