From: Robo Date: Wed, 13 Jan 2016 17:02:41 +0000 (+0530) Subject: webview: respect properties provided during webview creation X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b38bbcf1825ab37548ebc8b47684f823ad7d9fc;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git webview: respect properties provided during webview creation --- diff --git a/atom/renderer/lib/web-view/web-view-attributes.js b/atom/renderer/lib/web-view/web-view-attributes.js index fd5dad2..b02cd75 100644 --- a/atom/renderer/lib/web-view/web-view-attributes.js +++ b/atom/renderer/lib/web-view/web-view-attributes.js @@ -29,6 +29,7 @@ resolveURL = function(url) { WebViewAttribute = (function() { function WebViewAttribute(name, webViewImpl) { this.name = name; + this.value = webViewImpl.webviewNode[name] || ''; this.webViewImpl = webViewImpl; this.ignoreMutation = false; this.defineProperty(); @@ -38,7 +39,7 @@ WebViewAttribute = (function() { /* Retrieves and returns the attribute's value. */ WebViewAttribute.prototype.getValue = function() { - return this.webViewImpl.webviewNode.getAttribute(this.name) || ''; + return this.webViewImpl.webviewNode.getAttribute(this.name) || this.value; }; @@ -228,7 +229,7 @@ SrcAttribute = (function(superClass) { if (this.webViewImpl.webviewNode.hasAttribute(this.name)) { return resolveURL(this.webViewImpl.webviewNode.getAttribute(this.name)); } else { - return ''; + return this.value; } }; @@ -368,7 +369,7 @@ PreloadAttribute = (function(superClass) { PreloadAttribute.prototype.getValue = function() { var preload, protocol; if (!this.webViewImpl.webviewNode.hasAttribute(this.name)) { - return ''; + return this.value; } preload = resolveURL(this.webViewImpl.webviewNode.getAttribute(this.name)); protocol = preload.substr(0, 5);