Commit cf84e6ee authored by fsamuel's avatar fsamuel Committed by Commit bot

<webview> + <extensionview>: Generalize setValueIgnoreMutation

setValueIgnoreMutation should call setValue so that derived attribute objects
only need to modify setValue to get the desired behavior.

BUG=none
TBR=lazyboy@chromium.org

Review URL: https://codereview.chromium.org/928623002

Cr-Commit-Position: refs/heads/master@{#316318}
parent fef215b9
......@@ -37,7 +37,7 @@ ExtensionViewAttribute.prototype.setValue = function(value) {
// Changes the attribute's value without triggering its mutation handler.
ExtensionViewAttribute.prototype.setValueIgnoreMutation = function(value) {
this.ignoreMutation = true;
this.extensionViewImpl.element.setAttribute(this.name, value || '');
this.setValue(value);
this.ignoreMutation = false;
}
......@@ -80,9 +80,7 @@ SrcAttribute.prototype.__proto__ = ExtensionViewAttribute.prototype;
SrcAttribute.prototype.setValueIgnoreMutation = function(value) {
this.observer.takeRecords();
this.ignoreMutation = true;
this.extensionViewImpl.element.setAttribute(this.name, value || '');
this.ignoreMutation = false;
ExtensionViewAttribute.prototype.setValueIgnoreMutation.call(this, value);
}
SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
......
......@@ -35,7 +35,7 @@ WebViewAttribute.prototype.setValue = function(value) {
// Changes the attribute's value without triggering its mutation handler.
WebViewAttribute.prototype.setValueIgnoreMutation = function(value) {
this.ignoreMutation = true;
this.webViewImpl.element.setAttribute(this.name, value || '');
this.setValue(value);
this.ignoreMutation = false;
}
......@@ -229,9 +229,7 @@ SrcAttribute.prototype.setValueIgnoreMutation = function(value) {
// observer |observer|, and then get handled even though we do not want to
// handle this mutation.
this.observer.takeRecords();
this.ignoreMutation = true;
this.webViewImpl.element.setAttribute(this.name, value || '');
this.ignoreMutation = false;
WebViewAttribute.prototype.setValueIgnoreMutation.call(this, value);
}
SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment