Bug 1358495 - Part 1: Add window.getComputedStyleWithoutFlushing to IDL. r?bz draft
authorWei-Cheng Pan <wpan@mozilla.com>
Fri, 28 Apr 2017 19:00:55 +0800
changeset 570140 9ff680041df726a3bd6025ac3d55862a4587e094
parent 569701 2cca333f546f38860f84940d4c72d7470a3410f4
child 570141 39c4d9cdb6c00be72c1ad7d997ff7b2d15c57c27
push id56403
push userbmo:wpan@mozilla.com
push dateFri, 28 Apr 2017 11:33:40 +0000
reviewersbz
bugs1358495
milestone55.0a1
Bug 1358495 - Part 1: Add window.getComputedStyleWithoutFlushing to IDL. r?bz Sometimes we know it is OK to get computed style without flushing because the data is slightly stale. Make this API as chrome-only because content might not need this. MozReview-Commit-ID: 5Vgd4spGQyE
dom/webidl/Window.webidl
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -361,16 +361,20 @@ partial interface Window {
 
   [Throws, ChromeOnly] any getInterface(IID iid);
 
   /**
    * Same as nsIDOMWindow.windowRoot, useful for event listener targeting.
    */
   [ChromeOnly, Throws]
   readonly attribute WindowRoot? windowRoot;
+
+  // bug 1358495
+  [NewObject, Throws, ChromeOnly]
+  CSSStyleDeclaration? getComputedStyleWithoutFlushing(Element elt, optional DOMString pseudoElt = "");
 };
 
 Window implements TouchEventHandlers;
 
 Window implements OnErrorEventHandlerForWindow;
 
 #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
 // https://compat.spec.whatwg.org/#windoworientation-interface