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

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

Issue 240063003: Revert "A sizes attribute parser" (https://codereview.chromium.org/224733011) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/MediaQueryEvaluator.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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 return static_cast<float>(computeLengthDouble(conversionData)); 588 return static_cast<float>(computeLengthDouble(conversionData));
589 } 589 }
590 590
591 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa ta& conversionData) 591 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa ta& conversionData)
592 { 592 {
593 return computeLengthDouble(conversionData); 593 return computeLengthDouble(conversionData);
594 } 594 }
595 595
596 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c onversionData) 596 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c onversionData)
597 { 597 {
598 // The logic in this function is duplicated in MediaValues::computeLength
599 // because MediaValues::computeLength needs nearly identical logic, but we h aven't found a way to make
600 // CSSPrimitiveValue::computeLengthDouble more generic (to solve both cases) without hurting performance.
601 if (m_primitiveUnitType == CSS_CALC) 598 if (m_primitiveUnitType == CSS_CALC)
602 return m_value.calc->computeLengthPx(conversionData); 599 return m_value.calc->computeLengthPx(conversionData);
603 600
604 const RenderStyle& style = conversionData.style(); 601 const RenderStyle& style = conversionData.style();
605 const RenderStyle* rootStyle = conversionData.rootStyle(); 602 const RenderStyle* rootStyle = conversionData.rootStyle();
606 bool computingFontSize = conversionData.computingFontSize(); 603 bool computingFontSize = conversionData.computingFontSize();
607 604
608 double factor; 605 double factor;
609 606
610 switch (primitiveType()) { 607 switch (primitiveType()) {
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 case CSS_SHAPE: 1405 case CSS_SHAPE:
1409 visitor->trace(m_value.shape); 1406 visitor->trace(m_value.shape);
1410 break; 1407 break;
1411 default: 1408 default:
1412 break; 1409 break;
1413 } 1410 }
1414 CSSValue::traceAfterDispatch(visitor); 1411 CSSValue::traceAfterDispatch(visitor);
1415 } 1412 }
1416 1413
1417 } // namespace WebCore 1414 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/MediaQueryEvaluator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698