Changeset 91268 in webkit
- Timestamp:
- Jul 19, 2011 10:22:57 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r91267 r91268 1 2011-07-19 Tony Chang <tony@chromium.org> 2 3 use more specific types in CSSFlexValue 4 https://bugs.webkit.org/show_bug.cgi?id=64763 5 6 Reviewed by Ojan Vafai. 7 8 No new tests because no change in functionality. 9 10 * css/CSSFlexValue.h: 11 (WebCore::CSSFlexValue::create): 12 (WebCore::CSSFlexValue::isFlexValue): Make it possible to tell if 13 we're a flex value or not. Will be needed when we're copying 14 values to RenderStyle. 15 (WebCore::CSSFlexValue::positiveFlex): Use floats for positive and 16 negative flex because in the render code, we use floats. 17 (WebCore::CSSFlexValue::negativeFlex): Add accessors for these since 18 we'll need it when reading the flex values. 19 (WebCore::CSSFlexValue::preferredSize): 20 (WebCore::CSSFlexValue::CSSFlexValue): 21 * css/CSSParser.cpp: 22 (WebCore::CSSParser::parseValidPrimitive): Make the type more 23 specific. 24 (WebCore::CSSParser::parseFlex): 25 * css/CSSParser.h: 26 * css/CSSValue.h: 27 (WebCore::CSSValue::isFlexValue): 28 1 29 2011-07-19 Chris Fleizach <cfleizach@apple.com> 2 30 -
trunk/Source/WebCore/css/CSSFlexValue.h
r89396 r91268 39 39 class CSSFlexValue : public CSSValue { 40 40 public: 41 static PassRefPtr<CSSFlexValue> create( double positiveFlex, double negativeFlex, PassRefPtr<CSSValue> preferredSize)41 static PassRefPtr<CSSFlexValue> create(float positiveFlex, float negativeFlex, PassRefPtr<CSSPrimitiveValue> preferredSize) 42 42 { 43 43 return adoptRef(new CSSFlexValue(positiveFlex, negativeFlex, preferredSize)); … … 48 48 virtual String cssText() const; 49 49 50 virtual bool isFlexValue() const { return true; } 51 52 float positiveFlex() { return m_positiveFlex; } 53 float negativeFlex() { return m_negativeFlex; } 54 CSSPrimitiveValue* preferredSize() { return m_preferredSize.get(); } 55 50 56 private: 51 CSSFlexValue( double positiveFlex, double negativeFlex, PassRefPtr<CSSValue> preferredSize)57 CSSFlexValue(float positiveFlex, float negativeFlex, PassRefPtr<CSSPrimitiveValue> preferredSize) 52 58 : m_positiveFlex(positiveFlex) 53 59 , m_negativeFlex(negativeFlex) … … 56 62 } 57 63 58 doublem_positiveFlex;59 doublem_negativeFlex;60 RefPtr<CSS Value> m_preferredSize;64 float m_positiveFlex; 65 float m_negativeFlex; 66 RefPtr<CSSPrimitiveValue> m_preferredSize; 61 67 }; 62 68 -
trunk/Source/WebCore/css/CSSParser.cpp
r90966 r91268 794 794 } 795 795 796 inline PassRefPtr<CSS Value> CSSParser::parseValidPrimitive(int id, CSSParserValue* value)796 inline PassRefPtr<CSSPrimitiveValue> CSSParser::parseValidPrimitive(int id, CSSParserValue* value) 797 797 { 798 798 if (id) … … 5050 5050 double positiveFlex = unsetValue; 5051 5051 double negativeFlex = unsetValue; 5052 RefPtr<CSS Value> preferredSize;5052 RefPtr<CSSPrimitiveValue> preferredSize; 5053 5053 5054 5054 while (CSSParserValue* arg = args->current()) { … … 5081 5081 preferredSize = primitiveValueCache()->createIdentifierValue(CSSValueAuto); 5082 5082 5083 RefPtr<CSSFlexValue> flex = CSSFlexValue::create( positiveFlex, negativeFlex, preferredSize);5083 RefPtr<CSSFlexValue> flex = CSSFlexValue::create(clampToFloat(positiveFlex), clampToFloat(negativeFlex), preferredSize); 5084 5084 addProperty(propId, flex.release(), important); 5085 5085 return true; -
trunk/Source/WebCore/css/CSSParser.h
r90863 r91268 69 69 static bool parseColor(RGBA32& color, const String&, bool strict = false); 70 70 static bool parseSystemColor(RGBA32& color, const String&, Document*); 71 PassRefPtr<CSS Value> parseValidPrimitive(int propId, CSSParserValue*);71 PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int propId, CSSParserValue*); 72 72 bool parseColor(CSSMutableStyleDeclaration*, const String&); 73 73 bool parseDeclaration(CSSMutableStyleDeclaration*, const String&, RefPtr<CSSStyleSourceData>* styleSourceData = 0); -
trunk/Source/WebCore/css/CSSValue.h
r81684 r91268 55 55 virtual bool isBorderImageValue() const { return false; } 56 56 virtual bool isCursorImageValue() const { return false; } 57 #if ENABLE(CSS3_FLEXBOX) 58 virtual bool isFlexValue() const { return false; } 59 #endif 57 60 virtual bool isFontFamilyValue() const { return false; } 58 61 virtual bool isFontValue() const { return false; }
Note: See TracChangeset
for help on using the changeset viewer.