New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714079 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Media query aspect-ratios should be clamped

Reported by r...@opera.com, Apr 21 2017

Issue description

Media feature values are parsed as double values but stored as unsigned integers internally. We are currently casting double to unsigned. Instead we should clamp.

 
aspect.html
257 bytes View Download

Comment 1 by shend@chromium.org, Apr 23 2017

Labels: Update-Quarterly
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cf115265d17e7eec4e8c6c2d4441942988dc84db

commit cf115265d17e7eec4e8c6c2d4441942988dc84db
Author: rune <rune@opera.com>
Date: Thu Apr 27 07:13:49 2017

Better overflow handling for aspect-ratio MQ.

This change fixes two issues:

1. Clamp instead of casting double values from parser to internal
   unsigned storage.
2. Promote width/height/numerator/denominator multiplications to double
   to avoid integer overflow for large numerator/denominators.

R=yoav@yoav.ws,suzyh@chromium.org
BUG= 676709 , 714079 

Review-Url: https://codereview.chromium.org/2836613002
Cr-Commit-Position: refs/heads/master@{#467615}

[add] https://crrev.com/cf115265d17e7eec4e8c6c2d4441942988dc84db/third_party/WebKit/LayoutTests/fast/media/mq-aspect-ratio-overflow.html
[modify] https://crrev.com/cf115265d17e7eec4e8c6c2d4441942988dc84db/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
[modify] https://crrev.com/cf115265d17e7eec4e8c6c2d4441942988dc84db/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
[modify] https://crrev.com/cf115265d17e7eec4e8c6c2d4441942988dc84db/third_party/WebKit/Source/core/css/MediaQueryExp.cpp

Comment 3 by r...@opera.com, Apr 27 2017

Status: Fixed (was: Started)

Sign in to add a comment