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

Side by Side Diff: Source/devtools/front_end/ui/View.js

Issue 362273002: DevTools: Reduce code via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/ui/SidebarPane.js ('k') | 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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 12 matching lines...) Expand all
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 /** 27 /**
28 * @constructor 28 * @constructor
29 * @extends {WebInspector.Object} 29 * @extends {WebInspector.Object}
30 */ 30 */
31 WebInspector.View = function() 31 WebInspector.View = function()
32 { 32 {
33 this.element = document.createElement("div"); 33 this.element = document.createElementWithClass("div", "view");
34 this.element.className = "view";
35 this.element.__view = this; 34 this.element.__view = this;
36 this._visible = true; 35 this._visible = true;
37 this._isRoot = false; 36 this._isRoot = false;
38 this._isShowing = false; 37 this._isShowing = false;
39 this._children = []; 38 this._children = [];
40 this._hideOnDetach = false; 39 this._hideOnDetach = false;
41 this._cssFiles = []; 40 this._cssFiles = [];
42 this._notificationDepth = 0; 41 this._notificationDepth = 0;
43 } 42 }
44 43
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 { 693 {
695 WebInspector.View.__assert(!child.__viewCounter && !child.__view, "Attempt t o remove element containing view via regular DOM operation"); 694 WebInspector.View.__assert(!child.__viewCounter && !child.__view, "Attempt t o remove element containing view via regular DOM operation");
696 return WebInspector.View._originalRemoveChild.call(this, child); 695 return WebInspector.View._originalRemoveChild.call(this, child);
697 } 696 }
698 697
699 Element.prototype.removeChildren = function() 698 Element.prototype.removeChildren = function()
700 { 699 {
701 WebInspector.View.__assert(!this.__viewCounter, "Attempt to remove element c ontaining view via regular DOM operation"); 700 WebInspector.View.__assert(!this.__viewCounter, "Attempt to remove element c ontaining view via regular DOM operation");
702 WebInspector.View._originalRemoveChildren.call(this); 701 WebInspector.View._originalRemoveChildren.call(this);
703 } 702 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/SidebarPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698