Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
LayoutTests:
        Reviewed by Darin.

        - Update results for http://bugs.webkit.org/show_bug.cgi?id=13919
          Autogenerate the JS bindings for the CSSRule and its subclasses

        * fast/dom/Window/window-properties-expected.txt: adds new constructors
        * fast/dom/wrapper-classes-expected.txt: CSSStyleRule now passes!!

WebCore:

        Reviewed by Darin.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=13919
        Autogenerate the JS bindings for the CSSRule and its subclasses

        - subclasses generated are CSSCharsetRule, CSSFontFaceRule, CSSImportRule
          CSSMediaRule, CSSPageRule and CSSStyleRule.

        * DerivedSources.make:
        * WebCore.pro:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCSSRuleCustom.cpp: Added.
        (WebCore::toJS):
        * bindings/js/kjs_css.cpp:
        * bindings/js/kjs_css.h:
        * bindings/objc/DOMUtility.mm:
        (KJS::createDOMWrapper):
        * bindings/scripts/CodeGeneratorJS.pm:
        * css/CSSCharsetRule.h:
        (WebCore::CSSCharsetRule::setEncoding):
        * css/CSSCharsetRule.idl:
        * css/CSSFontFaceRule.idl:
        * css/CSSImportRule.idl:
        * css/CSSMediaRule.idl:
        * css/CSSPageRule.cpp:
        (WebCore::CSSPageRule::setSelectorText):
        * css/CSSPageRule.h:
        * css/CSSPageRule.idl:
        * css/CSSRule.cpp:
        (WebCore::CSSRule::setCssText):
        * css/CSSRule.h:
        * css/CSSRule.idl:
        * css/CSSStyleRule.cpp:
        (WebCore::CSSStyleRule::setSelectorText):
        * css/CSSStyleRule.h:
        * css/CSSStyleRule.idl:
        * page/DOMWindow.idl: add new constructors.



Canonical link: https://commits.webkit.org/18264@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Sam Weinig committed May 30, 2007
1 parent 446a75c commit da064cb
Show file tree
Hide file tree
Showing 27 changed files with 316 additions and 312 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2007-05-30 Sam Weinig <sam@webkit.org>

Reviewed by Darin.

- Update results for http://bugs.webkit.org/show_bug.cgi?id=13919
Autogenerate the JS bindings for the CSSRule and its subclasses

* fast/dom/Window/window-properties-expected.txt: adds new constructors
* fast/dom/wrapper-classes-expected.txt: CSSStyleRule now passes!!

2007-05-30 Oliver Hunt <oliver@apple.com>

