diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 96cc3613e623..0e4a7341f807 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1726,6 +1726,18 @@ nsDOMWindowUtils::NeedsFlush(int32_t aFlushType, bool* aResult) return NS_OK; } +NS_IMETHODIMP +nsDOMWindowUtils::FlushLayoutWithoutThrottledAnimations() +{ + nsCOMPtr doc = GetDocument(); + if (doc) { + doc->FlushPendingNotifications( + ChangesToFlush(FlushType::Layout, false /* flush animations */)); + } + + return NS_OK; +} + NS_IMETHODIMP nsDOMWindowUtils::GetRootBounds(nsISupports** aResult) { diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index b65384d2e8ff..84b17c2ff1d9 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -856,6 +856,12 @@ interface nsIDOMWindowUtils : nsISupports { */ bool needsFlush(in long aFlushtype); + /** + * Flush pending layout-type notification without flushing throttled + * animations. + */ + void flushLayoutWithoutThrottledAnimations(); + /** * Returns the bounds of the window's currently loaded document. This will * generally be (0, 0, pageWidth, pageHeight) but in some cases (e.g. RTL