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

Side by Side Diff: webkit/glue/devtools/js/devtools.js

Issue 341052: Fix spurious errors when dragging Web Inspector elements (Closed)
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Tools is a main class that wires all components of the 6 * @fileoverview Tools is a main class that wires all components of the
7 * DevTools frontend together. It is also responsible for overriding existing 7 * DevTools frontend together. It is also responsible for overriding existing
8 * WebInspector functionality while it is getting upstreamed into WebCore. 8 * WebInspector functionality while it is getting upstreamed into WebCore.
9 */ 9 */
10 goog.provide('devtools.Tools'); 10 goog.provide('devtools.Tools');
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 return result; 332 return result;
333 }; 333 };
334 })(); 334 })();
335 335
336 336
337 /** Pending WebKit upstream by apavlov). Fixes iframe vs drag problem. */ 337 /** Pending WebKit upstream by apavlov). Fixes iframe vs drag problem. */
338 (function() { 338 (function() {
339 var originalDragStart = WebInspector.elementDragStart; 339 var originalDragStart = WebInspector.elementDragStart;
340 WebInspector.elementDragStart = function(element) { 340 WebInspector.elementDragStart = function(element) {
341 var glassPane = document.createElement("div"); 341 if (element) {
342 glassPane.style.cssText = 342 var glassPane = document.createElement("div");
343 'position:absolute;width:100%;height:100%;opacity:0;z-index:1'; 343 glassPane.style.cssText =
344 glassPane.id = 'glass-pane-for-drag'; 344 'position:absolute;width:100%;height:100%;opacity:0;z-index:1';
345 element.parentElement.appendChild(glassPane); 345 glassPane.id = 'glass-pane-for-drag';
346 element.parentElement.appendChild(glassPane);
347 }
346 348
347 originalDragStart.apply(this, arguments); 349 originalDragStart.apply(this, arguments);
348 }; 350 };
349 351
350 var originalDragEnd = WebInspector.elementDragEnd; 352 var originalDragEnd = WebInspector.elementDragEnd;
351 WebInspector.elementDragEnd = function() { 353 WebInspector.elementDragEnd = function() {
352 originalDragEnd.apply(this, arguments); 354 originalDragEnd.apply(this, arguments);
353 355
354 var glassPane = document.getElementById('glass-pane-for-drag'); 356 var glassPane = document.getElementById('glass-pane-for-drag');
355 glassPane.parentElement.removeChild(glassPane); 357 if (glassPane) {
358 glassPane.parentElement.removeChild(glassPane);
359 }
356 }; 360 };
357 })(); 361 })();
358 362
359 363
360 (function () { 364 (function () {
361 var orig = InjectedScriptAccess.getProperties; 365 var orig = InjectedScriptAccess.getProperties;
362 InjectedScriptAccess.getProperties = function( 366 InjectedScriptAccess.getProperties = function(
363 objectProxy, ignoreHasOwnProperty, callback) { 367 objectProxy, ignoreHasOwnProperty, callback) {
364 if (objectProxy.isScope) { 368 if (objectProxy.isScope) {
365 devtools.tools.getDebuggerAgent().resolveScope(objectProxy.objectId, 369 devtools.tools.getDebuggerAgent().resolveScope(objectProxy.objectId,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 includeInspectorCommandLineAPI, callFrameId, reportCompletions) { 449 includeInspectorCommandLineAPI, callFrameId, reportCompletions) {
446 if (goog.isDef(callFrameId)) { 450 if (goog.isDef(callFrameId)) {
447 devtools.tools.getDebuggerAgent().resolveCompletionsOnFrame( 451 devtools.tools.getDebuggerAgent().resolveCompletionsOnFrame(
448 expressionString, callFrameId, reportCompletions); 452 expressionString, callFrameId, reportCompletions);
449 } else { 453 } else {
450 return orig.apply(this, arguments); 454 return orig.apply(this, arguments);
451 } 455 }
452 }; 456 };
453 })(); 457 })();
454 458
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698