Changeset 36044 in webkit


Ignore:
Timestamp:
Sep 2, 2008 11:01:15 PM (16 years ago)
Author:
mrowe@apple.com
Message:

2008-09-02 Dirk Schulze <vbs85@gmx.de>

Reviewed by Darin Adler.

Fallback on invalid fill or stroke styles in Canvas was
transparent black. Changed it to last valid style.

Canvas fillStyle() and strokeStyle() needs fallback
https://bugs.webkit.org/show_bug.cgi?id=20474

Tests: fast/canvas/canvas-invalid-fillstyle.html

fast/canvas/canvas-invalid-strokestyle.html

  • html/CanvasStyle.cpp: (WebCore::CanvasStyle::applyStrokeColor): (WebCore::CanvasStyle::applyFillColor):

2008-09-02 Dirk Schulze <vbs85@gmx.de>

Reviewed by Darin Adler.

Tests for https://bugs.webkit.org/show_bug.cgi?id=20474
Tests behaviour on invalid fillStyle() or strokeStyle() in canvas.

  • fast/canvas/canvas-invalid-fillstyle-expected.txt: Added.
  • fast/canvas/canvas-invalid-fillstyle.html: Added.
  • fast/canvas/canvas-invalid-fillstyle.js: Added.
  • fast/canvas/canvas-invalid-strokestyle-expected.txt: Added.
  • fast/canvas/canvas-invalid-strokestyle.html: Added.
  • fast/canvas/canvas-invalid-strokestyle.js: Added.
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r36043 r36044  
     12008-09-02  Dirk Schulze  <vbs85@gmx.de>
     2
     3        Reviewed by Darin Adler.
     4
     5        Tests for https://bugs.webkit.org/show_bug.cgi?id=20474
     6        Tests behaviour on invalid fillStyle() or strokeStyle() in canvas.
     7
     8        * fast/canvas/canvas-invalid-fillstyle-expected.txt: Added.
     9        * fast/canvas/canvas-invalid-fillstyle.html: Added.
     10        * fast/canvas/canvas-invalid-fillstyle.js: Added.
     11        * fast/canvas/canvas-invalid-strokestyle-expected.txt: Added.
     12        * fast/canvas/canvas-invalid-strokestyle.html: Added.
     13        * fast/canvas/canvas-invalid-strokestyle.js: Added.
     14
    1152008-09-02  Dirk Schulze  <vbs85@gmx.de>
    216
  • trunk/WebCore/ChangeLog

    r36043 r36044  
     12008-09-02  Dirk Schulze  <vbs85@gmx.de>
     2
     3        Reviewed by Darin Adler.
     4
     5        Fallback on invalid fill or stroke styles in Canvas was
     6        transparent black. Changed it to last valid style.
     7
     8        Canvas fillStyle() and strokeStyle() needs fallback
     9        https://bugs.webkit.org/show_bug.cgi?id=20474
     10
     11        Tests: fast/canvas/canvas-invalid-fillstyle.html
     12               fast/canvas/canvas-invalid-strokestyle.html
     13
     14        * html/CanvasStyle.cpp:
     15        (WebCore::CanvasStyle::applyStrokeColor):
     16        (WebCore::CanvasStyle::applyFillColor):
     17
    1182008-09-02  Dirk Schulze  <vbs85@gmx.de>
    219
  • trunk/WebCore/html/CanvasStyle.cpp

    r35966 r36044  
    107107        case ColorString: {
    108108            RGBA32 color = 0; // default is transparant black
    109             CSSParser::parseColor(color, m_color);
    110             context->setStrokeColor(color);
     109            if (CSSParser::parseColor(color, m_color))
     110                context->setStrokeColor(color);
    111111            break;
    112112        }
    113113        case ColorStringWithAlpha: {
    114114            RGBA32 color = 0; // default is transparant black
    115             CSSParser::parseColor(color, m_color);
    116             context->setStrokeColor(colorWithOverrideAlpha(color, m_alpha));
     115            if (CSSParser::parseColor(color, m_color))
     116                context->setStrokeColor(colorWithOverrideAlpha(color, m_alpha));
    117117            break;
    118118        }
     
    158158        case ColorString: {
    159159            RGBA32 rgba = 0; // default is transparant black
    160             CSSParser::parseColor(rgba, m_color);
    161             context->setFillColor(rgba);
     160            if (CSSParser::parseColor(rgba, m_color))
     161                context->setFillColor(rgba);
    162162            break;
    163163        }
    164164        case ColorStringWithAlpha: {
    165165            RGBA32 color = 0; // default is transparant black
    166             CSSParser::parseColor(color, m_color);
    167             context->setFillColor(colorWithOverrideAlpha(color, m_alpha));
     166            if (CSSParser::parseColor(color, m_color))
     167                context->setFillColor(colorWithOverrideAlpha(color, m_alpha));
    168168            break;
    169169        }
Note: See TracChangeset for help on using the changeset viewer.