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

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

Issue 23591068: Generate toCSSFooValue() for CSSAspectRatioValue, CSSBorderImageSliceValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/CSSValueList.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return a <= b; 165 return a <= b;
166 case NoPrefix: 166 case NoPrefix:
167 return a == b; 167 return a == b;
168 } 168 }
169 return false; 169 return false;
170 } 170 }
171 171
172 static bool compareAspectRatioValue(CSSValue* value, int width, int height, Medi aFeaturePrefix op) 172 static bool compareAspectRatioValue(CSSValue* value, int width, int height, Medi aFeaturePrefix op)
173 { 173 {
174 if (value->isAspectRatioValue()) { 174 if (value->isAspectRatioValue()) {
175 CSSAspectRatioValue* aspectRatio = static_cast<CSSAspectRatioValue*>(val ue); 175 CSSAspectRatioValue* aspectRatio = toCSSAspectRatioValue(value);
176 return compareValue(width * static_cast<int>(aspectRatio->denominatorVal ue()), height * static_cast<int>(aspectRatio->numeratorValue()), op); 176 return compareValue(width * static_cast<int>(aspectRatio->denominatorVal ue()), height * static_cast<int>(aspectRatio->numeratorValue()), op);
177 } 177 }
178 178
179 return false; 179 return false;
180 } 180 }
181 181
182 static bool numberValue(CSSValue* value, float& result) 182 static bool numberValue(CSSValue* value, float& result)
183 { 183 {
184 if (value->isPrimitiveValue() 184 if (value->isPrimitiveValue()
185 && toCSSPrimitiveValue(value)->isNumber()) { 185 && toCSSPrimitiveValue(value)->isNumber()) {
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 // and let trampoline functions override the prefix if prefix is 684 // and let trampoline functions override the prefix if prefix is
685 // used 685 // used
686 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 686 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
687 if (func) 687 if (func)
688 return func(expr->value(), m_style.get(), m_frame, NoPrefix); 688 return func(expr->value(), m_style.get(), m_frame, NoPrefix);
689 689
690 return false; 690 return false;
691 } 691 }
692 692
693 } // namespace 693 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/CSSValueList.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698