Changeset 85722 in webkit
- Timestamp:
- May 3, 2011 11:45:27 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85715 r85722 1 2011-05-03 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: can't inspect element in an iframe when element originates from non-frame document 6 https://bugs.webkit.org/show_bug.cgi?id=60031 7 8 * inspector/elements/elements-inspect-iframe-from-different-domain-expected.txt: Added. 9 * inspector/elements/elements-inspect-iframe-from-different-domain.html: Added. 10 1 11 2011-05-03 Dan Bernstein <mitz@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r85721 r85722 1 2011-05-03 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: can't inspect element in an iframe when element originates from non-frame document 6 https://bugs.webkit.org/show_bug.cgi?id=60031 7 8 Inspected object type evaluation has moved into native bindings. This way it doesn't 9 depend on the current JS context. 10 11 Test: inspector/elements/elements-inspect-iframe-from-different-domain.html 12 13 * bindings/js/JSInjectedScriptHostCustom.cpp: 14 (WebCore::JSInjectedScriptHost::isHTMLAllCollection): this method helps distinguish 15 real undefined values from HTMLAllCollection 16 (WebCore::JSInjectedScriptHost::type): method that returns presice type of the passed 17 value 18 * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: 19 (WebCore::V8InjectedScriptHost::isHTMLAllCollectionCallback): 20 (WebCore::V8InjectedScriptHost::typeCallback): 21 * inspector/InjectedScriptHost.idl: 22 * inspector/InjectedScriptSource.js: 23 (.): 24 1 25 2011-05-03 Pratik Solanki <psolanki@apple.com> 2 26 -
trunk/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
r85035 r85722 40 40 #include "JSDatabase.h" 41 41 #endif 42 #include "DateInstance.h" 42 43 #include "ExceptionCode.h" 43 44 #include "InjectedScriptHost.h" 44 45 #include "InspectorDebuggerAgent.h" 45 46 #include "InspectorValues.h" 47 #include "JSArray.h" 48 #include "JSHTMLAllCollection.h" 49 #include "JSHTMLCollection.h" 46 50 #include "JSNode.h" 51 #include "JSNodeList.h" 52 #include "RegExpObject.h" 47 53 #include "ScriptValue.h" 48 54 #if ENABLE(DOM_STORAGE) … … 91 97 } 92 98 99 JSValue JSInjectedScriptHost::isHTMLAllCollection(ExecState* exec) 100 { 101 if (exec->argumentCount() < 1) 102 return jsUndefined(); 103 104 JSValue value = exec->argument(0); 105 return jsBoolean(value.inherits(&JSHTMLAllCollection::s_info)); 106 } 107 108 JSValue JSInjectedScriptHost::type(ExecState* exec) 109 { 110 if (exec->argumentCount() < 1) 111 return jsUndefined(); 112 113 JSValue value = exec->argument(0); 114 if (value.isString()) 115 return jsString(exec, String("string")); 116 if (value.inherits(&JSArray::s_info)) 117 return jsString(exec, String("array")); 118 if (value.isBoolean()) 119 return jsString(exec, String("boolean")); 120 if (value.isNumber()) 121 return jsString(exec, String("number")); 122 if (value.inherits(&DateInstance::s_info)) 123 return jsString(exec, String("date")); 124 if (value.inherits(&RegExpObject::s_info)) 125 return jsString(exec, String("regexp")); 126 if (value.inherits(&JSNode::s_info)) 127 return jsString(exec, String("node")); 128 if (value.inherits(&JSNodeList::s_info)) 129 return jsString(exec, String("array")); 130 if (value.inherits(&JSHTMLCollection::s_info)) 131 return jsString(exec, String("array")); 132 return jsUndefined(); 133 } 134 93 135 JSValue JSInjectedScriptHost::inspect(ExecState* exec) 94 136 { -
trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
r85035 r85722 40 40 #include "V8BindingState.h" 41 41 #include "V8Database.h" 42 #include "V8HTMLAllCollection.h" 43 #include "V8HTMLCollection.h" 42 44 #include "V8HiddenPropertyName.h" 45 #include "V8NodeList.h" 43 46 #include "V8Node.h" 44 47 #include "V8Proxy.h" … … 90 93 } 91 94 95 v8::Handle<v8::Value> V8InjectedScriptHost::isHTMLAllCollectionCallback(const v8::Arguments& args) 96 { 97 INC_STATS("InjectedScriptHost.isHTMLAllCollectionCallback()"); 98 if (args.Length() < 1) 99 return v8::Undefined(); 100 101 if (!args[0]->IsObject()) 102 return v8::False(); 103 104 v8::HandleScope handleScope; 105 return v8::Boolean::New(V8HTMLAllCollection::HasInstance(args[0])); 106 } 107 108 v8::Handle<v8::Value> V8InjectedScriptHost::typeCallback(const v8::Arguments& args) 109 { 110 INC_STATS("InjectedScriptHost.typeCallback()"); 111 if (args.Length() < 1) 112 return v8::Undefined(); 113 114 v8::Handle<v8::Value> value = args[0]; 115 if (value->IsString()) 116 return v8::String::New("string"); 117 if (value->IsArray()) 118 return v8::String::New("array"); 119 if (value->IsBoolean()) 120 return v8::String::New("boolean"); 121 if (value->IsNumber()) 122 return v8::String::New("number"); 123 if (value->IsDate()) 124 return v8::String::New("date"); 125 if (value->IsRegExp()) 126 return v8::String::New("regexp"); 127 if (V8Node::HasInstance(value)) 128 return v8::String::New("node"); 129 if (V8NodeList::HasInstance(value)) 130 return v8::String::New("array"); 131 if (V8HTMLCollection::HasInstance(value)) 132 return v8::String::New("array"); 133 return v8::Undefined(); 134 } 135 92 136 v8::Handle<v8::Value> V8InjectedScriptHost::inspectCallback(const v8::Arguments& args) 93 137 { -
trunk/Source/WebCore/inspector/InjectedScriptHost.idl
r85035 r85722 39 39 [Custom] DOMObject inspectedNode(in int num); 40 40 [Custom] DOMObject internalConstructorName(in DOMObject object); 41 [Custom] boolean isHTMLAllCollection(in DOMObject object); 42 [Custom] DOMString type(in DOMObject object); 41 43 42 44 [Custom] int databaseId(in DOMObject database); -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r85596 r85722 346 346 { 347 347 // document.all is reported as undefined, but we still want to process it. 348 return (typeof object === "undefined") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;348 return (typeof object === "undefined") && InjectedScriptHost.isHTMLAllCollection(object); 349 349 }, 350 350 … … 362 362 } 363 363 364 // If owning frame has navigated to somewhere else window properties will be undefined. 365 // In this case just return result of the typeof. 366 if (!inspectedWindow.document) 367 return type; 368 369 if (obj instanceof inspectedWindow.Node) 370 return "node"; 371 if (obj instanceof inspectedWindow.String) 372 return "string"; 373 if (obj instanceof inspectedWindow.Array) 374 return "array"; 375 if (obj instanceof inspectedWindow.Boolean) 376 return "boolean"; 377 if (obj instanceof inspectedWindow.Number) 378 return "number"; 379 if (obj instanceof inspectedWindow.Date) 380 return "date"; 381 if (obj instanceof inspectedWindow.RegExp) 382 return "regexp"; 364 var preciseType = InjectedScriptHost.type(obj); 365 if (preciseType) 366 return preciseType; 367 383 368 // FireBug's array detection. 384 369 try { … … 388 373 return "array"; 389 374 } catch (e) { 390 return type; 391 } 392 if (obj instanceof inspectedWindow.NodeList) 393 return "array"; 394 if (obj instanceof inspectedWindow.HTMLCollection) 395 return "array"; 375 } 376 377 // If owning frame has navigated to somewhere else window properties will be undefined. 378 // In this case just return result of the typeof. 396 379 return type; 397 380 },
Note: See TracChangeset
for help on using the changeset viewer.