Closed
Bug 1276707
Opened 9 years ago
Closed 1 year ago
SVG overflows with 1pixel when in max-width centered container
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: tozz, Unassigned)
Details
Attachments
(1 file)
641 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160529004021
Steps to reproduce:
This one is a bit "fun". When having an SVG inside a container that has margin: 0 auto and a max-width the left side will overflow with 1pixel and since the spec calls for overflow: hidden on non-root SVG icons using the full viewBox gets chopped off.
Tested the following in a clean html-file.
<section style="max-width: 400px; overflow: auto; margin: 0 auto;">
<svg style="display: none;">
<g id="icon-test"><path d="M32 0c-17.672 0-32 14.328-32 32s14.328 32 32 32 32-14.328 32-32-14.328-32-32-32zM47.828 42.172l-5.656 5.656-10.172-10.172-10.172 10.172-5.656-5.656 10.172-10.172-10.172-10.172 5.656-5.656 10.172 10.172 10.172-10.172 5.656 5.656-10.172 10.172 10.172 10.172z"></path></g>
</svg>
<div style="padding: 2rem;">
<div style="height: 32px; width: 32px">
<svg style="overflow: hidden;" viewBox="0 0 64 64"><use xlink:href="#icon-test"></use></svg>
</div>
</div>
</section>
Actual results:
Left 1 pixel side of the icon is chopped off.
Expected results:
Left 1 pixel side of the icon should be visible.
Comment 1•9 years ago
|
||
Tested on Mac OS X 10.10 with FF Nightly 49.0a1 and I can reproduce it.
Status: UNCONFIRMED → NEW
Component: Untriaged → SVG
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Updated•3 years ago
|
Severity: normal → S3
Comment 2•1 year ago
|
||
Comment 3•1 year ago
|
||
Seems OK now.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•