Commit 6d270f6f authored by weinig@apple.com's avatar weinig@apple.com

WebCore:

        Reviewed by Mark Rowe.

        Move JSClipboard into its own file.

        * DerivedSources.make:
        * GNUmakefile.am:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * bindings/js/JSAttrCustom.cpp:
        * bindings/js/JSClipboardCustom.cpp: Added.
        (WebCore::JSClipboard::types):
        (WebCore::JSClipboard::clearData):
        (WebCore::JSClipboard::getData):
        (WebCore::JSClipboard::setData):
        (WebCore::JSClipboard::setDragImage):
        * bindings/js/JSElementCustom.cpp:
        * bindings/js/JSEventCustom.cpp:
        * bindings/js/JSHTMLFrameElementCustom.cpp:
        * bindings/js/JSHTMLIFrameElementCustom.cpp:
        * bindings/js/kjs_events.cpp:
        * bindings/js/kjs_events.h:
        * bindings/js/kjs_window.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        * dom/Clipboard.cpp:
        (WebCore::Clipboard::setDropEffect):
        (WebCore::Clipboard::setEffectAllowed):
        * dom/Clipboard.idl: Added.

LayoutTests:

        Reviewed by Mark Rowe.

        Update test results.

        * fast/dom/Window/window-properties-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b1f7256e
