RESOLVED FIXED 103068
Viewport CSS rules should not clamp values like Viewport META
https://bugs.webkit.org/show_bug.cgi?id=103068
Summary Viewport CSS rules should not clamp values like Viewport META
Thiago Marcos P. Santos
Reported 2012-11-22 07:09:28 PST
Currently we are clamping values like width and height following the rules for META tags (1px - 10000px) which are not valid for @viewport. http://dev.w3.org/csswg/css-device-adapt/#translation-into-atviewport-descriptors
Attachments
Patch (20.67 KB, patch)
2012-11-23 04:58 PST, Thiago Marcos P. Santos
no flags
Patch (20.73 KB, patch)
2012-11-26 07:46 PST, Thiago Marcos P. Santos
no flags
Thiago Marcos P. Santos
Comment 1 2012-11-23 04:58:38 PST
Kenneth Rohde Christiansen
Comment 2 2012-11-23 05:04:37 PST
Comment on attachment 175784 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175784&action=review > Source/WebCore/dom/ViewportArguments.cpp:186 > + } else { > + // Clamp values to a valid range, but not for @viewport since is > + // not mandated by the specification. > + resultWidth = clampLengthValue(resultWidth); > + resultHeight = clampLengthValue(resultHeight); > + resultZoom = clampScaleValue(resultZoom); > + resultMinZoom = clampScaleValue(resultMinZoom); > + resultMaxZoom = clampScaleValue(resultMaxZoom); > } I think an if would be nicer, we probably dont want to clam implicit viewport either if (type != ViewportArguments::CSSDeviceAdaptation && type != ViewportArguments::Implicit) or maybe the other way around. Make it explicit what we are clamping. > Source/WebCore/dom/ViewportArguments.cpp:240 > + } else { > + // Extend width and height to fill the visual viewport for the resolved initial-scale. > + resultWidth = max<float>(resultWidth, initialViewportSize.width() / result.initialScale); > + resultHeight = max<float>(resultHeight, initialViewportSize.height() / result.initialScale); > + } I think this should probably only happen for viewport meta, not the old legacy meta tags which dont support scale anyway
Thiago Marcos P. Santos
Comment 3 2012-11-26 07:46:44 PST
WebKit Review Bot
Comment 4 2012-11-26 08:23:18 PST
Comment on attachment 176001 [details] Patch Clearing flags on attachment: 176001 Committed r135728: <http://trac.webkit.org/changeset/135728>
WebKit Review Bot
Comment 5 2012-11-26 08:23:22 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.