Bug 979658 part 1 - Add check that caller is chrome to GetOMTAOrComputedStyle; r=dzbarsky
authorBrian Birtles <birtles@gmail.com>
Mon, 10 Mar 2014 13:47:11 +0900
changeset 190915 3622141b21655dd80b36f931cfac0b3d8fe129ac
parent 190914 d3ebc96a208016cf87f3b5d7b146a0017508db3b
child 190916 a2395a98788163dc6c428c9e5b0d753459f8a1d9
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdzbarsky
bugs979658
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 979658 part 1 - Add check that caller is chrome to GetOMTAOrComputedStyle; r=dzbarsky Every other exposed method in nsDOMWindowUtils except getViewPortInfo and getViewId performs this check. This patch makes getOMTAOrComputedStyle check the caller is chrome as well.
dom/base/nsDOMWindowUtils.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3613,16 +3613,20 @@ nsDOMWindowUtils::RunBeforeNextEvent(nsI
   return appShell->RunBeforeNextEvent(runnable);
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetOMTAOrComputedStyle(nsIDOMNode* aNode,
                                          const nsAString& aProperty,
                                          nsAString& aResult)
 {
+  if (!nsContentUtils::IsCallerChrome()) {
+    return NS_ERROR_DOM_SECURITY_ERR;
+  }
+
   aResult.Truncate();
   ErrorResult rv;
   nsCOMPtr<Element> element = do_QueryInterface(aNode);
   if (!element) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsRefPtr<nsROCSSPrimitiveValue> cssValue = nullptr;