Bug 968814: Frames added in Toolbar have scrollbars if they have any content in them. r=zer0, a=sledru
authorIrakli Gozalishvili <rfobic@gmail.com>
Thu, 06 Mar 2014 10:26:15 -0800
changeset 183185 6f3804e364bde37faca06035db54fb8903849da3
parent 183184 93039361e80eaa22dd5300187141c770b5a84d94
child 183186 e8883bce299f66be0374f0e072afd91cbfa50b82
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszer0, sledru
bugs968814
milestone29.0a2
Bug 968814: Frames added in Toolbar have scrollbars if they have any content in them. r=zer0, a=sledru
addon-sdk/source/lib/sdk/ui/frame/view.html
addon-sdk/source/lib/sdk/ui/frame/view.js
--- a/addon-sdk/source/lib/sdk/ui/frame/view.html
+++ b/addon-sdk/source/lib/sdk/ui/frame/view.html
@@ -8,10 +8,11 @@ window.onmessage = function(event) {
   // If message is posted from chrome it has no `event.source`.
   if (event.source === null)
     content.postMessage(event.data, "*");
 };
 // Hack: Ideally we would have used srcdoc on iframe, but in
 // that case origin of document is either content which is unable
 // to load add-on resources or a chrome to which add-on resource
 // can not send messages back.
+document.documentElement.style.overflow = "hidden";
 document.documentElement.innerHTML = atob(location.hash.substr(1));
 </script>
--- a/addon-sdk/source/lib/sdk/ui/frame/view.js
+++ b/addon-sdk/source/lib/sdk/ui/frame/view.js
@@ -63,29 +63,32 @@ const registerFrame = ({id, url}) => {
       view.setAttribute("id", id);
       view.setAttribute("flex", 2);
 
       let innerFrame = document.createElementNS(HTML_NS, "iframe");
       innerFrame.setAttribute("id", id);
       innerFrame.setAttribute("src", url);
       innerFrame.setAttribute("seamless", "seamless");
       innerFrame.setAttribute("sandbox", "allow-scripts");
+      innerFrame.setAttribute("scrolling", "no");
       innerFrame.setAttribute("data-is-sdk-inner-frame", true);
       innerFrame.setAttribute("style", [ "border:none",
-        "position:absolute", "width:100%", "top: 0", "left: 0"].join(";"));
+        "position:absolute", "width:100%", "top: 0",
+        "left: 0", "overflow: hidden"].join(";"));
 
       let outerFrame = document.createElementNS(XUL_NS, "iframe");
       outerFrame.setAttribute("src", OUTER_FRAME_URI + "#" +
                                      encode(innerFrame.outerHTML));
       outerFrame.setAttribute("id", "outer-" + id);
       outerFrame.setAttribute("data-is-sdk-outer-frame", true);
       outerFrame.setAttribute("type", "content");
       outerFrame.setAttribute("transparent", true);
       outerFrame.setAttribute("flex", 2);
       outerFrame.setAttribute("style", "overflow: hidden;");
+      outerFrame.setAttribute("scrolling", "no");
       outerFrame.setAttribute("disablehistory", true);
       outerFrame.setAttribute("seamless", "seamless");
 
       view.appendChild(outerFrame);
 
       return view;
     }
   });