Reviewed by Mitz.
Expand Down
49 changes: 49 additions & 0 deletions LayoutTests/fast/dom/Window/window-properties-expected.txt
Expand Up @@ -69,6 +69,53 @@ window.CDATASection.prototype.replaceChild [function]
window.CDATASection.prototype.replaceData [function]
window.CDATASection.prototype.splitText [function]
window.CDATASection.prototype.substringData [function]
window.CSSCharsetRule [object CSSCharsetRuleConstructor]
window.CSSCharsetRule.prototype [object CSSCharsetRulePrototype]
window.CSSCharsetRule.prototype.CHARSET_RULE [number]
window.CSSCharsetRule.prototype.FONT_FACE_RULE [number]
window.CSSCharsetRule.prototype.IMPORT_RULE [number]
window.CSSCharsetRule.prototype.MEDIA_RULE [number]
window.CSSCharsetRule.prototype.PAGE_RULE [number]
window.CSSCharsetRule.prototype.STYLE_RULE [number]
window.CSSCharsetRule.prototype.UNKNOWN_RULE [number]
window.CSSFontFaceRule [object CSSFontFaceRuleConstructor]
window.CSSFontFaceRule.prototype [object CSSFontFaceRulePrototype]
window.CSSFontFaceRule.prototype.CHARSET_RULE [number]
window.CSSFontFaceRule.prototype.FONT_FACE_RULE [number]
window.CSSFontFaceRule.prototype.IMPORT_RULE [number]
window.CSSFontFaceRule.prototype.MEDIA_RULE [number]
window.CSSFontFaceRule.prototype.PAGE_RULE [number]
window.CSSFontFaceRule.prototype.STYLE_RULE [number]
window.CSSFontFaceRule.prototype.UNKNOWN_RULE [number]
window.CSSImportRule [object CSSImportRuleConstructor]
window.CSSImportRule.prototype [object CSSImportRulePrototype]
window.CSSImportRule.prototype.CHARSET_RULE [number]
window.CSSImportRule.prototype.FONT_FACE_RULE [number]
window.CSSImportRule.prototype.IMPORT_RULE [number]
window.CSSImportRule.prototype.MEDIA_RULE [number]
window.CSSImportRule.prototype.PAGE_RULE [number]
window.CSSImportRule.prototype.STYLE_RULE [number]
window.CSSImportRule.prototype.UNKNOWN_RULE [number]
window.CSSMediaRule [object CSSMediaRuleConstructor]
window.CSSMediaRule.prototype [object CSSMediaRulePrototype]
window.CSSMediaRule.prototype.CHARSET_RULE [number]
window.CSSMediaRule.prototype.FONT_FACE_RULE [number]
window.CSSMediaRule.prototype.IMPORT_RULE [number]
window.CSSMediaRule.prototype.MEDIA_RULE [number]
window.CSSMediaRule.prototype.PAGE_RULE [number]
window.CSSMediaRule.prototype.STYLE_RULE [number]
window.CSSMediaRule.prototype.UNKNOWN_RULE [number]
window.CSSMediaRule.prototype.deleteRule [function]
window.CSSMediaRule.prototype.insertRule [function]
window.CSSPageRule [object CSSPageRuleConstructor]
window.CSSPageRule.prototype [object CSSPageRulePrototype]
window.CSSPageRule.prototype.CHARSET_RULE [number]
window.CSSPageRule.prototype.FONT_FACE_RULE [number]
window.CSSPageRule.prototype.IMPORT_RULE [number]
window.CSSPageRule.prototype.MEDIA_RULE [number]
window.CSSPageRule.prototype.PAGE_RULE [number]
window.CSSPageRule.prototype.STYLE_RULE [number]
window.CSSPageRule.prototype.UNKNOWN_RULE [number]
window.CSSPrimitiveValue [object CSSPrimitiveValueConstructor]
window.CSSPrimitiveValue.CSS_ATTR [number]
window.CSSPrimitiveValue.CSS_CM [number]
Expand Down Expand Up @@ -160,6 +207,8 @@ window.CSSStyleDeclaration.prototype.isPropertyImplicit [function]
window.CSSStyleDeclaration.prototype.item [function]
window.CSSStyleDeclaration.prototype.removeProperty [function]
window.CSSStyleDeclaration.prototype.setProperty [function]
window.CSSStyleRule [object CSSStyleRuleConstructor]
window.CSSStyleRule.prototype [printed above as window.CSSRule.prototype]
window.CSSValue [object CSSValueConstructor]
window.CSSValue.CSS_CUSTOM [number]
window.CSSValue.CSS_INHERIT [number]
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/dom/wrapper-classes-expected.txt
Expand Up @@ -66,7 +66,7 @@ PASS jsWrapperClass(stylesheet) is 'CSSStyleSheet'
PASS objCWrapperClass(stylesheet) is 'DOMCSSStyleSheet'
PASS jsWrapperClass(stylesheet.cssRules) is 'CSSRuleList'
PASS objCWrapperClass(stylesheet.cssRules) is 'DOMCSSRuleList'
FAIL jsWrapperClass(stylesheet.cssRules.item(0)) should be CSSStyleRule. Was CSSRule.
PASS jsWrapperClass(stylesheet.cssRules.item(0)) is 'CSSStyleRule'
PASS objCWrapperClass(stylesheet.cssRules.item(0)) is 'DOMCSSStyleRule'
PASS jsWrapperClass(stylesheet.cssRules.item(0).style) is 'CSSStyleDeclaration'
PASS objCWrapperClass(stylesheet.cssRules.item(0).style) is 'DOMCSSStyleDeclaration'
Expand Down
40 changes: 40 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,43 @@
2007-05-30 Sam Weinig <sam@webkit.org>

Reviewed by Darin.

Patch for http://bugs.webkit.org/show_bug.cgi?id=13919
Autogenerate the JS bindings for the CSSRule and its subclasses

