Commit 5e5675ed authored by weinig's avatar weinig
Browse files

WebCore:

        Reviewed by Adam Roben.

        Fix http://bugs.webkit.org/show_bug.cgi?id=14953
        Implement window.console in WebCore

        - Adds a window.console object that has 4 methods (log, info, warn, and error)
          that send messages to the Chrome.  This moves functionality that was in the
          app down into WebCore.

        * DerivedSources.make:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorJS.pm: Add extended attribute
        to mark attributes as [Replacable] which indicates they can 
        overridden when set.
        * page/Chrome.cpp:
        (WebCore::Chrome::addMessageToConsole): Allow all messages to go
        up to the ChromeClient.
        * page/Console.cpp: Added.
        (WebCore::Console::Console):
        (WebCore::Console::disconnectFrame):
        (WebCore::Console::error):
        (WebCore::Console::info):
        (WebCore::Console::log):
        (WebCore::Console::warn):
        * page/Console.h: Added.
        * page/Console.idl: Added.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::clear):
        (WebCore::DOMWindow::console):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:

LayoutTests:

        Reviewed by Adam Roben.

        Update tests for http://bugs.webkit.org/show_bug.cgi?id=14953
        Implement window.console in WebCore

        * fast/dom/Window/window-properties-expected.txt:
        * http/tests/security/cross-frame-access-put-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3e8594fb