2008-03-03 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
Update test results.
* fast/dom/Window/window-properties-expected.txt:
2008-03-03 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
......@@ -264,6 +264,12 @@ window.CharacterData.prototype.removeEventListener [function]
window.CharacterData.prototype.replaceChild [function]
window.CharacterData.prototype.replaceData [function]
window.CharacterData.prototype.substringData [function]
window.Clipboard [object ClipboardConstructor]
window.Clipboard.prototype [object ClipboardPrototype]
window.Clipboard.prototype.clearData [function]
window.Clipboard.prototype.getData [function]
window.Clipboard.prototype.setData [function]
window.Clipboard.prototype.setDragImage [function]
window.Comment [object CommentConstructor]
window.Comment.prototype [printed above as window.CharacterData.prototype]
window.Counter [object CounterConstructor]
......
2008-03-03 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
Move JSClipboard into its own file.
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* bindings/js/JSAttrCustom.cpp:
* bindings/js/JSClipboardCustom.cpp: Added.
(WebCore::JSClipboard::types):
(WebCore::JSClipboard::clearData):
(WebCore::JSClipboard::getData):
(WebCore::JSClipboard::setData):
(WebCore::JSClipboard::setDragImage):
* bindings/js/JSElementCustom.cpp:
* bindings/js/JSEventCustom.cpp:
* bindings/js/JSHTMLFrameElementCustom.cpp:
* bindings/js/JSHTMLIFrameElementCustom.cpp:
* bindings/js/kjs_events.cpp:
* bindings/js/kjs_events.h:
* bindings/js/kjs_window.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
* dom/Clipboard.cpp:
(WebCore::Clipboard::setDropEffect):
(WebCore::Clipboard::setEffectAllowed):
* dom/Clipboard.idl: Added.
2008-03-03 Sam Weinig <sam@webkit.org>
Windows build-fix.
......@@ -321,6 +321,7 @@ all : \
JSCSSPrimitiveValue.h \
JSCSSRule.h \
JSCSSRuleList.h \
JSCSSStyleDeclaration.h \
JSCSSStyleRule.h \
JSCSSStyleSheet.h \
JSCSSValue.h \
......@@ -330,10 +331,10 @@ all : \
JSCanvasPixelArray.h \
JSCanvasRenderingContext2D.h \
JSCharacterData.h \
JSClipboard.h \
JSComment.h \
JSConsole.h \
JSCounter.h \
JSCSSStyleDeclaration.h \
JSDOMCoreException.h \
JSDOMImplementation.h \
JSDOMParser.h \
......@@ -599,7 +600,6 @@ all : \
XMLNames.cpp \
XPathGrammar.cpp \
kjs_css.lut.h \
kjs_events.lut.h \
kjs_navigator.lut.h \
kjs_window.lut.h \
tokenizer.cpp \
......
......@@ -53,7 +53,6 @@ webcore_built_nosources += \
WebCore/bindings/js/JSXMLHttpRequest.lut.h \
WebCore/bindings/js/JSXSLTProcessor.lut.h \
WebCore/bindings/js/kjs_css.lut.h \
WebCore/bindings/js/kjs_events.lut.h \
WebCore/bindings/js/kjs_navigator.lut.h \
WebCore/bindings/js/kjs_window.lut.h \
WebCore/bindings/js/JSHTMLInputElementBaseTable.cpp
......@@ -91,6 +90,7 @@ webcore_built_sources += \
DerivedSources/JSCanvasPixelArray.h \
DerivedSources/JSCanvasRenderingContext2D.h \
DerivedSources/JSCharacterData.h \
DerivedSources/JSClipboard.h \
DerivedSources/JSComment.h \
DerivedSources/JSConsole.h \
DerivedSources/JSCounter.h \
......@@ -342,6 +342,7 @@ IDL_BINDINGS += \
WebCore/css/StyleSheetList.idl \
WebCore/dom/Attr.idl \
WebCore/dom/CharacterData.idl \
WebCore/dom/Clipboard.idl \
WebCore/dom/CDATASection.idl \
WebCore/dom/Comment.idl \
WebCore/dom/DocumentFragment.idl \
......@@ -454,6 +455,7 @@ webcore_sources += \
WebCore/bindings/js/JSAttrCustom.cpp \
WebCore/bindings/js/JSCanvasPixelArrayCustom.cpp \
WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp \
WebCore/bindings/js/JSClipboardCustom.cpp \
WebCore/bindings/js/JSCSSRuleCustom.cpp \
WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp \
WebCore/bindings/js/JSCSSValueCustom.cpp \
......@@ -2054,7 +2056,6 @@ CLEANFILES += \
JSXMLHttpRequest.lut.h \
JSXSLTProcessor.lut.h \
kjs_css.lut.h \
kjs_events.lut.h \
kjs_navigator.lut.h \
kjs_window.lut.h
......@@ -249,7 +249,6 @@ LUT_FILES += \
bindings/js/JSXMLHttpRequest.cpp \
bindings/js/JSXSLTProcessor.cpp \
bindings/js/kjs_css.cpp \
bindings/js/kjs_events.cpp \
bindings/js/kjs_navigator.cpp \
bindings/js/kjs_window.cpp
......@@ -277,6 +276,7 @@ IDL_BINDINGS += \
css/StyleSheetList.idl \
dom/Attr.idl \
dom/CharacterData.idl \
dom/Clipboard.idl \
dom/CDATASection.idl \
dom/Comment.idl \
dom/DocumentFragment.idl \
......@@ -391,6 +391,7 @@ SOURCES += \
bindings/js/JSAttrCustom.cpp \
bindings/js/JSCanvasPixelArrayCustom.cpp \
bindings/js/JSCanvasRenderingContext2DCustom.cpp \
bindings/js/JSClipboardCustom.cpp \
bindings/js/JSCSSRuleCustom.cpp \
bindings/js/JSCSSStyleDeclarationCustom.cpp \
bindings/js/JSCSSValueCustom.cpp \
......
......@@ -372,6 +372,14 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCharacterData.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSClipboard.cpp"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSClipboard.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSComment.cpp"
>
......@@ -2512,10 +2520,6 @@
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\kjs_css.lut.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\kjs_events.lut.h"
>
</File>
<File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\kjs_html.lut.h"
>
......@@ -7571,6 +7575,10 @@
RelativePath="..\bindings\js\JSCanvasRenderingContext2DCustom.cpp"
>
</File>
<File
RelativePath="..\bindings\js\JSClipboardCustom.cpp"
>
</File>
<File
RelativePath="..\bindings\js\JSCSSRuleCustom.cpp"
>
......
......@@ -477,7 +477,6 @@
656581EE09D1508D000E61D7 /* JSXMLHttpRequest.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */; };
656581F009D1508D000E61D7 /* JSXSLTProcessor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */; };
656581F109D1508D000E61D7 /* kjs_css.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DA09D1508D000E61D7 /* kjs_css.lut.h */; };
656581F309D1508D000E61D7 /* kjs_events.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DC09D1508D000E61D7 /* kjs_events.lut.h */; };
656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */; };
656581F809D1508D000E61D7 /* kjs_window.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E109D1508D000E61D7 /* kjs_window.lut.h */; };
656581FE09D1508D000E61D7 /* SVGElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E709D1508D000E61D7 /* SVGElementFactory.h */; };
......@@ -3566,6 +3565,10 @@
BCA379140D163E5500B793D6 /* JSLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA379120D163E5500B793D6 /* JSLocation.cpp */; };
BCA379150D163E5500B793D6 /* JSLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA379130D163E5500B793D6 /* JSLocation.h */; };
BCA3793F0D1647E000B793D6 /* JSLocation.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA3793E0D1647E000B793D6 /* JSLocation.lut.h */; };
BCA83E370D7CDC4E003421A8 /* Clipboard.idl in Resources */ = {isa = PBXBuildFile; fileRef = BCA83E360D7CDC4E003421A8 /* Clipboard.idl */; };
BCA83E4F0D7CE1E9003421A8 /* JSClipboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA83E4D0D7CE1E9003421A8 /* JSClipboard.cpp */; };
BCA83E500D7CE1E9003421A8 /* JSClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA83E4E0D7CE1E9003421A8 /* JSClipboard.h */; };
BCA83E520D7CE205003421A8 /* JSClipboardCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */; };
BCA85A100C3AEAF4006F8308 /* DOMSVGNumberInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */; };
BCAA90C30A7EBA60008B1229 /* ScrollBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */; };
BCB16C170979C3BD00467741 /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* Cache.cpp */; };
......@@ -3621,7 +3624,6 @@
BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */; };
BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */; };
BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */; };
BCD9C2C60C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */; };
BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE013980C0BEF180043860A /* JSStyleSheet.cpp */; };
BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE013990C0BEF180043860A /* JSStyleSheet.h */; };
BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */; };
......@@ -4760,7 +4762,6 @@
656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequest.lut.h; sourceTree = "<group>"; };
656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXSLTProcessor.lut.h; sourceTree = "<group>"; };
656581DA09D1508D000E61D7 /* kjs_css.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_css.lut.h; sourceTree = "<group>"; };
656581DC09D1508D000E61D7 /* kjs_events.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_events.lut.h; sourceTree = "<group>"; };
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_navigator.lut.h; sourceTree = "<group>"; };
656581E109D1508D000E61D7 /* kjs_window.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_window.lut.h; sourceTree = "<group>"; };
656581E609D1508D000E61D7 /* SVGElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGElementFactory.cpp; sourceTree = "<group>"; };
......@@ -7670,6 +7671,10 @@
BCA379120D163E5500B793D6 /* JSLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLocation.cpp; sourceTree = "<group>"; };
BCA379130D163E5500B793D6 /* JSLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLocation.h; sourceTree = "<group>"; };
BCA3793E0D1647E000B793D6 /* JSLocation.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLocation.lut.h; sourceTree = "<group>"; };
BCA83E360D7CDC4E003421A8 /* Clipboard.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Clipboard.idl; sourceTree = "<group>"; };
BCA83E4D0D7CE1E9003421A8 /* JSClipboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClipboard.cpp; sourceTree = "<group>"; };
BCA83E4E0D7CE1E9003421A8 /* JSClipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClipboard.h; sourceTree = "<group>"; };
BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClipboardCustom.cpp; sourceTree = "<group>"; };
BCA85A0F0C3AEAF4006F8308 /* DOMSVGNumberInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGNumberInternal.h; sourceTree = "<group>"; };
BCAA90C20A7EBA60008B1229 /* ScrollBar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollBar.cpp; path = platform/ScrollBar.cpp; sourceTree = SOURCE_ROOT; };
BCB16BFE0979C3BD00467741 /* Cache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cache.cpp; sourceTree = "<group>"; };
......@@ -7723,7 +7728,6 @@
BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNamedNodeMap.h; sourceTree = "<group>"; };
BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeList.cpp; sourceTree = "<group>"; };
BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeList.h; sourceTree = "<group>"; };
BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMExceptionConstructor.lut.h; sourceTree = "<group>"; };
BCE013980C0BEF180043860A /* JSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheet.cpp; sourceTree = "<group>"; };
BCE013990C0BEF180043860A /* JSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSStyleSheet.h; sourceTree = "<group>"; };
BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagNodeList.cpp; sourceTree = "<group>"; };
......@@ -8236,10 +8240,8 @@
6565814B09D13043000E61D7 /* HTMLEntityNames.c */,
A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
A8D06B370A265DCD005E7203 /* HTMLNames.h */,
BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */,
BCA3793E0D1647E000B793D6 /* JSLocation.lut.h */,
656581DA09D1508D000E61D7 /* kjs_css.lut.h */,
656581DC09D1508D000E61D7 /* kjs_events.lut.h */,
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */,
656581E109D1508D000E61D7 /* kjs_window.lut.h */,
656581E609D1508D000E61D7 /* SVGElementFactory.cpp */,
......@@ -10503,6 +10505,8 @@
93F9B79F0BA6032600854064 /* JSCDATASection.h */,
65DF31DF09D1CC60000BE325 /* JSCharacterData.cpp */,
65DF31E009D1CC60000BE325 /* JSCharacterData.h */,
BCA83E4D0D7CE1E9003421A8 /* JSClipboard.cpp */,
BCA83E4E0D7CE1E9003421A8 /* JSClipboard.h */,
93F9B6DE0BA0FB7200854064 /* JSComment.cpp */,
93F9B6DF0BA0FB7200854064 /* JSComment.h */,
659DDC8009E198BA001BF3C6 /* JSDocument.cpp */,
......@@ -11521,9 +11525,10 @@
BC4EDEF70C08F414007EDD49 /* Custom */ = {
isa = PBXGroup;
children = (
A766F3520D6BDE3500ABDDB3 /* JSCanvasPixelArrayCustom.cpp */,
BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
A766F3520D6BDE3500ABDDB3 /* JSCanvasPixelArrayCustom.cpp */,
1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
BCA83E510D7CE205003421A8 /* JSClipboardCustom.cpp */,
BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */,
BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
......@@ -12195,6 +12200,7 @@
BC904B730D10998F00680D32 /* ClassNodeList.h */,
A784941A0B5FE507001E237A /* Clipboard.cpp */,
85031B280A44EFC700F992E0 /* Clipboard.h */,
BCA83E360D7CDC4E003421A8 /* Clipboard.idl */,
4B8AF4A90B1CE02B00687690 /* ClipboardAccessPolicy.h */,
85031B290A44EFC700F992E0 /* ClipboardEvent.cpp */,
85031B2A0A44EFC700F992E0 /* ClipboardEvent.h */,
......@@ -13405,7 +13411,6 @@
51EC926A0CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.h in Headers */,
1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */,
E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */,
BCD9C2C60C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h in Headers */,
65DF31F809D1CC60000BE325 /* JSDOMImplementation.h in Headers */,
1ACE53E00A8D18810022947D /* JSDOMParser.h in Headers */,
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
......@@ -14157,7 +14162,6 @@
656581F109D1508D000E61D7 /* kjs_css.lut.h in Headers */,
93B70D6809EB0C7C009D8468 /* kjs_dom.h in Headers */,
93B70D6A09EB0C7C009D8468 /* kjs_events.h in Headers */,
656581F309D1508D000E61D7 /* kjs_events.lut.h in Headers */,
93B70D6C09EB0C7C009D8468 /* kjs_html.h in Headers */,
93B70D6E09EB0C7C009D8468 /* kjs_navigator.h in Headers */,
656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */,
......@@ -14229,6 +14233,7 @@
1AF3264A0D78B5530068F0C4 /* WebCoreScriptDebugger.h in Headers */,
1AF326780D78B9440068F0C4 /* AXObjectCache.h in Headers */,
1AF3267B0D78B94E0068F0C4 /* GlobalHistory.h in Headers */,
BCA83E500D7CE1E9003421A8 /* JSClipboard.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -14343,6 +14348,7 @@
1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
A77979180D6B9D0C003851B9 /* CanvasPixelArray.idl in Resources */,
A779791B0D6B9D0C003851B9 /* ImageData.idl in Resources */,
BCA83E370D7CDC4E003421A8 /* Clipboard.idl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -15824,6 +15830,8 @@
1AF326470D78B5530068F0C4 /* GlobalHistoryMac.mm in Sources */,
1AF326490D78B5530068F0C4 /* WebCoreAXObject.mm in Sources */,
1AF3264B0D78B5530068F0C4 /* WebCoreScriptDebugger.mm in Sources */,
BCA83E4F0D7CE1E9003421A8 /* JSClipboard.cpp in Sources */,
BCA83E520D7CE205003421A8 /* JSClipboardCustom.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -39,6 +39,7 @@ This file contains the list of files needed to build WebCore.
bindings/js/JSAudioConstructor.cpp
bindings/js/JSCanvasPixelArrayCustom.cpp
bindings/js/JSCanvasRenderingContext2DCustom.cpp
bindings/js/JSClipboardCustom.cpp
bindings/js/JSCSSRuleCustom.cpp
bindings/js/JSCSSStyleDeclarationCustom.cpp
bindings/js/JSCSSValueCustom.cpp
......@@ -171,6 +172,7 @@ This file contains the list of files needed to build WebCore.
DerivedSources/WebCore/JSCanvasPixelArray.cpp
DerivedSources/WebCore/JSCanvasRenderingContext2D.cpp
DerivedSources/WebCore/JSCharacterData.cpp
DerivedSources/WebCore/JSClipboard.cpp
DerivedSources/WebCore/JSComment.cpp
DerivedSources/WebCore/JSConsole.cpp
DerivedSources/WebCore/JSCounter.cpp
......
......@@ -32,6 +32,7 @@
#include "CSSHelper.h"
#include "HTMLFrameElementBase.h"
#include "HTMLNames.h"
#include "kjs_dom.h"
using namespace KJS;
......
/*
* Copyright (C) 2008 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 "JSClipboard.h"
#include "Clipboard.h"
#include "Element.h"
#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "IntPoint.h"
#include "JSNode.h"
#include "Node.h"
#include "PlatformString.h"
#include "StringHash.h"
#include <kjs/array_object.h>
#include <wtf/HashSet.h>
using namespace KJS;
namespace WebCore {
using namespace HTMLNames;
JSValue* JSClipboard::types(ExecState* exec) const
{
Clipboard* clipboard = impl();
HashSet<String> types = clipboard->types();
if (types.isEmpty())
return jsNull();
List list;
HashSet<String>::const_iterator end = types.end();
for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it)
list.append(jsString(UString(*it)));
return exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, list);
}
JSValue* JSClipboard::clearData(ExecState* exec, const List& args)
{
Clipboard* clipboard = impl();
if (args.size() == 0) {
clipboard->clearAllData();
return jsUndefined();
}
if (args.size() == 1) {
clipboard->clearData(args[0]->toString(exec));
return jsUndefined();
}
// FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments.
return throwError(exec, SyntaxError, "clearData: Invalid number of arguments");
}
JSValue* JSClipboard::getData(ExecState* exec, const List& args)
{
// FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments.
if (args.size() != 1)
return throwError(exec, SyntaxError, "getData: Invalid number of arguments");
Clipboard* clipboard = impl();
bool success;
String result = clipboard->getData(args[0]->toString(exec), success);
if (!success)
return jsUndefined();
return jsString(result);
}
JSValue* JSClipboard::setData(ExecState* exec, const List& args)
{
Clipboard* clipboard = impl();
// FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments.
if (args.size() != 2)
return throwError(exec, SyntaxError, "setData: Invalid number of arguments");
return jsBoolean(clipboard->setData(args[0]->toString(exec), args[1]->toString(exec)));
}
JSValue* JSClipboard::setDragImage(ExecState* exec, const List& args)
{
Clipboard* clipboard = impl();
if (!clipboard->isForDragging())
return jsUndefined();
// FIXME: It does not match the rest of the JS bindings to throw on invalid number of arguments.
if (args.size() != 3)
return throwError(exec, SyntaxError, "setDragImage: Invalid number of arguments");
int x = args[1]->toInt32(exec);
int y = args[2]->toInt32(exec);
// See if they passed us a node
Node* node = toNode(args[0]);
if (!node)
return throwError(exec, TypeError);
// FIXME: This should probably be a TypeError.
if (!node->isElementNode())
return throwError(exec, SyntaxError, "setDragImageFromElement: Invalid first argument");
if (static_cast<Element*>(node)->hasLocalName(imgTag) && !node->inDocument())
clipboard->setDragImage(static_cast<HTMLImageElement*>(node)->cachedImage(), IntPoint(x, y));
else
clipboard->setDragImageElement(node, IntPoint(x, y));
return jsUndefined();
}
} // namespace WebCore
......@@ -34,6 +34,7 @@
#include "ExceptionCode.h"
#include "HTMLFrameElementBase.h"
#include "HTMLNames.h"
#include "kjs_dom.h"
using namespace KJS;
......
......@@ -31,6 +31,7 @@
#include "Clipboard.h"
#include "Event.h"
#include "JSClipboard.h"
#include "JSKeyboardEvent.h"
#include "JSMouseEvent.h"
#include "JSMutationEvent.h"
......
......@@ -31,6 +31,7 @@
#include "CSSHelper.h"
#include "HTMLFrameElement.h"
#include "kjs_dom.h"
using namespace KJS;
......
......@@ -31,6 +31,7 @@
#include "CSSHelper.h"
#include "HTMLIFrameElement.h"
#include "kjs_dom.h"
using namespace KJS;
......
......@@ -22,23 +22,19 @@
#include "CString.h"
#include "Chrome.h"
#include "Clipboard.h"
#include "ClipboardEvent.h"
#include "DOMWindow.h"
#include "Document.h"
#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "JSDOMWindow.h"
#include "JSEvent.h"
#include "JSEventTargetNode.h"
#include "Page.h"
#include "kjs_dom.h"
#include "kjs_proxy.h"
#include "kjs_window.h"
#include <kjs/array_object.h>
#include <kjs/function_object.h>
#include "kjs_events.lut.h"
......@@ -48,7 +44,6 @@ using namespace KJS;
namespace WebCore {
using namespace EventNames;
using namespace HTMLNames;
JSAbstractEventListener::JSAbstractEventListener(bool html)
: m_html(html)
......@@ -341,180 +336,4 @@ JSValue* getNodeEventListener(EventTargetNode* n, const AtomicString& eventType)
return jsNull();
}
// -------------------------------------------------------------------------
const ClassInfo JSClipboard::info = { "Clipboard", 0, &JSClipboardTable };
/* Source for JSClipboardTable. Use "make hashtables" to regenerate.
@begin JSClipboardTable 3
dropEffect WebCore::JSClipboard::DropEffect DontDelete
effectAllowed WebCore::JSClipboard::EffectAllowed DontDelete
types WebCore::JSClipboard::Types DontDelete|ReadOnly
@end
@begin JSClipboardPrototypeTable 4
clearData WebCore::jsClipboardPrototypeFunctionClearData DontDelete|Function 0
getData WebCore::jsClipboardPrototypeFunctionGetData DontDelete|Function 1
setData WebCore::jsClipboardPrototypeFunctionSetData DontDelete|Function 2
setDragImage WebCore::jsClipboardPrototypeFunctionSetDragImage DontDelete|Function 3
@end
*/
KJS_DEFINE_PROTOTYPE(JSClipboardPrototype)
KJS_IMPLEMENT_PROTOTYPE("Clipboard", JSClipboardPrototype)
JSClipboard::JSClipboard(JSObject* prototype, Clipboard* clipboard)
: DOMObject(prototype)
, m_impl(clipboard)
{
}
JSClipboard::~JSClipboard()
{
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
bool JSClipboard::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSClipboard, DOMObject>(exec, &JSClipboardTable, this, propertyName, slot);
}
JSValue* JSClipboard::getValueProperty(ExecState* exec, int token) const
{
Clipboard* clipboard = impl();
switch (token) {
case DropEffect:
ASSERT(clipboard->isForDragging() || clipboard->dropEffect().isNull());
return jsStringOrUndefined(clipboard->dropEffect());
case EffectAllowed:
ASSERT(clipboard->isForDragging() || clipboard->effectAllowed().isNull());
return jsStringOrUndefined(clipboard->effectAllowed());
case Types:
{
HashSet<String> types = clipboard->types();
if (types.isEmpty())
return jsNull();
else {
List list;
HashSet<String>::const_iterator end = types.end();
for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it)
list.append(jsString(UString(*it)));
return exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, list);
}
}
default:
return 0;
}
}
void JSClipboard::put(ExecState* exec, const Identifier& propertyName, JSValue* value)
{
lookupPut<JSClipboard, DOMObject>(exec, propertyName, value, &JSClipboardTable, this);
}
void JSClipboard::putValueProperty(ExecState* exec, int token, JSValue* value)
{
Clipboard* clipboard = impl();
switch (token) {
case DropEffect:
// can never set this when not for dragging, thus getting always returns NULL string
if (clipboard->isForDragging())
clipboard->setDropEffect(value->toString(exec));
break;
case EffectAllowed:
// can never set this when not for dragging, thus getting always returns NULL string
if (clipboard->isForDragging())
clipboard->setEffectAllowed(value->toString(exec));
break;
}
}
JSValue* jsClipboardPrototypeFunctionClearData(ExecState* exec, JSObject* thisObj, const List& args)
{
if (!thisObj->inherits(&JSClipboard::info))
return throwError(exec, TypeError);