Changeset 67574 in webkit
- Timestamp:
- Sep 15, 2010 3:57:04 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r67571 r67574 1 2010-09-15 Julien Chaffraix <jchaffraix@codeaurora.org> 2 3 Unreviewed. 4 5 Reverting my changes as it is breaking several tests on Gtk and Qt. 6 7 * platform/mac/Skipped: 8 * platform/qt/Skipped: 9 1 10 2010-09-15 Erik Arvidsson <arv@chromium.org> 2 11 -
trunk/LayoutTests/platform/mac/Skipped
r67570 r67574 189 189 canvas/philip/tests/2d.fillStyle.parse.current.changed.html 190 190 canvas/philip/tests/2d.fillStyle.parse.current.removed.html 191 canvas/philip/tests/2d.fillStyle.parse.system.html 191 192 canvas/philip/tests/2d.gradient.radial.cone.front.html 192 193 canvas/philip/tests/2d.gradient.radial.cone.top.html -
trunk/LayoutTests/platform/qt/Skipped
r67570 r67574 5224 5224 canvas/philip/tests/2d.fillStyle.parse.current.changed.html 5225 5225 canvas/philip/tests/2d.fillStyle.parse.current.removed.html 5226 canvas/philip/tests/2d.fillStyle.parse.system.html 5226 5227 canvas/philip/tests/2d.gradient.radial.cone.behind.html 5227 5228 canvas/philip/tests/2d.gradient.radial.cone.beside.html -
trunk/WebCore/ChangeLog
r67570 r67574 1 2010-09-15 Julien Chaffraix <jchaffraix@codeaurora.org> 2 3 Unreviewed. 4 5 Reverting my changes as it is breaking several tests on Gtk and Qt. 6 7 * css/CSSParser.cpp: 8 (WebCore::CSSParser::parseColor): 9 * css/CSSParser.h: 10 * html/canvas/CanvasRenderingContext2D.cpp: 11 (WebCore::CanvasRenderingContext2D::setStrokeColor): 12 (WebCore::CanvasRenderingContext2D::setFillColor): 13 * html/canvas/CanvasStyle.cpp: 14 (WebCore::CanvasStyle::createFromString): 15 * html/canvas/CanvasStyle.h: 16 1 17 2010-09-15 Julien Chaffraix <jchaffraix@codeaurora.org> 2 18 -
trunk/WebCore/css/CSSParser.cpp
r67570 r67574 64 64 #include "MediaList.h" 65 65 #include "MediaQueryExp.h" 66 #include "Page.h"67 66 #include "Pair.h" 68 67 #include "Rect.h" 69 #include "RenderTheme.h"70 68 #include "ShadowValue.h" 71 69 #include "WebKitCSSKeyframeRule.h" … … 296 294 297 295 CSSValue* value = parser.m_parsedProperties[0]->value(); 298 if (value->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) 299 return false; 300 301 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 302 if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_RGBCOLOR) { 296 if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE) { 297 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 303 298 color = primitiveValue->getRGBA32Value(); 304 return true;305 } 306 return false;299 } 300 301 return true; 307 302 } 308 303 … … 317 312 318 313 return (m_numParsedProperties && m_parsedProperties[0]->m_id == CSSPropertyColor); 319 }320 321 bool CSSParser::parseSystemColor(RGBA32& color, const String& string, Document* document)322 {323 if (!document || !document->page())324 return false;325 326 CSSParserString cssColor;327 cssColor.characters = const_cast<UChar*>(string.characters());328 cssColor.length = string.length();329 int id = cssValueKeywordID(cssColor);330 if (id <= 0)331 return false;332 333 color = document->page()->theme()->systemColor(id).rgb();334 return true;335 314 } 336 315 -
trunk/WebCore/css/CSSParser.h
r67570 r67574 66 66 bool parseValue(CSSMutableStyleDeclaration*, int propId, const String&, bool important); 67 67 static bool parseColor(RGBA32& color, const String&, bool strict = false); 68 static bool parseSystemColor(RGBA32& color, const String&, Document*);69 68 bool parseColor(CSSMutableStyleDeclaration*, const String&); 70 69 bool parseDeclaration(CSSMutableStyleDeclaration*, const String&); -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r67570 r67574 54 54 #include "Page.h" 55 55 #include "RenderHTMLCanvas.h" 56 #include "RenderTheme.h"57 56 #include "SecurityOrigin.h" 58 57 #include "Settings.h" … … 571 570 if (color == state().m_unparsedStrokeColor) 572 571 return; 573 setStrokeStyle(CanvasStyle::createFromString(color , canvas()->document()));572 setStrokeStyle(CanvasStyle::createFromString(color)); 574 573 state().m_unparsedStrokeColor = color; 575 574 } … … 612 611 if (color == state().m_unparsedFillColor) 613 612 return; 614 setFillStyle(CanvasStyle::createFromString(color , canvas()->document()));613 setFillStyle(CanvasStyle::createFromString(color)); 615 614 state().m_unparsedFillColor = color; 616 615 } -
trunk/WebCore/html/canvas/CanvasStyle.cpp
r67570 r67574 87 87 } 88 88 89 PassRefPtr<CanvasStyle> CanvasStyle::createFromString(const String& color , Document* document)89 PassRefPtr<CanvasStyle> CanvasStyle::createFromString(const String& color) 90 90 { 91 91 RGBA32 rgba; 92 if (CSSParser::parseColor(rgba, color)) 93 return adoptRef(new CanvasStyle(rgba)); 94 95 if (CSSParser::parseSystemColor(rgba, color, document)) 96 return adoptRef(new CanvasStyle(rgba)); 97 98 return 0; 92 if (!CSSParser::parseColor(rgba, color)) 93 return 0; 94 return adoptRef(new CanvasStyle(rgba)); 99 95 } 100 96 -
trunk/WebCore/html/canvas/CanvasStyle.h
r67570 r67574 35 35 class CanvasGradient; 36 36 class CanvasPattern; 37 class Document;38 37 class GraphicsContext; 39 38 … … 41 40 public: 42 41 static PassRefPtr<CanvasStyle> createFromRGBA(RGBA32 rgba) { return adoptRef(new CanvasStyle(rgba)); } 43 static PassRefPtr<CanvasStyle> createFromString(const String& color , Document* = 0);42 static PassRefPtr<CanvasStyle> createFromString(const String& color); 44 43 static PassRefPtr<CanvasStyle> createFromStringWithOverrideAlpha(const String& color, float alpha); 45 44 static PassRefPtr<CanvasStyle> createFromGrayLevelWithAlpha(float grayLevel, float alpha) { return adoptRef(new CanvasStyle(grayLevel, alpha)); }
Note: See TracChangeset
for help on using the changeset viewer.