Summary: | GraphicsContext restores need to do nothing if the state stack is empty | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Myles C. Maxfield <mmaxfield> | ||||||||||
Component: | New Bugs | Assignee: | Myles C. Maxfield <mmaxfield> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | dino, kkinnunen, koivisto, rniwa, sabouhallawa, simon.fraser, thorton, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=227028 https://bugs.webkit.org/show_bug.cgi?id=227525 |
||||||||||||
Attachments: |
|
Description
Myles C. Maxfield
2021-06-14 20:20:41 PDT
Created attachment 431397 [details]
Patch
Comment on attachment 431397 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431397&action=review > Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:222 > + if (!stackSize()) > + return; I think you'll want this in all of the subclasses? Comment on attachment 431397 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431397&action=review > Source/WebCore/ChangeLog:10 > + According to the HTML spec (https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-restore-dev), > + "If there is no saved state, then the method must do nothing." That's true, and the CanvasRenderingContext protects against it, but you're changing GraphicsContext. We have thus far assumed that mismatched push/pop in GraphicsContext is a programming error. Created attachment 431400 [details]
Patch
Created attachment 431407 [details]
Patch
Created attachment 431408 [details]
Patch
Committed r278884 (238826@main): <https://commits.webkit.org/238826@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431408 [details]. |