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

Unified Diff: third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp

Issue 2847133002: Abort the SVG filter content recording if the FilterData was dropped (Closed)
Patch Set: Created 3 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/core/paint/SVGFilterPainter.h ('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/core/paint/SVGFilterPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
index 94d880cf37d5dfd91548cd705b884404ec238e50..6d6bf86af8f9553c03dd258443305dcdab435619 100644
--- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
@@ -47,6 +47,12 @@ sk_sp<PaintRecord> SVGFilterRecordingContext::EndContent(
return content;
}
+void SVGFilterRecordingContext::Abort() {
+ if (!paint_controller_)
+ return;
+ EndContent(FloatRect());
+}
+
static void PaintFilteredContent(GraphicsContext& context,
const LayoutObject& object,
const FloatRect& bounds,
@@ -115,8 +121,14 @@ void SVGFilterPainter::FinishEffect(
const LayoutObject& object,
SVGFilterRecordingContext& recording_context) {
FilterData* filter_data = filter_.GetFilterDataForLayoutObject(&object);
- if (!filter_data)
+ if (!filter_data) {
+ // Our state was torn down while we were being painted (selection style for
+ // <text> can have this effect), or it was never created (invalid filter.)
+ // In the former case we may have been in the process of recording content,
+ // so make sure we put recording state into a consistent state.
+ recording_context.Abort();
return;
+ }
// A painting cycle can occur when an FeImage references a source that
// makes use of the FeImage itself. This is the first place we would hit
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGFilterPainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698