Bug 217564

Summary: Dominant-baseline doesn't work properly when viewBox attribute is present
Product: WebKit Reporter: Guvenc Usanmaz <gusanmaz>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ahmad.saleem792, gusanmaz, mmaxfield, sabouhallawa, smoley, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: All   
OS: All   
Attachments:
Description Flags
Page without using viewBox (normal.html) and with viewBox (buggy.html)
none
Screenshot
none
Renderings of two different html pages (buggy.html and normal.html) on Safari
none
Test Case (out of ZIP) none

Description Guvenc Usanmaz 2020-10-10 16:11:02 PDT
Created attachment 411022 [details]
Page without using viewBox (normal.html) and with viewBox (buggy.html)

When viewBox attribute is used for an SVG element and text elements are present as child of the SVG element, dominant-baseline attribute doesn't behave correctly.

Check two links below. First page contains an SVG element and doesn't use viewbox attribute. In contrast second page has an SVG element with viewbox attribute. Both pages should render similar pages. This is the case for Chrome and Firefox on Android and Linux platforms but not the case for Safari on MacOs or IOS. As can be seen from pages dominant-baseline="central" rule couldn't achieve to center text on blue square. Changing attribute value of dominant-baseline also seems to have no apparent effect on second page (buggy.html).

https://repl.it/@GuvencUsanmaz/WebkitSVGDBaseline1#normal.html
https://repl.it/@GuvencUsanmaz/WebkitSVGDBaseline1#buggy.html

In case links for these two pages go stale contents of these two pages are attached.
Comment 1 Radar WebKit Bug Importer 2020-10-12 17:46:34 PDT
<rdar://problem/70232126>
Comment 2 Smoley 2020-10-19 13:04:51 PDT
Created attachment 411781 [details]
Screenshot
Comment 3 Smoley 2020-10-19 13:05:51 PDT
Thanks for filing. I may be missing a step, but I can't seem to get the test pages to show any content in Safari 14.0 or Chrome. See screenshot.
Comment 4 Guvenc Usanmaz 2020-10-19 13:33:52 PDT
I am sorry for the mistake. I think I gave wrong URLs.

Could you check two URLs below.

https://webkitsvgdbaseline1.guvencusanmaz.repl.co/normal.html
https://webkitsvgdbaseline1.guvencusanmaz.repl.co/buggy.html

I have also added an attechments in my first post where these two html documents could be viewed offline.

I am also attaching a screenshot where buggy page appears on left and normal page appears on right.
Comment 5 Guvenc Usanmaz 2020-10-19 13:37:38 PDT
Created attachment 411790 [details]
Renderings of two different html pages (buggy.html and normal.html) on Safari
Comment 6 Smoley 2020-10-19 13:41:47 PDT
Got it, thanks. I am able to reproduce this with the updated link.
Comment 7 Ahmad Saleem 2023-01-22 03:15:53 PST
I am able still to reproduce this bug in WebKit Trunk (259178@main), which do contain some fixes etc. but it still differs from Chrome Canary 111 and Firefox Nightly 111, which show like normal version.

Test - https://webkitsvgdbaseline1.guvencusanmaz.repl.co/buggy.html
Comment 8 Ahmad Saleem 2023-07-07 14:01:40 PDT
Created attachment 466983 [details]
Test Case (out of ZIP)
Comment 9 Ahmad Saleem 2023-07-07 14:03:53 PDT
(In reply to Ahmad Saleem from comment #8)
> Created attachment 466983 [details]
> Test Case (out of ZIP)

From the Comment 0, I took out this buggy test case and now it works due to dominant-baseline being inherited in WebKit ToT (265838@main).

Marking this as duplicate for bug 139258.

*** This bug has been marked as a duplicate of bug 139258 ***