Re: [svgwg] context-value UA rules for OpenType are giving unexpected rendering / compat problems

It's true that whether it's inherited as an absolute value or a keyword doesn't matter, when the font size and font is given, but the problem here is unrelated to that. It is the value itself is problematic.

As I've described in that bug, the used value for `context-value` in that environment is expected to be one CSS pixel, and it works as expected per spec. But there is a `transform="scale(32.0)"` in the glyph, which effectively scales the stroke-width to 32px, thus the problem.

This didn't cause issue in the old style system not because it was inherited as absolute value, but because the old style system simply drops `context-value` and uses the initial value instead when inheriting happens, which is apparently a bug in terms of cascading.

You may be confused for the argument around why `context-value` needs to be a keyword in computed value. That is because it is used inside glyph, and glyph element would never know what `context-value` is before it is actually painted with a number from its environment. If we want to convert it to an absolute value at computation time, we would need to cascade the SVG glyph during painting it, which can be problematic performance-wise. It would be much performant to just cascade everything before-hand, and paint with a value passed via painting context to replace the keyword.

-- 
GitHub Notification of comment by upsuper
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/421#issuecomment-383341815 using your GitHub account

Received on Saturday, 21 April 2018 23:47:30 UTC