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

Unified Diff: chrome/renderer/resources/extensions/web_view.js

Issue 11554030: <webview>: Add name attribute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests Created 8 years 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
Index: chrome/renderer/resources/extensions/web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index 99c504b6dca27094aa2af1b3b7bd2a646a766012..0d2fac0e2492939115c0ff7d1ed2f3d526a28ef7 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -9,7 +9,7 @@
var watchForTag = require("tagWatcher").watchForTag;
-var WEB_VIEW_ATTRIBUTES = ['src', 'partition'];
+var WEB_VIEW_ATTRIBUTES = ['name', 'src', 'partition'];
// All exposed api methods for <webview>, these are forwarded to the browser
// plugin.
@@ -125,8 +125,12 @@ WebView.prototype.handleMutation_ = function(mutation) {
* @private
*/
WebView.prototype.handleObjectMutation_ = function(mutation) {
- this.node_.setAttribute(mutation.attributeName,
- this.objectNode_.getAttribute(mutation.attributeName));
+ if (!this.objectNode_.hasAttribute(mutation.attributeName)) {
Charlie Reis 2012/12/13 01:11:42 I'm not entirely sure which type of attribute chan
Fady Samuel 2012/12/13 17:46:45 Done.
+ this.node_.removeAttribute(mutation.attributeName);
+ } else {
+ this.node_.setAttribute(mutation.attributeName,
+ this.objectNode_.getAttribute(mutation.attributeName));
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698