+2006-04-03 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - http://bugzilla.opendarwin.org/show_bug.cgi?id=8147
+ convert derived sources script to a Makefile
+
+ * DerivedSources.make: Added.
+ * css/CSSPrimitiveValue.idl: Added.
+ * css/Counter.idl: Added.
+ * css/StyleSheet.idl: Added.
+
+ * WebCore.xcodeproj/project.pbxproj: Added new generated files, IDLs, and the makefile.
+ * bindings/scripts/CodeGeneratorJS.pm:
+
+ * generate-derived-sources: Added license header. Removed most of the script, except for
+ a single invocation of make.
+
+ * khtml/ecma/kjs_css.h: Removed DOMStyleSheet, DOMCSSPrimitiveValue,
+ CSSPrimitiveValueConstructor, and DOMCounter.
+ * khtml/ecma/kjs_css.cpp:
+ (KJS::DOMCSSStyleSheet::DOMCSSStyleSheet): Changed to use JSStyleSheet as the base class.
+ (KJS::DOMCSSStyleSheet::getOwnPropertySlot): Ditto.
+ (KJS::DOMCSSValueProtoFunc::callAsFunction): Added.
+ (KJS::toJS): Changed to use JSCSSPrimitiveValue.
+ (KJS::DOMRGBColor::getValueProperty): Changed to call toJS instead of making a
+ DOMCSSPrimitiveValue directly.
+
2006-04-03 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
--- /dev/null
+# Copyright (C) 2006 Apple Computer, 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.
+
+VPATH = \
+ $(WebCore) \
+ $(WebCore)/bindings/js \
+ $(WebCore)/css \
+ $(WebCore)/dom \
+ $(WebCore)/html \
+ $(WebCore)/khtml/ecma \
+#
+
+.PHONY : all
+all : \
+ CSSGrammar.cpp \
+ CSSPropertyNames.h \
+ CSSValueKeywords.h \
+ CharsetData.cpp \
+ ColorData.c \
+ DocTypeStrings.cpp \
+ HTMLEntityNames.c \
+ JSAttr.h \
+ JSCanvasGradient.h \
+ JSCanvasPattern.h \
+ JSCanvasRenderingContext2D.h \
+ JSCanvasRenderingContext2DBaseTable.cpp \
+ JSCounter.h \
+ JSCharacterData.h \
+ JSCSSPrimitiveValue.h \
+ JSDOMImplementation.h \
+ JSDOMParser.lut.h \
+ JSDocumentType.h \
+ JSElement.h \
+ JSEntity.h \
+ JSKeyboardEvent.h \
+ JSMouseEvent.h \
+ JSMutationEvent.h \
+ JSNotation.h \
+ JSProcessingInstruction.h \
+ JSRange.h \
+ JSStyleSheet.h \
+ JSText.h \
+ JSUIEvent.h \
+ JSWheelEvent.h \
+ JSXMLHttpRequest.lut.h \
+ JSXMLSerializer.lut.h \
+ JSXSLTProcessor.lut.h \
+ SVGNames.cpp \
+ UserAgentStyleSheets.h \
+ XLinkNames.cpp \
+ kjs_css.lut.h \
+ kjs_dom.lut.h \
+ kjs_events.lut.h \
+ kjs_html.lut.h \
+ kjs_navigator.lut.h \
+ kjs_traversal.lut.h \
+ kjs_views.lut.h \
+ kjs_window.lut.h \
+ ksvgcssproperties.h \
+ ksvgcssvalues.h \
+ tokenizer.cpp \
+#
+
+# CSS property names and value keywords
+
+CSSPropertyNames.h : css/CSSPropertyNames.in css/makeprop
+ cat $< > CSSPropertyNames.in
+ sh "$(WebCore)/css/makeprop"
+
+CSSValueKeywords.h : css/CSSValueKeywords.in css/makevalues
+ cat $< > CSSValueKeywords.in
+ sh "$(WebCore)/css/makevalues"
+
+# DOCTYPE strings
+
+DocTypeStrings.cpp : html/DocTypeStrings.gperf
+ gperf -CEot -L ANSI-C -k "*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards $< > $@
+
+# HTML entity names
+
+HTMLEntityNames.c : html/HTMLEntityNames.gperf
+ gperf -a -L ANSI-C -C -G -c -o -t -k '*' -N findEntity -D -s 2 $< > $@
+
+# color names
+
+ColorData.c : platform/ColorData.gperf
+ gperf -CDEot -L ANSI-C -k '*' -N findColor -D -s 2 $< > $@
+
+# CSS tokenizer
+
+tokenizer.cpp : css/tokenizer.flex css/maketokenizer
+ flex -t $< | perl $(WebCore)/css/maketokenizer > $@
+
+# CSS grammar
+
+CSSGrammar.cpp : css/CSSGrammar.y
+ bison -d -p cssyy $< -o $@
+ touch CSSGrammar.cpp.h
+ touch CSSGrammar.hpp
+ cat CSSGrammar.cpp.h CSSGrammar.hpp > CSSGrammar.h
+ rm -f CSSGrammar.cpp.h CSSGrammar.hpp
+
+# user agent style sheets
+
+USER_AGENT_STYLE_SHEETS = $(WebCore)/css/html4.css $(WebCore)/css/quirks.css $(WebCore)/css/svg.css
+UserAgentStyleSheets.h : css/make-css-file-arrays.pl $(USER_AGENT_STYLE_SHEETS)
+ $< $@ UserAgentStyleSheetsData.cpp $(USER_AGENT_STYLE_SHEETS)
+
+# character set name table
+
+CharsetData.cpp : platform/make-charset-table.pl platform/character-sets.txt $(ENCODINGS_FILE)
+ $^ $(ENCODINGS_PREFIX) > $@
+
+# lookup tables for old-style JavaScript bindings
+
+%.lut.h: %.cpp $(CREATE_HASH_TABLE)
+ $(CREATE_HASH_TABLE) $< > $@
+%Table.cpp: %.cpp $(CREATE_HASH_TABLE)
+ $(CREATE_HASH_TABLE) $< > $@
+
+# SVG tag and attribute names
+
+SVGNames.cpp : $(WebCore)/ksvg2/scripts/make_names.pl $(WebCore)/ksvg2/svg/svgtags.in $(WebCore)/ksvg2/svg/svgattrs.in
+ $< --tags $(WebCore)/ksvg2/svg/svgtags.in --attrs $(WebCore)/ksvg2/svg/svgattrs.in \
+ --namespace SVG --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output .
+
+XLinkNames.cpp : $(WebCore)/ksvg2/scripts/make_names.pl $(WebCore)/ksvg2/misc/xlinkattrs.in
+ $< --attrs $(WebCore)/ksvg2/misc/xlinkattrs.in \
+ --namespace XLink --cppNamespace WebCore --namespaceURI "http://www.w3.org/1999/xlink" --output .
+ touch $(WebCore)/WebCore+SVG/XLinkNamesWrapper.cpp
+
+# SVG CSS property names and value keywords
+
+ksvgcssproperties.h : $(WebCore)/ksvg2/scripts/cssmakeprops $(WebCore)/css/CSSPropertyNames.in $(WebCore)/ksvg2/css/CSSPropertyNames.in
+ if sort $(WebCore)/css/CSSPropertyNames.in $(WebCore)/ksvg2/css/CSSPropertyNames.in | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
+ cat $(WebCore)/ksvg2/css/CSSPropertyNames.in > ksvgcssproperties.in
+ $(WebCore)/ksvg2/scripts/cssmakeprops -n SVG -f ksvgcssproperties.in
+
+ksvgcssvalues.h : $(WebCore)/ksvg2/scripts/cssmakevalues $(WebCore)/css/CSSValueKeywords.in $(WebCore)/ksvg2/css/CSSValueKeywords.in
+ if sort $(WebCore)/css/CSSValueKeywords.in $(WebCore)/ksvg2/css/CSSValueKeywords.in | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
+ # Lower case all the values, as CSS values are case-insensitive
+ perl -ne 'print lc' $(WebCore)/ksvg2/css/CSSValueKeywords.in > ksvgcssvalues.in
+ $(WebCore)/ksvg2/scripts/cssmakevalues -n SVG -f ksvgcssvalues.in
+
+# new-style JavaScript bindings
+
+JS_BINDINGS_SCRIPTS = \
+ $(WebCore)/bindings/scripts/CodeGenerator.pm \
+ $(WebCore)/bindings/scripts/CodeGeneratorJS.pm \
+ $(WebCore)/bindings/scripts/IDLParser.pm \
+ $(WebCore)/bindings/scripts/IDLStructure.pm \
+ $(WebCore)/bindings/scripts/generate-bindings.pl \
+#
+
+JS%.h : %.idl $(JS_BINDINGS_SCRIPTS)
+ perl -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir . $<
93032CCA09AEC34B00F82A18 /* Path.h in Headers */ = {isa = PBXBuildFile; fileRef = 93032CC909AEC34B00F82A18 /* Path.h */; };
9305B24D098F1B6B00C28855 /* Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305B24C098F1B6B00C28855 /* Timer.h */; };
9307056C09E0AF8F00B17FE4 /* csshelper.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4786097CAAC80094C9E4 /* csshelper.h */; };
+ 930705D809E0C9B700B17FE4 /* JSCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930705D709E0C9B700B17FE4 /* JSCounter.cpp */; };
+ 930705DA09E0C9BF00B17FE4 /* JSCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 930705D909E0C9BF00B17FE4 /* JSCounter.h */; };
+ 930705DC09E0C9DB00B17FE4 /* JSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930705DB09E0C9DB00B17FE4 /* JSStyleSheet.cpp */; };
+ 930705DE09E0C9E000B17FE4 /* JSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 930705DD09E0C9E000B17FE4 /* JSStyleSheet.h */; };
+ 930705E909E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */; };
+ 930705EB09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */; };
930CAD1509C4F3C300229C04 /* JSCanvasRenderingContext2DBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 930CAD1409C4F3C300229C04 /* JSCanvasRenderingContext2DBase.h */; };
930CAD2609C4F49100229C04 /* JSCanvasRenderingContext2DBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930CAD2509C4F49100229C04 /* JSCanvasRenderingContext2DBase.cpp */; };
9326DC0B09DAD5BE00AFC847 /* CharsetData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9326DC0A09DAD5BE00AFC847 /* CharsetData.h */; };
93032CC709AEC34300F82A18 /* PathCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathCG.cpp; sourceTree = "<group>"; };
93032CC909AEC34B00F82A18 /* Path.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Path.h; path = platform/Path.h; sourceTree = "<group>"; };
9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timer.h; path = platform/Timer.h; sourceTree = "<group>"; };
+ 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 4; path = CSSPrimitiveValue.idl; sourceTree = "<group>"; };
+ 9307059109E0C76600B17FE4 /* StyleSheet.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StyleSheet.idl; sourceTree = "<group>"; };
+ 930705C709E0C95F00B17FE4 /* Counter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Counter.idl; sourceTree = "<group>"; };
+ 930705D709E0C9B700B17FE4 /* JSCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSCounter.cpp; path = /Volumes/Spoon/Users/darin/symroots/Debug/DerivedSources/WebCore/JSCounter.cpp; sourceTree = "<absolute>"; };
+ 930705D909E0C9BF00B17FE4 /* JSCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSCounter.h; path = /Volumes/Spoon/Users/darin/symroots/Debug/DerivedSources/WebCore/JSCounter.h; sourceTree = "<absolute>"; };
+ 930705DB09E0C9DB00B17FE4 /* JSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSStyleSheet.cpp; path = /Volumes/Spoon/Users/darin/symroots/Debug/DerivedSources/WebCore/JSStyleSheet.cpp; sourceTree = "<absolute>"; };
+ 930705DD09E0C9E000B17FE4 /* JSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSStyleSheet.h; path = /Volumes/Spoon/Users/darin/symroots/Debug/DerivedSources/WebCore/JSStyleSheet.h; sourceTree = "<absolute>"; };
+ 930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSCSSPrimitiveValue.cpp; path = /Volumes/Spoon/Users/darin/symroots/Debug/DerivedSources/WebCore/JSCSSPrimitiveValue.cpp; sourceTree = "<absolute>"; };
+ 930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSCSSPrimitiveValue.h; path = /Volumes/Spoon/Users/darin/symroots/Debug/DerivedSources/WebCore/JSCSSPrimitiveValue.h; sourceTree = "<absolute>"; };
+ 9307061309E0CA8200B17FE4 /* DerivedSources.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = DerivedSources.make; sourceTree = "<group>"; usesTabs = 1; };
930CAAD609C495B600229C04 /* CanvasRenderingContext2D.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasRenderingContext2D.idl; sourceTree = "<group>"; };
930CAB8809C49EFA00229C04 /* CanvasGradient.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasGradient.idl; sourceTree = "<group>"; };
930CAB8F09C49F1B00229C04 /* CanvasPattern.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CanvasPattern.idl; sourceTree = "<group>"; };
isa = PBXGroup;
children = (
65C97AF208EA908800ACD273 /* config.h */,
+ 9307061309E0CA8200B17FE4 /* DerivedSources.make */,
651B2B6209D12891008808C6 /* generate-derived-sources */,
F58EF58E02DFDFB7018635CA /* WebCore.exp */,
BC1A3790097C6F970019F3D8 /* bindings */,
656581D509D1508D000E61D7 /* JSCanvasRenderingContext2DBaseTable.cpp */,
65DF31DF09D1CC60000BE325 /* JSCharacterData.cpp */,
65DF31E009D1CC60000BE325 /* JSCharacterData.h */,
+ 930705D709E0C9B700B17FE4 /* JSCounter.cpp */,
+ 930705D909E0C9BF00B17FE4 /* JSCounter.h */,
+ 930705E809E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp */,
+ 930705EA09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h */,
65DF31E109D1CC60000BE325 /* JSDocumentType.cpp */,
65DF31E209D1CC60000BE325 /* JSDocumentType.h */,
65DF31E309D1CC60000BE325 /* JSDOMImplementation.cpp */,
65DF31EC09D1CC60000BE325 /* JSProcessingInstruction.h */,
65DF31ED09D1CC60000BE325 /* JSRange.cpp */,
65DF31EE09D1CC60000BE325 /* JSRange.h */,
+ 930705DB09E0C9DB00B17FE4 /* JSStyleSheet.cpp */,
+ 930705DD09E0C9E000B17FE4 /* JSStyleSheet.h */,
65DF31EF09D1CC60000BE325 /* JSText.cpp */,
65DF31F009D1CC60000BE325 /* JSText.h */,
A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */,
F523D18402DE42E8018635CA /* css */ = {
isa = PBXGroup;
children = (
+ 930705C709E0C95F00B17FE4 /* Counter.idl */,
BCEA477A097CAAC80094C9E4 /* css_base.cpp */,
BCEA477B097CAAC80094C9E4 /* css_base.h */,
BCEA477F097CAAC80094C9E4 /* css_ruleimpl.cpp */,
BCEA4786097CAAC80094C9E4 /* csshelper.h */,
BCEA4787097CAAC80094C9E4 /* cssparser.cpp */,
BCEA4788097CAAC80094C9E4 /* cssparser.h */,
+ 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */,
BCEA4789097CAAC80094C9E4 /* CSSPropertyNames.in */,
BCEA478A097CAAC80094C9E4 /* cssstyleselector.cpp */,
BCEA478B097CAAC80094C9E4 /* cssstyleselector.h */,
93CA4C9C09DF93FA00DF8677 /* maketokenizer */,
93CA4C9D09DF93FA00DF8677 /* makevalues */,
93CA4C9F09DF93FA00DF8677 /* quirks.css */,
+ 9307059109E0C76600B17FE4 /* StyleSheet.idl */,
93CA4CA209DF93FA00DF8677 /* svg.css */,
93CA4CA309DF93FA00DF8677 /* tokenizer.flex */,
);
A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */,
9326DC0B09DAD5BE00AFC847 /* CharsetData.h in Headers */,
9307056C09E0AF8F00B17FE4 /* csshelper.h in Headers */,
+ 930705DA09E0C9BF00B17FE4 /* JSCounter.h in Headers */,
+ 930705DE09E0C9E000B17FE4 /* JSStyleSheet.h in Headers */,
+ 930705EB09E0C9F600B17FE4 /* JSCSSPrimitiveValue.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
A86629D409DA2B48009633A5 /* JSKeyboardEvent.cpp in Sources */,
9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */,
+ 930705D809E0C9B700B17FE4 /* JSCounter.cpp in Sources */,
+ 930705DC09E0C9DB00B17FE4 /* JSStyleSheet.cpp in Sources */,
+ 930705E909E0C9F000B17FE4 /* JSCSSPrimitiveValue.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
push(@headerContent, "\n ");
}
- my $value = ucfirst($attribute->signature->name);
+ my $value = ucfirst($attribute->signature->name) . "AttrNum";
$value .= ", " if(($i < $numAttributes - 1));
$value .= ", " if(($i eq $numAttributes - 1) and ($numFunctions ne 0));
push(@headerContent, $value);
push(@headerContent, "\n ");
}
- my $value = ucfirst($function->signature->name);
+ my $value = ucfirst($function->signature->name) . "FuncNum";
$value .= ", " if ($i < $numFunctions - 1);
push(@headerContent, $value);
}
my $name = $attribute->signature->name;
push(@hashKeys, $name);
- my $value = $className . "::" . ucfirst($name);
+ my $value = $className . "::" . ucfirst($name) . "AttrNum";
push(@hashValues, $value);
my $special = "DontDelete";
my $name = $function->signature->name;
push(@hashKeys, $name);
- my $value = $className . "::" . ucfirst($name);
+ my $value = $className . "::" . ucfirst($name) . "FuncNum";
push(@hashValues, $value);
my $special = "DontDelete|Function";
my $name = $attribute->signature->name;
if (!@{$attribute->getterExceptions}) {
- push(@implContent, " case " . ucfirst($name) . ":\n");
+ push(@implContent, " case " . ucfirst($name) . "AttrNum:\n");
push(@implContent, " return " . NativeToJSValue($attribute->signature, "impl->$name()") . ";\n");
} else {
- push(@implContent, " case " . ucfirst($name) .": {\n");
+ push(@implContent, " case " . ucfirst($name) . "AttrNum: {\n");
push(@implContent, " ExceptionCode ec = 0;\n");
push(@implContent, " KJS::JSValue* result = " . NativeToJSValue($attribute->signature, "impl->$name(ec)") . ";\n");
push(@implContent, " setDOMException(exec, ec);\n");
foreach my $attribute (@{$dataNode->attributes}) {
if ($attribute->type !~ /^readonly/) {
my $name = $attribute->signature->name;
- push(@implContent, " case " . ucfirst($name) .": {\n");
+ push(@implContent, " case " . ucfirst($name) ."AttrNum: {\n");
push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
push(@implContent, " impl->set" . ucfirst($name) . "(" . JSValueToNative($attribute->signature, "value"));
push(@implContent, ", ec") if @{$attribute->setterExceptions};
push(@implContent, " switch (id) {\n");
foreach my $function (@{$dataNode->functions}) {
- push(@implContent, " case ${className}::" . ucfirst($function->signature->name) . ": {\n");
+ push(@implContent, " case ${className}::" . ucfirst($function->signature->name) . "FuncNum: {\n");
AddIncludesForType($function->signature->type);
$implIncludes{"css_ruleimpl.h"} = 1;
$implIncludes{"kjs_css.h"} = 1;
return "toJS(exec, $value)";
- } elsif ($type eq "CSSStyleDeclaration" or $type eq "Counter" or $type eq "Rect") {
+ } elsif ($type eq "CSSStyleDeclaration" or $type eq "Rect") {
$implIncludes{"css_valueimpl.h"} = 1;
$implIncludes{"kjs_css.h"} = 1;
return "toJS(exec, $value)";
$implIncludes{"kjs_dom.h"} = 1;
$implIncludes{"HTMLCanvasElement.h"} = 1;
return "toJS(exec, $value)";
- } elsif ($type eq "CanvasGradient") {
- $implIncludes{"JSCanvasGradient.h"} = 1;
- return "toJS(exec, $value)";
- } elsif ($type eq "Range") {
- $implIncludes{"JSRange.h"} = 1;
+ } elsif ($type eq "CanvasGradient" or $type eq "Counter" or $type eq "Range") {
+ $implIncludes{"JS$type.h"} = 1;
return "toJS(exec, $value)";
} elsif ($type eq "views::AbstractView") {
$implIncludes{"kjs_views.h"} = 1;
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module css {
+
+ interface [LegacyParent=KJS::DOMCSSValue] CSSPrimitiveValue : CSSValue {
+
+ // UnitTypes
+ const unsigned short CSS_UNKNOWN = 0;
+ const unsigned short CSS_NUMBER = 1;
+ const unsigned short CSS_PERCENTAGE = 2;
+ const unsigned short CSS_EMS = 3;
+ const unsigned short CSS_EXS = 4;
+ const unsigned short CSS_PX = 5;
+ const unsigned short CSS_CM = 6;
+ const unsigned short CSS_MM = 7;
+ const unsigned short CSS_IN = 8;
+ const unsigned short CSS_PT = 9;
+ const unsigned short CSS_PC = 10;
+ const unsigned short CSS_DEG = 11;
+ const unsigned short CSS_RAD = 12;
+ const unsigned short CSS_GRAD = 13;
+ const unsigned short CSS_MS = 14;
+ const unsigned short CSS_S = 15;
+ const unsigned short CSS_HZ = 16;
+ const unsigned short CSS_KHZ = 17;
+ const unsigned short CSS_DIMENSION = 18;
+ const unsigned short CSS_STRING = 19;
+ const unsigned short CSS_URI = 20;
+ const unsigned short CSS_IDENT = 21;
+ const unsigned short CSS_ATTR = 22;
+ const unsigned short CSS_COUNTER = 23;
+ const unsigned short CSS_RECT = 24;
+ const unsigned short CSS_RGBCOLOR = 25;
+
+ readonly attribute unsigned short primitiveType;
+
+ void setFloatValue(in unsigned short unitType,
+ in float floatValue)
+ raises(dom::DOMException);
+ float getFloatValue(in unsigned short unitType);
+ void setStringValue(in unsigned short stringType,
+ in DOMString stringValue)
+ raises(dom::DOMException);
+ DOMString getStringValue();
+ Counter getCounterValue();
+ Rect getRectValue();
+ RGBColor getRGBColorValue();
+
+ };
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module css {
+
+ interface Counter {
+
+ // DOM Level 2
+
+ readonly attribute DOMString identifier;
+ readonly attribute DOMString listStyle;
+ readonly attribute DOMString separator;
+
+ };
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module stylesheets {
+
+ interface StyleSheet {
+
+ // DOM Level 2
+
+ readonly attribute DOMString type;
+ attribute boolean disabled;
+ readonly attribute Node ownerNode;
+ readonly attribute StyleSheet parentStyleSheet;
+ readonly attribute DOMString href;
+ readonly attribute DOMString title;
+ readonly attribute MediaList media;
+
+ };
+
+}
#!/bin/sh
-DerivedSourcesDir="${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
-WebCoreSourceRoot="${SRCROOT}"
-
-echo "Generating files into \"${DerivedSourcesDir}\""
-mkdir -p "${DerivedSourcesDir}"
-
-cd "$SRCROOT"
-
-# Rebuild CSSPropertyNames.h and CSSValueKeywords.h if the .in files have changed
-
-if [ css/CSSPropertyNames.in -nt "$DerivedSourcesDir/CSSPropertyNames.h" -o css/makeprop -nt "$DerivedSourcesDir/CSSPropertyNames.h" ]; then
- echo "Generating CSS properties table"
- cat css/CSSPropertyNames.in > "$DerivedSourcesDir/CSSPropertyNames.in"
- cd "$DerivedSourcesDir"
- sh "$WebCoreSourceRoot/css/makeprop"
- cd "$WebCoreSourceRoot"
-fi
-
-if [ css/CSSValueKeywords.in -nt "$DerivedSourcesDir/CSSValueKeywords.h" -o css/makevalues -nt "$DerivedSourcesDir/CSSValueKeywords.h" ]; then
- echo "Generating CSS values table"
- cat css/CSSValueKeywords.in > "$DerivedSourcesDir/CSSValueKeywords.in"
- cd "$DerivedSourcesDir"
- sh "$WebCoreSourceRoot/css/makevalues"
- cd "$WebCoreSourceRoot"
-fi
-
-if [ html/DocTypeStrings.gperf -nt "$DerivedSourcesDir/DocTypeStrings.cpp" ]; then
- echo "Generating doctype string table"
- gperf -CEot -L ANSI-C -k "*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards html/DocTypeStrings.gperf > "$DerivedSourcesDir/DocTypeStrings.cpp"
-fi
-
-if [ html/HTMLEntityNames.gperf -nt "$DerivedSourcesDir/HTMLEntityNames.c" ]; then
- echo "Generating entities table"
- gperf -a -L ANSI-C -C -G -c -o -t -k '*' -NfindEntity -D -s 2 html/HTMLEntityNames.gperf > "$DerivedSourcesDir/HTMLEntityNames.c"
-fi
-
-# Generate the CSS tokenizer using flex
-
-if [ css/tokenizer.flex -nt "$DerivedSourcesDir/tokenizer.cpp" ]; then
- echo "Generating the CSS tokenizer using flex"
- flex -t css/tokenizer.flex | perl css/maketokenizer > "$DerivedSourcesDir/tokenizer.cpp"
-fi
-
-# Generate the CSS grammar using bison
-
-if [ css/CSSGrammar.y -nt "$DerivedSourcesDir/CSSGrammar.cpp" ]; then
- echo "Generating the CSS grammar using bison"
- bison -d -p cssyy css/CSSGrammar.y -o "$DerivedSourcesDir/CSSGrammar.cpp"
- cat "$DerivedSourcesDir/CSSGrammar.cpp.h" "$DerivedSourcesDir/CSSGrammar.hpp" > "$DerivedSourcesDir/CSSGrammar.h" 2>/dev/null
- rm -f "$DerivedSourcesDir/CSSGrammar.cpp.h" "$DerivedSourcesDir/CSSGrammar.hpp"
-fi
-
-# Convert the style sheets to C arrays
-
-if [ css/make-css-file-arrays.pl -nt "$DerivedSourcesDir/UserAgentStyleSheets.h" -o css/html4.css -nt "$DerivedSourcesDir/UserAgentStyleSheets.h" -o css/quirks.css -nt "$DerivedSourcesDir/UserAgentStyleSheets.h" -o css/svg.css -nt "$DerivedSourcesDir/UserAgentStyleSheets.h" ]; then
- echo "Re-generating the user agent stylesheet files"
- css/make-css-file-arrays.pl "$DerivedSourcesDir/UserAgentStyleSheets.h" "$DerivedSourcesDir/UserAgentStyleSheetsData.cpp" css/html4.css css/quirks.css css/svg.css
-fi
-
-# Generate the color data table.
-
-if [ platform/ColorData.gperf -nt "$DerivedSourcesDir/ColorData.c" ]; then
- echo "Generating the color table data for the Color class"
- gperf -CDEot -L 'ANSI-C' -k '*' -N findColor platform/ColorData.gperf > "$DerivedSourcesDir/ColorData.c"
-fi
-
-# Generate the charset name table
+# Copyright (C) 2006 Apple Computer, 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.
+
+mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
+cd "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
+
+WebCore="${SRCROOT}"
+export WebCore
if which sw_vers 2>&1 > /dev/null; then
- ENCODINGS_FILE="platform/mac/mac-encodings.txt"
+ ENCODINGS_FILE="${WebCore}/platform/mac/mac-encodings.txt"
ENCODINGS_PREFIX="kCFStringEncoding"
else
- ENCODINGS_FILE="platform/win/win-encodings.txt";
+ ENCODINGS_FILE="${WebCore}/platform/win/win-encodings.txt";
ENCODINGS_PREFIX=""
fi
+export ENCODINGS_FILE
+export ENCODINGS_PREFIX
-if [ platform/character-sets.txt -nt "$DerivedSourcesDir/CharsetData.cpp" -o "$ENCODINGS_FILE" -nt "$DerivedSourcesDir/CharsetData.cpp" -o platform/make-charset-table.pl -nt "$DerivedSourcesDir/CharsetData.cpp" ]; then
- echo "Generating character set name table"
- platform/make-charset-table.pl platform/character-sets.txt "${ENCODINGS_FILE}" "${ENCODINGS_PREFIX}" > "$DerivedSourcesDir/CharsetData.cpp"
-fi
-
-# Generate the lookup tables for the JS bindings
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/JSDOMParser.lut.h" -o khtml/ecma/JSDOMParser.cpp -nt "$DerivedSourcesDir/JSDOMParser.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/JSDOMParser.cpp > "$DerivedSourcesDir/JSDOMParser.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_css.lut.h" -o khtml/ecma/kjs_css.cpp -nt "$DerivedSourcesDir/kjs_css.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_css.cpp > "$DerivedSourcesDir/kjs_css.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_dom.lut.h" -o khtml/ecma/kjs_dom.cpp -nt "$DerivedSourcesDir/kjs_dom.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_dom.cpp > "$DerivedSourcesDir/kjs_dom.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_events.lut.h" -o khtml/ecma/kjs_events.cpp -nt "$DerivedSourcesDir/kjs_events.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_events.cpp > "$DerivedSourcesDir/kjs_events.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_html.lut.h" -o khtml/ecma/kjs_html.cpp -nt "$DerivedSourcesDir/kjs_html.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_html.cpp > "$DerivedSourcesDir/kjs_html.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_navigator.lut.h" -o khtml/ecma/kjs_navigator.cpp -nt "$DerivedSourcesDir/kjs_navigator.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_navigator.cpp > "$DerivedSourcesDir/kjs_navigator.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_traversal.lut.h" -o khtml/ecma/kjs_traversal.cpp -nt "$DerivedSourcesDir/kjs_traversal.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_traversal.cpp > "$DerivedSourcesDir/kjs_traversal.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_views.lut.h" -o khtml/ecma/kjs_views.cpp -nt "$DerivedSourcesDir/kjs_views.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_views.cpp > "$DerivedSourcesDir/kjs_views.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/kjs_window.lut.h" -o khtml/ecma/kjs_window.cpp -nt "$DerivedSourcesDir/kjs_window.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/kjs_window.cpp > "$DerivedSourcesDir/kjs_window.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/JSXMLSerializer.lut.h" -o khtml/ecma/JSXMLSerializer.cpp -nt "$DerivedSourcesDir/JSXMLSerializer.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/JSXMLSerializer.cpp > "$DerivedSourcesDir/JSXMLSerializer.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/JSXSLTProcessor.lut.h" -o khtml/ecma/JSXSLTProcessor.cpp -nt "$DerivedSourcesDir/JSXSLTProcessor.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/JSXSLTProcessor.cpp > "$DerivedSourcesDir/JSXSLTProcessor.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/JSXMLHttpRequest.lut.h" -o khtml/ecma/JSXMLHttpRequest.cpp -nt "$DerivedSourcesDir/JSXMLHttpRequest.lut.h" ]; then
- "$CREATE_HASH_TABLE" khtml/ecma/JSXMLHttpRequest.cpp > "$DerivedSourcesDir/JSXMLHttpRequest.lut.h"
-fi
-
-if [ "$CREATE_HASH_TABLE" -nt "$DerivedSourcesDir/JSCanvasRenderingContext2DBaseTable.cpp" -o bindings/js/JSCanvasRenderingContext2DBase.cpp -nt "$DerivedSourcesDir/JSCanvasRenderingContext2DBaseTable.cpp" ]; then
- "$CREATE_HASH_TABLE" bindings/js/JSCanvasRenderingContext2DBase.cpp -n WebCore > "$DerivedSourcesDir/JSCanvasRenderingContext2DBaseTable.cpp"
-fi
-
-if [ ksvg2/svg/svgtags.in -nt "$DerivedSourcesDir/SVGNames.cpp" -o ksvg2/svg/svgattrs.in -nt "$DerivedSourcesDir/SVGNames.cpp" -o ksvg2/scripts/make_names.pl -nt "$DerivedSourcesDir/SVGNames.cpp" ]; then
- ksvg2/scripts/make_names.pl --tags ksvg2/svg/svgtags.in --attrs ksvg2/svg/svgattrs.in --namespace SVG --cppNamespace WebCore --namespaceURI "http://www.w3.org/2000/svg" --factory --attrsNullNamespace --output "$DerivedSourcesDir"
-fi
-
-if [ ksvg2/misc/xlinkattrs.in -nt "$DerivedSourcesDir/XLinkNames.cpp" -o ksvg2/scripts/make_names.pl -nt "$DerivedSourcesDir/XLinkNames.cpp" ]; then
- ksvg2/scripts/make_names.pl --attrs ksvg2/misc/xlinkattrs.in --namespace XLink --cppNamespace WebCore --namespaceURI "http://www.w3.org/1999/xlink" --output "$DerivedSourcesDir"
- touch WebCore+SVG/XLinkNamesWrapper.cpp
-fi
-
-if [ ksvg2/scripts/cssmakeprops -nt "$DerivedSourcesDir/ksvgcssproperties.h" -o ksvg2/css/CSSPropertyNames.in -nt "$DerivedSourcesDir/ksvgcssproperties.h" ]; then
- cat css/CSSPropertyNames.in ksvg2/css/CSSPropertyNames.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'
- if [ $? -eq 0 ]; then
- echo "Duplicate property!";
- exit 1;
- fi
- cat ksvg2/css/CSSPropertyNames.in > "$DerivedSourcesDir/ksvgcssproperties.in"
- cd "$DerivedSourcesDir"
- "$WebCoreSourceRoot/ksvg2/scripts/cssmakeprops" -n SVG -f ksvgcssproperties.in
- cd "$WebCoreSourceRoot"
-fi
-
-if [ ksvg2/css/CSSValueKeywords.in -nt "$DerivedSourcesDir/ksvgcssvalues.h" -o ksvg2/scripts/cssmakevalues -nt "$DerivedSourcesDir/ksvgcssvalues.h" ]; then
- cat css/CSSValueKeywords.in ksvg2/css/CSSValueKeywords.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'
- if [ $? -eq 0 ]; then
- echo "Duplicate value!";
- exit 1;
- fi
- # Lower case all the values, as CSS values are case-insensitive
- cat ksvg2/css/CSSValueKeywords.in | perl -pe '$_ = lc;' > "$DerivedSourcesDir/ksvgcssvalues.in"
- cd "$DerivedSourcesDir"
- "$WebCoreSourceRoot/ksvg2/scripts/cssmakevalues" -n SVG -f ksvgcssvalues.in
- cd "$WebCoreSourceRoot"
-fi
-
-if [ dom/Attr.idl -nt "$DerivedSourcesDir/JSAttr.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSAttr.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSAttr.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSAttr.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSAttr.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSAttr.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/Attr.idl
-fi
-
-if [ dom/CharacterData.idl -nt "$DerivedSourcesDir/JSCharacterData.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSCharacterData.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSCharacterData.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSCharacterData.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSCharacterData.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSCharacterData.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/CharacterData.idl
-fi
-
-if [ dom/DocumentType.idl -nt "$DerivedSourcesDir/JSDocumentType.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSDocumentType.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSDocumentType.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSDocumentType.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSDocumentType.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSDocumentType.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/DocumentType.idl
-fi
-
-if [ dom/DOMImplementation.idl -nt "$DerivedSourcesDir/JSDOMImplementation.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSDOMImplementation.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSDOMImplementation.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSDOMImplementation.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSDOMImplementation.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSDOMImplementation.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/DOMImplementation.idl
-fi
-
-if [ dom/Element.idl -nt "$DerivedSourcesDir/JSElement.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSElement.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSElement.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSElement.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSElement.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSElement.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/Element.idl
-fi
-
-if [ dom/Entity.idl -nt "$DerivedSourcesDir/JSEntity.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSEntity.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSEntity.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSEntity.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSEntity.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSEntity.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/Entity.idl
-fi
-
-if [ dom/MutationEvent.idl -nt "$DerivedSourcesDir/JSMutationEvent.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSMutationEvent.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSMutationEvent.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSMutationEvent.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSMutationEvent.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSMutationEvent.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/MutationEvent.idl
-fi
-
-if [ dom/UIEvent.idl -nt "$DerivedSourcesDir/JSUIEvent.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSUIEvent.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSUIEvent.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSUIEvent.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSUIEvent.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSUIEvent.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/UIEvent.idl
-fi
-
-if [ dom/Notation.idl -nt "$DerivedSourcesDir/JSNotation.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSNotation.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSNotation.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSNotation.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSNotation.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSNotation.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/Notation.idl
-fi
-
-if [ dom/ProcessingInstruction.idl -nt "$DerivedSourcesDir/JSProcessingInstruction.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSProcessingInstruction.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSProcessingInstruction.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSProcessingInstruction.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSProcessingInstruction.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSProcessingInstruction.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/ProcessingInstruction.idl
-fi
-
-if [ dom/Range.idl -nt "$DerivedSourcesDir/JSRange.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSRange.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSRange.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSRange.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSRange.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSRange.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/Range.idl
-fi
-
-if [ dom/Text.idl -nt "$DerivedSourcesDir/JSText.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSText.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSText.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSText.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSText.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSText.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/Text.idl
-fi
-
-if [ dom/KeyboardEvent.idl -nt "$DerivedSourcesDir/JSKeyboardEvent.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSKeyboardEvent.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSKeyboardEvent.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSKeyboardEvent.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSKeyboardEvent.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSKeyboardEvent.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/KeyboardEvent.idl
-fi
-
-if [ dom/MouseEvent.idl -nt "$DerivedSourcesDir/JSMouseEvent.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSMouseEvent.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSMouseEvent.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSMouseEvent.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSMouseEvent.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSMouseEvent.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/MouseEvent.idl
-fi
-
-if [ dom/WheelEvent.idl -nt "$DerivedSourcesDir/JSWheelEvent.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSWheelEvent.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSWheelEvent.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSWheelEvent.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSWheelEvent.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSWheelEvent.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" dom/WheelEvent.idl
-fi
-
-if [ html/CanvasGradient.idl -nt "$DerivedSourcesDir/JSCanvasGradient.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSCanvasGradient.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSCanvasGradient.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSCanvasGradient.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSCanvasGradient.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSCanvasGradient.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" html/CanvasGradient.idl
-fi
-
-if [ html/CanvasPattern.idl -nt "$DerivedSourcesDir/JSCanvasPattern.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSCanvasPattern.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSCanvasPattern.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSCanvasPattern.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSCanvasPattern.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSCanvasPattern.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" html/CanvasPattern.idl
-fi
-
-if [ html/CanvasRenderingContext2D.idl -nt "$DerivedSourcesDir/JSCanvasRenderingContext2D.h" -o \
- bindings/scripts/generate-bindings.pl -nt "$DerivedSourcesDir/JSCanvasRenderingContext2D.h" -o \
- bindings/scripts/CodeGenerator.pm -nt "$DerivedSourcesDir/JSCanvasRenderingContext2D.h" -o \
- bindings/scripts/CodeGeneratorJS.pm -nt "$DerivedSourcesDir/JSCanvasRenderingContext2D.h" -o \
- bindings/scripts/IDLParser.pm -nt "$DerivedSourcesDir/JSCanvasRenderingContext2D.h" -o \
- bindings/scripts/IDLStructure.pm -nt "$DerivedSourcesDir/JSCanvasRenderingContext2D.h" ]; then
- perl -Ibindings/scripts bindings/scripts/generate-bindings.pl --generator JS --include dom --include html --outputdir "$DerivedSourcesDir" html/CanvasRenderingContext2D.idl
-fi
+make -f "$WebCore/DerivedSources.make"
#include "config.h"
#include "kjs_css.h"
-#include "css/css_base.h"
-#include "css/css_ruleimpl.h"
-#include "css/css_stylesheetimpl.h"
-#include "css/css_valueimpl.h"
#include "Document.h"
+#include "HTMLNames.h"
+#include "JSCSSPrimitiveValue.h"
+#include "css_base.h"
+#include "css_ruleimpl.h"
+#include "css_stylesheetimpl.h"
+#include "css_valueimpl.h"
#include "html_headimpl.h" // for HTMLStyleElement
#include "kjs_dom.h"
-#include "HTMLNames.h"
#include "kjs_css.lut.h"
-using namespace WebCore::HTMLNames;
-
using namespace WebCore;
+using namespace HTMLNames;
namespace KJS {
// -------------------------------------------------------------------------
-const ClassInfo DOMStyleSheet::info = { "StyleSheet", 0, &DOMStyleSheetTable, 0 };
-/*
-@begin DOMStyleSheetTable 7
- type DOMStyleSheet::Type DontDelete|ReadOnly
- disabled DOMStyleSheet::Disabled DontDelete
- ownerNode DOMStyleSheet::OwnerNode DontDelete|ReadOnly
- parentStyleSheet DOMStyleSheet::ParentStyleSheet DontDelete|ReadOnly
- href DOMStyleSheet::Href DontDelete|ReadOnly
- title DOMStyleSheet::Title DontDelete|ReadOnly
- media DOMStyleSheet::Media DontDelete|ReadOnly
-@end
-*/
-
-DOMStyleSheet::DOMStyleSheet(ExecState*, WebCore::StyleSheet* ss)
- : m_impl(ss)
-{
-}
-
-DOMStyleSheet::DOMStyleSheet(WebCore::StyleSheet *ss)
- : m_impl(ss)
-{
-}
-
-DOMStyleSheet::~DOMStyleSheet()
-{
- ScriptInterpreter::forgetDOMObject(m_impl.get());
-}
-
-bool DOMStyleSheet::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<DOMStyleSheet, DOMObject>(exec, &DOMStyleSheetTable, this, propertyName, slot);
-}
-
-JSValue *DOMStyleSheet::getValueProperty(ExecState *exec, int token) const
-{
- StyleSheet &styleSheet = *m_impl;
- switch (token) {
- case Type:
- return jsStringOrNull(styleSheet.type());
- case Disabled:
- return jsBoolean(styleSheet.disabled());
- case OwnerNode:
- return toJS(exec,styleSheet.ownerNode());
- case ParentStyleSheet:
- return toJS(exec,styleSheet.parentStyleSheet());
- case Href:
- return jsStringOrNull(styleSheet.href());
- case Title:
- return jsStringOrNull(styleSheet.title());
- case Media:
- return toJS(exec, styleSheet.media());
- }
- return NULL;
-}
-
-void DOMStyleSheet::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
-{
- if (propertyName == "disabled") {
- m_impl->setDisabled(value->toBoolean(exec));
- }
- else
- DOMObject::put(exec, propertyName, value, attr);
-}
-
-JSValue* toJS(ExecState *exec, PassRefPtr<StyleSheet> ss)
-{
- DOMObject *ret;
- if (!ss)
- return jsNull();
- ScriptInterpreter *interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
- if ((ret = interp->getDOMObject(ss.get())))
- return ret;
- else {
- if (ss->isCSSStyleSheet())
- ret = new DOMCSSStyleSheet(exec, static_cast<CSSStyleSheet *>(ss.get()));
- else
- ret = new DOMStyleSheet(exec, ss.get());
- interp->putDOMObject(ss.get(), ret);
- return ret;
- }
-}
-
-// -------------------------------------------------------------------------
-
const ClassInfo DOMStyleSheetList::info = { "StyleSheetList", 0, &DOMStyleSheetListTable, 0 };
/*
KJS_IMPLEMENT_PROTOFUNC(DOMCSSStyleSheetProtoFunc)
KJS_IMPLEMENT_PROTOTYPE("DOMCSSStyleSheet",DOMCSSStyleSheetProto,DOMCSSStyleSheetProtoFunc) // warning, use _WITH_PARENT if DOMStyleSheet gets a proto
-DOMCSSStyleSheet::DOMCSSStyleSheet(ExecState *exec, CSSStyleSheet *ss)
- : DOMStyleSheet(ss)
+DOMCSSStyleSheet::DOMCSSStyleSheet(ExecState* exec, CSSStyleSheet* ss)
+ : JSStyleSheet(exec, ss)
{
setPrototype(DOMCSSStyleSheetProto::self(exec));
}
bool DOMCSSStyleSheet::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
- return getStaticValueSlot<DOMCSSStyleSheet, DOMStyleSheet>(exec, &DOMCSSStyleSheetTable, this, propertyName, slot);
+ return getStaticValueSlot<DOMCSSStyleSheet, JSStyleSheet>(exec, &DOMCSSStyleSheetTable, this, propertyName, slot);
}
JSValue *DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
const ClassInfo DOMCSSValue::info = { "CSSValue", 0, &DOMCSSValueTable, 0 };
/*
+@begin DOMCSSValueProtoTable 0
+@end
@begin DOMCSSValueTable 2
cssText DOMCSSValue::CssText DontDelete|ReadOnly
cssValueType DOMCSSValue::CssValueType DontDelete|ReadOnly
@end
*/
+KJS_IMPLEMENT_PROTOFUNC(DOMCSSValueProtoFunc)
+KJS_IMPLEMENT_PROTOTYPE("DOMCSSValue", DOMCSSValueProto, DOMCSSValueProtoFunc)
+
DOMCSSValue::~DOMCSSValue()
{
ScriptInterpreter::forgetDOMObject(m_impl.get());
DOMObject::put(exec, propertyName, value, attr);
}
+JSValue* DOMCSSValueProtoFunc::callAsFunction(ExecState*, JSObject*, const List&)
+{
+ return 0;
+}
+
JSValue *toJS(ExecState *exec, CSSValue *v)
{
DOMObject *ret;
if (v->isValueList())
ret = new DOMCSSValueList(exec, static_cast<CSSValueList *>(v));
else if (v->isPrimitiveValue())
- ret = new DOMCSSPrimitiveValue(exec, static_cast<CSSPrimitiveValue *>(v));
+ ret = new JSCSSPrimitiveValue(exec, static_cast<CSSPrimitiveValue *>(v));
else
ret = new DOMCSSValue(exec,v);
interp->putDOMObject(v, ret);
// -------------------------------------------------------------------------
-const ClassInfo DOMCSSPrimitiveValue::info = { "CSSPrimitiveValue", 0, &DOMCSSPrimitiveValueTable, 0 };
-/*
-@begin DOMCSSPrimitiveValueTable 1
- primitiveType DOMCSSPrimitiveValue::PrimitiveType DontDelete|ReadOnly
-@end
-@begin DOMCSSPrimitiveValueProtoTable 3
- setFloatValue DOMCSSPrimitiveValue::SetFloatValue DontDelete|Function 2
- getFloatValue DOMCSSPrimitiveValue::GetFloatValue DontDelete|Function 1
- setStringValue DOMCSSPrimitiveValue::SetStringValue DontDelete|Function 2
- getStringValue DOMCSSPrimitiveValue::GetStringValue DontDelete|Function 0
- getCounterValue DOMCSSPrimitiveValue::GetCounterValue DontDelete|Function 0
- getRectValue DOMCSSPrimitiveValue::GetRectValue DontDelete|Function 0
- getRGBColorValue DOMCSSPrimitiveValue::GetRGBColorValue DontDelete|Function 0
-@end
-*/
-KJS_DEFINE_PROTOTYPE(DOMCSSPrimitiveValueProto)
-KJS_IMPLEMENT_PROTOFUNC(DOMCSSPrimitiveValueProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE("DOMCSSPrimitiveValue",DOMCSSPrimitiveValueProto,DOMCSSPrimitiveValueProtoFunc)
-
-DOMCSSPrimitiveValue::DOMCSSPrimitiveValue(ExecState *exec, CSSPrimitiveValue *v)
- : DOMCSSValue(v)
-{
- setPrototype(DOMCSSPrimitiveValueProto::self(exec));
-}
-
-JSValue *DOMCSSPrimitiveValue::getValueProperty(ExecState *exec, int token)
-{
- assert(token == PrimitiveType);
- return jsNumber(static_cast<CSSPrimitiveValue *>(impl())->primitiveType());
-}
-
-bool DOMCSSPrimitiveValue::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<DOMCSSPrimitiveValue, DOMCSSValue>(exec, &DOMCSSPrimitiveValueTable, this, propertyName, slot);
-}
-
-JSValue *DOMCSSPrimitiveValueProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
-{
- if (!thisObj->inherits(&KJS::DOMCSSPrimitiveValue::info))
- return throwError(exec, TypeError);
- DOMExceptionTranslator exception(exec);
- CSSPrimitiveValue &val = *static_cast<CSSPrimitiveValue *>(static_cast<DOMCSSPrimitiveValue *>(thisObj)->impl());
- switch (id) {
- case DOMCSSPrimitiveValue::SetFloatValue:
- val.setFloatValue(args[0]->toInt32(exec), args[1]->toNumber(exec), exception);
- return jsUndefined();
- case DOMCSSPrimitiveValue::GetFloatValue:
- return jsNumber(val.getFloatValue(args[0]->toInt32(exec)));
- case DOMCSSPrimitiveValue::SetStringValue:
- val.setStringValue(args[0]->toInt32(exec), args[1]->toString(exec), exception);
- return jsUndefined();
- case DOMCSSPrimitiveValue::GetStringValue:
- return jsStringOrNull(val.getStringValue());
- case DOMCSSPrimitiveValue::GetCounterValue:
- return toJS(exec,val.getCounterValue());
- case DOMCSSPrimitiveValue::GetRectValue:
- return toJS(exec,val.getRectValue());
- case DOMCSSPrimitiveValue::GetRGBColorValue:
- return getDOMRGBColor(exec,val.getRGBColorValue());
- default:
- return jsUndefined();
- }
-}
-
-// -------------------------------------------------------------------------
-
-const ClassInfo CSSPrimitiveValueConstructor::info = { "CSSPrimitiveValueConstructor", 0, &CSSPrimitiveValueConstructorTable, 0 };
-
-/*
-@begin CSSPrimitiveValueConstructorTable 27
- CSS_UNKNOWN WebCore::CSSPrimitiveValue::CSS_UNKNOWN DontDelete|ReadOnly
- CSS_NUMBER WebCore::CSSPrimitiveValue::CSS_NUMBER DontDelete|ReadOnly
- CSS_PERCENTAGE WebCore::CSSPrimitiveValue::CSS_PERCENTAGE DontDelete|ReadOnly
- CSS_EMS WebCore::CSSPrimitiveValue::CSS_EMS DontDelete|ReadOnly
- CSS_EXS WebCore::CSSPrimitiveValue::CSS_EXS DontDelete|ReadOnly
- CSS_PX WebCore::CSSPrimitiveValue::CSS_PX DontDelete|ReadOnly
- CSS_CM WebCore::CSSPrimitiveValue::CSS_CM DontDelete|ReadOnly
- CSS_MM WebCore::CSSPrimitiveValue::CSS_MM DontDelete|ReadOnly
- CSS_IN WebCore::CSSPrimitiveValue::CSS_IN DontDelete|ReadOnly
- CSS_PT WebCore::CSSPrimitiveValue::CSS_PT DontDelete|ReadOnly
- CSS_PC WebCore::CSSPrimitiveValue::CSS_PC DontDelete|ReadOnly
- CSS_DEG WebCore::CSSPrimitiveValue::CSS_DEG DontDelete|ReadOnly
- CSS_RAD WebCore::CSSPrimitiveValue::CSS_RAD DontDelete|ReadOnly
- CSS_GRAD WebCore::CSSPrimitiveValue::CSS_GRAD DontDelete|ReadOnly
- CSS_MS WebCore::CSSPrimitiveValue::CSS_MS DontDelete|ReadOnly
- CSS_S WebCore::CSSPrimitiveValue::CSS_S DontDelete|ReadOnly
- CSS_HZ WebCore::CSSPrimitiveValue::CSS_HZ DontDelete|ReadOnly
- CSS_KHZ WebCore::CSSPrimitiveValue::CSS_KHZ DontDelete|ReadOnly
- CSS_DIMENSION WebCore::CSSPrimitiveValue::CSS_DIMENSION DontDelete|ReadOnly
- CSS_STRING WebCore::CSSPrimitiveValue::CSS_STRING DontDelete|ReadOnly
- CSS_URI WebCore::CSSPrimitiveValue::CSS_URI DontDelete|ReadOnly
- CSS_IDENT WebCore::CSSPrimitiveValue::CSS_IDENT DontDelete|ReadOnly
- CSS_ATTR WebCore::CSSPrimitiveValue::CSS_ATTR DontDelete|ReadOnly
- CSS_COUNTER WebCore::CSSPrimitiveValue::CSS_COUNTER DontDelete|ReadOnly
- CSS_RECT WebCore::CSSPrimitiveValue::CSS_RECT DontDelete|ReadOnly
- CSS_RGBCOLOR WebCore::CSSPrimitiveValue::CSS_RGBCOLOR DontDelete|ReadOnly
-@end
-*/
-
-bool CSSPrimitiveValueConstructor::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<CSSPrimitiveValueConstructor, CSSValueConstructor>(exec, &CSSPrimitiveValueConstructorTable, this, propertyName, slot);
-}
-
-JSValue *CSSPrimitiveValueConstructor::getValueProperty(ExecState *, int token) const
-{
- // We use the token as the value to return directly
- return jsNumber(token);
-}
-
-JSValue *getCSSPrimitiveValueConstructor(ExecState *exec)
-{
- return cacheGlobalObject<CSSPrimitiveValueConstructor>( exec, "[[cssPrimitiveValue.constructor]]" );
-}
-
-// -------------------------------------------------------------------------
-
const ClassInfo DOMCSSValueList::info = { "CSSValueList", 0, &DOMCSSValueListTable, 0 };
/*
return getStaticValueSlot<DOMRGBColor, DOMObject>(exec, &DOMRGBColorTable, this, propertyName, slot);
}
-JSValue *DOMRGBColor::getValueProperty(ExecState *exec, int token) const
+JSValue *DOMRGBColor::getValueProperty(ExecState* exec, int token) const
{
int color = m_color;
switch (token) {
color >>= 8;
// fall through
case Blue:
- return new DOMCSSPrimitiveValue(exec, new CSSPrimitiveValue(color & 0xFF, CSSPrimitiveValue::CSS_NUMBER));
+ return toJS(exec, new CSSPrimitiveValue(color & 0xFF, CSSPrimitiveValue::CSS_NUMBER));
default:
return NULL;
}
return cacheDOMObject<RectImpl, DOMRect>(exec, r);
}
-// -------------------------------------------------------------------------
-
-const ClassInfo DOMCounter::info = { "Counter", 0, &DOMCounterTable, 0 };
-/*
-@begin DOMCounterTable 3
- identifier DOMCounter::identifier DontDelete|ReadOnly
- listStyle DOMCounter::listStyle DontDelete|ReadOnly
- separator DOMCounter::separator DontDelete|ReadOnly
-@end
-*/
-
-DOMCounter::~DOMCounter()
-{
- ScriptInterpreter::forgetDOMObject(m_counter.get());
-}
-
-bool DOMCounter::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<DOMCounter, DOMObject>(exec, &DOMCounterTable, this, propertyName, slot);
-}
-
-JSValue *DOMCounter::getValueProperty(ExecState *, int token) const
-{
- Counter &counter = *m_counter;
- switch (token) {
- case identifier:
- return jsStringOrNull(counter.identifier());
- case listStyle:
- return jsStringOrNull(counter.listStyle());
- case separator:
- return jsStringOrNull(counter.separator());
- default:
- return NULL;
- }
-}
-
-JSValue *toJS(ExecState *exec, Counter *c)
-{
- return cacheDOMObject<Counter, DOMCounter>(exec, c);
-}
-
}
#define KJS_CSS_H_
#include "Color.h"
+#include "JSStyleSheet.h"
#include "kjs_binding.h"
namespace WebCore {
JSValue* toJS(ExecState*, WebCore::CSSStyleDeclaration*);
- class DOMStyleSheet : public DOMObject {
- public:
- DOMStyleSheet(ExecState *, WebCore::StyleSheet *ss);
- virtual ~DOMStyleSheet();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- virtual bool toBoolean(ExecState *) const { return true; }
- virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
- enum { Type, Disabled, OwnerNode, ParentStyleSheet, Href, Title, Media };
- WebCore::StyleSheet *impl() const { return m_impl.get(); }
- protected:
- // Constructor for derived classes; doesn't set up a prototype.
- DOMStyleSheet(WebCore::StyleSheet *ss);
- private:
- RefPtr<WebCore::StyleSheet> m_impl;
- };
-
- JSValue* toJS(ExecState*, PassRefPtr<WebCore::StyleSheet>);
-
class DOMStyleSheetList : public DOMObject {
public:
DOMStyleSheetList(ExecState *, WebCore::StyleSheetList *ssl, WebCore::Document *doc);
JSValue* toJS(ExecState*, WebCore::MediaList*);
- class DOMCSSStyleSheet : public DOMStyleSheet {
+ class DOMCSSStyleSheet : public WebCore::JSStyleSheet {
public:
DOMCSSStyleSheet(ExecState *exec, WebCore::CSSStyleSheet *ss);
virtual ~DOMCSSStyleSheet();
RefPtr<WebCore::CSSValue> m_impl;
};
+ KJS_DEFINE_PROTOTYPE(DOMCSSValueProto)
+
JSValue* toJS(ExecState*, WebCore::CSSValue*);
// Constructor for CSSValue - currently only used for some global values
JSValue *getCSSValueConstructor(ExecState *exec);
- class DOMCSSPrimitiveValue : public DOMCSSValue {
- public:
- DOMCSSPrimitiveValue(ExecState *exec, WebCore::CSSPrimitiveValue *v);
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token);
- // no put - all read-only
- virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
- enum { PrimitiveType, SetFloatValue, GetFloatValue, SetStringValue, GetStringValue,
- GetCounterValue, GetRectValue, GetRGBColorValue };
- };
-
- // Constructor for CSSPrimitiveValue - currently only used for some global values
- class CSSPrimitiveValueConstructor : public CSSValueConstructor {
- public:
- CSSPrimitiveValueConstructor(ExecState *exec) : CSSValueConstructor(exec) { }
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
- // no put - all read-only
- virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
- };
-
- JSValue *getCSSPrimitiveValueConstructor(ExecState *exec);
-
class DOMCSSValueList : public DOMCSSValue {
public:
DOMCSSValueList(ExecState *exec, WebCore::CSSValueList *l);
JSValue* toJS(ExecState*, WebCore::RectImpl*);
- class DOMCounter : public DOMObject {
- public:
- DOMCounter(ExecState *, WebCore::Counter *c) : m_counter(c) { }
- ~DOMCounter();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token) const;
- // no put - all read-only
- virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
- enum { identifier, listStyle, separator };
- protected:
- RefPtr<WebCore::Counter> m_counter;
- };
-
- JSValue* toJS(ExecState*, WebCore::Counter*);
-
} // namespace
#endif