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

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

Issue 224733011: A sizes attribute parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added invalid length layout test 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
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 fo r performance reasons.
eseidel 2014/04/14 22:55:32 Is MediaValues performance sensitive?
599 // Changes in logic here should be duplicated there as well.
598 if (m_primitiveUnitType == CSS_CALC) 600 if (m_primitiveUnitType == CSS_CALC)
599 return m_value.calc->computeLengthPx(conversionData); 601 return m_value.calc->computeLengthPx(conversionData);
600 602
601 const RenderStyle& style = conversionData.style(); 603 const RenderStyle& style = conversionData.style();
602 const RenderStyle* rootStyle = conversionData.rootStyle(); 604 const RenderStyle* rootStyle = conversionData.rootStyle();
603 bool computingFontSize = conversionData.computingFontSize(); 605 bool computingFontSize = conversionData.computingFontSize();
604 606
605 double factor; 607 double factor;
606 608
607 switch (primitiveType()) { 609 switch (primitiveType()) {
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 case CSS_SHAPE: 1407 case CSS_SHAPE:
1406 visitor->trace(m_value.shape); 1408 visitor->trace(m_value.shape);
1407 break; 1409 break;
1408 default: 1410 default:
1409 break; 1411 break;
1410 } 1412 }
1411 CSSValue::traceAfterDispatch(visitor); 1413 CSSValue::traceAfterDispatch(visitor);
1412 } 1414 }
1413 1415
1414 } // namespace WebCore 1416 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698