2007-10-27 Sam Weinig <sam@webkit.org>
Reviewed by Adam Roben.
Update tests for http://bugs.webkit.org/show_bug.cgi?id=14953
Implement window.console in WebCore
* fast/dom/Window/window-properties-expected.txt:
* http/tests/security/cross-frame-access-put-expected.txt:
2007-10-27 Matt Lilek <webkit@mattlilek.com>
Update results.
......
......@@ -1170,6 +1170,11 @@ window.clientInformation.vendorSub [string]
window.close [function]
window.closed [boolean]
window.confirm [function]
window.console [object Console]
window.console.error [function]
window.console.info [function]
window.console.log [function]
window.console.warn [function]
window.crypto [undefined]
window.defaultStatus [string]
window.defaultstatus [string]
......
......@@ -413,7 +413,7 @@ ALERT: PASS: window.XPathEvaluator should be '[object XPathEvaluatorConstructor]
ALERT: PASS: window.XPathResult should be '[object XPathResultConstructor]' and is.
ALERT: PASS: window.clientInformation should be '[object Navigator]' and is.
ALERT: PASS: window.closed should be 'false' and is.
ALERT: PASS: window.console should be '[object HTMLPreElement]' and is.
ALERT: PASS: window.console should be '[object Console]' and is.
ALERT: PASS: window.crypto should be 'undefined' and is.
ALERT: PASS: window.defaultStatus should be '' and is.
ALERT: PASS: window.defaultstatus should be '' and is.
......
2007-10-27 Sam Weinig <sam@webkit.org>
Reviewed by Adam Roben.
Fix http://bugs.webkit.org/show_bug.cgi?id=14953
Implement window.console in WebCore
- Adds a window.console object that has 4 methods (log, info, warn, and error)
that send messages to the Chrome. This moves functionality that was in the
app down into WebCore.
* DerivedSources.make:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm: Add extended attribute
to mark attributes as [Replacable] which indicates they can
overridden when set.
* page/Chrome.cpp:
(WebCore::Chrome::addMessageToConsole): Allow all messages to go
up to the ChromeClient.
* page/Console.cpp: Added.
(WebCore::Console::Console):
(WebCore::Console::disconnectFrame):
(WebCore::Console::error):
(WebCore::Console::info):
(WebCore::Console::log):
(WebCore::Console::warn):
* page/Console.h: Added.
* page/Console.idl: Added.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clear):
(WebCore::DOMWindow::console):
* page/DOMWindow.h:
* page/DOMWindow.idl:
2007-10-27 Eric Seidel <eric@webkit.org>
Reviewed by aroben.
......
......@@ -327,6 +327,7 @@ all : \
JSCanvasRenderingContext2D.h \
JSCharacterData.h \
JSComment.h \
JSConsole.h \
JSCounter.h \
JSCSSStyleDeclaration.h \
JSDatabase.h \
......
......@@ -293,6 +293,7 @@ IDL_BINDINGS += \
html/HTMLTitleElement.idl \
html/HTMLUListElement.idl \
page/BarInfo.idl \
page/Console.idl \
page/DOMSelection.idl \
page/DOMWindow.idl \
page/History.idl \
......@@ -605,6 +606,7 @@ SOURCES += \
loader/TextResourceDecoder.cpp \
page/BarInfo.cpp \
page/Chrome.cpp \
page/Console.cpp \
page/ContextMenuController.cpp \
page/DOMSelection.cpp \
page/DOMWindow.cpp \
......
......@@ -408,6 +408,14 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSComment.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSConsole.cpp"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSConsole.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCounter.cpp"
>
......@@ -2502,6 +2510,14 @@
RelativePath="..\page\ChromeClient.h"
>
</File>
<File
RelativePath="..\page\Console.cpp"
>
</File>
<File
RelativePath="..\page\Console.h"
>
</File>
<File
RelativePath="..\page\ContextMenuClient.h"
>
......
......@@ -3298,6 +3298,9 @@
BC06EE040BFD71AA00856E9D /* JSHTMLTableElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC06EE020BFD71AA00856E9D /* JSHTMLTableElement.cpp */; };
BC06EE050BFD71AA00856E9D /* JSHTMLTableElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06EE030BFD71AA00856E9D /* JSHTMLTableElement.h */; };
BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = BC073BA90C399B1F000F5979 /* FloatConversion.h */; };
BC0B36A40CD3C67C00AC7EB5 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */; };
BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0B36A20CD3C67C00AC7EB5 /* Console.h */; };
BC0B36A60CD3C67C00AC7EB5 /* Console.idl in Resources */ = {isa = PBXBuildFile; fileRef = BC0B36A30CD3C67C00AC7EB5 /* Console.idl */; };
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EE40C2641CD009E2349 /* BarInfo.cpp */; };
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EE50C2641CD009E2349 /* BarInfo.h */; };
BC124EFF0C26447A009E2349 /* JSBarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */; };
......@@ -3419,6 +3422,8 @@
BC94D1540C275C8B006BC617 /* History.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94D1510C275C8B006BC617 /* History.h */; };
BC94D1570C275CAB006BC617 /* GlobalHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94D1560C275CAB006BC617 /* GlobalHistory.h */; };
BC94D1590C275CB6006BC617 /* GlobalHistoryMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC94D1580C275CB6006BC617 /* GlobalHistoryMac.mm */; };
BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */; };
BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = BC98543C0CD3D98B00069BC1 /* JSConsole.h */; };
BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */; };
BC9ADD230CC4032600098C4C /* CSSTransformValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9ADD220CC4032600098C4C /* CSSTransformValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC9ADD800CC4092200098C4C /* CSSTransformValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9ADD7F0CC4092200098C4C /* CSSTransformValue.cpp */; };
......@@ -7192,6 +7197,9 @@
BC06F24B06D18A7E004A6FA3 /* XSLTProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTProcessor.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC06F24C06D18A7E004A6FA3 /* XSLTProcessor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = XSLTProcessor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC073BA90C399B1F000F5979 /* FloatConversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FloatConversion.h; sourceTree = "<group>"; };
BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Console.cpp; sourceTree = "<group>"; };
BC0B36A20CD3C67C00AC7EB5 /* Console.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Console.h; sourceTree = "<group>"; };
BC0B36A30CD3C67C00AC7EB5 /* Console.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Console.idl; sourceTree = "<group>"; };
BC124EE40C2641CD009E2349 /* BarInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BarInfo.cpp; sourceTree = "<group>"; };
BC124EE50C2641CD009E2349 /* BarInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BarInfo.h; sourceTree = "<group>"; };
BC124EE60C2641CD009E2349 /* BarInfo.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = BarInfo.idl; sourceTree = "<group>"; };
......@@ -7318,6 +7326,8 @@
BC94D1520C275C8B006BC617 /* History.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = History.idl; sourceTree = "<group>"; };
BC94D1560C275CAB006BC617 /* GlobalHistory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlobalHistory.h; sourceTree = "<group>"; };
BC94D1580C275CB6006BC617 /* GlobalHistoryMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = GlobalHistoryMac.mm; sourceTree = "<group>"; };
BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsole.cpp; sourceTree = "<group>"; };
BC98543C0CD3D98B00069BC1 /* JSConsole.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSConsole.h; sourceTree = "<group>"; };
BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetCustom.cpp; sourceTree = "<group>"; };
BC9ADD220CC4032600098C4C /* CSSTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSTransformValue.h; sourceTree = "<group>"; };
BC9ADD7F0CC4092200098C4C /* CSSTransformValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSTransformValue.cpp; sourceTree = "<group>"; };
......@@ -7688,22 +7698,16 @@
14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
isa = PBXGroup;
children = (
A83B79100CCB001B000B0825 /* Core */,
A83B790E0CCAFF97000B0825 /* CSS */,
A83B79100CCB001B000B0825 /* DOM */,
A83B79120CCB003F000B0825 /* Events */,
A83B79080CCAFF2B000B0825 /* HTML */,
BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */,
BC124EFE0C26447A009E2349 /* JSBarInfo.h */,
BC94D14C0C275C68006BC617 /* JSHistory.cpp */,
BC94D14D0C275C68006BC617 /* JSHistory.h */,
BCFE2F0F0C1B58370020235F /* JSRect.cpp */,
BCFE2F100C1B58370020235F /* JSRect.h */,
BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
A83B79220CCB00F0000B0825 /* XML */,
656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */,
BC9854460CD3DA5F00069BC1 /* Ranges */,
A83B79150CCB0078000B0825 /* Storage */,
A83B790A0CCAFF47000B0825 /* SVG */,
BC9854530CD3DA8F00069BC1 /* Traversal */,
BC9854430CD3D9D000069BC1 /* Window */,
A83B79220CCB00F0000B0825 /* XML */,
A83B790C0CCAFF83000B0825 /* XPath */,
);
name = "Derived Sources";
......@@ -8028,6 +8032,9 @@
14D8238A0AF92DF60004F057 /* Chrome.cpp */,
14D823500AF92A790004F057 /* Chrome.h */,
14D824060AF93AEB0004F057 /* ChromeClient.h */,
BC0B36A10CD3C67C00AC7EB5 /* Console.cpp */,
BC0B36A20CD3C67C00AC7EB5 /* Console.h */,
BC0B36A30CD3C67C00AC7EB5 /* Console.idl */,
065AD4F20B0C2EDA005A2B1D /* ContextMenuClient.h */,
065AD4F30B0C2EDA005A2B1D /* ContextMenuController.cpp */,
065AD4F40B0C2EDA005A2B1D /* ContextMenuController.h */,
......@@ -10059,6 +10066,8 @@
A8D05FAA0A23B30F005E7203 /* JSCSSValueList.h */,
BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */,
BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */,
BCFE2F0F0C1B58370020235F /* JSRect.cpp */,
BCFE2F100C1B58370020235F /* JSRect.h */,
BCE013980C0BEF180043860A /* JSStyleSheet.cpp */,
BCE013990C0BEF180043860A /* JSStyleSheet.h */,
A84EBD820CB8C97700079609 /* JSStyleSheetList.cpp */,
......@@ -10067,7 +10076,7 @@
name = CSS;
sourceTree = "<group>";
};
A83B79100CCB001B000B0825 /* DOM */ = {
A83B79100CCB001B000B0825 /* Core */ = {
isa = PBXGroup;
children = (
65DF31D809D1C122000BE325 /* JSAttr.cpp */,
......@@ -10086,12 +10095,6 @@
65DF31E209D1CC60000BE325 /* JSDocumentType.h */,
65DF31E309D1CC60000BE325 /* JSDOMImplementation.cpp */,
65DF31E409D1CC60000BE325 /* JSDOMImplementation.h */,
1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */,
1ACE53DE0A8D18810022947D /* JSDOMParser.h */,
BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */,
BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */,
1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,
1403BA0E09EB18F800797C7F /* JSDOMWindow.h */,
65DF31E509D1CC60000BE325 /* JSElement.cpp */,
65DF31E609D1CC60000BE325 /* JSElement.h */,
65DF322D09D1DDBC000BE325 /* JSEntity.cpp */,
......@@ -10102,26 +10105,16 @@
BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */,
14DC0D3509FED073007B0235 /* JSNode.cpp */,
14DC0D3609FED073007B0235 /* JSNode.h */,
14115B7009F84CD600CA4FC1 /* JSNodeFilter.cpp */,
14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */,
1A750D8B0A90E521000FF215 /* JSNodeIterator.cpp */,
1A750D8C0A90E521000FF215 /* JSNodeIterator.h */,
BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */,
BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */,
65DF31E909D1CC60000BE325 /* JSNotation.cpp */,
65DF31EA09D1CC60000BE325 /* JSNotation.h */,
65DF31EB09D1CC60000BE325 /* JSProcessingInstruction.cpp */,
65DF31EC09D1CC60000BE325 /* JSProcessingInstruction.h */,
65DF31ED09D1CC60000BE325 /* JSRange.cpp */,
65DF31EE09D1CC60000BE325 /* JSRange.h */,
D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */,
D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */,
65DF31EF09D1CC60000BE325 /* JSText.cpp */,
65DF31F009D1CC60000BE325 /* JSText.h */,
1A750D5A0A90DEE1000FF215 /* JSTreeWalker.cpp */,
1A750D5B0A90DEE1000FF215 /* JSTreeWalker.h */,
);
name = DOM;
name = Core;
sourceTree = "<group>";
};
A83B79120CCB003F000B0825 /* Events */ = {
......@@ -10167,9 +10160,12 @@
A83B79220CCB00F0000B0825 /* XML */ = {
isa = PBXGroup;
children = (
1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */,
1ACE53DE0A8D18810022947D /* JSDOMParser.h */,
656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */,
1ACE53F40A8D19470022947D /* JSXMLSerializer.cpp */,
1ACE53F50A8D19470022947D /* JSXMLSerializer.h */,
656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */,
);
name = XML;
sourceTree = "<group>";
......@@ -11038,6 +11034,49 @@
name = Custom;
sourceTree = "<group>";
};
BC9854430CD3D9D000069BC1 /* Window */ = {
isa = PBXGroup;
children = (
BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */,
BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */,
1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,
1403BA0E09EB18F800797C7F /* JSDOMWindow.h */,
BC98543B0CD3D98B00069BC1 /* JSConsole.cpp */,
BC98543C0CD3D98B00069BC1 /* JSConsole.h */,
BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */,
BC124EFE0C26447A009E2349 /* JSBarInfo.h */,
BC94D14C0C275C68006BC617 /* JSHistory.cpp */,
BC94D14D0C275C68006BC617 /* JSHistory.h */,
BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */,
BCEC01C10C274DDD009F4EC9 /* JSScreen.h */,
);
name = Window;
sourceTree = "<group>";
};
BC9854460CD3DA5F00069BC1 /* Ranges */ = {
isa = PBXGroup;
children = (
65DF31ED09D1CC60000BE325 /* JSRange.cpp */,
65DF31EE09D1CC60000BE325 /* JSRange.h */,
D23CA55E0AB0EAB6005108A5 /* JSRangeException.cpp */,
D23CA55C0AB0EAAE005108A5 /* JSRangeException.h */,
);
name = Ranges;
sourceTree = "<group>";
};
BC9854530CD3DA8F00069BC1 /* Traversal */ = {
isa = PBXGroup;
children = (
14115B7009F84CD600CA4FC1 /* JSNodeFilter.cpp */,
14115B7109F84CD600CA4FC1 /* JSNodeFilter.h */,
1A750D8B0A90E521000FF215 /* JSNodeIterator.cpp */,
1A750D8C0A90E521000FF215 /* JSNodeIterator.h */,
1A750D5A0A90DEE1000FF215 /* JSTreeWalker.cpp */,
1A750D5B0A90DEE1000FF215 /* JSTreeWalker.h */,
);
name = Traversal;
sourceTree = "<group>";
};
BCB16BFB0979C38700467741 /* loader */ = {
isa = PBXGroup;
children = (
......@@ -13582,6 +13621,8 @@
A80F3A7D0CCDA324002DD990 /* DOMSVGAngle.h in Headers */,
A80F43520CCDE604002DD990 /* DOMSVGAnimateElementInternal.h in Headers */,
E15863990CD10B730066E2C9 /* TextCodecUserDefined.h in Headers */,
BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */,
BC98543E0CD3D98C00069BC1 /* JSConsole.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -13701,6 +13742,7 @@
A83B78DF0CCAFEC1000B0825 /* SVGFontFaceFormatElement.idl in Resources */,
A83B78E20CCAFEC1000B0825 /* SVGFontFaceElement.idl in Resources */,
A83B78E50CCAFEC1000B0825 /* SVGDefinitionSrcElement.idl in Resources */,
BC0B36A60CD3C67C00AC7EB5 /* Console.idl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -15115,6 +15157,8 @@
A80F393E0CCD971A002DD990 /* JSSVGDefinitionSrcElement.cpp in Sources */,
A80F39590CCD9796002DD990 /* DOMSVGDefinitionSrcElement.mm in Sources */,
E158639A0CD10B730066E2C9 /* TextCodecUserDefined.cpp in Sources */,
BC0B36A40CD3C67C00AC7EB5 /* Console.cpp in Sources */,
BC98543D0CD3D98B00069BC1 /* JSConsole.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1047,6 +1047,8 @@ sub GenerateImplementation
$implIncludes{"JS" . $constructorType . ".h"} = 1;
push(@implContent, " // Shadowing a built-in constructor\n");
push(@implContent, " JSObject::put(exec, \"$name\", value);\n");
} elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) {
push(@implContent, " JSObject::put(exec, \"$name\", value);\n");
} else {
if ($podType) {
push(@implContent, " $podType imp(*impl());\n\n");
......
......@@ -197,7 +197,7 @@ void Chrome::setResizable(bool b) const
void Chrome::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
{
if (source == JSMessageSource && level == ErrorMessageLevel)
if (source == JSMessageSource)
m_client->addMessageToConsole(message, lineNumber, sourceID);
if (InspectorController* inspector = m_page->inspectorController())
......
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "Console.h"
#include "Chrome.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "Page.h"
#include "PlatformString.h"
namespace WebCore {
Console::Console(Frame* frame)
: m_frame(frame)
{
}
void Console::disconnectFrame()
{
m_frame = 0;
}
void Console::error(const String& message)
{
if (!m_frame)
return;
Page* page = m_frame->page();
if (!page)
return;
page->chrome()->addMessageToConsole(JSMessageSource, ErrorMessageLevel, message, 0, m_frame->loader()->url().prettyURL());
}
void Console::info(const String& message)
{
if (!m_frame)
return;
Page* page = m_frame->page();
if (!page)
return;
page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, message, 0, m_frame->loader()->url().prettyURL());
}
void Console::log(const String& message)
{
if (!m_frame)
return;
Page* page = m_frame->page();
if (!page)
return;
page->chrome()->addMessageToConsole(JSMessageSource, LogMessageLevel, message, 0, m_frame->loader()->url().prettyURL());
}
void Console::warn(const String& message)
{
if (!m_frame)
return;
Page* page = m_frame->page();
if (!page)
return;
page->chrome()->addMessageToConsole(JSMessageSource, WarningMessageLevel, message, 0, m_frame->loader()->url().prettyURL());
}
} // namespace WebCore
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef Console_h
#define Console_h
#include "Shared.h"
#include "PlatformString.h"
namespace WebCore {
class Frame;
class Console : public Shared<Console> {
public:
Console(Frame*);
void disconnectFrame();
void error(const String& message);
void info(const String& message);
void log(const String& message);
void warn(const String& message);
private:
Frame* m_frame;
};
} // namespace WebCore
#endif // Console_h
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module window {
interface Console {
void error(in DOMString message);
void info(in DOMString message);
void log(in DOMString message);
void warn(in DOMString message);
};
}
......@@ -31,6 +31,7 @@
#include "CSSRuleList.h"
#include "CSSStyleSelector.h"
#include "Chrome.h"
#include "Console.h"
#include "Database.h"
#include "DOMSelection.h"
#include "Document.h"
......@@ -99,6 +100,10 @@ void DOMWindow::clear()
if (m_toolbar)
m_toolbar->disconnectFrame();
m_toolbar = 0;
if (m_console)
m_console->disconnectFrame();
m_console = 0;
}
Screen* DOMWindow::screen() const
......@@ -157,6 +162,13 @@ BarInfo* DOMWindow::toolbar() const
return m_toolbar.get();
}
Console* DOMWindow::console() const
{
if (!m_console)
m_console = new Console(m_frame);
return m_console.get();
}
DOMSelection* DOMWindow::getSelection()
{
if (!m_selection)
......
......@@ -36,6 +36,7 @@ namespace WebCore {
class BarInfo;
class CSSRuleList;
class CSSStyleDeclaration;
class Console;
class Database;
class DOMSelection;
class Document;
......@@ -43,7 +44,7 @@ namespace WebCore {
class Frame;
class History;
class Screen;
typedef int ExceptionCode;
class DOMWindow : public Shared<DOMWindow> {
......@@ -136,6 +137,8 @@ namespace WebCore {
PassRefPtr<Database> openDatabase(const String& name, const String& version, ExceptionCode&);
#endif
Console* console() const;