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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This module implements the attributes of the <webview> tag. 5 // This module implements the attributes of the <webview> tag.
6 6
7 var GuestViewInternal = 7 var GuestViewInternal =
8 require('binding').Binding.create('guestViewInternal').generate(); 8 require('binding').Binding.create('guestViewInternal').generate();
9 var WebViewImpl = require('webView').WebViewImpl; 9 var WebViewImpl = require('webView').WebViewImpl;
10 var WebViewConstants = require('webViewConstants').WebViewConstants; 10 var WebViewConstants = require('webViewConstants').WebViewConstants;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 SrcAttribute.prototype.__proto__ = WebViewAttribute.prototype; 190 SrcAttribute.prototype.__proto__ = WebViewAttribute.prototype;
191 191
192 SrcAttribute.prototype.handleMutation = function(oldValue, newValue) { 192 SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
193 // Once we have navigated, we don't allow clearing the src attribute. 193 // Once we have navigated, we don't allow clearing the src attribute.
194 // Once <webview> enters a navigated state, it cannot return to a 194 // Once <webview> enters a navigated state, it cannot return to a
195 // placeholder state. 195 // placeholder state.
196 if (!newValue && oldValue) { 196 if (!newValue && oldValue) {
197 // src attribute changes normally initiate a navigation. We suppress 197 // src attribute changes normally initiate a navigation. We suppress
198 // the next src attribute handler call to avoid reloading the page 198 // the next src attribute handler call to avoid reloading the page
199 // on every guest-initiated navigation. 199 // on every guest-initiated navigation.
200 // takeRecords() needed to clear queued up src mutations.
Fady Samuel 2014/11/10 19:25:39 This doesn't explain why this was causing an issue
paulmeyer 2014/11/10 19:35:48 Done.
201 this.observer.takeRecords();
200 this.setValueIgnoreMutation(oldValue); 202 this.setValueIgnoreMutation(oldValue);
201 return; 203 return;
202 } 204 }
203 this.webViewImpl.parseSrcAttribute(); 205 this.webViewImpl.parseSrcAttribute();
204 }; 206 };
205 207
206 // The purpose of this mutation observer is to catch assignment to the src 208 // The purpose of this mutation observer is to catch assignment to the src
207 // attribute without any changes to its value. This is useful in the case 209 // attribute without any changes to its value. This is useful in the case
208 // where the webview guest has crashed and navigating to the same address 210 // where the webview guest has crashed and navigating to the same address
209 // spawns off a new process. 211 // spawns off a new process.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 248
247 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT, 249 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT,
248 WebViewConstants.ATTRIBUTE_MAXWIDTH, 250 WebViewConstants.ATTRIBUTE_MAXWIDTH,
249 WebViewConstants.ATTRIBUTE_MINHEIGHT, 251 WebViewConstants.ATTRIBUTE_MINHEIGHT,
250 WebViewConstants.ATTRIBUTE_MINWIDTH]; 252 WebViewConstants.ATTRIBUTE_MINWIDTH];
251 for (var i = 0; autosizeAttributes[i]; ++i) { 253 for (var i = 0; autosizeAttributes[i]; ++i) {
252 this.attributes[autosizeAttributes[i]] = 254 this.attributes[autosizeAttributes[i]] =
253 new AutosizeDimensionAttribute(autosizeAttributes[i], this); 255 new AutosizeDimensionAttribute(autosizeAttributes[i], this);
254 } 256 }
255 }; 257 };
OLDNEW
« 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