[webkit-reviews] review granted: [Bug 219287] [css-values-4] Support small (sv*), large (lv*) and dynamic (dv*) viewport units : [Attachment 440557] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 12 16:25:52 PDT 2021


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Devin Rousso
<drousso at apple.com>'s request for review:
Bug 219287: [css-values-4] Support small (sv*), large (lv*) and dynamic (dv*)
viewport units
https://bugs.webkit.org/show_bug.cgi?id=219287

Attachment 440557: Patch

https://bugs.webkit.org/attachment.cgi?id=440557&action=review




--- Comment #8 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 440557
  --> https://bugs.webkit.org/attachment.cgi?id=440557
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440557&action=review

> Source/WebCore/css/CSSPrimitiveValue.cpp:706
> +	       return std::max(size.width(), size.height()) / 100.0 * value;

If we added FloatSize::maxDimension() const { return std::max(width(), height()
} we could do this in one line.

> Source/WebCore/css/CSSPrimitiveValue.cpp:712
> +	       return std::min(size.width(), size.height()) / 100.0 * value;

Likewise.

> Source/WebCore/css/CSSPrimitiveValue.cpp:800
> +	   return value * std::fmax(defaultViewportFactor.width(),
defaultViewportFactor.height());

not sure why you need fmax. Maybe max<float> if needed.

> Source/WebCore/page/FrameView.h:240
> +    WEBCORE_EXPORT void setSizeForCSSDefaultViewportUnits(IntSize);
> +    void clearSizeOverrideForCSSDefaultViewportUnits();
> +    IntSize sizeForCSSDefaultViewportUnits() const;
> +
> +    WEBCORE_EXPORT void setSizeForCSSSmallViewportUnits(IntSize);
> +    void clearSizeOverrideForCSSSmallViewportUnits();
> +    IntSize sizeForCSSSmallViewportUnits() const;
> +
> +    IntSize sizeForCSSLargeViewportUnits() const;
> +    IntSize sizeForCSSDynamicViewportUnits() const;

It's wrong for these to be integral. Views can be fractional pixels wide.


More information about the webkit-reviews mailing list