" +
+ "" +
+ "" +
+ "Three Laws" +
+ "" +
+ "" +
+ "" +
+ "A robot may not injure a human being or, through inaction, allow a" +
+ "human being to come to harm." +
+ "
" +
+ "" +
+ "A robot must obey the orders given to it by human beings, except" +
+ "where such orders would conflict with the First Law." +
+ "
" +
+ "" +
+ "A robot must protect its own existence as long as such protection" +
+ "does not conflict with the First or Second Laws." +
+ "
" +
+ "" +
+ "";
+
+const INSPECTOR_OPENED = InspectorUI.INSPECTOR_NOTIFICATIONS.OPENED;
+const INSPECTOR_CLOSED = InspectorUI.INSPECTOR_NOTIFICATIONS.CLOSED;
+
+const TILT_INITIALIZED = Tilt.NOTIFICATIONS.INITIALIZED;
+const TILT_DESTROYED = Tilt.NOTIFICATIONS.DESTROYED;
+const TILT_SHOWN = Tilt.NOTIFICATIONS.SHOWN;
+const TILT_HIDDEN = Tilt.NOTIFICATIONS.HIDDEN;
+
+const TILT_ENABLED = Services.prefs.getBoolPref("devtools.tilt.enabled");
+const INSP_ENABLED = Services.prefs.getBoolPref("devtools.inspector.enabled");
+
+
+function isTiltEnabled() {
+ return TILT_ENABLED && INSP_ENABLED;
+}
+
+function isWebGLSupported() {
+ return TiltGL.isWebGLSupported() &&
+ TiltGL.create3DContext(
+ document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"));
+}
+
+function isApprox(num1, num2) {
+ return Math.abs(num1 - num2) < EPSILON;
+}
+
+function isApproxVec(vec1, vec2) {
+ if (vec1.length !== vec2.length) {
+ return false;
+ }
+ for (let i = 0, len = vec1.length; i < len; i++) {
+ if (!isApprox(vec1[i], vec2[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+function createCanvas() {
+ return gBrowser.parentNode
+ .ownerDocument
+ .createElementNS("http://www.w3.org/1999/xhtml", "canvas");
+}
+
+
+function createTab(callback, location) {
+ let tab = gBrowser.selectedTab = gBrowser.addTab();
+
+ gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
+ gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
+ callback(tab);
+ }, true);
+
+ gBrowser.selectedBrowser.contentWindow.location = location || DEFAULT_HTML;
+ return tab;
+}
+
+
+function createTilt(callbacks, close) {
+ Services.obs.addObserver(onInspectorOpen, INSPECTOR_OPENED, false);
+ InspectorUI.toggleInspectorUI();
+
+ function onInspectorOpen() {
+ Services.obs.removeObserver(onInspectorOpen, INSPECTOR_OPENED);
+
+ executeSoon(function() {
+ if ("function" === typeof callbacks.onInspectorOpen) {
+ callbacks.onInspectorOpen();
+ }
+ Services.obs.addObserver(onTiltOpen, TILT_INITIALIZED, false);
+ Tilt.initialize();
+ });
+ }
+
+ function onTiltOpen() {
+ Services.obs.removeObserver(onTiltOpen, TILT_INITIALIZED);
+
+ executeSoon(function() {
+ if ("function" === typeof callbacks.onTiltOpen) {
+ callbacks.onTiltOpen();
+ }
+ if (close) {
+ Services.obs.addObserver(onTiltClose, TILT_DESTROYED, false);
+ Tilt.destroy(Tilt.currentWindowId);
+ }
+ });
+ }
+
+ function onTiltClose() {
+ Services.obs.removeObserver(onTiltClose, TILT_DESTROYED);
+
+ executeSoon(function() {
+ if ("function" === typeof callbacks.onTiltClose) {
+ callbacks.onTiltClose();
+ }
+ if (close) {
+ Services.obs.addObserver(onInspectorClose, INSPECTOR_CLOSED, false);
+ InspectorUI.closeInspectorUI();
+ }
+ });
+ }
+
+ function onInspectorClose() {
+ Services.obs.removeObserver(onInspectorClose, INSPECTOR_CLOSED);
+
+ executeSoon(function() {
+ if ("function" === typeof callbacks.onInspectorClose) {
+ callbacks.onInspectorClose();
+ }
+ if ("function" === typeof callbacks.onEnd) {
+ callbacks.onEnd();
+ }
+ });
+ }
+}
diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd
index e3f4482b7030..e71068ce6b8e 100644
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -217,6 +217,8 @@ can reach it easily. -->
+
+
diff --git a/browser/locales/en-US/chrome/browser/devtools/tilt.properties b/browser/locales/en-US/chrome/browser/devtools/tilt.properties
new file mode 100755
index 000000000000..e20ffe15187b
--- /dev/null
+++ b/browser/locales/en-US/chrome/browser/devtools/tilt.properties
@@ -0,0 +1,45 @@
+# LOCALIZATION NOTE These strings are used inside the Tilt Inspector
+# which is available from the Web Developer sub-menu -> 'Tilt'.
+#
+# The correct localization of this file might be to keep it in
+# English, or another language commonly spoken among web developers.
+# You want to make that choice consistent across the developer tools.
+# A good criteria is the language in which you'd find the best
+# documentation on web development on the web.
+
+# LOCALIZATION NOTE (initTilt.error): Tilt requires WebGL capabilities, which
+# are not available on every hardware. This message is displayed as an modal
+# popup window when initialization fails because of unsupported hardware.
+initTilt.error = Could not initialize Tilt, please check the\ntroubleshooting information available at http://get.webgl.org/troubleshooting
+
+# LOCALIZATION NOTE (initWebGL.error): Tilt requires WebGL capabilities, which
+# are not available on every hardware. This message is displayed in the console
+# when initialization fails because of unsupported hardware.
+initWebGL.error = Could not initialize the WebGL context, your hardware or drivers may not support it.
+
+# LOCALIZATION NOTE (linkProgram.error): This error happens when the WebGL
+# context can't link two compiled shader programs together. It is displayed in
+# the Error Console.
+linkProgram.error = Could not initialize shader program: %S
+
+# LOCALIZATION NOTE (compileShader.source.error): This error is caused when the
+# source (uri or path) of a shader is not the expected one. It is displayed in
+# the Error Console.
+compileShader.source.error = Bad shader source type (expected String).
+
+# LOCALIATION NOTE (compileShader.type.error): There are two types of shader
+# programs - vertex and fragment. At a shader initialization, if none of these
+# two types is specified, this compile-time error is shown. It is displayed in
+# the Error Console.
+compileShader.type.error = Wrong shader type specified for: %S
+
+# LOCALIZATION NOTE (compileShader.compile.error): If the shader source and
+# type are correctly specified, there may be syntax errors in the shader code.
+# If this is the case, this compile-time error is shown. It is displayed in
+# the Error Console.
+compileShader.compile.error = Shader compile status:\n%S
+
+# LOCALIZATION NOTE (compileShader.source.error): This error is caused when the
+# source (canvas or image) of a texture is not as expected. It is displayed in
+# the Error Console.
+initTexture.source.error = Bad texture source type (expected Image).
diff --git a/browser/locales/jar.mn b/browser/locales/jar.mn
index a3e78af9dcc3..c35e53bc3102 100644
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -19,6 +19,7 @@
locale/browser/devtools/gclicommands.properties (%chrome/browser/devtools/gclicommands.properties)
locale/browser/devtools/webconsole.properties (%chrome/browser/devtools/webconsole.properties)
locale/browser/devtools/inspector.properties (%chrome/browser/devtools/inspector.properties)
+ locale/browser/devtools/tilt.properties (%chrome/browser/devtools/tilt.properties)
locale/browser/devtools/scratchpad.properties (%chrome/browser/devtools/scratchpad.properties)
locale/browser/devtools/scratchpad.dtd (%chrome/browser/devtools/scratchpad.dtd)
locale/browser/devtools/styleeditor.properties (%chrome/browser/devtools/styleeditor.properties)