Bug 158234 - SVG content renders in incorrect vertical position when padding-left is not specified
Summary: SVG content renders in incorrect vertical position when padding-left is not s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Mac OS X 10.11
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-31 13:55 PDT by Marco
Modified: 2016-06-02 11:38 PDT (History)
3 users (show)

See Also:


Attachments
Test case reduction (281 bytes, text/html)
2016-05-31 13:55 PDT, Marco
no flags Details
Patch (4.52 KB, patch)
2016-05-31 15:52 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (4.49 KB, patch)
2016-06-01 15:08 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marco 2016-05-31 13:55:37 PDT
Created attachment 280177 [details]
Test case reduction

Found a rendering bug in WebKit related to SVG and padding.

If you have an <svg> element inside a <div>, and you specify a non-zero padding-top value for the SVG element, but keep the padding-left property as 0, the element content gets rendered as if padding-top was 0. Specifying a padding-left of 1px makes the rendering normal. The same bug doesn't seem to happen with padding-right. The problem seems to be only related to the rendering of the SVG content, since layout seems to be normal on the Web Inspector. All other major browsers seem to agree on the rendering. (Screenshots below)

Attached is a test case reduction for the bug.

Rendering in Safari Technology Preview: https://cldup.com/hti9HBL7Df.png
Rendering in Firefox: https://cldup.com/N6V1hKJvdL.png
Rendering in Chrome: https://cldup.com/B8RxpaeDN2.png
Rendering in Edge: https://cldup.com/Y30FAbpYaU.png

Layout as per the Safari Technology Preview Web Inspector: https://cldup.com/V4ZCGl0zrC.png
Comment 1 Said Abou-Hallawa 2016-05-31 15:52:12 PDT
Created attachment 280194 [details]
Patch
Comment 2 Said Abou-Hallawa 2016-05-31 17:00:29 PDT
This is related to http://trac.webkit.org/changeset/105247
Comment 3 Said Abou-Hallawa 2016-06-01 15:08:21 PDT
Created attachment 280270 [details]
Patch
Comment 4 WebKit Commit Bot 2016-06-02 11:38:42 PDT
Comment on attachment 280270 [details]
Patch

Clearing flags on attachment: 280270

Committed r201604: <http://trac.webkit.org/changeset/201604>
Comment 5 WebKit Commit Bot 2016-06-02 11:38:47 PDT
All reviewed patches have been landed.  Closing bug.