Skip to content
  • senorblanco@chromium.org's avatar
    Assertion fires if canvas is resized while save() active · 58a47bd1
    senorblanco@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=66710
    
    Reviewed by Simon Fraser.
    
    Source/WebCore: 
    
    Test: fast/canvas/resize-while-save-active.html
    
    * html/HTMLCanvasElement.cpp:
    (WebCore::HTMLCanvasElement::reset):
    Call CanvasRenderingContext2D::reset() before resizing the canvas,
    so that the GraphicsContext state stack can be unwound.
    * html/canvas/CanvasRenderingContext2D.cpp:
    (WebCore::CanvasRenderingContext2D::unwindStateStack):
    (WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D):
    Refactor the state stack unwinding code from the destructor to 
    unwindStateStack() (new).
    (WebCore::CanvasRenderingContext2D::reset):
    Unwind the GraphicsContext state stack when the context is reset.
    * html/canvas/CanvasRenderingContext2D.h:
    
    LayoutTests: 
    
    * fast/canvas/resize-while-save-active-expected.txt: Added.
    * fast/canvas/resize-while-save-active.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    58a47bd1