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

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

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/ui/Checkbox.js ('k') | Source/devtools/front_end/ui/DOMSyntaxHighlighter.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/DOMExtension.js
diff --git a/Source/devtools/front_end/ui/DOMExtension.js b/Source/devtools/front_end/ui/DOMExtension.js
index d862f94212839c823b06dc74b64cd0f377d55f74..9dd9b9daf441629bcf8c0af0f5d541817838fbf6 100644
--- a/Source/devtools/front_end/ui/DOMExtension.js
+++ b/Source/devtools/front_end/ui/DOMExtension.js
@@ -398,6 +398,24 @@ Element.prototype.isInsertionCaretInside = function()
}
/**
+ * @param {string} tagName
+ * @return {!Element}
+ */
+function createElement(tagName)
+{
+ return document.createElement(tagName);
+}
+
+/**
+ * @param {number|string} data
+ * @return {!Text}
+ */
+function createTextNode(data)
+{
+ return document.createTextNode(data);
+}
+
+/**
* @param {string} elementName
* @param {string=} className
* @return {!Element}
@@ -415,6 +433,24 @@ Document.prototype.createElementWithClass = function(elementName, className)
* @param {string=} className
* @return {!Element}
*/
+function createElementWithClass(elementName, className)
+{
+ return document.createElementWithClass(elementName, className);
+}
+
+/**
+ * @return {!DocumentFragment}
+ */
+function createDocumentFragment()
+{
+ return document.createDocumentFragment();
+}
+
+/**
+ * @param {string} elementName
+ * @param {string=} className
+ * @return {!Element}
+ */
Element.prototype.createChild = function(elementName, className)
{
var element = this.ownerDocument.createElementWithClass(elementName, className);
« no previous file with comments | « Source/devtools/front_end/ui/Checkbox.js ('k') | Source/devtools/front_end/ui/DOMSyntaxHighlighter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698