[webkit-reviews] review granted: [Bug 25197] implement orientation and aspect-ratio media queries : [Attachment 29524] patch now does live updating

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 12 11:16:13 PDT 2009


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Dean Jackson
<dino at apple.com>'s request for review:
Bug 25197: implement orientation and aspect-ratio media queries
https://bugs.webkit.org/show_bug.cgi?id=25197

Attachment 29524: patch now does live updating
https://bugs.webkit.org/attachment.cgi?id=29524&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
> +static bool orientationMediaFeatureEval(CSSValue* value, RenderStyle*,
Frame* frame, MediaFeaturePrefix)
> +{
> +    if (value) {

An early return if !(value) would make the code simpler.

> +	   FrameView* view = frame->view();
> +	   int width = view->layoutWidth();
> +	   int height = view->layoutHeight();
> +	   if (width > height) // Square viewport is portrait
> +	       return "landscape" ==
static_cast<CSSPrimitiveValue*>(value)->getStringValue();
> +	   else
> +	       return "portrait" ==
static_cast<CSSPrimitiveValue*>(value)->getStringValue();

Don't use 'else' after 'return'.

> +static bool aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle*,
Frame* frame, MediaFeaturePrefix op)
> +{
> +    if (value) {

Prefer early return.

r=me


More information about the webkit-reviews mailing list