Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Issue 1904523002: Fix double comparisons for Media Queries (Closed)

Created:
4 years, 8 months ago by Yoav Weiss
Modified:
4 years, 8 months ago
Reviewers:
rune
CC:
chromium-reviews, kenneth.christiansen, blink-reviews-css, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix double comparisons for Media Queries Media queries that require double-based length comparisons weren't handled correctly. As a result, some media queries weren't matching when they should have. This CL fixes this issue by: * Performing the length calculation in a more double-friendly way, by multiplying before dividing rather than the other way around. * Apply a certain precision to length calculations, so that we could compare double equality. BUG=604289 Committed: https://crrev.com/ee8bfd6290293a1b5dbf0813b6b3987f0e1ca545 Cr-Commit-Position: refs/heads/master@{#388464}

Patch Set 1 #

Total comments: 4

Patch Set 2 : s/abs/std::abs/ #

Patch Set 3 : Review comments #

Total comments: 2

Patch Set 4 : unreachable build error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -49 lines) Patch
M third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp View 1 2 2 chunks +15 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp View 3 chunks +24 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/MediaValues.cpp View 1 2 3 1 chunk +25 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/core/css/MediaValuesTest.cpp View 3 chunks +14 lines, -13 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
Yoav Weiss
Hey Rune :) I followed your advice in the related issue, and added precision based ...
4 years, 8 months ago (2016-04-19 20:00:56 UTC) #2
Yoav Weiss
On 2016/04/19 20:00:56, Yoav Weiss wrote: > Hey Rune :) > > I followed your ...
4 years, 8 months ago (2016-04-19 20:01:29 UTC) #3
rune
https://codereview.chromium.org/1904523002/diff/1/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp File third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp (right): https://codereview.chromium.org/1904523002/diff/1/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp#newcode178 third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp:178: const double precision = 0.000001; We use std::numeric_limits<T>::epsilon() other ...
4 years, 8 months ago (2016-04-20 07:04:46 UTC) #6
Yoav Weiss
https://codereview.chromium.org/1904523002/diff/1/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp File third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp (right): https://codereview.chromium.org/1904523002/diff/1/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp#newcode178 third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp:178: const double precision = 0.000001; On 2016/04/20 07:04:46, rune ...
4 years, 8 months ago (2016-04-20 07:26:57 UTC) #7
rune
https://codereview.chromium.org/1904523002/diff/40001/third_party/WebKit/Source/core/css/MediaValues.cpp File third_party/WebKit/Source/core/css/MediaValues.cpp (left): https://codereview.chromium.org/1904523002/diff/40001/third_party/WebKit/Source/core/css/MediaValues.cpp#oldcode216 third_party/WebKit/Source/core/css/MediaValues.cpp:216: return true; If you just remove NOTREACHED() and the ...
4 years, 8 months ago (2016-04-20 07:39:25 UTC) #8
Yoav Weiss
https://codereview.chromium.org/1904523002/diff/40001/third_party/WebKit/Source/core/css/MediaValues.cpp File third_party/WebKit/Source/core/css/MediaValues.cpp (left): https://codereview.chromium.org/1904523002/diff/40001/third_party/WebKit/Source/core/css/MediaValues.cpp#oldcode216 third_party/WebKit/Source/core/css/MediaValues.cpp:216: return true; On 2016/04/20 07:39:25, rune wrote: > If ...
4 years, 8 months ago (2016-04-20 09:50:23 UTC) #9
rune
lgtm
4 years, 8 months ago (2016-04-20 10:55:06 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904523002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904523002/60001
4 years, 8 months ago (2016-04-20 10:56:48 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 8 months ago (2016-04-20 11:18:41 UTC) #14
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:22:23 UTC) #16
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/ee8bfd6290293a1b5dbf0813b6b3987f0e1ca545
Cr-Commit-Position: refs/heads/master@{#388464}

Powered by Google App Engine
This is Rietveld 408576698