Modified: trunk/Source/WebInspectorUI/ChangeLog (165006 => 165007)
--- trunk/Source/WebInspectorUI/ChangeLog 2014-03-03 21:45:25 UTC (rev 165006)
+++ trunk/Source/WebInspectorUI/ChangeLog 2014-03-03 21:52:31 UTC (rev 165007)
@@ -1,3 +1,15 @@
+2014-03-03 Timothy Hatcher <timo...@apple.com>
+
+ Fix an exception caused by trying to access the DOM before it is loaded.
+
+ https://bugs.webkit.org/show_bug.cgi?id=129617
+
+ Reviewed by Andreas Kling.
+
+ * UserInterface/Base/Main.js:
+ (WebInspector.loaded): Move global event listeners from here...
+ (WebInspector.contentLoaded): ... to here.
+
2014-03-01 Timothy Hatcher <timo...@apple.com>
Make Start Timeline Recording in the Develop menu show the Timeline view again.
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (165006 => 165007)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2014-03-03 21:45:25 UTC (rev 165006)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2014-03-03 21:52:31 UTC (rev 165007)
@@ -130,21 +130,6 @@
document.addEventListener("DOMContentLoaded", this.contentLoaded.bind(this));
- document.addEventListener("beforecopy", this._beforecopy.bind(this));
- document.addEventListener("copy", this._copy.bind(this));
-
- document.addEventListener("click", this._mouseWasClicked.bind(this));
- document.addEventListener("dragover", this._dragOver.bind(this));
- document.addEventListener("focus", WebInspector._focusChanged.bind(this), true);
-
- window.addEventListener("focus", this._windowFocused.bind(this));
- window.addEventListener("blur", this._windowBlurred.bind(this));
- window.addEventListener("resize", this._windowResized.bind(this));
- window.addEventListener("keydown", this._windowKeyDown.bind(this));
- window.addEventListener("keyup", this._windowKeyUp.bind(this));
- window.addEventListener("mousemove", this._mouseMoved.bind(this), true);
- window.addEventListener("pagehide", this._pageHidden.bind(this));
-
// Create settings.
this._lastInspectorViewStateCookieSetting = new WebInspector.Setting("last-content-view-state-cookie", {});
@@ -181,6 +166,22 @@
WebInspector.contentLoaded = function()
{
+ // Register for global events.
+ document.addEventListener("beforecopy", this._beforecopy.bind(this));
+ document.addEventListener("copy", this._copy.bind(this));
+
+ document.addEventListener("click", this._mouseWasClicked.bind(this));
+ document.addEventListener("dragover", this._dragOver.bind(this));
+ document.addEventListener("focus", WebInspector._focusChanged.bind(this), true);
+
+ window.addEventListener("focus", this._windowFocused.bind(this));
+ window.addEventListener("blur", this._windowBlurred.bind(this));
+ window.addEventListener("resize", this._windowResized.bind(this));
+ window.addEventListener("keydown", this._windowKeyDown.bind(this));
+ window.addEventListener("keyup", this._windowKeyUp.bind(this));
+ window.addEventListener("mousemove", this._mouseMoved.bind(this), true);
+ window.addEventListener("pagehide", this._pageHidden.bind(this));
+
// Check for a nightly build by looking for a plus in the version number and a small number of stylesheets (indicating combined resources).
var versionMatch = / AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);
if (versionMatch && versionMatch[1].indexOf("+") !== -1 && document.styleSheets.length < 10)