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

Side by Side Diff: Source/core/css/MediaQueryEvaluator.cpp

Issue 64293008: Wrap CSS length conversion arguments in an object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: erm.. use DEFINE_STATIC_REF Created 7 years 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 16 matching lines...) Expand all
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "core/css/MediaQueryEvaluator.h" 31 #include "core/css/MediaQueryEvaluator.h"
32 32
33 #include "CSSValueKeywords.h" 33 #include "CSSValueKeywords.h"
34 #include "core/css/CSSAspectRatioValue.h" 34 #include "core/css/CSSAspectRatioValue.h"
35 #include "core/css/CSSHelper.h" 35 #include "core/css/CSSHelper.h"
36 #include "core/css/CSSPrimitiveValue.h" 36 #include "core/css/CSSPrimitiveValue.h"
37 #include "core/css/CSSToLengthConversionData.h"
37 #include "core/css/MediaFeatureNames.h" 38 #include "core/css/MediaFeatureNames.h"
38 #include "core/css/MediaList.h" 39 #include "core/css/MediaList.h"
39 #include "core/css/MediaQuery.h" 40 #include "core/css/MediaQuery.h"
40 #include "core/css/resolver/MediaQueryResult.h" 41 #include "core/css/resolver/MediaQueryResult.h"
41 #include "core/dom/NodeRenderStyle.h" 42 #include "core/dom/NodeRenderStyle.h"
42 #include "core/inspector/InspectorInstrumentation.h" 43 #include "core/inspector/InspectorInstrumentation.h"
43 #include "core/frame/Frame.h" 44 #include "core/frame/Frame.h"
44 #include "core/frame/FrameView.h" 45 #include "core/frame/FrameView.h"
45 #include "core/page/Page.h" 46 #include "core/page/Page.h"
46 #include "core/page/Settings.h" 47 #include "core/page/Settings.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 341 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
341 342
342 if (primitiveValue->isNumber()) { 343 if (primitiveValue->isNumber()) {
343 result = primitiveValue->getIntValue(); 344 result = primitiveValue->getIntValue();
344 return !strict || !result; 345 return !strict || !result;
345 } 346 }
346 347
347 if (primitiveValue->isLength()) { 348 if (primitiveValue->isLength()) {
348 // Relative (like EM) and root relative (like REM) units are always reso lved against the initial values 349 // Relative (like EM) and root relative (like REM) units are always reso lved against the initial values
349 // for media queries, hence the two initialStyle parameters. 350 // for media queries, hence the two initialStyle parameters.
350 result = primitiveValue->computeLength<int>(initialStyle, initialStyle, 1.0 /* multiplier */, true /* computingFontSize */); 351 result = primitiveValue->computeLength<int>(CSSToLengthConversionData(in itialStyle, initialStyle, 1.0, true /* computingFontSize */));
Julien - ping for review 2013/11/26 05:31:07 /* zoom */ ?
Timothy Loh 2013/11/27 05:44:51 Err okay sure. Not sure why I dropped the comment.
351 return true; 352 return true;
352 } 353 }
353 354
354 return false; 355 return false;
355 } 356 }
356 357
357 static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr ame* frame, MediaFeaturePrefix op) 358 static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr ame* frame, MediaFeaturePrefix op)
358 { 359 {
359 if (value) { 360 if (value) {
360 int length; 361 int length;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 // and let trampoline functions override the prefix if prefix is 686 // and let trampoline functions override the prefix if prefix is
686 // used 687 // used
687 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 688 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
688 if (func) 689 if (func)
689 return func(expr->value(), m_style.get(), m_frame, NoPrefix); 690 return func(expr->value(), m_style.get(), m_frame, NoPrefix);
690 691
691 return false; 692 return false;
692 } 693 }
693 694
694 } // namespace 695 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698