Chromium Code Reviews| 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 1617e5c4108ed464472bd9812dba6365dcb925f7..10b80c532fb63b7762598f8afccfa928e02d5425 100644 |
| --- a/chrome/renderer/resources/extensions/web_view.js |
| +++ b/chrome/renderer/resources/extensions/web_view.js |
| @@ -90,6 +90,14 @@ function WebView(node) { |
| this.node_, |
| {attributes: true, attributeFilter: WEB_VIEW_ATTRIBUTES}); |
| + var handleObjectMutation = this.handleObjectMutation_.bind(this); |
| + var objectObserver = new WebKitMutationObserver(function(mutations) { |
| + mutations.forEach(handleObjectMutation); |
| + }); |
| + objectObserver.observe( |
| + this.objectNode_, |
| + {attributes: true, attributeFilter: WEB_VIEW_ATTRIBUTES}); |
| + |
| var objectNode = this.objectNode_; |
| // Expose getters and setters for the attributes. |
| WEB_VIEW_ATTRIBUTES.forEach(function(attributeName) { |
| @@ -126,13 +134,22 @@ function WebView(node) { |
| * @private |
| */ |
| WebView.prototype.handleMutation_ = function(mutation) { |
| - this.node_[mutation.attributeName] = |
| + this.objectNode_[mutation.attributeName] = |
| this.node_.getAttribute(mutation.attributeName); |
| }; |
| /** |
| * @private |
| */ |
| +WebView.prototype.handleObjectMutation_ = function(mutation) { |
| + console.log('observed object mutation'); |
|
sadrul
2012/12/04 01:28:46
remove this?
Fady Samuel
2012/12/04 01:57:30
Done.
|
| + this.node_.setAttribute(mutation.attributeName, |
| + this.objectNode_.getAttribute(mutation.attributeName)); |
| +}; |
| + |
| +/** |
| + * @private |
| + */ |
| WebView.prototype.setupEvent_ = function(eventname, attribs) { |
| var node = this.node_; |
| this.objectNode_.addEventListener('-internal-' + eventname, function(e) { |