Re: [csswg-drafts] [css-text-decor-4] Composition of inset shadows (#7251)

> The obvious: What is the stacking order of inset shadows wrt stroke?

As an author, I agree with @smfr that putting the inset shadows between stroke and fill would be the expected stacking order. The reason is that the shadows are used to style the inner part of the text while the stroke is an outline for the text.

> * Less obvious: Are text decorations composited with their text before being shadowed?
> 
> Here's a [fun test case](https://www.software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cp%20style%3D%22text-shadow%3A%20%235555%2020px%2020px%3B%20font-weight%3A%20bold%3B%20font-size%3A%2020px%3B%20text-decoration%3A%20line-through%3B%20text-decoration-thickness%3A%2010px%22%3ETest%20This). From an authoring perspective, I think I'd expect the shadow to have a consistent color throughout...
> 
> But if we composit the text and the decorations together for shadowing, we can't say that the inset shadows are between the stroke and fill since text and decorations are stroked independently.

Again, from an author's perspective, you'd expect the inset shadows to be between fill and stroke. And I agree that outset shadows are expected to _not_ overlap.
That means, from a specification and implementation perspective inset and outset need to be handled differently. For inset shadows, they'd need to be drawn before compositing text and decorations and their fills and strokes and for outset shadows, text and decorations including their fills and strokes should be composited first.

Having said that, current implementations (tested your example in Chrome 101 and Firefox 100) obviously do _not_ composite text and decorations - and are thus not following the spec. - and ignore the stroke for outset shadows (tested with `-webkit-text-stroke` because browsers don't implement [`stroke`](https://drafts.fxtf.org/fill-stroke/#stroke-shorthand) yet).

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7251#issuecomment-1117810020 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 4 May 2022 19:53:39 UTC