Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp

Issue 1903613002: Skip canvas filter construction in frameless documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
index c76cff5f2062e30bd3d4386f974e194517d64586..aba170e1339a576a40ab75bcfb88c9201fa7acbd 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
@@ -293,6 +293,10 @@ SkImageFilter* CanvasRenderingContext2DState::getFilter(Element* styleResolution
if (!m_filterValue)
return nullptr;
+ // StyleResolverState cannot be used in frame-less documents.
+ if (!styleResolutionHost->document().frame())
+ return nullptr;
+
if (!m_resolvedFilter) {
RefPtr<ComputedStyle> filterStyle = ComputedStyle::create();
// Must set font in case the filter uses any font-relative units (em, ex)
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698