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

Unified Diff: extensions/renderer/resources/guest_view/web_view_attributes.js

Issue 954543002: <webview>: Fix SrcAttribute and Cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
Index: extensions/renderer/resources/guest_view/web_view_attributes.js
diff --git a/extensions/renderer/resources/guest_view/web_view_attributes.js b/extensions/renderer/resources/guest_view/web_view_attributes.js
index 3bf72bcdbea53b7b536725ba8d76e6a8ab42e057..1c907b12e1ebd9a61b732736513a4924c73437e7 100644
--- a/extensions/renderer/resources/guest_view/web_view_attributes.js
+++ b/extensions/renderer/resources/guest_view/web_view_attributes.js
@@ -184,6 +184,15 @@ NameAttribute.prototype.handleMutation = function(oldValue, newValue) {
WebViewInternal.setName(this.webViewImpl.guest.getId(), newValue);
};
+NameAttribute.prototype.setValue = function(value) {
+ value = value || '';
+ if (value === '') {
+ this.webViewImpl.element.removeAttribute(this.name);
+ } else {
+ this.webViewImpl.element.setAttribute(this.name, value);
+ }
+};
+
// Attribute representing the state of the storage partition.
function PartitionAttribute(webViewImpl) {
WebViewAttribute.call(
@@ -224,12 +233,12 @@ function SrcAttribute(webViewImpl) {
SrcAttribute.prototype.__proto__ = WebViewAttribute.prototype;
SrcAttribute.prototype.setValueIgnoreMutation = function(value) {
+ WebViewAttribute.prototype.setValueIgnoreMutation.call(this, value);
// takeRecords() is needed to clear queued up src mutations. Without it, it is
// possible for this change to get picked up asyncronously by src's mutation
// observer |observer|, and then get handled even though we do not want to
// handle this mutation.
this.observer.takeRecords();
- WebViewAttribute.prototype.setValueIgnoreMutation.call(this, value);
}
SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
« no previous file with comments | « extensions/renderer/resources/guest_view/web_view.js ('k') | extensions/renderer/resources/guest_view/web_view_events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698