Closed
Bug 407495
Opened 17 years ago
Closed 12 years ago
Make SVG documents with percentage width/height respond to page zoom
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: netrolller.3d, Assigned: jwatt)
References
(Blocks 1 open bug, )
Details
(Keywords: testcase)
Attachments
(1 file)
15.71 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
Page zoom scales images, text and other elements, except those that have percentage sizes. This can break many percentage-based page layouts, so it should be fixed. The URL is an SVG showing a bug, here is another (a HTML): data:text/html,<body style="margin:0"><div style="background: black; width: 50%; height: 50%"> Pagezoom in on any of these examples, and notice that they don't scale.
Flags: blocking1.9?
Comment 1•17 years ago
|
||
The percentage value is calculated against the viewport. The viewport size stays the same, no matter what zoom value. So this seems invalid to me.
Keywords: testcase
Comment 2•17 years ago
|
||
Martjin is right. 50% of the viewport width means exactly what it says.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Assignee | ||
Comment 4•17 years ago
|
||
I don't think I agree about this bug being invalid. I'd think of this as "take the element size to be X% of the viewport, _then_ zoom/scale it in/up by Y. At any rate, I think it would be useful to get the thoughts of a few other people first. Whatever we choose, HTML and SVG should be consistent.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Comment 6•17 years ago
|
||
If we were doing pixel-for-pixel scaling, comment 4 would be correct. But we're not. Zoom is just redefining the CSS-to-device pixel ratio. So the viewport size in CSS pixels actually becomes _smaller_ when you zoom, for example. So comment 1 is right on the money, I think. And HTML and SVG _are_ consistent, no?
Comment 7•17 years ago
|
||
HTML and SVG _are_ consistent.
Assignee | ||
Comment 8•17 years ago
|
||
Yes, HTML and SVG are currently consistent. I just meant that if we changed anything we should keep them consistent - sorry. I think from the average user's perspective it's going to be frustrating to have the Zoom In and Zoom Out menu items work on some content but have no effect on other content. Since percentage width/height are the common/default case in SVG, it'll be especially frustrating here. I'm not sure that the limitations of the way zoom is currently implemented should come before how it should ideally behave.
Comment 9•17 years ago
|
||
It's not a matter of limitation but a matter of what the goal is. Please see roc's blog about the various "ideal" behaviors for zoom. There are tradeoffs here, not just an obvious "ideal" behavior.
Reporter | ||
Comment 10•17 years ago
|
||
The problem here is that percentages shouldn't be calculated against the zoomed viewport, instead the original viewport should be the base of the calculation. Also, consider a rectangle which has a pixel height but a percentage width. When zooming, the shape of the rectangle changes, even though Zoom is supposed to change sizes, not shapes. (Maybe making percentage zoom on the document root max out at 100% is a good idea to prevent horizontal scrolling, however.)
I've seen pages/demos where this would be useful. However, changing this way would mean that when you zoom into a site using percentage widths, you would invariable need to scroll horizontally to see all the content, and that's a worse user experience on most real sites.
One thing we could do, I suppose, is to have different treatment for the case where the document root is percent-sized SVG whose content is going to be scaled to the viewport size. In that case we could apply the percentage sizing to the unscaled viewport, because we know that otherwise zooming is going to have no effect, which will surprise the user.
Assignee | ||
Comment 13•17 years ago
|
||
I now think we should, despite comment 4.
Comment 14•17 years ago
|
||
On the other hand, if you met a page that is way too wide for your screen (this is real problems, with some "webdesigner" wannabe that designs with stupidity in mind) you can have an option to resize the page to your viewport, while possibly enlarging the text to fit the eye.
Pages that are too wide for your screen are rarely too wide because of percentage widths, that would probably mean they were too wide for *any* screen. Jonathan, do you want to whip up a patch for this?
Comment 16•16 years ago
|
||
Shouldn't it be a more general component than SVG?
Assignee | ||
Updated•15 years ago
|
Flags: wanted1.9.2+
Comment 18•15 years ago
|
||
I agree with #12.
Assignee | ||
Updated•12 years ago
|
Assignee | ||
Comment 21•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Summary: Percentage sizes don't react to page zoom → Make SVG documents with percentage width/height respond to page zoom
Attachment #620607 -
Flags: review?(roc) → review+
Assignee | ||
Comment 22•12 years ago
|
||
Pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/046fd4ab5b19
Target Milestone: --- → mozilla15
Comment 23•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/046fd4ab5b19
Status: ASSIGNED → RESOLVED
Closed: 17 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•