- subclasses generated are CSSCharsetRule, CSSFontFaceRule, CSSImportRule
CSSMediaRule, CSSPageRule and CSSStyleRule.

* DerivedSources.make:
* WebCore.pro:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp: Added.
(WebCore::toJS):
* bindings/js/kjs_css.cpp:
* bindings/js/kjs_css.h:
* bindings/objc/DOMUtility.mm:
(KJS::createDOMWrapper):
* bindings/scripts/CodeGeneratorJS.pm:
* css/CSSCharsetRule.h:
(WebCore::CSSCharsetRule::setEncoding):
* css/CSSCharsetRule.idl:
* css/CSSFontFaceRule.idl:
* css/CSSImportRule.idl:
* css/CSSMediaRule.idl:
* css/CSSPageRule.cpp:
(WebCore::CSSPageRule::setSelectorText):
* css/CSSPageRule.h:
* css/CSSPageRule.idl:
* css/CSSRule.cpp:
(WebCore::CSSRule::setCssText):
* css/CSSRule.h:
* css/CSSRule.idl:
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):
* css/CSSStyleRule.h:
* css/CSSStyleRule.idl:
* page/DOMWindow.idl: add new constructors.

2007-05-30 Mark Rowe <mrowe@apple.com>

Build fixes after r21889. Add missing #includes.
Expand Down
6 changes: 6 additions & 0 deletions WebCore/DerivedSources.make
Expand Up @@ -300,9 +300,15 @@ all : \
HTMLEntityNames.c \
JSAttr.h \
JSCDATASection.h \
JSCSSCharsetRule.h \
JSCSSFontFaceRule.h \
JSCSSImportRule.h \
JSCSSMediaRule.h \
JSCSSPageRule.h \
JSCSSPrimitiveValue.h \
JSCSSRule.h \
JSCSSRuleList.h \
JSCSSStyleRule.h \
JSCSSValue.h \
JSCSSValueList.h \
JSCanvasGradient.h \
Expand Down
7 changes: 7 additions & 0 deletions WebCore/WebCore.pro
Expand Up @@ -161,10 +161,16 @@ LUT_TABLE_FILES += \

IDL_BINDINGS += \
css/Counter.idl \
css/CSSCharsetRule.idl \
css/CSSFontFaceRule.idl \
css/CSSImportRule.idl \
css/CSSMediaRule.idl \
css/CSSPageRule.idl \
css/CSSPrimitiveValue.idl \
css/CSSRule.idl \
css/CSSRuleList.idl \
css/CSSStyleDeclaration.idl \
css/CSSStyleRule.idl \
css/CSSValue.idl \
css/CSSValueList.idl \
css/MediaList.idl \
Expand Down Expand Up @@ -268,6 +274,7 @@ IDL_BINDINGS += \

