Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2044)

Unified Diff: Source/devtools/front_end/ui/View.js

Issue 663083004: [DevTools] Remove remaining usages of global properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/ui/UIUtils.js ('k') | Source/devtools/front_end/ui/ViewportControl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/View.js
diff --git a/Source/devtools/front_end/ui/View.js b/Source/devtools/front_end/ui/View.js
index 6b167489e85e62920813b8374b044c0a85ddcdea..c25fcfde92835a47027274765ed316f73aca3a0d 100644
--- a/Source/devtools/front_end/ui/View.js
+++ b/Source/devtools/front_end/ui/View.js
@@ -390,7 +390,7 @@ WebInspector.View.prototype = {
focus: function()
{
var element = this.defaultFocusedElement();
- if (!element || element.isAncestor(document.activeElement))
+ if (!element || element.isAncestor(this.element.ownerDocument.activeElement))
return;
WebInspector.setCurrentFocusElement(element);
@@ -401,7 +401,7 @@ WebInspector.View.prototype = {
*/
hasFocus: function()
{
- var activeElement = document.activeElement;
+ var activeElement = this.element.ownerDocument.activeElement;
return activeElement && activeElement.isSelfOrDescendant(this.element);
},
@@ -410,6 +410,7 @@ WebInspector.View.prototype = {
*/
measurePreferredSize: function()
{
+ var document = this.element.ownerDocument;
WebInspector.View._originalAppendChild.call(document.body, this.element);
this.element.positionAt(0, 0);
var result = new Size(this.element.offsetWidth, this.element.offsetHeight);
« no previous file with comments | « Source/devtools/front_end/ui/UIUtils.js ('k') | Source/devtools/front_end/ui/ViewportControl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698