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

Side by Side Diff: Source/devtools/front_end/DOMExtension.js

Issue 182113004: DevTools: Get rid of Element.prototype.enableStyleClass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 9 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/ConsoleView.js ('k') | Source/devtools/front_end/DataGrid.js » ('j') | 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 Element.prototype.removeMatchingStyleClasses = function(classNameRegex) 147 Element.prototype.removeMatchingStyleClasses = function(classNameRegex)
148 { 148 {
149 var regex = new RegExp("(^|\\s+)" + classNameRegex + "($|\\s+)"); 149 var regex = new RegExp("(^|\\s+)" + classNameRegex + "($|\\s+)");
150 if (regex.test(this.className)) 150 if (regex.test(this.className))
151 this.className = this.className.replace(regex, " "); 151 this.className = this.className.replace(regex, " ");
152 } 152 }
153 153
154 /** 154 /**
155 * @param {string} className
156 * @param {*} enable
157 */
158 Element.prototype.enableStyleClass = function(className, enable)
159 {
160 if (enable)
161 this.classList.add(className);
162 else
163 this.classList.remove(className);
164 }
165
166 /**
167 * @param {number|undefined} x 155 * @param {number|undefined} x
168 * @param {number|undefined} y 156 * @param {number|undefined} y
169 * @param {!Element=} relativeTo 157 * @param {!Element=} relativeTo
170 */ 158 */
171 Element.prototype.positionAt = function(x, y, relativeTo) 159 Element.prototype.positionAt = function(x, y, relativeTo)
172 { 160 {
173 var shift = {x: 0, y: 0}; 161 var shift = {x: 0, y: 0};
174 if (relativeTo) 162 if (relativeTo)
175 shift = relativeTo.boxInWindow(this.ownerDocument.defaultView); 163 shift = relativeTo.boxInWindow(this.ownerDocument.defaultView);
176 164
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 */ 562 */
575 function isEnterKey(event) { 563 function isEnterKey(event) {
576 // Check if in IME. 564 // Check if in IME.
577 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; 565 return event.keyCode !== 229 && event.keyIdentifier === "Enter";
578 } 566 }
579 567
580 function consumeEvent(e) 568 function consumeEvent(e)
581 { 569 {
582 e.consume(); 570 e.consume();
583 } 571 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ConsoleView.js ('k') | Source/devtools/front_end/DataGrid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698