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

Side by Side Diff: sky/engine/core/css/MediaQueryEvaluator.cpp

Issue 689853003: Remove CSS Grid Layout and grid media queries. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * CSS Media Query Evaluator 2 * CSS Media Query Evaluator
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. 6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 UseCounter::count(mediaValues.document(), UseCounter::PrefixedDevicePixelRat ioMediaFeature); 308 UseCounter::count(mediaValues.document(), UseCounter::PrefixedDevicePixelRat ioMediaFeature);
309 309
310 return (!value.isValid() || value.unit == CSSPrimitiveValue::CSS_NUMBER) && evalResolution(value, op, mediaValues); 310 return (!value.isValid() || value.unit == CSSPrimitiveValue::CSS_NUMBER) && evalResolution(value, op, mediaValues);
311 } 311 }
312 312
313 static bool resolutionMediaFeatureEval(const MediaQueryExpValue& value, MediaFea turePrefix op, const MediaValues& MediaValues) 313 static bool resolutionMediaFeatureEval(const MediaQueryExpValue& value, MediaFea turePrefix op, const MediaValues& MediaValues)
314 { 314 {
315 return (!value.isValid() || CSSPrimitiveValue::isResolution(value.unit)) && evalResolution(value, op, MediaValues); 315 return (!value.isValid() || CSSPrimitiveValue::isResolution(value.unit)) && evalResolution(value, op, MediaValues);
316 } 316 }
317 317
318 static bool gridMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePr efix op, const MediaValues&)
319 {
320 // if output device is bitmap, grid: 0 == true
321 // assume we have bitmap device
322 float number;
323 if (value.isValid() && numberValue(value, number))
324 return compareValue(static_cast<int>(number), 0, op);
325 return false;
326 }
327
328 static bool computeLength(const MediaQueryExpValue& value, const MediaValues& me diaValues, int& result) 318 static bool computeLength(const MediaQueryExpValue& value, const MediaValues& me diaValues, int& result)
329 { 319 {
330 if (!value.isValue) 320 if (!value.isValue)
331 return false; 321 return false;
332 322
333 if (value.unit == CSSPrimitiveValue::CSS_NUMBER) { 323 if (value.unit == CSSPrimitiveValue::CSS_NUMBER) {
334 result = clampTo<int>(value.value); 324 result = clampTo<int>(value.value);
335 return !mediaValues.strictMode() || !result; 325 return !mediaValues.strictMode() || !result;
336 } 326 }
337 327
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 // Call the media feature evaluation function. Assume no prefix and let 642 // Call the media feature evaluation function. Assume no prefix and let
653 // trampoline functions override the prefix if prefix is used. 643 // trampoline functions override the prefix if prefix is used.
654 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 644 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
655 if (func) 645 if (func)
656 return func(expr->expValue(), NoPrefix, *m_mediaValues); 646 return func(expr->expValue(), NoPrefix, *m_mediaValues);
657 647
658 return false; 648 return false;
659 } 649 }
660 650
661 } // namespace 651 } // namespace
OLDNEW
« no previous file with comments | « sky/engine/core/css/MediaFeatureNames.in ('k') | sky/engine/core/css/MediaQueryEvaluatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698