Index: Source/core/inspector/InjectedScriptSource.js |
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js |
index 234c0a831a3eb73c6ac57de6a3ba89256daebddb..52d87f4fcaa2b613b466ad78c564aee3e2a6666a 100644 |
--- a/Source/core/inspector/InjectedScriptSource.js |
+++ b/Source/core/inspector/InjectedScriptSource.js |
@@ -220,6 +220,33 @@ function indexOf(str, searchElement, fromIndex) |
} |
/** |
+ * DOM Attributes which have observable side effect on getter, in the form of |
+ * {interfaceName1: {attributeName1: true, |
+ * attributeName2: true, |
+ * ...}, |
+ * interfaceName2: {...}, |
+ * ...} |
+ * @type {!Object<string, !Object<string, boolean>>} |
+ * @const |
+ */ |
+var domAttributesWithObservableSideEffectOnGet = InjectedScriptHost.getDOMAttributesWithObservableSideEffectOnGet(); |
+ |
+/** |
+ * @param {!Object} object |
+ * @param {!string} attribute |
+ * @return {boolean} |
+ */ |
+function doesAttributeHaveObservableSideEffectOnGet(object, attribute) |
+{ |
+ for (var interfaceName in domAttributesWithObservableSideEffectOnGet) { |
+ if (window[interfaceName] && object instanceof window[interfaceName]) { |
yurys
2015/03/06 09:55:39
Note that window[interfaceName] may well be overwr
Yuki
2015/03/06 14:15:56
I've enclosed this part with InjectedScriptHost.su
|
+ return attribute in domAttributesWithObservableSideEffectOnGet[interfaceName]; |
+ } |
+ } |
+ return false; |
+} |
+ |
+/** |
* @constructor |
*/ |
var InjectedScript = function() |
@@ -555,7 +582,7 @@ InjectedScript.prototype = { |
if (descriptor) { |
if (accessorPropertiesOnly && !("get" in descriptor || "set" in descriptor)) |
continue; |
- if ("get" in descriptor && "set" in descriptor && InjectedScriptHost.isPopularDOMObject(object) && name != "__proto__") { |
+ if ("get" in descriptor && "set" in descriptor && name != "__proto__" && InjectedScriptHost.isDOMWrapper(object) && !doesAttributeHaveObservableSideEffectOnGet(object, name)) { |
descriptor.value = InjectedScriptHost.suppressWarningsAndCallFunction(function(attribute) { return this[attribute]; }, object, [name]); |
delete descriptor.get; |
delete descriptor.set; |
@@ -1516,6 +1543,7 @@ InjectedScript.RemoteObject.prototype = { |
__proto__: null |
} |
+ |
/** |
* @constructor |
* @param {number} ordinal |