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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 11 months 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
« no previous file with comments | « Source/core/css/CSSToLengthConversionData.cpp ('k') | Source/core/css/resolver/FontBuilder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 343 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
344 344
345 if (primitiveValue->isNumber()) { 345 if (primitiveValue->isNumber()) {
346 result = primitiveValue->getIntValue(); 346 result = primitiveValue->getIntValue();
347 return !strict || !result; 347 return !strict || !result;
348 } 348 }
349 349
350 if (primitiveValue->isLength()) { 350 if (primitiveValue->isLength()) {
351 // Relative (like EM) and root relative (like REM) units are always reso lved against 351 // Relative (like EM) and root relative (like REM) units are always reso lved against
352 // the initial values for media queries, hence the two initialStyle para meters. 352 // the initial values for media queries, hence the two initialStyle para meters.
353 result = primitiveValue->computeLength<int>(CSSToLengthConversionData(in itialStyle, initialStyle, 1.0 /* zoom */, true /* computingFontSize */)); 353 // FIXME: We need to plumb viewport unit support down to here.
354 result = primitiveValue->computeLength<int>(CSSToLengthConversionData(in itialStyle, initialStyle, 0, 1.0 /* zoom */, true /* computingFontSize */));
354 return true; 355 return true;
355 } 356 }
356 357
357 return false; 358 return false;
358 } 359 }
359 360
360 static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr ame* frame, MediaFeaturePrefix op) 361 static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr ame* frame, MediaFeaturePrefix op)
361 { 362 {
362 if (value) { 363 if (value) {
363 int length; 364 int length;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // Call the media feature evaluation function. Assume no prefix and let 687 // Call the media feature evaluation function. Assume no prefix and let
687 // trampoline functions override the prefix if prefix is used. 688 // trampoline functions override the prefix if prefix is used.
688 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 689 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
689 if (func) 690 if (func)
690 return func(expr->value(), m_style.get(), m_frame, NoPrefix); 691 return func(expr->value(), m_style.get(), m_frame, NoPrefix);
691 692
692 return false; 693 return false;
693 } 694 }
694 695
695 } // namespace 696 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/CSSToLengthConversionData.cpp ('k') | Source/core/css/resolver/FontBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698