Summary: | list-style-image with SVG image renders at incorrect size | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | paladox <thomasmulhall410> | ||||||||||
Component: | SVG | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Critical | CC: | a9016009, commit-queue, dbates, erwin, esprehn+autocc, glenn, jonlee, kondapallykalyan, pdr, sabouhallawa, thomasmulhall410, zimmermann | ||||||||||
Priority: | P1 | Keywords: | BlinkMergeCandidate | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Attachments: |
|
Description
paladox
2015-02-08 03:34:24 PST
the problem happens in iOS all version. so could this please get this fixed. Please fix it. This problem is only with ios since I can only try it on ios and not safari. this may be a webkit problem. please could someone fix this. This should not be an issue on the iOS os. The problem is also described here https://phabricator.wikimedia.org/T37338 and does it on Wikimedia. To summarize: The core problem is that the intrinsic size of the SVG is ignored when used in list-style-image. This results in the SVG not being sized correctly when the device resolution is higher than 1dppx. This was fixed in Chromium as linked by OP. Thanks for summerising the question. It seems this was fixed in chromium. Here is the code review. https://codereview.chromium.org/197203003/patch/1/10003 Found where the code should be fixed https://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderListMarker.cpp#L1377 And the code to fix the issue from chromium is at https://chromium.googlesource.com/chromium/blink/+/master/Source/core/layout/LayoutListMarker.cpp on line 1183. Created attachment 250644 [details]
test case
Created attachment 250645 [details]
Expected
Created attachment 250648 [details]
Patch
Comment on attachment 250648 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250648&action=review > Source/WebCore/rendering/RenderListMarker.cpp:1427 > int bulletWidth = style().fontMetrics().ascent() / 2; I wonder if we really want to round up to an integer here before converting to a LayoutSize. Worth talking to Zalan about which kind of rounding/snapping is best here. Comment on attachment 250648 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250648&action=review >> Source/WebCore/rendering/RenderListMarker.cpp:1427 >> int bulletWidth = style().fontMetrics().ascent() / 2; > > I wonder if we really want to round up to an integer here before converting to a LayoutSize. Worth talking to Zalan about which kind of rounding/snapping is best here. updateContent() is called during layout and we normally snap at painting. There are a few exceptions, but rule of thumb of snapping is that it should only happen right before painting. Please use LayoutUnit instead of int. -to avoid any kind of rounding/snapping here. Created attachment 250662 [details]
Patch
(In reply to comment #14) > Comment on attachment 250648 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=250648&action=review > > >> Source/WebCore/rendering/RenderListMarker.cpp:1427 > >> int bulletWidth = style().fontMetrics().ascent() / 2; > > > > I wonder if we really want to round up to an integer here before converting to a LayoutSize. Worth talking to Zalan about which kind of rounding/snapping is best here. > > updateContent() is called during layout and we normally snap at painting. > There are a few exceptions, but rule of thumb of snapping is that it should > only happen right before painting. > Please use LayoutUnit instead of int. -to avoid any kind of > rounding/snapping here. As suggested, I changed the bulletWidth in RenderListMarker::updateContent() to be of type LayoutUnit to avoid the integer rounding. Thankyou. Comment on attachment 250662 [details] Patch Clearing flags on attachment: 250662 Committed r182751: <http://trac.webkit.org/changeset/182751> All reviewed patches have been landed. Closing bug. When will Apple include a updated WebKit because iOS 8.4 doesn't seem to show list style image correctly for svg still. (In reply to comment #21) > When will Apple include a updated WebKit because iOS 8.4 doesn't seem to > show list style image correctly for svg still. You may wish to try out the recently released public beta. (In reply to comment #22) > (In reply to comment #21) > > When will Apple include a updated WebKit because iOS 8.4 doesn't seem to > > show list style image correctly for svg still. > > You may wish to try out the recently released public beta. Hi yes it is fixed in ios 9. |