Changeset 27161 in webkit
- Timestamp:
- Oct 27, 2007 7:11:55 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r27160 r27161 1 2007-10-27 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Adam Roben. 4 5 Update tests for http://bugs.webkit.org/show_bug.cgi?id=14953 6 Implement window.console in WebCore 7 8 * fast/dom/Window/window-properties-expected.txt: 9 * http/tests/security/cross-frame-access-put-expected.txt: 10 1 11 2007-10-27 Matt Lilek <webkit@mattlilek.com> 2 12 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r26805 r27161 1171 1171 window.closed [boolean] 1172 1172 window.confirm [function] 1173 window.console [object Console] 1174 window.console.error [function] 1175 window.console.info [function] 1176 window.console.log [function] 1177 window.console.warn [function] 1173 1178 window.crypto [undefined] 1174 1179 window.defaultStatus [string] -
trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt
r24743 r27161 414 414 ALERT: PASS: window.clientInformation should be '[object Navigator]' and is. 415 415 ALERT: PASS: window.closed should be 'false' and is. 416 ALERT: PASS: window.console should be '[object HTMLPreElement]' and is.416 ALERT: PASS: window.console should be '[object Console]' and is. 417 417 ALERT: PASS: window.crypto should be 'undefined' and is. 418 418 ALERT: PASS: window.defaultStatus should be '' and is. -
trunk/WebCore/ChangeLog
r27158 r27161 1 2007-10-27 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Adam Roben. 4 5 Fix http://bugs.webkit.org/show_bug.cgi?id=14953 6 Implement window.console in WebCore 7 8 - Adds a window.console object that has 4 methods (log, info, warn, and error) 9 that send messages to the Chrome. This moves functionality that was in the 10 app down into WebCore. 11 12 * DerivedSources.make: 13 * WebCore.pro: 14 * WebCore.vcproj/WebCore.vcproj: 15 * WebCore.xcodeproj/project.pbxproj: 16 * bindings/scripts/CodeGeneratorJS.pm: Add extended attribute 17 to mark attributes as [Replacable] which indicates they can 18 overridden when set. 19 * page/Chrome.cpp: 20 (WebCore::Chrome::addMessageToConsole): Allow all messages to go 21 up to the ChromeClient. 22 * page/Console.cpp: Added. 23 (WebCore::Console::Console): 24 (WebCore::Console::disconnectFrame): 25 (WebCore::Console::error): 26 (WebCore::Console::info): 27 (WebCore::Console::log): 28 (WebCore::Console::warn): 29 * page/Console.h: Added. 30 * page/Console.idl: Added. 31 * page/DOMWindow.cpp: 32 (WebCore::DOMWindow::clear): 33 (WebCore::DOMWindow::console): 34 * page/DOMWindow.h: 35 * page/DOMWindow.idl: 36 1 37 2007-10-27 Eric Seidel <eric@webkit.org> 2 38 -
trunk/WebCore/DerivedSources.make
r26916 r27161 328 328 JSCharacterData.h \ 329 329 JSComment.h \ 330 JSConsole.h \ 330 331 JSCounter.h \ 331 332 JSCSSStyleDeclaration.h \ -
trunk/WebCore/WebCore.pro
r27145 r27161 294 294 html/HTMLUListElement.idl \ 295 295 page/BarInfo.idl \ 296 page/Console.idl \ 296 297 page/DOMSelection.idl \ 297 298 page/DOMWindow.idl \ … … 606 607 page/BarInfo.cpp \ 607 608 page/Chrome.cpp \ 609 page/Console.cpp \ 608 610 page/ContextMenuController.cpp \ 609 611 page/DOMSelection.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r27145 r27161 410 410 </File> 411 411 <File 412 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSConsole.cpp" 413 > 414 </File> 415 <File 416 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSConsole.h" 417 > 418 </File> 419 <File 412 420 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCounter.cpp" 413 421 > … … 2501 2509 <File 2502 2510 RelativePath="..\page\ChromeClient.h" 2511 > 2512 </File> 2513 <File 2514 RelativePath="..\page\Console.cpp" 2515 > 2516 </File> 2517 <File 2518 RelativePath="..\page\Console.h" 2503 2519 > 2504 2520 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r27145 r27161 3299 3299 BC06EE050BFD71AA00856E9D /* JSHTMLTableElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06EE030BFD71AA00856E9D /* JSHTMLTableElement.h */; }; 3300 3300 BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = BC073BA90C399B1F000F5979 /* FloatConversion.h */; }; 3301 BC0B36A40CD3C67C00AC7EB5 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */; }; 3302 BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0B36A20CD3C67C00AC7EB5 /* Console.h */; }; 3303 BC0B36A60CD3C67C00AC7EB5 /* Console.idl in Resources */ = {isa = PBXBuildFile; fileRef = BC0B36A30CD3C67C00AC7EB5 /* Console.idl */; }; 3301 3304 BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EE40C2641CD009E2349 /* BarInfo.cpp */; }; 3302 3305 BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EE50C2641CD009E2349 /* BarInfo.h */; }; … … 3420 3423 BC94D1570C275CAB006BC617 /* GlobalHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94D1560C275CAB006BC617 /* GlobalHistory.h */; }; 3421 3424 BC94D1590C275CB6006BC617 /* GlobalHistoryMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC94D1580C275CB6006BC617 /* GlobalHistoryMac.mm */; }; 3425 BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */; }; 3426 BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = BC98543C0CD3D98B00069BC1 /* JSConsole.h */; }; 3422 3427 BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */; }; 3423 3428 BC9ADD230CC4032600098C4C /* CSSTransformValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9ADD220CC4032600098C4C /* CSSTransformValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7193 7198 BC06F24C06D18A7E004A6FA3 /* XSLTProcessor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = XSLTProcessor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 7194 7199 BC073BA90C399B1F000F5979 /* FloatConversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FloatConversion.h; sourceTree = "<group>"; }; 7200 BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Console.cpp; sourceTree = "<group>"; }; 7201 BC0B36A20CD3C67C00AC7EB5 /* Console.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Console.h; sourceTree = "<group>"; }; 7202 BC0B36A30CD3C67C00AC7EB5 /* Console.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Console.idl; sourceTree = "<group>"; }; 7195 7203 BC124EE40C2641CD009E2349 /* BarInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BarInfo.cpp; sourceTree = "<group>"; }; 7196 7204 BC124EE50C2641CD009E2349 /* BarInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BarInfo.h; sourceTree = "<group>"; }; … … 7319 7327 BC94D1560C275CAB006BC617 /* GlobalHistory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlobalHistory.h; sourceTree = "<group>"; }; 7320 7328 BC94D1580C275CB6006BC617 /* GlobalHistoryMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = GlobalHistoryMac.mm; sourceTree = "<group>"; }; 7329 BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsole.cpp; sourceTree = "<group>"; }; 7330 BC98543C0CD3D98B00069BC1 /* JSConsole.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSConsole.h; sourceTree = "<group>"; }; 7321 7331 BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetCustom.cpp; sourceTree = "<group>"; }; 7322 7332 BC9ADD220CC4032600098C4C /* CSSTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSTransformValue.h; sourceTree = "<group>"; }; … … 7689 7699 isa = PBXGroup; 7690 7700 children = ( 7701 A83B79100CCB001B000B0825 /* Core */, 7691 7702 A83B790E0CCAFF97000B0825 /* CSS */, 7692 A83B79100CCB001B000B0825 /* DOM */,7693 7703 A83B79120CCB003F000B0825 /* Events */, 7694 7704 A83B79080CCAFF2B000B0825 /* HTML */, 7695 BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */, 7696 BC124EFE0C26447A009E2349 /* JSBarInfo.h */, 7697 BC94D14C0C275C68006BC617 /* JSHistory.cpp */, 7698 BC94D14D0C275C68006BC617 /* JSHistory.h */, 7699 BCFE2F0F0C1B58370020235F /* JSRect.cpp */, 7700 BCFE2F100C1B58370020235F /* JSRect.h */, 7701 BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */, 7702 BCEC01C10C274DDD009F4EC9 /* JSScreen.h */, 7703 A83B79220CCB00F0000B0825 /* XML */, 7704 656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */, 7705 BC9854460CD3DA5F00069BC1 /* Ranges */, 7705 7706 A83B79150CCB0078000B0825 /* Storage */, 7706 7707 A83B790A0CCAFF47000B0825 /* SVG */, 7708 BC9854530CD3DA8F00069BC1 /* Traversal */, 7709 BC9854430CD3D9D000069BC1 /* Window */, 7710 A83B79220CCB00F0000B0825 /* XML */, 7707 7711 A83B790C0CCAFF83000B0825 /* XPath */, 7708 7712 ); … … 8029 8033 14D823500AF92A790004F057 /* Chrome.h */, 8030 8034 14D824060AF93AEB0004F057 /* ChromeClient.h */, 8035 BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */, 8036 BC0B36A20CD3C67C00AC7EB5 /* Console.h */, 8037 BC0B36A30CD3C67C00AC7EB5 /* Console.idl */, 8031 8038 065AD4F20B0C2EDA005A2B1D /* ContextMenuClient.h */, 8032 8039 065AD4F30B0C2EDA005A2B1D /* ContextMenuController.cpp */, … … 10060 10067 BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */, 10061 10068 BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */, 10069 BCFE2F0F0C1B58370020235F /* JSRect.cpp */, 10070 BCFE2F100C1B58370020235F /* JSRect.h */, 10062 10071 BCE013980C0BEF180043860A /* JSStyleSheet.cpp */, 10063 10072 BCE013990C0BEF180043860A /* JSStyleSheet.h */, … … 10068 10077 sourceTree = "<group>"; 10069 10078 }; 10070 A83B79100CCB001B000B0825 /* DOM*/ = {10079 A83B79100CCB001B000B0825 /* Core */ = { 10071 10080 isa = PBXGroup; 10072 10081 children = ( … … 10087 10096 65DF31E309D1CC60000BE325 /* JSDOMImplementation.cpp */, 10088 10097 65DF31E409D1CC60000BE325 /* JSDOMImplementation.h */, 10089 1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */,10090 1ACE53DE0A8D18810022947D /* JSDOMParser.h */,10091 BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */,10092 BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */,10093 1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,10094 1403BA0E09EB18F800797C7F /* JSDOMWindow.h */,10095 10098 65DF31E509D1CC60000BE325 /* JSElement.cpp */, 10096 10099 65DF31E609D1CC60000BE325 /* JSElement.h */, … … 10103 10106 14DC0D3509FED073007B0235 /* JSNode.cpp */, 10104 10107 14DC0D3609FED073007B0235 /* JSNode.h */, 10105 14115B7009F84CD600CA4FC1 /* JSNodeFilter.cpp */,10106 14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */,10107 1A750D8B0A90E521000FF215 /* JSNodeIterator.cpp */,10108 1A750D8C0A90E521000FF215 /* JSNodeIterator.h */,10109 10108 BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */, 10110 10109 BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */, … … 10113 10112 65DF31EB09D1CC60000BE325 /* JSProcessingInstruction.cpp */, 10114 10113 65DF31EC09D1CC60000BE325 /* JSProcessingInstruction.h */, 10115 65DF31ED09D1CC60000BE325 /* JSRange.cpp */,10116 65DF31EE09D1CC60000BE325 /* JSRange.h */,10117 D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */,10118 D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */,10119 10114 65DF31EF09D1CC60000BE325 /* JSText.cpp */, 10120 10115 65DF31F009D1CC60000BE325 /* JSText.h */, 10121 1A750D5A0A90DEE1000FF215 /* JSTreeWalker.cpp */,10122 1A750D5B0A90DEE1000FF215 /* JSTreeWalker.h */,10123 10116 ); 10124 name = DOM;10117 name = Core; 10125 10118 sourceTree = "<group>"; 10126 10119 }; … … 10168 10161 isa = PBXGroup; 10169 10162 children = ( 10163 1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */, 10164 1ACE53DE0A8D18810022947D /* JSDOMParser.h */, 10170 10165 656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */, 10171 10166 1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */, 10172 10167 1ACE53F50A8D19470022947D /* JSXMLSerializer.h */, 10168 656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */, 10173 10169 ); 10174 10170 name = XML; … … 11037 11033 ); 11038 11034 name = Custom; 11035 sourceTree = "<group>"; 11036 }; 11037 BC9854430CD3D9D000069BC1 /* Window */ = { 11038 isa = PBXGroup; 11039 children = ( 11040 BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */, 11041 BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */, 11042 1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */, 11043 1403BA0E09EB18F800797C7F /* JSDOMWindow.h */, 11044 BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */, 11045 BC98543C0CD3D98B00069BC1 /* JSConsole.h */, 11046 BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */, 11047 BC124EFE0C26447A009E2349 /* JSBarInfo.h */, 11048 BC94D14C0C275C68006BC617 /* JSHistory.cpp */, 11049 BC94D14D0C275C68006BC617 /* JSHistory.h */, 11050 BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */, 11051 BCEC01C10C274DDD009F4EC9 /* JSScreen.h */, 11052 ); 11053 name = Window; 11054 sourceTree = "<group>"; 11055 }; 11056 BC9854460CD3DA5F00069BC1 /* Ranges */ = { 11057 isa = PBXGroup; 11058 children = ( 11059 65DF31ED09D1CC60000BE325 /* JSRange.cpp */, 11060 65DF31EE09D1CC60000BE325 /* JSRange.h */, 11061 D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */, 11062 D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */, 11063 ); 11064 name = Ranges; 11065 sourceTree = "<group>"; 11066 }; 11067 BC9854530CD3DA8F00069BC1 /* Traversal */ = { 11068 isa = PBXGroup; 11069 children = ( 11070 14115B7009F84CD600CA4FC1 /* JSNodeFilter.cpp */, 11071 14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */, 11072 1A750D8B0A90E521000FF215 /* JSNodeIterator.cpp */, 11073 1A750D8C0A90E521000FF215 /* JSNodeIterator.h */, 11074 1A750D5A0A90DEE1000FF215 /* JSTreeWalker.cpp */, 11075 1A750D5B0A90DEE1000FF215 /* JSTreeWalker.h */, 11076 ); 11077 name = Traversal; 11039 11078 sourceTree = "<group>"; 11040 11079 }; … … 13583 13622 A80F43520CCDE604002DD990 /* DOMSVGAnimateElementInternal.h in Headers */, 13584 13623 E15863990CD10B730066E2C9 /* TextCodecUserDefined.h in Headers */, 13624 BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */, 13625 BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */, 13585 13626 ); 13586 13627 runOnlyForDeploymentPostprocessing = 0; … … 13702 13743 A83B78E20CCAFEC1000B0825 /* SVGFontFaceElement.idl in Resources */, 13703 13744 A83B78E50CCAFEC1000B0825 /* SVGDefinitionSrcElement.idl in Resources */, 13745 BC0B36A60CD3C67C00AC7EB5 /* Console.idl in Resources */, 13704 13746 ); 13705 13747 runOnlyForDeploymentPostprocessing = 0; … … 15116 15158 A80F39590CCD9796002DD990 /* DOMSVGDefinitionSrcElement.mm in Sources */, 15117 15159 E158639A0CD10B730066E2C9 /* TextCodecUserDefined.cpp in Sources */, 15160 BC0B36A40CD3C67C00AC7EB5 /* Console.cpp in Sources */, 15161 BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */, 15118 15162 ); 15119 15163 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r26956 r27161 1047 1047 $implIncludes{"JS" . $constructorType . ".h"} = 1; 1048 1048 push(@implContent, " // Shadowing a built-in constructor\n"); 1049 push(@implContent, " JSObject::put(exec, \"$name\", value);\n"); 1050 } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { 1049 1051 push(@implContent, " JSObject::put(exec, \"$name\", value);\n"); 1050 1052 } else { -
trunk/WebCore/page/Chrome.cpp
r26816 r27161 198 198 void Chrome::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID) 199 199 { 200 if (source == JSMessageSource && level == ErrorMessageLevel)200 if (source == JSMessageSource) 201 201 m_client->addMessageToConsole(message, lineNumber, sourceID); 202 202 -
trunk/WebCore/page/DOMWindow.cpp
r26877 r27161 32 32 #include "CSSStyleSelector.h" 33 33 #include "Chrome.h" 34 #include "Console.h" 34 35 #include "Database.h" 35 36 #include "DOMSelection.h" … … 100 101 m_toolbar->disconnectFrame(); 101 102 m_toolbar = 0; 103 104 if (m_console) 105 m_console->disconnectFrame(); 106 m_console = 0; 102 107 } 103 108 … … 158 163 } 159 164 165 Console* DOMWindow::console() const 166 { 167 if (!m_console) 168 m_console = new Console(m_frame); 169 return m_console.get(); 170 } 171 160 172 DOMSelection* DOMWindow::getSelection() 161 173 { -
trunk/WebCore/page/DOMWindow.h
r26877 r27161 37 37 class CSSRuleList; 38 38 class CSSStyleDeclaration; 39 class Console; 39 40 class Database; 40 41 class DOMSelection; … … 44 45 class History; 45 46 class Screen; 46 47 47 48 typedef int ExceptionCode; 48 49 … … 137 138 #endif 138 139 140 Console* console() const; 141 139 142 private: 140 143 Frame* m_frame; … … 148 151 mutable RefPtr<BarInfo> m_statusbar; 149 152 mutable RefPtr<BarInfo> m_toolbar; 153 mutable RefPtr<Console> m_console; 150 154 }; 151 155 -
trunk/WebCore/page/DOMWindow.idl
r26877 r27161 115 115 raises(DOMException); 116 116 #endif 117 118 attribute [Replaceable] Console console; 117 119 118 120 #if defined(LANGUAGE_JAVASCRIPT)
Note: See TracChangeset
for help on using the changeset viewer.