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

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

Issue 11111020: <browser>: Always read <browser>.src attribute from <object>.src. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from creis@ Created 8 years, 2 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/browser_tag.js
diff --git a/chrome/renderer/resources/extensions/browser_tag.js b/chrome/renderer/resources/extensions/browser_tag.js
index 3035257e36fbcd20e87a3f4e5f1246b8dba76dce..0f38f32ea4562b533694eab92d69a64278e1978d 100644
--- a/chrome/renderer/resources/extensions/browser_tag.js
+++ b/chrome/renderer/resources/extensions/browser_tag.js
@@ -72,10 +72,17 @@ function BrowserTag(node) {
this.node_,
{attributes: true, attributeFilter: BROWSER_TAG_ATTRIBUTES});
+ var objectNode = this.objectNode_;
// Expose getters and setters for the attributes.
BROWSER_TAG_ATTRIBUTES.forEach(function(attributeName) {
Object.defineProperty(this.node_, attributeName, {
get: function() {
+ if (attributeName == 'src') {
+ // Always read src attribute from the plugin <object> since: a) It can
+ // have different value when empty src is set. b) BrowserPlugin
+ // updates its src attribute on guest-initiated navigations.
+ return objectNode.src;
+ }
var value = node.getAttribute(attributeName);
var numericValue = parseInt(value, 10);
return isNaN(numericValue) ? value : numericValue;

Powered by Google App Engine
This is Rietveld 408576698