SOURCES += \
bindings/js/JSCanvasRenderingContext2DCustom.cpp \
bindings/js/JSCSSRuleCustom.cpp \
bindings/js/JSCSSStyleDeclarationCustom.cpp \
bindings/js/JSCustomXPathNSResolver.cpp \
bindings/js/JSDocumentCustom.cpp \
Expand Down
52 changes: 52 additions & 0 deletions WebCore/WebCore.xcodeproj/project.pbxproj
Expand Up @@ -2767,6 +2767,19 @@
BC3C39B60C0D3D8D005F4D7A /* JSMediaList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */; };
BC3C39B70C0D3D8D005F4D7A /* JSMediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */; };
BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */; settings = {ATTRIBUTES = (); }; };
BC46C1EE0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */; };
BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */; };
BC46C1FB0C0DDC8F0020CFC3 /* JSCSSCharsetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F10C0DDC8F0020CFC3 /* JSCSSCharsetRule.h */; };
BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */; };
BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */; };
BC46C1FE0C0DDC8F0020CFC3 /* JSCSSImportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F40C0DDC8F0020CFC3 /* JSCSSImportRule.cpp */; };
BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F50C0DDC8F0020CFC3 /* JSCSSImportRule.h */; };
BC46C2000C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F60C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp */; };
BC46C2010C0DDC8F0020CFC3 /* JSCSSMediaRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F70C0DDC8F0020CFC3 /* JSCSSMediaRule.h */; };
BC46C2020C0DDC8F0020CFC3 /* JSCSSPageRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F80C0DDC8F0020CFC3 /* JSCSSPageRule.cpp */; };
BC46C2030C0DDC8F0020CFC3 /* JSCSSPageRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F90C0DDC8F0020CFC3 /* JSCSSPageRule.h */; };
BC46C2060C0DDCA10020CFC3 /* JSCSSStyleRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C2040C0DDCA10020CFC3 /* JSCSSStyleRule.cpp */; };
BC46C2070C0DDCA10020CFC3 /* JSCSSStyleRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C2050C0DDCA10020CFC3 /* JSCSSStyleRule.h */; };
BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */; };
BC4918C70BFEA050009D6316 /* JSHTMLFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4918C10BFEA050009D6316 /* JSHTMLFrameElement.h */; };
BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4918C20BFEA050009D6316 /* JSHTMLIFrameElement.cpp */; };
Expand Down Expand Up @@ -6027,6 +6040,19 @@
BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaList.cpp; sourceTree = "<group>"; };
BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSMediaList.h; sourceTree = "<group>"; };
BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformScrollBar.h; sourceTree = "<group>"; };
BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSRuleCustom.cpp; sourceTree = "<group>"; };
BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSCharsetRule.cpp; sourceTree = "<group>"; };
BC46C1F10C0DDC8F0020CFC3 /* JSCSSCharsetRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSCharsetRule.h; sourceTree = "<group>"; };
BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSFontFaceRule.cpp; sourceTree = "<group>"; };
BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSFontFaceRule.h; sourceTree = "<group>"; };
BC46C1F40C0DDC8F0020CFC3 /* JSCSSImportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSImportRule.cpp; sourceTree = "<group>"; };
BC46C1F50C0DDC8F0020CFC3 /* JSCSSImportRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSImportRule.h; sourceTree = "<group>"; };
BC46C1F60C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSMediaRule.cpp; sourceTree = "<group>"; };
BC46C1F70C0DDC8F0020CFC3 /* JSCSSMediaRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSMediaRule.h; sourceTree = "<group>"; };
BC46C1F80C0DDC8F0020CFC3 /* JSCSSPageRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSPageRule.cpp; sourceTree = "<group>"; };
BC46C1F90C0DDC8F0020CFC3 /* JSCSSPageRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSPageRule.h; sourceTree = "<group>"; };
BC46C2040C0DDCA10020CFC3 /* JSCSSStyleRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleRule.cpp; sourceTree = "<group>"; };
BC46C2050C0DDCA10020CFC3 /* JSCSSStyleRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleRule.h; sourceTree = "<group>"; };
BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameElement.cpp; sourceTree = "<group>"; };
BC4918C10BFEA050009D6316 /* JSHTMLFrameElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLFrameElement.h; sourceTree = "<group>"; };
BC4918C20BFEA050009D6316 /* JSHTMLIFrameElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLIFrameElement.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6418,6 +6444,16 @@
93F9B6DF0BA0FB7200854064 /* JSComment.h */,
930705D709E0C9B700B17FE4 /* JSCounter.cpp */,
930705D909E0C9BF00B17FE4 /* JSCounter.h */,
BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */,
BC46C1F10C0DDC8F0020CFC3 /* JSCSSCharsetRule.h */,
BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */,
BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */,
BC46C1F40C0DDC8F0020CFC3 /* JSCSSImportRule.cpp */,
BC46C1F50C0DDC8F0020CFC3 /* JSCSSImportRule.h */,
BC46C1F60C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp */,
BC46C1F70C0DDC8F0020CFC3 /* JSCSSMediaRule.h */,
BC46C1F80C0DDC8F0020CFC3 /* JSCSSPageRule.cpp */,
BC46C1F90C0DDC8F0020CFC3 /* JSCSSPageRule.h */,
930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */,
930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */,
14CF7B3109F6ECD700EB3665 /* JSCSSRule.cpp */,
Expand All @@ -6426,6 +6462,8 @@
A8D05FA60A23B301005E7203 /* JSCSSRuleList.h */,
142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */,
142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */,
BC46C2040C0DDCA10020CFC3 /* JSCSSStyleRule.cpp */,
BC46C2050C0DDCA10020CFC3 /* JSCSSStyleRule.h */,
14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */,
14CF78A509F58CD800EB3665 /* JSCSSValue.h */,
A8D05FA90A23B30F005E7203 /* JSCSSValueList.cpp */,
Expand Down Expand Up @@ -9197,6 +9235,7 @@
BC4EDEF70C08F414007EDD49 /* Custom */ = {
isa = PBXGroup;
children = (
BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */,
1A9EF4560A1B957D00332B63 /* JSCanvasRenderingContext2DCustom.cpp */,
BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */,
Expand Down Expand Up @@ -11444,6 +11483,12 @@
BC6D44ED0C07F2ED0072D2C9 /* JSHTMLEmbedElement.h in Headers */,
BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */,
BC3C39B70C0D3D8D005F4D7A /* JSMediaList.h in Headers */,
BC46C1FB0C0DDC8F0020CFC3 /* JSCSSCharsetRule.h in Headers */,
BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */,
BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */,
BC46C2010C0DDC8F0020CFC3 /* JSCSSMediaRule.h in Headers */,
BC46C2030C0DDC8F0020CFC3 /* JSCSSPageRule.h in Headers */,
BC46C2070C0DDCA10020CFC3 /* JSCSSStyleRule.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -12847,6 +12892,13 @@
BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */,
BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */,
BC3C39B60C0D3D8D005F4D7A /* JSMediaList.cpp in Sources */,
BC46C1EE0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp in Sources */,
BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */,
BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */,
BC46C1FE0C0DDC8F0020CFC3 /* JSCSSImportRule.cpp in Sources */,
BC46C2000C0DDC8F0020CFC3 /* JSCSSMediaRule.cpp in Sources */,
BC46C2020C0DDC8F0020CFC3 /* JSCSSPageRule.cpp in Sources */,
BC46C2060C0DDCA10020CFC3 /* JSCSSStyleRule.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
85 changes: 85 additions & 0 deletions WebCore/bindings/js/JSCSSRuleCustom.cpp
@@ -0,0 +1,85 @@
/*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
* 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 "JSCSSRule.h"

#include "CSSCharsetRule.h"
#include "CSSFontFaceRule.h"
#include "CSSImportRule.h"
#include "CSSMediaRule.h"
#include "CSSPageRule.h"
#include "CSSRule.h"
#include "CSSStyleRule.h"
#include "JSCSSCharsetRule.h"
#include "JSCSSFontFaceRule.h"
#include "JSCSSImportRule.h"
#include "JSCSSMediaRule.h"
#include "JSCSSPageRule.h"
#include "JSCSSStyleRule.h"
#include "kjs_binding.h"

namespace WebCore {

KJS::JSValue* toJS(KJS::ExecState* exec, CSSRule* rule)
{
if (!rule)
return KJS::jsNull();

KJS::ScriptInterpreter* interp = static_cast<KJS::ScriptInterpreter*>(exec->dynamicInterpreter());
KJS::DOMObject* ret = interp->getDOMObject(rule);

if (ret)
return ret;

switch (rule->type()) {
case CSSRule::STYLE_RULE:
ret = new JSCSSStyleRule(exec, static_cast<CSSStyleRule*>(rule));
break;
case CSSRule::MEDIA_RULE:
ret = new JSCSSMediaRule(exec, static_cast<CSSMediaRule*>(rule));
break;
case CSSRule::FONT_FACE_RULE:
ret = new JSCSSFontFaceRule(exec, static_cast<CSSFontFaceRule*>(rule));
break;
case CSSRule::PAGE_RULE:
ret = new JSCSSPageRule(exec, static_cast<CSSPageRule*>(rule));
break;
case CSSRule::IMPORT_RULE:
ret = new JSCSSImportRule(exec, static_cast<CSSImportRule*>(rule));
break;
case CSSRule::CHARSET_RULE:
ret = new JSCSSCharsetRule(exec, static_cast<CSSCharsetRule*>(rule));
break;
default:
ret = new JSCSSRule(exec, rule);
break;
}

interp->putDOMObject(rule, ret);
return ret;
}

} // namespace WebCore

0 comments on commit da064cb

Please sign in to comment.