From 6735b077927712121b7629eab437503b01473a3a Mon Sep 17 00:00:00 2001 From: Giovanny Andres Gongora Granada Date: Sun, 22 Feb 2015 18:17:31 -0800 Subject: [PATCH] Bug 974435 - Remove inline scripts and styles usage via JavaScript for shell.html and shell.js r=fabrice --- b2g/chrome/content/blank.css | 7 +++++++ b2g/chrome/content/blank.html | 10 ++++++++++ b2g/chrome/content/shell.css | 12 +++++++++++- b2g/chrome/content/shell.js | 3 +-- b2g/chrome/jar.mn | 2 ++ 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 b2g/chrome/content/blank.css create mode 100644 b2g/chrome/content/blank.html diff --git a/b2g/chrome/content/blank.css b/b2g/chrome/content/blank.css new file mode 100644 index 00000000000..71914be1f5f --- /dev/null +++ b/b2g/chrome/content/blank.css @@ -0,0 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +body { + background: black; +} diff --git a/b2g/chrome/content/blank.html b/b2g/chrome/content/blank.html new file mode 100644 index 00000000000..b8b20e2c679 --- /dev/null +++ b/b2g/chrome/content/blank.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/b2g/chrome/content/shell.css b/b2g/chrome/content/shell.css index 44cdafdf8d5..9043feec0c4 100644 --- a/b2g/chrome/content/shell.css +++ b/b2g/chrome/content/shell.css @@ -9,10 +9,20 @@ html { height: 100%; padding: 0 !important; } - body { margin: 0; width: 100%; height: 100%; overflow: hidden; } +iframe { + overflow: hidden; + height: 100%; + width: 100%; + border: none; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; +} diff --git a/b2g/chrome/content/shell.js b/b2g/chrome/content/shell.js index a4e53a08680..9a85d2f45f3 100644 --- a/b2g/chrome/content/shell.js +++ b/b2g/chrome/content/shell.js @@ -311,8 +311,7 @@ var shell = { systemAppFrame.setAttribute('mozbrowser', 'true'); systemAppFrame.setAttribute('mozapp', manifestURL); systemAppFrame.setAttribute('allowfullscreen', 'true'); - systemAppFrame.setAttribute('style', "overflow: hidden; height: 100%; width: 100%; border: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0;"); - systemAppFrame.setAttribute('src', "data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;"); + systemAppFrame.setAttribute('src', 'blank.html'); let container = document.getElementById('container'); #ifdef MOZ_WIDGET_COCOA // See shell.html diff --git a/b2g/chrome/jar.mn b/b2g/chrome/jar.mn index feabb84b4bc..441bd653a7d 100644 --- a/b2g/chrome/jar.mn +++ b/b2g/chrome/jar.mn @@ -13,6 +13,8 @@ chrome.jar: * content/shell.html (content/shell.html) * content/shell.js (content/shell.js) content/shell.css (content/shell.css) + content/blank.html (content/blank.html) + content/blank.css (content/blank.css) #ifdef MOZ_WIDGET_GONK content/devtools/adb.js (content/devtools/adb.js) #endif