TSPAN positioned in `em` units does not update when container element font-size changes
Reported by
bruckner...@gmail.com,
Aug 15 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 Steps to reproduce the problem: 1. Create SVG <text font-size="X"> with <tspan dy="1em"> 2. Change `font-size` from X to Y. 3. Observe the position of the TSPAN What is the expected behavior? Position of the TSPAN is updated based on the new font-size value What went wrong? Position of the TSPAN seems not to be updated Did this work before? Yes Not sure Does this work in other browsers? Yes Chrome version: 60.0.3112.101 Channel: stable OS Version: OS X 10.12.6 Flash Version:
,
Aug 15 2017
I'd suspect that we're missing a position value invalidation in LayoutSVGInlineText::StyleDidChange. I also suspect that we should always invalidate the position values when metrics are invalidated (i.e "metric changed" would imply "position values changed"), because of cases like this. We _almost_ always set both as things are right now. I think more state would be needed to be able to be "smarter" in these cases. I guess r379566 (d0ffb54118db1b76565dd6d3ffe7623227663038) could have caused this, but that is just a guess.
,
Aug 15 2017
...and unless my analysis above completely misses the mark, this is a layout issue (and not a paint invalidation one), so I'll put this back in that original bucket.
,
Aug 15 2017
I have a fix. But maybe it can be slightly better.
,
Aug 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a4fb9d8f40652c3f09425032866ca22df5611541 commit a4fb9d8f40652c3f09425032866ca22df5611541 Author: Stephen Chenney <schenney@chromium.org> Date: Tue Aug 15 19:18:16 2017 Update SVG Text positioning values on metrics change When font metrics change it can change the positioning of child tspan elements within an SVG text element. So update positions when the font changes. Test by fs@opera.com R=fs@opera.com BUG= 755518 Change-Id: I6a8686e4bcdd14e820eba8770aa9c682146b467c Reviewed-on: https://chromium-review.googlesource.com/615469 Commit-Queue: Fredrik Söderquist <fs@opera.com> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#494485} [add] https://crrev.com/a4fb9d8f40652c3f09425032866ca22df5611541/third_party/WebKit/LayoutTests/svg/text/position-update-on-font-size-change-expected.html [add] https://crrev.com/a4fb9d8f40652c3f09425032866ca22df5611541/third_party/WebKit/LayoutTests/svg/text/position-update-on-font-size-change.html [modify] https://crrev.com/a4fb9d8f40652c3f09425032866ca22df5611541/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp
,
Aug 15 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by schenney@chromium.org
, Aug 15 2017Labels: -Type-Bug-Regression BugSource-User PaintTeamTriaged-20170815 Type-Bug
Status: Available (was: Unconfirmed)