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

Side by Side Diff: chrome/browser/resources/print_preview/component.js

Issue 617973002: Remove assert() from getChildElement() to fix the bug caused by https://chromiumcodereview.appspot.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: 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 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Class that represents a UI component. 9 * Class that represents a UI component.
10 * @constructor 10 * @constructor
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 removeChildren: function() { 147 removeChildren: function() {
148 while (this.children_.length > 0) { 148 while (this.children_.length > 0) {
149 this.removeChild(this.children_[0]); 149 this.removeChild(this.children_[0]);
150 } 150 }
151 }, 151 },
152 152
153 /** 153 /**
154 * @param {string} query Selector query to select an element starting from 154 * @param {string} query Selector query to select an element starting from
155 * the component's root element using a depth first search for the first 155 * the component's root element using a depth first search for the first
156 * element that matches the query. 156 * element that matches the query.
157 * @return {!HTMLElement} Element selected by the given query. 157 * @return {HTMLElement} Element selected by the given query.
158 * TODO(alekseys): Check all call sites and rename this function to 158 * TODO(alekseys): Check all call sites and rename this function to
159 * something like getRequiredChildElement. 159 * something like getRequiredChildElement.
160 */ 160 */
161 getChildElement: function(query) { 161 getChildElement: function(query) {
162 return assert(this.element_.querySelector(query)); 162 return this.element_.querySelector(query);
163 }, 163 },
164 164
165 /** 165 /**
166 * Sets the component's element. 166 * Sets the component's element.
167 * @param {Element} element HTML element to set as the component's element. 167 * @param {Element} element HTML element to set as the component's element.
168 * @protected 168 * @protected
169 */ 169 */
170 setElementInternal: function(element) { 170 setElementInternal: function(element) {
171 this.element_ = element; 171 this.element_ = element;
172 }, 172 },
(...skipping 22 matching lines...) Expand all
195 setIsVisible(el, true); 195 setIsVisible(el, true);
196 } 196 }
197 return el; 197 return el;
198 } 198 }
199 }; 199 };
200 200
201 return { 201 return {
202 Component: Component 202 Component: Component
203 }; 203 };
204 }); 204 });
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