From 2f9adce2c3f483077d454d722d0abb9294cf6a03 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Mon, 5 May 2014 10:23:18 +0200 Subject: [PATCH] Bug 1000875 - Give nsDOMWindowUtils::CheckAndClearPaintedState the ability to check paints of canvas frames. r=roc --- dom/base/nsDOMWindowUtils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 3762d5a5ecb..0f03158710a 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -3076,6 +3076,17 @@ nsDOMWindowUtils::CheckAndClearPaintedState(nsIDOMElement* aElement, bool* aResu return NS_OK; } + // Get the outermost frame for the content node, so that we can test + // canvasframe invalidations by observing the documentElement. + for (;;) { + nsIFrame* parentFrame = frame->GetParent(); + if (parentFrame && parentFrame->GetContent() == content) { + frame = parentFrame; + } else { + break; + } + } + *aResult = frame->CheckAndClearPaintedState(); return NS_OK; }