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

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

Issue 440463002: Fix display:none issue for <webview>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix back the merge change Created 6 years, 4 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: 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 f36662b81327925ad0cb063b4a188fbae295d967..30278f0f4fd5105bbba48bd9b3ff6f264b78d725 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -106,7 +106,7 @@ function WebViewInternal(webviewNode) {
this.browserPluginNode = this.createBrowserPluginNode();
var shadowRoot = this.webviewNode.createShadowRoot();
- shadowRoot.appendChild(this.browserPluginNode);
+ this.partition = new Partition();
this.setupWebviewNodeAttributes();
this.setupFocusPropagation();
@@ -114,10 +114,9 @@ function WebViewInternal(webviewNode) {
this.viewInstanceId = IdGenerator.GetNextId();
- this.partition = new Partition();
- this.parseAttributes();
-
new WebViewEvents(this, this.viewInstanceId);
+
+ shadowRoot.appendChild(this.browserPluginNode);
}
/**
@@ -563,8 +562,13 @@ WebViewInternal.prototype.handleBrowserPluginAttributeMutation =
if (name == 'internalinstanceid' && !oldValue && !!newValue) {
this.browserPluginNode.removeAttribute('internalinstanceid');
this.internalInstanceId = parseInt(newValue);
- if (this.deferredAttachState && !!this.guestInstanceId &&
- this.guestInstanceId != 0) {
+
+ if (!this.deferredAttachState) {
+ this.parseAttributes();
+ return;
+ }
+
+ if (!!this.guestInstanceId && this.guestInstanceId != 0) {
window.setTimeout(function() {
var isNewWindow = this.deferredAttachState ?
this.deferredAttachState.isNewWindow : false;
@@ -575,6 +579,7 @@ WebViewInternal.prototype.handleBrowserPluginAttributeMutation =
params);
}.bind(this), 0);
}
+
return;
}
@@ -737,6 +742,10 @@ WebViewInternal.prototype.onFrameNameChanged = function(name) {
}
};
+WebViewInternal.prototype.onPluginDestroyed = function() {
+ this.reset();
+};
+
WebViewInternal.prototype.dispatchEvent = function(webViewEvent) {
return this.webviewNode.dispatchEvent(webViewEvent);
};
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | chrome/renderer/resources/extensions/web_view_events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698