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

Side by Side Diff: Source/core/css/CSSPrimitiveValue.h

Issue 345903005: calc expressions should support time, angle and frequency values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 template <typename T, TimeUnit timeUnit> T computeTime() 278 template <typename T, TimeUnit timeUnit> T computeTime()
279 { 279 {
280 if (timeUnit == Seconds && m_primitiveUnitType == CSS_S) 280 if (timeUnit == Seconds && m_primitiveUnitType == CSS_S)
281 return getValue<T>(); 281 return getValue<T>();
282 if (timeUnit == Seconds && m_primitiveUnitType == CSS_MS) 282 if (timeUnit == Seconds && m_primitiveUnitType == CSS_MS)
283 return getValue<T>() / 1000; 283 return getValue<T>() / 1000;
284 if (timeUnit == Milliseconds && m_primitiveUnitType == CSS_MS) 284 if (timeUnit == Milliseconds && m_primitiveUnitType == CSS_MS)
285 return getValue<T>(); 285 return getValue<T>();
286 if (timeUnit == Milliseconds && m_primitiveUnitType == CSS_S) 286 if (timeUnit == Milliseconds && m_primitiveUnitType == CSS_S)
287 return getValue<T>() * 1000; 287 return getValue<T>() * 1000;
288 if (m_primitiveUnitType == CSS_CALC)
289 return getValue<T>();
alancutter (OOO until 2018) 2014/07/02 05:56:11 This should be returning a value relative to timeU
Timothy Loh 2014/07/02 07:06:13 Alternatively we can just simplify this function t
288 ASSERT_NOT_REACHED(); 290 ASSERT_NOT_REACHED();
289 return 0; 291 return 0;
290 } 292 }
291 293
292 /* 294 /*
293 * Computes a length in pixels out of the given CSSValue 295 * Computes a length in pixels out of the given CSSValue
294 * 296 *
295 * The metrics have to be a bit different for screen and printer output. 297 * The metrics have to be a bit different for screen and printer output.
296 * For screen output we assume 1 inch == 72 px, for printer we assume 300 dp i 298 * For screen output we assume 1 inch == 72 px, for printer we assume 300 dp i
297 * 299 *
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } m_value; 427 } m_value;
426 }; 428 };
427 429
428 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray; 430 typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray;
429 431
430 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue()); 432 DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
431 433
432 } // namespace WebCore 434 } // namespace WebCore
433 435
434 #endif // CSSPrimitiveValue_h 436 #endif // CSSPrimitiveValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698