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

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

Issue 692333009: Fixed the problem at the source of the flaky WebViewTest.ShimArcAttribute test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another small fix. Created 6 years, 1 month 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 | « chrome/browser/apps/web_view_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 745af03f16c7b18d6bb68db7cb6d5cef2ac6dbb1..f3ae1f1f5035d30196188889b148f6d440a836b4 100644
--- a/extensions/renderer/resources/guest_view/web_view_attributes.js
+++ b/extensions/renderer/resources/guest_view/web_view_attributes.js
@@ -189,6 +189,17 @@ function SrcAttribute(webViewImpl) {
SrcAttribute.prototype.__proto__ = WebViewAttribute.prototype;
+SrcAttribute.prototype.setValueIgnoreMutation = function(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();
+ this.ignoreMutation = true;
+ this.webViewImpl.webviewNode.setAttribute(this.name, value || '');
+ this.ignoreMutation = false;
+}
+
SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
// Once we have navigated, we don't allow clearing the src attribute.
// Once <webview> enters a navigated state, it cannot return to a
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698