Re: [csswg-drafts] [css-inline] CSS properties appply to SVG elements (#3411)

I'm working on these edits, per @fantasai's request (trying to clean up issues on CSS Inline for publication).

I'm trying to use the categories currently defined in SVG 2:  [text content elements](https://svgwg.org/svg2-draft/text.html#TermTextContentElement) (for any of text, tspan, and textPath), text content block element (text), and text content child element (tspan and textPath). I'm using the [SVG 1.1 spec](https://www.w3.org/TR/SVG11/text.html) as reference for how properties were originally spec'd to apply to the SVG elements.

But, it seems we have some inconsistencies between what the spec said and what browsers did. Also, `dominant-baseline` and `alignment-baseline` have been changed so much compared to the SVG 1 spec already that it isn't entirely relevant.

- `baseline-shift`: [SVG 1 says child elements only](https://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty), but Chromium (and probably WebKit???) supports it on `text` and Firefox doesn't support at all.

- `alignment-baseline` is defined to align the current element relative to it's _parent_ so it should logically only apply to _child_ elements, and that's how it was defined in SVG 1. But again, Chromium supports it on `text` to change the alignment relative to the SVG text anchor point, and Firefox doesn't support it at all.

- `dominant-baseline` everyone (SVG 1, Chromium, Firefox) agrees applies to all text content elements.

[CodePen tests](https://codepen.io/AmeliaBR/pen/0fbc72442bb4fcf389ca035f845b6571)

So, I'm spec'ing all three to apply to all text content elements unless there is a strong objection and/or my guess is wrong about WebKit and Chromium matching here. There's no reason not to let baseline-shift and alignment-baseline apply to SVG `<text>` since there is still a clear reference point to measure alignment against.

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

Received on Tuesday, 2 June 2020 15:33:03 UTC