- http://bugzilla.opendarwin.org/show_bug.cgi?id=7867
get rid of macro hacks for DOM, KDOM, KSVG, khtml, DOMString, QString
* config.h: Remove the defines for DOM, KDOM, KSVG, khtml, DOMString, QString,
and qstring().
* WebCore.xcodeproj/project.pbxproj: Pass in WebCore instead of KSVG as the
namespace for SVG names.
* ksvg2/scripts/make_names.pl: Made a couple changes to trick the SVG names into
recompiling, since they are in a different namespace now.
* ForwardingHeaders/kjs/identifier.h: Added.
* dom/PlatformWheelEvent.idl: Removed.
* dom/WheelEvent.idl: Added. This file was renamed by accident.
* bindings/js/JSDOMCore.cpp:
* bindings/js/JSDOMEvents.cpp:
* bindings/js/JSDOMHTML.cpp:
* dom/Attr.idl:
* dom/CharacterData.idl:
* dom/DOMImplementation.idl:
* dom/DocumentType.idl:
* dom/Element.idl:
* dom/Entity.idl:
* dom/MutationEvent.idl:
* dom/Notation.idl:
* dom/ProcessingInstruction.idl:
* dom/Text.idl:
* html/CanvasGradient.idl:
* html/CanvasPattern.idl:
* html/CanvasRenderingContext2D.idl:
Touched, to get CodeGeneratorJS.pm changes to take effect.
* css/CSSGrammar.y:
* css/css_valueimpl.cpp: (WebCore::propertyID):
Changed calls to get CSS property values to use an explicit SVG:: namespace,
to match what the script writes out.
* khtml/ecma/kjs_binding.h: Added forward declaration of WebCore::String.
* ksvg2/scripts/cssmakeget rid of macro hacks for DOM, KDOM, KSVG, khtml, DOMString, QString
props: Made this compile with warnings and strict turned on.
Really just a trick to get properties to recompile, which turned out to be unneeded.
* ksvg2/scripts/cssmakevalues: Ditto.
* ksvg2/svg/SVGAElement.cpp:
(SVGAElement::parseMappedAttribute):
(SVGAElement::defaultEventHandler):
* ksvg2/svg/SVGAnimateTransformElement.cpp:
(SVGAnimateTransformElement::parseMappedAttribute):
* ksvg2/svg/SVGAnimationElement.cpp:
(SVGAnimationElement::parseMappedAttribute):
* ksvg2/svg/SVGClipPathElement.cpp:
(SVGClipPathElement::parseMappedAttribute):
* ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
(SVGComponentTransferFunctionElement::parseMappedAttribute):
* ksvg2/svg/SVGExternalResourcesRequired.cpp:
(SVGExternalResourcesRequired::parseMappedAttribute):
* ksvg2/svg/SVGFEBlendElement.cpp:
(SVGFEBlendElement::parseMappedAttribute):
* ksvg2/svg/SVGFEColorMatrixElement.cpp:
(SVGFEColorMatrixElement::parseMappedAttribute):
* ksvg2/svg/SVGFEComponentTransferElement.cpp:
(SVGFEComponentTransferElement::parseMappedAttribute):
* ksvg2/svg/SVGFECompositeElement.cpp:
(SVGFECompositeElement::parseMappedAttribute):
* ksvg2/svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::parseMappedAttribute):
* ksvg2/svg/SVGFEDisplacementMapElement.cpp:
(SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
(SVGFEDisplacementMapElement::stringToChannel):
(SVGFEDisplacementMapElement::parseMappedAttribute):
(SVGFEDisplacementMapElement::filterEffect):
* ksvg2/svg/SVGFEDisplacementMapElement.h:
* ksvg2/svg/SVGFEFloodElement.cpp:
(SVGFEFloodElement::parseMappedAttribute):
* ksvg2/svg/SVGFEGaussianBlurElement.cpp:
(SVGFEGaussianBlurElement::parseMappedAttribute):
* ksvg2/svg/SVGFEImageElement.cpp:
(SVGFEImageElement::parseMappedAttribute):
* ksvg2/svg/SVGFELightElement.cpp:
(SVGFELightElement::parseMappedAttribute):
* ksvg2/svg/SVGFEMergeNodeElement.cpp:
(SVGFEMergeNodeElement::parseMappedAttribute):
* ksvg2/svg/SVGFEOffsetElement.cpp:
(SVGFEOffsetElement::parseMappedAttribute):
* ksvg2/svg/SVGFESpecularLightingElement.cpp:
(SVGFESpecularLightingElement::parseMappedAttribute):
* ksvg2/svg/SVGFETileElement.cpp:
(SVGFETileElement::parseMappedAttribute):
* ksvg2/svg/SVGFETurbulenceElement.cpp:
(SVGFETurbulenceElement::parseMappedAttribute):
* ksvg2/svg/SVGFilterElement.cpp:
(SVGFilterElement::parseMappedAttribute):
* ksvg2/svg/SVGGradientElement.cpp:
(SVGGradientElement::parseMappedAttribute):
* ksvg2/svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::parseMappedAttribute):
* ksvg2/svg/SVGPolyElement.cpp:
(SVGPolyElement::parseMappedAttribute):
* ksvg2/svg/SVGStopElement.cpp:
(SVGStopElement::parseMappedAttribute):
* ksvg2/svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::parseMappedAttribute):
* ksvg2/svg/SVGTests.cpp:
(WebCore::SVGTests::parseMappedAttribute):
* ksvg2/svg/SVGTextContentElement.cpp:
(SVGTextContentElement::parseMappedAttribute):
* ksvg2/svg/SVGTextPositioningElement.cpp:
(SVGTextPositioningElement::parseMappedAttribute):
* ksvg2/svg/SVGViewElement.cpp:
(SVGViewElement::parseMappedAttribute):
* ksvg2/svg/SVGZoomAndPan.cpp:
(SVGZoomAndPan::parseMappedAttribute):
Changed code that converts an AtomicString to a String to do it in a
more-efficient fashion that works even with all the new conversions.
* page/Frame.cpp:
(WebCore::getString): Removed unneeded .deprecatedString().
(WebCore::Frame::begin): Removed the only use of QSTRING_NULL.
* platform/AtomicString.h: Added conversion to and from KJS::Identifier
and KJS::UString.
* platform/AtomicString.cpp:
(WebCore::AtomicString::add): Added overloads for Identifier and UString.
(WebCore::AtomicString::operator Identifier): Added.
(WebCore::AtomicString::operator UString): Added.
* platform/DeprecatedString.h: Added conversion to and from KJS::Identifier
and KJS::UString.
* platform/DeprecatedString.cpp:
(DeprecatedString::DeprecatedString): Added overloads for Identifier and UString.
(DeprecatedString::operator Identifier): Added.
(DeprecatedString::operator UString): Added.
* platform/PlatformString.h: Added conversion to and from KJS::Identifier
and KJS::UString.
* platform/String.cpp:
(WebCore::String::String): Added overloads for Identifier and UString.
(WebCore::String::operator Identifier): Added.
(WebCore::String::operator UString): Added.
* platform/StringImpl.h: Added constructors that take KJS::Identifier
and KJS::UString
* platform/StringImpl.cpp:
(WebCore::getWordBreakIterator): Changed a use of UChar to say ::UChar
instead because of ambiguity with KJS::UChar.
(WebCore::StringImpl::StringImpl): Added overloads for Identifier and String.
* bindings/js/JSCanvasRenderingContext2DBase.cpp:
(WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
(WebCore::toHTMLCanvasStyle):
* bindings/scripts/CodeGeneratorJS.pm:
* bridge/mac/WebCoreFrameBridge.mm:
(aeDescFromJSValue):
(-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::toString):
* khtml/ecma/JSDOMParser.cpp:
(KJS::DOMParserProtoFunc::callAsFunction):
* khtml/ecma/JSXMLHttpRequest.cpp:
(KJS::JSXMLHttpRequestProtoFunc::callAsFunction):
* khtml/ecma/JSXSLTProcessor.cpp:
(KJS::XSLTProcessorProtoFunc::callAsFunction):
* khtml/ecma/kjs_binding.cpp:
(KJS::valueToStringWithNullCheck):
* khtml/ecma/kjs_css.cpp:
(KJS::cssPropertyName):
(KJS::DOMCSSStyleDeclaration::put):
(KJS::DOMCSSStyleDeclarationProtoFunc::callAsFunction):
(KJS::DOMStyleSheetList::nameGetter):
(KJS::DOMStyleSheetList::getOwnPropertySlot):
(KJS::DOMMediaList::put):
(KJS::KJS::DOMMediaListProtoFunc::callAsFunction):
(KJS::DOMCSSStyleSheetProtoFunc::callAsFunction):
(KJS::DOMCSSRule::putValueProperty):
(KJS::DOMCSSRuleFunc::callAsFunction):
(KJS::DOMCSSValue::put):
(KJS::DOMCSSPrimitiveValueProtoFunc::callAsFunction):
* khtml/ecma/kjs_dom.cpp:
(KJS::DOMNode::putValueProperty):
(KJS::DOMNode::toString):
(KJS::DOMNodeProtoFunc::callAsFunction):
(KJS::DOMEventTargetNodeProtoFunc::callAsFunction):
(KJS::DOMNodeList::nameGetter):
(KJS::DOMNodeList::getOwnPropertySlot):
(KJS::DOMDocument::putValueProperty):
(KJS::DOMDocumentProtoFunc::callAsFunction):
(KJS::DOMElement::attributeGetter):
(KJS::DOMElement::getOwnPropertySlot):
(KJS::DOMNamedNodeMap::nameGetter):
(KJS::DOMNamedNodeMap::getOwnPropertySlot):
(KJS::DOMNamedNodeMapProtoFunc::callAsFunction):
(KJS::DOMNamedNodesCollection::getOwnPropertySlot):
* khtml/ecma/kjs_events.cpp:
(KJS::JSAbstractEventListener::handleEvent):
(KJS::DOMEvent::getValueProperty):
(KJS::DOMEventProtoFunc::callAsFunction):
(KJS::DOMUIEventProtoFunc::callAsFunction):
(KJS::DOMMouseEventProtoFunc::callAsFunction):
(KJS::DOMKeyboardEventProtoFunc::callAsFunction):
(KJS::Clipboard::putValueProperty):
(KJS::ClipboardProtoFunc::callAsFunction):
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocFunction::callAsFunction):
(KJS::JSHTMLDocument::namedItemGetter):
(KJS::JSHTMLDocument::getOwnPropertySlot):
(KJS::JSHTMLDocument::putValueProperty):
(KJS::JSHTMLElement::framesetNameGetter):
(KJS::JSHTMLElement::getOwnPropertySlot):
(KJS::HTMLElementFunction::callAsFunction):
(KJS::JSHTMLElement::putValueProperty):
(KJS::JSHTMLCollection::callAsFunction):
(KJS::JSHTMLCollection::getNamedItems):
(KJS::HTMLCollectionProtoFunc::callAsFunction):
(KJS::OptionConstructorImp::construct):
* khtml/ecma/kjs_navigator.cpp:
(KJS::Plugins::nameGetter):
(KJS::Plugins::getOwnPropertySlot):
(KJS::MimeTypes::nameGetter):
(KJS::MimeTypes::getOwnPropertySlot):
(KJS::Plugin::nameGetter):
(KJS::Plugin::getOwnPropertySlot):
* khtml/ecma/kjs_proxy.cpp:
(WebCore::KJSProxy::evaluate):
* khtml/ecma/kjs_range.cpp:
(KJS::DOMRangeProtoFunc::callAsFunction):
* khtml/ecma/kjs_views.cpp:
(KJS::DOMAbstractViewProtoFunc::callAsFunction):
* khtml/ecma/kjs_window.cpp:
(KJS::parseModalDialogFeatures):
(KJS::showModalDialog):
(KJS::Window::childFrameGetter):
(KJS::Window::namedFrameGetter):
(KJS::Window::namedItemGetter):
(KJS::Window::getOwnPropertySlot):
(KJS::Window::put):
(KJS::WindowFunc::callAsFunction):
(KJS::ScheduledAction::execute):
(KJS::Window::installTimeout):
(KJS::FrameArray::nameGetter):
(KJS::FrameArray::getOwnPropertySlot):
(KJS::Location::put):
(KJS::LocationFunc::callAsFunction):
(KJS::SelectionFunc::callAsFunction):
Removed explicit calls to domString(), sometimes replacing with explicit calls to the
String() constructor. Other similar changes for AtomicString and DeprecatedString use.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13405
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-03-20 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoff.
+
+ - http://bugzilla.opendarwin.org/show_bug.cgi?id=7867
+ get rid of macro hacks for DOM, KDOM, KSVG, khtml, DOMString, QString
+
+ * config.h: Remove the defines for DOM, KDOM, KSVG, khtml, DOMString, QString,
+ and qstring().
+
+ * WebCore.xcodeproj/project.pbxproj: Pass in WebCore instead of KSVG as the
+ namespace for SVG names.
+ * ksvg2/scripts/make_names.pl: Made a couple changes to trick the SVG names into
+ recompiling, since they are in a different namespace now.
+
+ * ForwardingHeaders/kjs/identifier.h: Added.
+
+ * dom/PlatformWheelEvent.idl: Removed.
+ * dom/WheelEvent.idl: Added. This file was renamed by accident.
+
+ * bindings/js/JSDOMCore.cpp:
+ * bindings/js/JSDOMEvents.cpp:
+ * bindings/js/JSDOMHTML.cpp:
+ * dom/Attr.idl:
+ * dom/CharacterData.idl:
+ * dom/DOMImplementation.idl:
+ * dom/DocumentType.idl:
+ * dom/Element.idl:
+ * dom/Entity.idl:
+ * dom/MutationEvent.idl:
+ * dom/Notation.idl:
+ * dom/ProcessingInstruction.idl:
+ * dom/Text.idl:
+ * html/CanvasGradient.idl:
+ * html/CanvasPattern.idl:
+ * html/CanvasRenderingContext2D.idl:
+ Touched, to get CodeGeneratorJS.pm changes to take effect.
+
+ * css/CSSGrammar.y:
+ * css/css_valueimpl.cpp: (WebCore::propertyID):
+ Changed calls to get CSS property values to use an explicit SVG:: namespace,
+ to match what the script writes out.
+
+ * khtml/ecma/kjs_binding.h: Added forward declaration of WebCore::String.
+
+ * ksvg2/scripts/cssmakeget rid of macro hacks for DOM, KDOM, KSVG, khtml, DOMString, QString
+ props: Made this compile with warnings and strict turned on.
+ Really just a trick to get properties to recompile, which turned out to be unneeded.
+ * ksvg2/scripts/cssmakevalues: Ditto.
+
+ * ksvg2/svg/SVGAElement.cpp:
+ (SVGAElement::parseMappedAttribute):
+ (SVGAElement::defaultEventHandler):
+ * ksvg2/svg/SVGAnimateTransformElement.cpp:
+ (SVGAnimateTransformElement::parseMappedAttribute):
+ * ksvg2/svg/SVGAnimationElement.cpp:
+ (SVGAnimationElement::parseMappedAttribute):
+ * ksvg2/svg/SVGClipPathElement.cpp:
+ (SVGClipPathElement::parseMappedAttribute):
+ * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
+ (SVGComponentTransferFunctionElement::parseMappedAttribute):
+ * ksvg2/svg/SVGExternalResourcesRequired.cpp:
+ (SVGExternalResourcesRequired::parseMappedAttribute):
+ * ksvg2/svg/SVGFEBlendElement.cpp:
+ (SVGFEBlendElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEColorMatrixElement.cpp:
+ (SVGFEColorMatrixElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEComponentTransferElement.cpp:
+ (SVGFEComponentTransferElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFECompositeElement.cpp:
+ (SVGFECompositeElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEDisplacementMapElement.cpp:
+ (SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
+ (SVGFEDisplacementMapElement::stringToChannel):
+ (SVGFEDisplacementMapElement::parseMappedAttribute):
+ (SVGFEDisplacementMapElement::filterEffect):
+ * ksvg2/svg/SVGFEDisplacementMapElement.h:
+ * ksvg2/svg/SVGFEFloodElement.cpp:
+ (SVGFEFloodElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEGaussianBlurElement.cpp:
+ (SVGFEGaussianBlurElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEImageElement.cpp:
+ (SVGFEImageElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFELightElement.cpp:
+ (SVGFELightElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEMergeNodeElement.cpp:
+ (SVGFEMergeNodeElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFEOffsetElement.cpp:
+ (SVGFEOffsetElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFESpecularLightingElement.cpp:
+ (SVGFESpecularLightingElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFETileElement.cpp:
+ (SVGFETileElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFETurbulenceElement.cpp:
+ (SVGFETurbulenceElement::parseMappedAttribute):
+ * ksvg2/svg/SVGFilterElement.cpp:
+ (SVGFilterElement::parseMappedAttribute):
+ * ksvg2/svg/SVGGradientElement.cpp:
+ (SVGGradientElement::parseMappedAttribute):
+ * ksvg2/svg/SVGMaskElement.cpp:
+ (WebCore::SVGMaskElement::parseMappedAttribute):
+ * ksvg2/svg/SVGPolyElement.cpp:
+ (SVGPolyElement::parseMappedAttribute):
+ * ksvg2/svg/SVGStopElement.cpp:
+ (SVGStopElement::parseMappedAttribute):
+ * ksvg2/svg/SVGStyledElement.cpp:
+ (WebCore::SVGStyledElement::parseMappedAttribute):
+ * ksvg2/svg/SVGTests.cpp:
+ (WebCore::SVGTests::parseMappedAttribute):
+ * ksvg2/svg/SVGTextContentElement.cpp:
+ (SVGTextContentElement::parseMappedAttribute):
+ * ksvg2/svg/SVGTextPositioningElement.cpp:
+ (SVGTextPositioningElement::parseMappedAttribute):
+ * ksvg2/svg/SVGViewElement.cpp:
+ (SVGViewElement::parseMappedAttribute):
+ * ksvg2/svg/SVGZoomAndPan.cpp:
+ (SVGZoomAndPan::parseMappedAttribute):
+ Changed code that converts an AtomicString to a String to do it in a
+ more-efficient fashion that works even with all the new conversions.
+
+ * page/Frame.cpp:
+ (WebCore::getString): Removed unneeded .deprecatedString().
+ (WebCore::Frame::begin): Removed the only use of QSTRING_NULL.
+
+ * platform/AtomicString.h: Added conversion to and from KJS::Identifier
+ and KJS::UString.
+ * platform/AtomicString.cpp:
+ (WebCore::AtomicString::add): Added overloads for Identifier and UString.
+ (WebCore::AtomicString::operator Identifier): Added.
+ (WebCore::AtomicString::operator UString): Added.
+
+ * platform/DeprecatedString.h: Added conversion to and from KJS::Identifier
+ and KJS::UString.
+ * platform/DeprecatedString.cpp:
+ (DeprecatedString::DeprecatedString): Added overloads for Identifier and UString.
+ (DeprecatedString::operator Identifier): Added.
+ (DeprecatedString::operator UString): Added.
+
+ * platform/PlatformString.h: Added conversion to and from KJS::Identifier
+ and KJS::UString.
+ * platform/String.cpp:
+ (WebCore::String::String): Added overloads for Identifier and UString.
+ (WebCore::String::operator Identifier): Added.
+ (WebCore::String::operator UString): Added.
+
+ * platform/StringImpl.h: Added constructors that take KJS::Identifier
+ and KJS::UString
+ * platform/StringImpl.cpp:
+ (WebCore::getWordBreakIterator): Changed a use of UChar to say ::UChar
+ instead because of ambiguity with KJS::UChar.
+ (WebCore::StringImpl::StringImpl): Added overloads for Identifier and String.
+
+ * bindings/js/JSCanvasRenderingContext2DBase.cpp:
+ (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
+ (WebCore::toHTMLCanvasStyle):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (aeDescFromJSValue):
+ (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+ * dom/QualifiedName.cpp:
+ (WebCore::QualifiedName::toString):
+ * khtml/ecma/JSDOMParser.cpp:
+ (KJS::DOMParserProtoFunc::callAsFunction):
+ * khtml/ecma/JSXMLHttpRequest.cpp:
+ (KJS::JSXMLHttpRequestProtoFunc::callAsFunction):
+ * khtml/ecma/JSXSLTProcessor.cpp:
+ (KJS::XSLTProcessorProtoFunc::callAsFunction):
+ * khtml/ecma/kjs_binding.cpp:
+ (KJS::valueToStringWithNullCheck):
+ * khtml/ecma/kjs_css.cpp:
+ (KJS::cssPropertyName):
+ (KJS::DOMCSSStyleDeclaration::put):
+ (KJS::DOMCSSStyleDeclarationProtoFunc::callAsFunction):
+ (KJS::DOMStyleSheetList::nameGetter):
+ (KJS::DOMStyleSheetList::getOwnPropertySlot):
+ (KJS::DOMMediaList::put):
+ (KJS::KJS::DOMMediaListProtoFunc::callAsFunction):
+ (KJS::DOMCSSStyleSheetProtoFunc::callAsFunction):
+ (KJS::DOMCSSRule::putValueProperty):
+ (KJS::DOMCSSRuleFunc::callAsFunction):
+ (KJS::DOMCSSValue::put):
+ (KJS::DOMCSSPrimitiveValueProtoFunc::callAsFunction):
+ * khtml/ecma/kjs_dom.cpp:
+ (KJS::DOMNode::putValueProperty):
+ (KJS::DOMNode::toString):
+ (KJS::DOMNodeProtoFunc::callAsFunction):
+ (KJS::DOMEventTargetNodeProtoFunc::callAsFunction):
+ (KJS::DOMNodeList::nameGetter):
+ (KJS::DOMNodeList::getOwnPropertySlot):
+ (KJS::DOMDocument::putValueProperty):
+ (KJS::DOMDocumentProtoFunc::callAsFunction):
+ (KJS::DOMElement::attributeGetter):
+ (KJS::DOMElement::getOwnPropertySlot):
+ (KJS::DOMNamedNodeMap::nameGetter):
+ (KJS::DOMNamedNodeMap::getOwnPropertySlot):
+ (KJS::DOMNamedNodeMapProtoFunc::callAsFunction):
+ (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
+ * khtml/ecma/kjs_events.cpp:
+ (KJS::JSAbstractEventListener::handleEvent):
+ (KJS::DOMEvent::getValueProperty):
+ (KJS::DOMEventProtoFunc::callAsFunction):
+ (KJS::DOMUIEventProtoFunc::callAsFunction):
+ (KJS::DOMMouseEventProtoFunc::callAsFunction):
+ (KJS::DOMKeyboardEventProtoFunc::callAsFunction):
+ (KJS::Clipboard::putValueProperty):
+ (KJS::ClipboardProtoFunc::callAsFunction):
+ * khtml/ecma/kjs_html.cpp:
+ (KJS::HTMLDocFunction::callAsFunction):
+ (KJS::JSHTMLDocument::namedItemGetter):
+ (KJS::JSHTMLDocument::getOwnPropertySlot):
+ (KJS::JSHTMLDocument::putValueProperty):
+ (KJS::JSHTMLElement::framesetNameGetter):
+ (KJS::JSHTMLElement::getOwnPropertySlot):
+ (KJS::HTMLElementFunction::callAsFunction):
+ (KJS::JSHTMLElement::putValueProperty):
+ (KJS::JSHTMLCollection::callAsFunction):
+ (KJS::JSHTMLCollection::getNamedItems):
+ (KJS::HTMLCollectionProtoFunc::callAsFunction):
+ (KJS::OptionConstructorImp::construct):
+ * khtml/ecma/kjs_navigator.cpp:
+ (KJS::Plugins::nameGetter):
+ (KJS::Plugins::getOwnPropertySlot):
+ (KJS::MimeTypes::nameGetter):
+ (KJS::MimeTypes::getOwnPropertySlot):
+ (KJS::Plugin::nameGetter):
+ (KJS::Plugin::getOwnPropertySlot):
+ * khtml/ecma/kjs_proxy.cpp:
+ (WebCore::KJSProxy::evaluate):
+ * khtml/ecma/kjs_range.cpp:
+ (KJS::DOMRangeProtoFunc::callAsFunction):
+ * khtml/ecma/kjs_views.cpp:
+ (KJS::DOMAbstractViewProtoFunc::callAsFunction):
+ * khtml/ecma/kjs_window.cpp:
+ (KJS::parseModalDialogFeatures):
+ (KJS::showModalDialog):
+ (KJS::Window::childFrameGetter):
+ (KJS::Window::namedFrameGetter):
+ (KJS::Window::namedItemGetter):
+ (KJS::Window::getOwnPropertySlot):
+ (KJS::Window::put):
+ (KJS::WindowFunc::callAsFunction):
+ (KJS::ScheduledAction::execute):
+ (KJS::Window::installTimeout):
+ (KJS::FrameArray::nameGetter):
+ (KJS::FrameArray::getOwnPropertySlot):
+ (KJS::Location::put):
+ (KJS::LocationFunc::callAsFunction):
+ (KJS::SelectionFunc::callAsFunction):
+ Removed explicit calls to domString(), sometimes replacing with explicit calls to the
+ String() constructor. Other similar changes for AtomicString and DeprecatedString use.
+
2006-03-20 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
--- /dev/null
+#include <JavaScriptCore/identifier.h>
93EEC20609C2877700C515D1 /* Notation.idl in Resources */ = {isa = PBXBuildFile; fileRef = 93EEC1F409C2877700C515D1 /* Notation.idl */; };
93EEC20709C2877700C515D1 /* ProcessingInstruction.idl in Resources */ = {isa = PBXBuildFile; fileRef = 93EEC1F509C2877700C515D1 /* ProcessingInstruction.idl */; };
93EEC20809C2877700C515D1 /* Text.idl in Resources */ = {isa = PBXBuildFile; fileRef = 93EEC1F609C2877700C515D1 /* Text.idl */; };
- 93EEC20909C2877700C515D1 /* PlatformWheelEvent.idl in Resources */ = {isa = PBXBuildFile; fileRef = 93EEC1F709C2877700C515D1 /* PlatformWheelEvent.idl */; };
+ 93EEC20909C2877700C515D1 /* WheelEvent.idl in Resources */ = {isa = PBXBuildFile; fileRef = 93EEC1F709C2877700C515D1 /* WheelEvent.idl */; };
93EEC26F09C3218000C515D1 /* CanvasPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EEC26E09C3218000C515D1 /* CanvasPattern.cpp */; };
93EEC27109C3218800C515D1 /* CanvasStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EEC27009C3218800C515D1 /* CanvasStyle.cpp */; };
93F198CE08245E59001E9ABC /* kjs_binding.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D1F502DE4369018635CA /* kjs_binding.h */; };
93EEC1F409C2877700C515D1 /* Notation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Notation.idl; sourceTree = "<group>"; };
93EEC1F509C2877700C515D1 /* ProcessingInstruction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ProcessingInstruction.idl; sourceTree = "<group>"; };
93EEC1F609C2877700C515D1 /* Text.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Text.idl; sourceTree = "<group>"; };
- 93EEC1F709C2877700C515D1 /* PlatformWheelEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PlatformWheelEvent.idl; sourceTree = "<group>"; };
+ 93EEC1F709C2877700C515D1 /* WheelEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WheelEvent.idl; sourceTree = "<group>"; };
93EEC26E09C3218000C515D1 /* CanvasPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPattern.cpp; sourceTree = "<group>"; };
93EEC27009C3218800C515D1 /* CanvasStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasStyle.cpp; sourceTree = "<group>"; };
93F19B1908245E59001E9ABC /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A81872160977D3C0005826D9 /* NodeList.cpp */,
A81872100977D3C0005826D9 /* NodeList.h */,
93EEC1F409C2877700C515D1 /* Notation.idl */,
- 93EEC1F709C2877700C515D1 /* PlatformWheelEvent.idl */,
BE91FC8C06133666005E3790 /* Position.cpp */,
BE91FC8B06133666005E3790 /* Position.h */,
93EEC1F509C2877700C515D1 /* ProcessingInstruction.idl */,
6550B69B099DF0270090D781 /* Text.cpp */,
6550B69C099DF0270090D781 /* Text.h */,
93EEC1F609C2877700C515D1 /* Text.idl */,
+ 93EEC1F709C2877700C515D1 /* WheelEvent.idl */,
F523D30902DE4476018635CA /* xml_tokenizer.cpp */,
F523D30A02DE4476018635CA /* xml_tokenizer.h */,
);
93EEC20609C2877700C515D1 /* Notation.idl in Resources */,
93EEC20709C2877700C515D1 /* ProcessingInstruction.idl in Resources */,
93EEC20809C2877700C515D1 /* Text.idl in Resources */,
- 93EEC20909C2877700C515D1 /* PlatformWheelEvent.idl in Resources */,
+ 93EEC20909C2877700C515D1 /* WheelEvent.idl in Resources */,
930CAAD709C495B600229C04 /* CanvasRenderingContext2D.idl in Resources */,
930CAB8909C49EFA00229C04 /* CanvasGradient.idl in Resources */,
930CAB9009C49F1B00229C04 /* CanvasPattern.idl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "ksvg2/scripts/make_names.pl --tags ksvg2/svg/svgtags.in --attrs ksvg2/svg/svgattrs.in \\\n --namespace SVG --cppNamespace KSVG --namespaceURI \"http://www.w3.org/2000/svg\" \\\n --factory --attrsNullNamespace --output \"$DERIVED_FILE_DIR\"\ntouch WebCore+SVG/SVGNamesWrapper.cpp\ntouch WebCore+SVG/SVGElementFactoryWrapper.cpp\n";
+ shellScript = "ksvg2/scripts/make_names.pl --tags ksvg2/svg/svgtags.in --attrs ksvg2/svg/svgattrs.in \\\n --namespace SVG --cppNamespace WebCore --namespaceURI \"http://www.w3.org/2000/svg\" \\\n --factory --attrsNullNamespace --output \"$DERIVED_FILE_DIR\"\ntouch WebCore+SVG/SVGNamesWrapper.cpp\ntouch WebCore+SVG/SVGElementFactoryWrapper.cpp\n";
};
A88AD52509524A34001DD196 /* XLinkNames */ = {
isa = PBXShellScriptBuildPhase;
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "ksvg2/scripts/make_names.pl --attrs ksvg2/misc/xlinkattrs.in --namespace XLink --cppNamespace DOM --namespaceURI \"http://www.w3.org/1999/xlink\" --output \"$DERIVED_FILE_DIR\"\ntouch WebCore+SVG/XLinkNamesWrapper.cpp";
+ shellScript = "ksvg2/scripts/make_names.pl --attrs ksvg2/misc/xlinkattrs.in --namespace XLink --cppNamespace WebCore --namespaceURI \"http://www.w3.org/1999/xlink\" --output \"$DERIVED_FILE_DIR\"\ntouch WebCore+SVG/XLinkNamesWrapper.cpp";
};
A88AD52909524A4A001DD196 /* ksvgcssproperties.c/h */ = {
isa = PBXShellScriptBuildPhase;
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "echo \"First checking for duplicate CSSPropertyNames between html and SVG...\"\ncat css/CSSPropertyNames.in ksvg2/css/CSSPropertyNames.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'\nif [ $? -eq 0 ]; then\n\techo \"Duplicate property!\";\n\texit 1;\nfi\n\ncat ksvg2/css/CSSPropertyNames.in > \"$DERIVED_FILE_DIR/ksvgcssproperties.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakeprops\" -n KSVG -f ksvgcssproperties.in";
+ shellScript = "cat css/CSSPropertyNames.in ksvg2/css/CSSPropertyNames.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'\nif [ $? -eq 0 ]; then\n\techo \"Duplicate property!\";\n\texit 1;\nfi\n\ncat ksvg2/css/CSSPropertyNames.in > \"$DERIVED_FILE_DIR/ksvgcssproperties.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakeprops\" -n SVG -f ksvgcssproperties.in\n";
};
A88AD52B09524A52001DD196 /* ksvgcssvalues.c/h */ = {
isa = PBXShellScriptBuildPhase;
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "echo \"First checking for duplicate CSSValueKeywords between html and SVG...\"\ncat css/CSSValueKeywords.in ksvg2/css/CSSValueKeywords.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'\nif [ $? -eq 0 ]; then\n\techo \"Duplicate value!\";\n\texit 1;\nfi\n\n# Lower case all the values, as CSS values are case-insensitive\ncat ksvg2/css/CSSValueKeywords.in | perl -pe '$_ = lc;' > \"$DERIVED_FILE_DIR/ksvgcssvalues.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakevalues\" -n KSVG -f ksvgcssvalues.in";
+ shellScript = "cat css/CSSValueKeywords.in ksvg2/css/CSSValueKeywords.in | sort | uniq -c | grep -v 1 | awk '{print $2;}' | grep -E '^[^#]'\nif [ $? -eq 0 ]; then\n\techo \"Duplicate value!\";\n\texit 1;\nfi\n\n# Lower case all the values, as CSS values are case-insensitive\ncat ksvg2/css/CSSValueKeywords.in | perl -pe '$_ = lc;' > \"$DERIVED_FILE_DIR/ksvgcssvalues.in\"\ncd \"$DERIVED_FILE_DIR\"\n\"$SRCROOT/ksvg2/scripts/cssmakevalues\" -n SVG -f ksvgcssvalues.in\n";
};
/* End PBXShellScriptBuildPhase section */
switch (args.size()) {
case 1:
if (args[0]->isString())
- context->setStrokeColor(args[0]->toString(exec).domString());
+ context->setStrokeColor(args[0]->toString(exec));
else
context->setStrokeColor(args[0]->toNumber(exec));
break;
case 2:
if (args[0]->isString())
- context->setStrokeColor(args[0]->toString(exec).domString(), args[1]->toNumber(exec));
+ context->setStrokeColor(args[0]->toString(exec), args[1]->toNumber(exec));
else
context->setStrokeColor(args[0]->toNumber(exec), args[1]->toNumber(exec));
break;
switch (args.size()) {
case 1:
if (args[0]->isString())
- context->setFillColor(args[0]->toString(exec).domString());
+ context->setFillColor(args[0]->toString(exec));
else
context->setFillColor(args[0]->toNumber(exec));
break;
case 2:
if (args[0]->isString())
- context->setFillColor(args[0]->toString(exec).domString(), args[1]->toNumber(exec));
+ context->setFillColor(args[0]->toString(exec), args[1]->toNumber(exec));
else
context->setFillColor(args[0]->toNumber(exec), args[1]->toNumber(exec));
break;
case 4:
if (args[3]->isString())
context->setShadow(args[0]->toNumber(exec), args[1]->toNumber(exec),
- args[2]->toNumber(exec), args[3]->toString(exec).domString());
+ args[2]->toNumber(exec), args[3]->toString(exec));
else
context->setShadow(args[0]->toNumber(exec), args[1]->toNumber(exec),
args[2]->toNumber(exec), args[3]->toNumber(exec));
case 5:
if (args[3]->isString())
context->setShadow(args[0]->toNumber(exec), args[1]->toNumber(exec),
- args[2]->toNumber(exec), args[3]->toString(exec).domString(),
+ args[2]->toNumber(exec), args[3]->toString(exec),
args[4]->toNumber(exec));
else
context->setShadow(args[0]->toNumber(exec), args[1]->toNumber(exec),
args[3]->toNumber(exec), args[4]->toNumber(exec),
args[5]->toNumber(exec), args[6]->toNumber(exec),
args[7]->toNumber(exec), args[8]->toNumber(exec),
- args[9]->toString(exec).domString());
+ args[9]->toString(exec));
break;
}
case JSCanvasRenderingContext2DBase::CreatePattern:
return throwError(exec, TypeError);
return toJS(exec,
context->createPattern(static_cast<HTMLImageElement*>(static_cast<JSHTMLElement*>(args[0])->impl()),
- args[1]->toString(exec).domString()).get());
+ args[1]->toString(exec)).get());
}
return jsUndefined();
static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState* exec, JSValue* value)
{
if (value->isString())
- return new CanvasStyle(value->toString(exec).domString());
+ return new CanvasStyle(value->toString(exec));
if (!value->isObject())
return 0;
JSObject* object = static_cast<JSObject*>(value);
#include "config.h"
-// The files below are all generated by a script.
+// The files below are generated by a script.
#include "JSAttr.cpp"
#include "JSCharacterData.cpp"
#include "config.h"
-// The files below are all generated by a script.
+// The files below are generated by a script.
#include "JSMutationEvent.cpp"
#include "JSWheelEvent.cpp"
#include "config.h"
-// The files below are all generated by a script.
+// The files below are generated by a script.
#include "JSCanvasGradient.cpp"
#include "JSCanvasPattern.cpp"
} elsif ($type eq "float") {
return "$value->toNumber(exec)";
} elsif ($type eq "AtomicString") {
- return "AtomicString($value->toString(exec).domString())";
+ return "$value->toString(exec)";
} elsif ($type eq "DOMString") {
if ($signature->extendedAttributes->{"ConvertNullToNullString"}) {
return "valueToStringWithNullCheck(exec, $value)";
} else {
- return "$value->toString(exec).domString()";
+ return "$value->toString(exec)";
}
} elsif ($type eq "views::AbstractView") {
$implIncludes{"kjs_views.h"} = 1;
aeDesc = [NSAppleEventDescriptor descriptorWithBoolean:jsValue->getBoolean()];
break;
case StringType:
- aeDesc = [NSAppleEventDescriptor descriptorWithString:jsValue->getString().domString()];
+ aeDesc = [NSAppleEventDescriptor descriptorWithString:String(jsValue->getString())];
break;
case NumberType: {
Float64 value = jsValue->getNumber();
if (!result || !result->isString())
return 0;
JSLock lock;
- return result->getString().domString();
+ return String(result->getString());
}
- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)string
#define KHTML_NO_XBL 1
#define KHTML_XSLT 1
-// Temporary defines to help the namespace merging and platform projects.
-#define DOM WebCore
-#define KDOM WebCore
-#define KSVG WebCore
-#define khtml WebCore
-#define DOMString String
-#define QString DeprecatedString
-#define qstring() deprecatedString()
-
#if __APPLE__
#define HAVE_FUNC_USLEEP 1
#endif
$$ = getPropertyID( str.lower().latin1(), str.length() );
#if SVG_SUPPORT
if ($$ == 0)
- $$ = getSVGCSSPropertyID(str.lower().latin1(), str.length());
+ $$ = SVG::getSVGCSSPropertyID(str.lower().latin1(), str.length());
#endif
}
;
$$.id = getValueID( str.lower().latin1(), str.length() );
#if SVG_SUPPORT
if ($$.id == 0)
- $$.id = getSVGCSSValueID(str.lower().latin1(), str.length());
+ $$.id = SVG::getSVGCSSValueID(str.lower().latin1(), str.length());
#endif
$$.unit = CSSPrimitiveValue::CSS_IDENT;
$$.string = $1;
int id = getPropertyID(buffer, len);
#if SVG_SUPPORT
if (id == 0)
- id = getSVGCSSPropertyID(buffer, len);
+ id = SVG::getSVGCSSPropertyID(buffer, len);
#endif
return id;
}
{
String local = localName();
if (hasPrefix())
- return String(prefix()) + ":" + local;
+ return prefix() + ":" + local;
return local;
}
if (args.size() != 2)
return jsUndefined();
- DeprecatedString str = args[0]->toString(exec).deprecatedString();
- DeprecatedString contentType = args[1]->toString(exec).deprecatedString().stripWhiteSpace();
+ DeprecatedString str = args[0]->toString(exec);
+ DeprecatedString contentType = DeprecatedString(args[1]->toString(exec)).stripWhiteSpace();
if (DOMImplementation::isXMLMIMEType(contentType)) {
RefPtr<Document> doc = parser->doc->implementation()->createDocument();
case JSXMLHttpRequest::GetResponseHeader:
if (args.size() != 1)
return jsUndefined();
- return jsStringOrUndefined(request->m_impl->getResponseHeader(args[0]->toString(exec).domString()));
+ return jsStringOrUndefined(request->m_impl->getResponseHeader(args[0]->toString(exec)));
case JSXMLHttpRequest::Open:
{
if (args.size() < 2 || args.size() > 5)
return jsUndefined();
- String method = args[0]->toString(exec).domString();
- KURL url = KURL(Window::retrieveActive(exec)->frame()->document()->completeURL(args[1]->toString(exec).deprecatedString()));
+ String method = args[0]->toString(exec);
+ KURL url = KURL(Window::retrieveActive(exec)->frame()->document()->completeURL(DeprecatedString(args[1]->toString(exec))));
bool async = true;
if (args.size() >= 3)
String user;
if (args.size() >= 4)
- user = args[3]->toString(exec).domString();
+ user = args[3]->toString(exec);
String password;
if (args.size() >= 5)
- password = args[4]->toString(exec).domString();
+ password = args[4]->toString(exec);
request->m_impl->open(method, url, async, user, password);
if (exec->hadException())
exec->clearException();
else
- body = args[0]->toString(exec).domString();
+ body = args[0]->toString(exec);
}
}
case JSXMLHttpRequest::SetRequestHeader:
if (args.size() != 2)
return jsUndefined();
- request->m_impl->setRequestHeader(args[0]->toString(exec).domString(), args[1]->toString(exec).domString());
+ request->m_impl->setRequestHeader(args[0]->toString(exec), args[1]->toString(exec));
return jsUndefined();
case JSXMLHttpRequest::OverrideMIMEType:
if (args.size() != 1)
return jsUndefined();
- request->m_impl->overrideMIMEType(args[0]->toString(exec).domString());
+ request->m_impl->overrideMIMEType(args[0]->toString(exec));
return jsUndefined();
}
{
if (args[1]->isUndefinedOrNull() || args[2]->isUndefinedOrNull())
return jsUndefined(); // Throw exception?
- String namespaceURI = args[0]->toString(exec).domString();
- String localName = args[1]->toString(exec).domString();
- String value = args[2]->toString(exec).domString();
+ String namespaceURI = args[0]->toString(exec);
+ String localName = args[1]->toString(exec);
+ String value = args[2]->toString(exec);
processor.setParameter(namespaceURI.impl(), localName.impl(), value.impl());
return jsUndefined();
}
{
if (args[1]->isUndefinedOrNull())
return jsUndefined();
- String namespaceURI = args[0]->toString(exec).domString();
- String localName = args[1]->toString(exec).domString();
+ String namespaceURI = args[0]->toString(exec);
+ String localName = args[1]->toString(exec);
StringImpl *value = processor.getParameter(namespaceURI.impl(), localName.impl()).get();
if (value)
return jsString(UString(String(value)));
{
if (args[1]->isUndefinedOrNull())
return jsUndefined();
- String namespaceURI = args[0]->toString(exec).domString();
- String localName = args[1]->toString(exec).domString();
+ String namespaceURI = args[0]->toString(exec);
+ String localName = args[1]->toString(exec);
processor.removeParameter(namespaceURI.impl(), localName.impl());
return jsUndefined();
}
#include "EventNames.h"
#include "Frame.h"
-#include "dom2_eventsimpl.h"
+#include "PlatformString.h"
#include "Range.h"
+#include "dom2_eventsimpl.h"
#include "kjs_dom.h"
#include "kjs_window.h"
#include <kjs/collector.h>
//////
-UString::UString(const DeprecatedString &d)
-{
- // reinterpret_cast is ugly but in this case safe, since QChar and UChar have the same memory layout
- m_rep = UString::Rep::createCopying(reinterpret_cast<const UChar *>(d.unicode()), d.length());
-}
-
-UString::UString(const String &d)
-{
- if (d.isNull()) {
- m_rep = &Rep::null;
- return;
- }
- // reinterpret_cast is ugly but in this case safe, since QChar and UChar have the same memory layout
- m_rep = UString::Rep::createCopying(reinterpret_cast<const UChar *>(d.unicode()), d.length());
-}
-
-UString::UString(const AtomicString &d)
-{
- if (d.isNull()) {
- m_rep = &Rep::null;
- return;
- }
- // reinterpret_cast is ugly but in this case safe, since QChar and UChar have the same memory layout
- m_rep = UString::Rep::createCopying(reinterpret_cast<const UChar *>(d.domString().unicode()), d.domString().length());
-}
-
-String UString::domString() const
-{
- if (isNull())
- return String();
- if (isEmpty())
- return "";
- return String((QChar*) data(), size());
-}
-
-DeprecatedString UString::deprecatedString() const
-{
- if (isNull())
- return DeprecatedString();
- if (isEmpty())
- return "";
- return DeprecatedString((QChar*) data(), size());
-}
-
-QConstString UString::qconststring() const
-{
- return QConstString((QChar*) data(), size());
-}
-
-String Identifier::domString() const
-{
- if (isNull())
- return String();
- if (isEmpty())
- return "";
- return String((QChar*) data(), size());
-}
-
-DeprecatedString Identifier::deprecatedString() const
-{
- if (isNull())
- return DeprecatedString();
- if (isEmpty())
- return "";
- return DeprecatedString((QChar*) data(), size());
-}
-
JSValue *jsStringOrNull(const String &s)
{
if (s.isNull())
{
if (val->isNull())
return String();
- return val->toString(exec).domString();
+ return val->toString(exec);
}
static const char * const exceptionNames[] = {
class Event;
class Frame;
class Node;
+ class String;
typedef int ExceptionCode;
}
static String cssPropertyName(const Identifier &p, bool *hadPixelOrPosPrefix = 0)
{
- DeprecatedString prop = p.deprecatedString();
+ DeprecatedString prop = p;
int i = prop.length();
while (--i) {
void DOMCSSStyleDeclaration::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr )
{
#ifdef KJS_VERBOSE
- kdDebug(6070) << "DOMCSSStyleDeclaration::put " << propertyName.deprecatedString() << endl;
+ kdDebug(6070) << "DOMCSSStyleDeclaration::put " << propertyName << endl;
#endif
DOMExceptionTranslator exception(exec);
CSSStyleDeclaration &styleDecl = *m_impl;
if (propertyName == "cssText") {
- styleDecl.setCssText(value->toString(exec).domString(), exception);
+ styleDecl.setCssText(value->toString(exec), exception);
} else {
if (isCSSPropertyName(propertyName)) {
bool pixelOrPos;
String prop = cssPropertyName(propertyName, &pixelOrPos);
- String propvalue = value->toString(exec).domString();
+ String propvalue = value->toString(exec);
if (pixelOrPos)
propvalue += "px";
#ifdef KJS_VERBOSE
DOMExceptionTranslator exception(exec);
CSSStyleDeclaration &styleDecl = *static_cast<DOMCSSStyleDeclaration *>(thisObj)->impl();
UString str = args[0]->toString(exec);
- WebCore::String s = str.domString();
+ WebCore::String s = str;
switch (id) {
case DOMCSSStyleDeclaration::GetPropertyValue:
case DOMCSSStyleDeclaration::IsPropertyImplicit:
return jsBoolean(styleDecl.isPropertyImplicit(s));
case DOMCSSStyleDeclaration::SetProperty:
- styleDecl.setProperty(s, args[1]->toString(exec).domString(), args[2]->toString(exec).domString(), exception);
+ styleDecl.setProperty(s, args[1]->toString(exec), args[2]->toString(exec), exception);
return jsUndefined();
case DOMCSSStyleDeclaration::Item:
return jsStringOrNull(styleDecl.item(args[0]->toInt32(exec)));
JSValue *DOMStyleSheetList::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
DOMStyleSheetList *thisObj = static_cast<DOMStyleSheetList *>(slot.slotBase());
- Element *element = thisObj->m_doc->getElementById(propertyName.domString().impl());
+ Element *element = thisObj->m_doc->getElementById(propertyName);
return toJS(exec, static_cast<HTMLStyleElement *>(element)->sheet());
}
// ### Bad implementation because returns a single element (are IDs always unique?)
// and doesn't look for name attribute (see implementation above).
// But unicity of stylesheet ids is good practice anyway ;)
- Element *element = m_doc->getElementById(propertyName.domString().impl());
+ Element *element = m_doc->getElementById(propertyName);
if (element && element->hasTagName(styleTag)) {
slot.setCustom(this, nameGetter);
return true;
{
MediaList &mediaList = *m_impl;
if (propertyName == "mediaText")
- mediaList.setMediaText(value->toString(exec).domString());
+ mediaList.setMediaText(value->toString(exec));
else
DOMObject::put(exec, propertyName, value, attr);
}
case DOMMediaList::Item:
return jsStringOrNull(mediaList.item(args[0]->toInt32(exec)));
case DOMMediaList::DeleteMedium:
- mediaList.deleteMedium(args[0]->toString(exec).domString());
+ mediaList.deleteMedium(args[0]->toString(exec));
return jsUndefined();
case DOMMediaList::AppendMedium:
- mediaList.appendMedium(args[0]->toString(exec).domString());
+ mediaList.appendMedium(args[0]->toString(exec));
return jsUndefined();
default:
return jsUndefined();
CSSStyleSheet &styleSheet = *static_cast<CSSStyleSheet *>(static_cast<DOMCSSStyleSheet *>(thisObj)->impl());
switch (id) {
case DOMCSSStyleSheet::InsertRule:
- return jsNumber(styleSheet.insertRule(args[0]->toString(exec).domString(), args[1]->toInt32(exec), exception));
+ return jsNumber(styleSheet.insertRule(args[0]->toString(exec), args[1]->toInt32(exec), exception));
case DOMCSSStyleSheet::DeleteRule:
styleSheet.deleteRule(args[0]->toInt32(exec), exception);
return jsUndefined();
case DOMCSSStyleSheet::AddRule: {
int index = args.size() >= 3 ? args[2]->toInt32(exec) : -1;
- styleSheet.addRule(args[0]->toString(exec).domString(), args[1]->toString(exec).domString(), index, exception);
+ styleSheet.addRule(args[0]->toString(exec), args[1]->toString(exec), index, exception);
// As per Microsoft documentation, always return -1.
return jsNumber(-1);
}
switch (token) {
// for STYLE_RULE:
case Style_SelectorText:
- static_cast<CSSStyleRule *>(m_impl.get())->setSelectorText(value->toString(exec).domString());
+ static_cast<CSSStyleRule *>(m_impl.get())->setSelectorText(value->toString(exec));
return;
// for PAGE_RULE:
case Page_SelectorText:
- static_cast<CSSPageRule *>(m_impl.get())->setSelectorText(value->toString(exec).domString());
+ static_cast<CSSPageRule *>(m_impl.get())->setSelectorText(value->toString(exec));
return;
// for CHARSET_RULE:
case Charset_Encoding:
- static_cast<CSSCharsetRule *>(m_impl.get())->setEncoding(value->toString(exec).domString());
+ static_cast<CSSCharsetRule *>(m_impl.get())->setEncoding(value->toString(exec));
return;
}
}
if (cssRule.type() == WebCore::MEDIA_RULE) {
CSSMediaRule &rule = static_cast<CSSMediaRule &>(cssRule);
if (id == DOMCSSRule::Media_InsertRule)
- return jsNumber(rule.insertRule(args[0]->toString(exec).domString(), args[1]->toInt32(exec)));
+ return jsNumber(rule.insertRule(args[0]->toString(exec), args[1]->toInt32(exec)));
else if (id == DOMCSSRule::Media_DeleteRule)
rule.deleteRule(args[0]->toInt32(exec));
}
{
CSSValue &cssValue = *m_impl;
if (propertyName == "cssText")
- cssValue.setCssText(value->toString(exec).domString());
+ cssValue.setCssText(value->toString(exec));
else
DOMObject::put(exec, propertyName, value, attr);
}
case DOMCSSPrimitiveValue::GetFloatValue:
return jsNumber(val.getFloatValue(args[0]->toInt32(exec)));
case DOMCSSPrimitiveValue::SetStringValue:
- val.setStringValue(args[0]->toInt32(exec), args[1]->toString(exec).domString(), exception);
+ val.setStringValue(args[0]->toInt32(exec), args[1]->toString(exec), exception);
return jsUndefined();
case DOMCSSPrimitiveValue::GetStringValue:
return jsStringOrNull(val.getStringValue());
Node &node = *m_impl;
switch (token) {
case NodeValue:
- node.setNodeValue(value->toString(exec).domString(), exception);
+ node.setNodeValue(value->toString(exec), exception);
break;
case Prefix:
- node.setPrefix(value->toString(exec).domString().impl(), exception);
+ node.setPrefix(value->toString(exec), exception);
break;
case TextContent:
node.setTextContent(valueToStringWithNullCheck(exec, value), exception);
{
if (!m_impl)
return "null";
- return "[object " + (m_impl->isElementNode() ? m_impl->nodeName() : className()) + "]";
+ return "[object " + (m_impl->isElementNode() ? UString(m_impl->nodeName()) : className()) + "]";
}
JSValue *DOMNodeProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
node.normalize();
return jsUndefined();
case DOMNode::IsSupported:
- return jsBoolean(node.isSupported(args[0]->toString(exec).domString(),
+ return jsBoolean(node.isSupported(args[0]->toString(exec),
valueToStringWithNullCheck(exec, args[1])));
case DOMNode::IsSameNode:
return jsBoolean(node.isSameNode(toNode(args[0])));
case DOMEventTargetNode::AddEventListener: {
JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]);
if (listener)
- node->addEventListener(AtomicString(args[0]->toString(exec).domString()), listener,args[2]->toBoolean(exec));
+ node->addEventListener(args[0]->toString(exec), listener,args[2]->toBoolean(exec));
return jsUndefined();
}
case DOMEventTargetNode::RemoveEventListener: {
JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]);
if (listener)
- node->removeEventListener(AtomicString(args[0]->toString(exec).domString()), listener,args[2]->toBoolean(exec));
+ node->removeEventListener(args[0]->toString(exec), listener,args[2]->toBoolean(exec));
return jsUndefined();
}
case DOMEventTargetNode::DispatchEvent:
JSValue *DOMNodeList::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNodeList *thisObj = static_cast<DOMNodeList *>(slot.slotBase());
- return toJS(exec, thisObj->m_impl->itemById(propertyName.domString().impl()));
+ return toJS(exec, thisObj->m_impl->itemById(propertyName));
}
bool DOMNodeList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
if (ok && idx < list.length()) {
slot.setCustomIndex(this, idx, indexGetter);
return true;
- } else if (list.itemById(propertyName.domString().impl())) {
+ } else if (list.itemById(String(propertyName).impl())) {
slot.setCustom(this, nameGetter);
return true;
}
Document &doc = *static_cast<Document *>(impl());
switch (token) {
case SelectedStylesheetSet:
- doc.setSelectedStylesheetSet(value->toString(exec).domString());
+ doc.setSelectedStylesheetSet(value->toString(exec));
break;
case Charset:
doc.decoder()->setEncodingName(value->toString(exec).cstring().c_str(), Decoder::UserChosenEncoding);
Node &node = *static_cast<DOMNode *>(thisObj)->impl();
Document &doc = static_cast<Document &>(node);
UString str = args[0]->toString(exec);
- WebCore::String s = str.domString();
+ WebCore::String s = str;
switch(id) {
case DOMDocument::AdoptNode:
case DOMDocument::CreateCDATASection:
return toJS(exec, doc.createCDATASection(s, exception));
case DOMDocument::CreateProcessingInstruction:
- return toJS(exec, doc.createProcessingInstruction(args[0]->toString(exec).domString(), args[1]->toString(exec).domString(), exception));
+ return toJS(exec, doc.createProcessingInstruction(args[0]->toString(exec), args[1]->toString(exec), exception));
case DOMDocument::CreateAttribute:
return toJS(exec,doc.createAttribute(s, exception));
case DOMDocument::CreateEntityReference:
case DOMDocument::ImportNode: // DOM2
return toJS(exec,doc.importNode(toNode(args[0]), args[1]->toBoolean(exec), exception));
case DOMDocument::CreateElementNS: // DOM2
- return toJS(exec,doc.createElementNS(s, args[1]->toString(exec).domString(), exception));
+ return toJS(exec,doc.createElementNS(s, args[1]->toString(exec), exception));
case DOMDocument::CreateAttributeNS: // DOM2
- return toJS(exec,doc.createAttributeNS(s, args[1]->toString(exec).domString(), exception));
+ return toJS(exec,doc.createAttributeNS(s, args[1]->toString(exec), exception));
case DOMDocument::GetElementsByTagNameNS: // DOM2
- return toJS(exec,doc.getElementsByTagNameNS(s, args[1]->toString(exec).domString()).get());
+ return toJS(exec,doc.getElementsByTagNameNS(s, args[1]->toString(exec)).get());
case DOMDocument::GetElementById:
- return toJS(exec,doc.getElementById(args[0]->toString(exec).domString().impl()));
+ return toJS(exec,doc.getElementById(args[0]->toString(exec)));
case DOMDocument::CreateRange:
return toJS(exec, doc.createRange().get());
case DOMDocument::CreateNodeIterator: {
return toJS(exec, doc.createEvent(s, exception).get());
case DOMDocument::GetOverrideStyle:
if (Element *element0 = toElement(args[0]))
- return toJS(exec,doc.getOverrideStyle(element0, args[1]->toString(exec).domString()));
+ return toJS(exec,doc.getOverrideStyle(element0, args[1]->toString(exec)));
// FIXME: Is undefined right here, or should we raise an exception?
return jsUndefined();
case DOMDocument::ExecCommand: {
- return jsBoolean(doc.execCommand(args[0]->toString(exec).domString(), args[1]->toBoolean(exec), args[2]->toString(exec).domString()));
+ return jsBoolean(doc.execCommand(args[0]->toString(exec), args[1]->toBoolean(exec), args[2]->toString(exec)));
}
case DOMDocument::QueryCommandEnabled: {
- return jsBoolean(doc.queryCommandEnabled(args[0]->toString(exec).domString()));
+ return jsBoolean(doc.queryCommandEnabled(args[0]->toString(exec)));
}
case DOMDocument::QueryCommandIndeterm: {
- return jsBoolean(doc.queryCommandIndeterm(args[0]->toString(exec).domString()));
+ return jsBoolean(doc.queryCommandIndeterm(args[0]->toString(exec)));
}
case DOMDocument::QueryCommandState: {
- return jsBoolean(doc.queryCommandState(args[0]->toString(exec).domString()));
+ return jsBoolean(doc.queryCommandState(args[0]->toString(exec)));
}
case DOMDocument::QueryCommandSupported: {
- return jsBoolean(doc.queryCommandSupported(args[0]->toString(exec).domString()));
+ return jsBoolean(doc.queryCommandSupported(args[0]->toString(exec)));
}
case DOMDocument::QueryCommandValue: {
- WebCore::String commandValue(doc.queryCommandValue(args[0]->toString(exec).domString()));
+ WebCore::String commandValue(doc.queryCommandValue(args[0]->toString(exec)));
// Method returns null String to signal command is unsupported.
// Microsoft documentation for this method says:
// "If not supported [for a command identifier], this method returns a Boolean set to false."
DOMElement *thisObj = static_cast<DOMElement *>(slot.slotBase());
Element *element = static_cast<Element *>(thisObj->impl());
- WebCore::String attr = element->getAttribute(propertyName.domString());
+ WebCore::String attr = element->getAttribute(propertyName);
return jsStringOrNull(attr);
}
// FIXME: do we really want to do this attribute lookup thing? Mozilla doesn't do it,
// and it seems like it could interfere with XBL.
- WebCore::String attr = element.getAttribute(propertyName.domString());
+ WebCore::String attr = element.getAttribute(propertyName);
if (!attr.isNull()) {
slot.setCustom(this, attributeGetter);
return true;
JSValue *DOMNamedNodeMap::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
DOMNamedNodeMap *thisObj = static_cast<DOMNamedNodeMap *>(slot.slotBase());
- return toJS(exec, thisObj->m_impl->getNamedItem(propertyName.domString()));
+ return toJS(exec, thisObj->m_impl->getNamedItem(propertyName));
}
bool DOMNamedNodeMap::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
return true;
}
- if (m_impl->getNamedItem(propertyName.domString())) {
+ if (m_impl->getNamedItem(propertyName)) {
slot.setCustom(this, nameGetter);
return true;
}
NamedNodeMap &map = *static_cast<DOMNamedNodeMap *>(thisObj)->impl();
switch (id) {
case DOMNamedNodeMap::GetNamedItem:
- return toJS(exec, map.getNamedItem(args[0]->toString(exec).domString()));
+ return toJS(exec, map.getNamedItem(args[0]->toString(exec)));
case DOMNamedNodeMap::SetNamedItem:
return toJS(exec, map.setNamedItem(toNode(args[0]), exception).get());
case DOMNamedNodeMap::RemoveNamedItem:
- return toJS(exec, map.removeNamedItem(args[0]->toString(exec).domString(), exception).get());
+ return toJS(exec, map.removeNamedItem(args[0]->toString(exec), exception).get());
case DOMNamedNodeMap::Item:
return toJS(exec, map.item(args[0]->toInt32(exec)));
case DOMNamedNodeMap::GetNamedItemNS: // DOM2
- return toJS(exec, map.getNamedItemNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec).domString()));
+ return toJS(exec, map.getNamedItemNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec)));
case DOMNamedNodeMap::SetNamedItemNS: // DOM2
return toJS(exec, map.setNamedItemNS(toNode(args[0]), exception).get());
case DOMNamedNodeMap::RemoveNamedItemNS: // DOM2
- return toJS(exec, map.removeNamedItemNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec).domString(), exception).get());
+ return toJS(exec, map.removeNamedItemNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec), exception).get());
}
return jsUndefined();
}
// For IE compatibility, we need to be able to look up elements in a
// document.formName.name result by id as well as be index.
+ AtomicString atomicPropertyName = propertyName;
DeprecatedValueListConstIterator< RefPtr<Node> > end = m_nodes.end();
int i = 0;
for (DeprecatedValueListConstIterator< RefPtr<Node> > it = m_nodes.begin(); it != end; ++it, ++i) {
Node *node = (*it).get();
- if (node->hasAttributes() &&
- node->attributes()->id() == propertyName.domString()) {
+ if (node->hasAttributes() && node->attributes()->id() == atomicPropertyName) {
slot.setCustomIndex(this, i, indexGetter);
return true;
}
if (exec->hadException()) {
JSObject* exception = exec->exception()->toObject(exec);
- String message = exception->get(exec, messagePropertyName)->toString(exec).domString();
+ String message = exception->get(exec, messagePropertyName)->toString(exec);
int lineNumber = exception->get(exec, "line")->toInt32(exec);
- String sourceURL = exception->get(exec, "sourceURL")->toString(exec).domString();
+ String sourceURL = exception->get(exec, "sourceURL")->toString(exec);
if (Interpreter::shouldPrintExceptions())
printf("(event handler):%s\n", message.deprecatedString().utf8().data());
frame->addMessageToConsole(message, lineNumber, sourceURL);
exec->clearException();
} else {
if (!retval->isUndefinedOrNull() && event->storesResultAsString())
- event->storeResult(retval->toString(exec).domString());
+ event->storeResult(retval->toString(exec));
if (html) {
bool retvalbool;
if (retval->getBoolean(retvalbool) && !retvalbool)
Event &event = *m_impl;
switch (token) {
case Type:
- return jsString(event.type().domString());
+ return jsString(event.type());
case Target:
case SrcElement: /*MSIE extension - "the object that fired the event"*/
return toJS(exec, event.target());
event.preventDefault();
return jsUndefined();
case DOMEvent::InitEvent:
- event.initEvent(AtomicString(args[0]->toString(exec).domString()), args[1]->toBoolean(exec), args[2]->toBoolean(exec));
+ event.initEvent(AtomicString(args[0]->toString(exec)), args[1]->toBoolean(exec), args[2]->toBoolean(exec));
return jsUndefined();
};
return jsUndefined();
UIEvent &uiEvent = *static_cast<UIEvent *>(static_cast<DOMUIEvent *>(thisObj)->impl());
switch (id) {
case DOMUIEvent::InitUIEvent:
- uiEvent.initUIEvent(AtomicString(args[0]->toString(exec).domString()),
+ uiEvent.initUIEvent(AtomicString(args[0]->toString(exec)),
args[1]->toBoolean(exec),
args[2]->toBoolean(exec),
toAbstractView(args[3]),
MouseEvent &mouseEvent = *static_cast<MouseEvent *>(static_cast<DOMMouseEvent *>(thisObj)->impl());
switch (id) {
case DOMMouseEvent::InitMouseEvent:
- mouseEvent.initMouseEvent(AtomicString(args[0]->toString(exec).domString()), // typeArg
+ mouseEvent.initMouseEvent(AtomicString(args[0]->toString(exec)), // typeArg
args[1]->toBoolean(exec), // canBubbleArg
args[2]->toBoolean(exec), // cancelableArg
toAbstractView(args[3]), // viewArg
KeyboardEvent &event = *static_cast<KeyboardEvent *>(static_cast<DOMUIEvent *>(thisObj)->impl());
switch (id) {
case DOMKeyboardEvent::InitKeyboardEvent:
- event.initKeyboardEvent(AtomicString(args[0]->toString(exec).domString()), // typeArg
+ event.initKeyboardEvent(AtomicString(args[0]->toString(exec)), // typeArg
args[1]->toBoolean(exec), // canBubbleArg
args[2]->toBoolean(exec), // cancelableArg
toAbstractView(args[3]), // viewArg
- args[4]->toString(exec).domString(), // keyIdentifier
+ args[4]->toString(exec), // keyIdentifier
args[5]->toInt32(exec), // keyLocationArg
args[6]->toBoolean(exec), // ctrlKeyArg
args[7]->toBoolean(exec), // altKeyArg
case DropEffect:
// can never set this when not for dragging, thus getting always returns NULL string
if (clipboard->isForDragging())
- clipboard->setDropEffect(value->toString(exec).domString());
+ 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).domString());
+ clipboard->setEffectAllowed(value->toString(exec));
break;
}
}
cb->clipboard->clearAllData();
return jsUndefined();
} else if (args.size() == 1) {
- cb->clipboard->clearData(args[0]->toString(exec).domString());
+ cb->clipboard->clearData(args[0]->toString(exec));
return jsUndefined();
} else {
return throwError(exec, SyntaxError, "clearData: Invalid number of arguments");
{
if (args.size() == 1) {
bool success;
- WebCore::String result = cb->clipboard->getData(args[0]->toString(exec).domString(), success);
+ WebCore::String result = cb->clipboard->getData(args[0]->toString(exec), success);
if (success) {
return jsString(result);
} else {
}
case Clipboard::SetData:
if (args.size() == 2) {
- return jsBoolean(cb->clipboard->setData(args[0]->toString(exec).domString(), args[1]->toString(exec).domString()));
+ return jsBoolean(cb->clipboard->setData(args[0]->toString(exec), args[1]->toString(exec)));
} else {
return throwError(exec, SyntaxError, "setData: Invalid number of arguments");
}
case JSHTMLDocument::WriteLn: {
// DOM only specifies single string argument, but NS & IE allow multiple
// or no arguments
- UString str = "";
+ String str = "";
for (int i = 0; i < args.size(); i++)
str += args[i]->toString(exec);
if (id == JSHTMLDocument::WriteLn)
str += "\n";
- //kdDebug() << "document.write: " << str.ascii() << endl;
- doc.write(str.domString());
+ doc.write(str);
return jsUndefined();
}
case JSHTMLDocument::GetElementsByName:
- return toJS(exec, doc.getElementsByName(args[0]->toString(exec).domString()).get());
+ return toJS(exec, doc.getElementsByName(args[0]->toString(exec)).get());
case JSHTMLDocument::CaptureEvents:
case JSHTMLDocument::ReleaseEvents:
// Do nothing for now. These are NS-specific legacy calls.
JSHTMLDocument *thisObj = static_cast<JSHTMLDocument *>(slot.slotBase());
HTMLDocument &doc = *static_cast<HTMLDocument *>(thisObj->impl());
- String name = propertyName.domString();
+ String name = propertyName;
RefPtr<WebCore::HTMLCollection> collection = doc.documentNamedItems(name);
if (collection->length() == 1) {
{
HTMLDocument &doc = *static_cast<HTMLDocument *>(impl());
- String name = propertyName.domString();
+ String name = propertyName;
if (doc.hasNamedItem(name) || doc.hasDocExtraNamedItem(name)) {
slot.setCustom(this, namedItemGetter);
return true;
switch (token) {
case Title:
- doc.setTitle(value->toString(exec).domString());
+ doc.setTitle(value->toString(exec));
break;
case Body:
doc.setBody(toHTMLElement(value), exception);
break;
case Domain: // not part of the DOM
- doc.setDomain(value->toString(exec).domString());
+ doc.setDomain(value->toString(exec));
break;
case Cookie:
- doc.setCookie(value->toString(exec).domString());
+ doc.setCookie(value->toString(exec));
break;
case Location: {
Frame *frame = doc.frame();
if (frame)
{
- DeprecatedString str = value->toString(exec).deprecatedString();
+ DeprecatedString str = value->toString(exec);
// When assigning location, IE and Mozilla both resolve the URL
// relative to the frame where the JavaScript is executing not
}
case BgColor:
if (bodyElement)
- bodyElement->setBgColor(value->toString(exec).domString());
+ bodyElement->setBgColor(value->toString(exec));
break;
case FgColor:
if (bodyElement)
- bodyElement->setText(value->toString(exec).domString());
+ bodyElement->setText(value->toString(exec));
break;
case AlinkColor:
if (bodyElement) {
// this check is a bit silly, but some benchmarks like to set the
// document's link colors over and over to the same value and we
// don't want to incur a style update each time.
- String newColor = value->toString(exec).domString();
+ String newColor = value->toString(exec);
if (bodyElement->aLink() != newColor)
bodyElement->setALink(newColor);
}
// this check is a bit silly, but some benchmarks like to set the
// document's link colors over and over to the same value and we
// don't want to incur a style update each time.
- String newColor = value->toString(exec).domString();
+ String newColor = value->toString(exec);
if (bodyElement->link() != newColor)
bodyElement->setLink(newColor);
}
// this check is a bit silly, but some benchmarks like to set the
// document's link colors over and over to the same value and we
// don't want to incur a style update each time.
- String newColor = value->toString(exec).domString();
+ String newColor = value->toString(exec);
if (bodyElement->vLink() != newColor)
bodyElement->setVLink(newColor);
}
break;
case Dir:
- body->setDir(value->toString(exec).domString());
+ body->setDir(value->toString(exec));
break;
case DesignMode:
{
- String modeString = value->toString(exec).domString();
+ String modeString = value->toString(exec);
Document::InheritedBool mode;
if (equalIgnoringCase(modeString, "on"))
mode = Document::on;
JSHTMLElement *thisObj = static_cast<JSHTMLElement *>(slot.slotBase());
HTMLElement *element = static_cast<HTMLElement *>(thisObj->impl());
- Node *frame = element->children()->namedItem(propertyName.domString());
+ Node *frame = element->children()->namedItem(propertyName);
if (Document* doc = static_cast<HTMLFrameElement *>(frame)->contentDocument())
if (Window *window = Window::retrieveWindow(doc->frame()))
return window;
return true;
}
} else if (element.hasLocalName(framesetTag)) {
- Node *frame = element.children()->namedItem(propertyName.domString());
+ Node *frame = element.children()->namedItem(propertyName);
if (frame && frame->hasTagName(frameTag)) {
slot.setCustom(this, framesetNameGetter);
return true;
}
else if (element.hasLocalName(canvasTag)) {
if (id == JSHTMLElement::GetContext)
- return toJS(exec, static_cast<HTMLCanvasElement*>(&element)->getContext(args[0]->toString(exec).domString()));
+ return toJS(exec, static_cast<HTMLCanvasElement*>(&element)->getContext(args[0]->toString(exec)));
}
return jsUndefined();
void JSHTMLElement::putValueProperty(ExecState *exec, int token, JSValue *value, int)
{
DOMExceptionTranslator exception(exec);
- WebCore::String str = value->toString(exec).domString();
+ WebCore::String str = value->toString(exec);
// Check our set of generic properties first.
HTMLElement &element = *static_cast<HTMLElement *>(impl());
unsigned int u = args[1]->toString(exec).toUInt32(&ok);
if (ok)
{
- WebCore::String pstr = s.domString();
+ WebCore::String pstr = s;
Node *node = collection.namedItem(pstr);
while (node) {
if (!u)
JSValue *JSHTMLCollection::getNamedItems(ExecState *exec, const Identifier &propertyName) const
{
- DeprecatedValueList< RefPtr<Node> > namedItems = m_impl->namedItems(AtomicString(propertyName.domString()));
+ DeprecatedValueList< RefPtr<Node> > namedItems = m_impl->namedItems(propertyName);
if (namedItems.isEmpty())
return jsUndefined();
case JSHTMLCollection::Item:
return toJS(exec,coll.item(args[0]->toUInt32(exec)));
case JSHTMLCollection::Tags:
- return toJS(exec, coll.base()->getElementsByTagName(args[0]->toString(exec).domString()).get());
+ return toJS(exec, coll.base()->getElementsByTagName(args[0]->toString(exec)).get());
case JSHTMLCollection::NamedItem:
return static_cast<JSHTMLCollection *>(thisObj)->getNamedItems(exec, Identifier(args[0]->toString(exec)));
default:
RefPtr<Text> t = m_doc->createTextNode("");
opt->appendChild(t, exception);
if (exception == 0 && sz > 0)
- t->setData(args[0]->toString(exec).domString(), exception); // set the text
+ t->setData(args[0]->toString(exec), exception); // set the text
if (exception == 0 && sz > 1)
- opt->setValue(args[1]->toString(exec).domString());
+ opt->setValue(args[1]->toString(exec));
if (exception == 0 && sz > 2)
opt->setDefaultSelected(args[2]->toBoolean(exec));
if (exception == 0 && sz > 3)
#include "config.h"
#include "kjs_navigator.h"
+#include "AtomicString.h"
#include "CookieJar.h"
#include "Frame.h"
#include "Language.h"
JSValue *Plugins::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
+ AtomicString atomicPropertyName = propertyName;
Vector<PluginInfo*>::iterator end = plugins->end();
for (Vector<PluginInfo*>::iterator itr = plugins->begin(); itr != end; itr++) {
PluginInfo *pl = *itr;
- if (pl->name == propertyName.domString())
+ if (pl->name == atomicPropertyName)
return new Plugin(exec, pl);
}
return jsUndefined();
}
// plugin[name]
+ AtomicString atomicPropertyName = propertyName;
Vector<PluginInfo*>::iterator end = plugins->end();
for (Vector<PluginInfo*>::iterator itr = plugins->begin(); itr != end; itr++) {
- if ((*itr)->name == propertyName.domString()) {
+ if ((*itr)->name == atomicPropertyName) {
slot.setCustom(this, nameGetter);
return true;
}
JSValue *MimeTypes::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
+ AtomicString atomicPropertyName = propertyName;
Vector<MimeClassInfo*>::iterator end = mimes->end();
for (Vector<MimeClassInfo*>::iterator itr = mimes->begin(); itr != end; itr++) {
MimeClassInfo *m = (*itr);
- if (m->type == propertyName.domString())
+ if (m->type == atomicPropertyName)
return new MimeType(exec, m);
}
return jsUndefined();
}
// mimeTypes[name]
+ AtomicString atomicPropertyName = propertyName;
Vector<MimeClassInfo*>::iterator end = mimes->end();
for (Vector<MimeClassInfo*>::iterator itr = mimes->begin(); itr != end; itr++) {
- if ((*itr)->type == propertyName.domString()) {
+ if ((*itr)->type == atomicPropertyName) {
slot.setCustom(this, nameGetter);
return true;
}
JSValue *Plugin::nameGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
Plugin *thisObj = static_cast<Plugin *>(slot.slotBase());
+ AtomicString atomicPropertyName = propertyName;
Vector<MimeClassInfo*>::iterator end = thisObj->m_info->mimes.end();
for (Vector<MimeClassInfo*>::iterator itr = thisObj->m_info->mimes.begin(); itr != end; itr++) {
MimeClassInfo *m = (*itr);
- if (m->type == propertyName.domString())
+ if (m->type == atomicPropertyName)
return new MimeType(exec, m);
}
return jsUndefined();
}
// plugin["name"]
+ AtomicString atomicPropertyName = propertyName;
Vector<MimeClassInfo*>::iterator end = m_info->mimes.end();
for (Vector<MimeClassInfo*>::iterator itr = m_info->mimes.begin(); itr != end; itr++) {
- if ((*itr)->type == propertyName.domString()) {
+ if ((*itr)->type == atomicPropertyName) {
slot.setCustom(this, nameGetter);
return true;
}
UString errorMessage = comp.value()->toString(m_script->globalExec());
int lineNumber = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "line")->toInt32(m_script->globalExec());
UString sourceURL = comp.value()->toObject(m_script->globalExec())->get(m_script->globalExec(), "sourceURL")->toString(m_script->globalExec());
- m_frame->addMessageToConsole(errorMessage.domString(), lineNumber, sourceURL.domString());
+ m_frame->addMessageToConsole(errorMessage, lineNumber, sourceURL);
}
return 0;
return jsUndefined(); // throw exception?
else {
arg0->getDocument()->updateLayoutIgnorePendingStylesheets();
- return toJS(exec, abstractView.getComputedStyle(arg0, args[1]->toString(exec).domString().impl()));
+ return toJS(exec, abstractView.getComputedStyle(arg0, WebCore::String(args[1]->toString(exec)).impl()));
}
}
case DOMAbstractView::GetMatchedCSSRules: {
return jsUndefined(); // throw exception?
else {
// No need to update layout, since we just want the back-end rules.
- return toJS(exec, abstractView.getMatchedCSSRules(arg0,
- args[1]->toString(exec).domString().impl()).get());
+ return toJS(exec, abstractView.getMatchedCSSRules(arg0, WebCore::String(args[1]->toString(exec)).impl()).get());
}
}
}
{
HashMap<String, String> map;
- DeprecatedStringList features = DeprecatedStringList::split(';', featuresArg->toString(exec).deprecatedString());
+ DeprecatedStringList features = DeprecatedStringList::split(';', featuresArg->toString(exec));
DeprecatedStringList::ConstIterator end = features.end();
for (DeprecatedStringList::ConstIterator it = features.begin(); it != end; ++it) {
DeprecatedString s = *it;
wargs.locationBarVisible = false;
wargs.fullscreen = false;
- Frame *dialogPart = createNewWindow(exec, openerWindow, URL.deprecatedString(), "", wargs, args[1]);
+ Frame *dialogPart = createNewWindow(exec, openerWindow, URL, "", wargs, args[1]);
if (!dialogPart)
return jsUndefined();
JSValue* Window::childFrameGetter(ExecState*, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
{
- return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName.domString())));
+ return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName)));
}
JSValue* Window::namedFrameGetter(ExecState*, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
// There's no point in checking for child frames twice. I suspect this should be using
// find instead of "child". But I don't want to change the behavior without testing,
// so I'm leaving this as-is for now.
- return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName.domString())));
+ return retrieve(static_cast<Window*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName)));
}
JSValue* Window::indexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot)
Document *doc = thisObj->m_frame->document();
ASSERT(thisObj->isSafeScript(exec) && doc && doc->isHTMLDocument());
- String name = propertyName.domString();
+ String name = propertyName;
RefPtr<WebCore::HTMLCollection> collection = doc->windowNamedItems(name);
if (collection->length() == 1)
return toJS(exec, collection->firstItem());
// naming frames things that conflict with window properties that
// are in Moz but not IE. Since we have some of these, we have to do
// it the Moz way.
- AtomicString atomicPropertyName = AtomicString(propertyName.domString());
+ AtomicString atomicPropertyName = propertyName;
if (m_frame->tree()->child(atomicPropertyName)) {
slot.setCustom(this, childFrameGetter);
return true;
{
switch( entry->value ) {
case Status:
- m_frame->setJSStatusBarText(value->toString(exec).deprecatedString());
+ m_frame->setJSStatusBarText(value->toString(exec));
return;
case DefaultStatus:
- m_frame->setJSDefaultStatusBarText(value->toString(exec).deprecatedString());
+ m_frame->setJSDefaultStatusBarText(value->toString(exec));
return;
case Location_: {
Frame* p = Window::retrieveActive(exec)->m_frame;
if (p) {
- DeprecatedString dstUrl = p->document()->completeURL(value->toString(exec).deprecatedString());
+ DeprecatedString dstUrl = p->document()->completeURL(DeprecatedString(value->toString(exec)));
if (!dstUrl.startsWith("javascript:", false) || isSafeScript(exec))
{
bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
return;
case Name:
if (isSafeScript(exec))
- m_frame->tree()->setName(value->toString(exec).deprecatedString());
+ m_frame->tree()->setName(value->toString(exec));
return;
default:
break;
FrameView *widget = frame->view();
JSValue *v = args[0];
UString s = v->toString(exec);
- String str = s.domString();
+ String str = s;
String str2;
switch (id) {
{
if (frame && frame->document())
frame->document()->updateRendering();
- String message = args.size() >= 2 ? args[1]->toString(exec).domString() : String();
+ String message = args.size() >= 2 ? args[1]->toString(exec) : UString();
bool ok = frame->runJavaScriptPrompt(str, message, str2);
if (ok)
return jsString(str2);
case Window::Open:
{
AtomicString frameName = args[1]->isUndefinedOrNull()
- ? "_blank" : AtomicString(args[1]->toString(exec).domString());
+ ? "_blank" : AtomicString(args[1]->toString(exec));
if (!allowPopUp(exec, window) && !frame->tree()->find(frameName))
return jsUndefined();
WindowArgs windowArgs;
- String features = args[2]->isUndefinedOrNull() ? String() : args[2]->toString(exec).domString();
+ String features = args[2]->isUndefinedOrNull() ? UString() : args[2]->toString(exec);
parseWindowFeatures(features, windowArgs);
constrainToVisible(screenRect(widget), windowArgs);
return jsUndefined();
if (JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]))
if (Document *doc = frame->document())
- doc->addWindowEventListener(AtomicString(args[0]->toString(exec).domString()), listener, args[2]->toBoolean(exec));
+ doc->addWindowEventListener(AtomicString(args[0]->toString(exec)), listener, args[2]->toBoolean(exec));
return jsUndefined();
case Window::RemoveEventListener:
if (!window->isSafeScript(exec))
return jsUndefined();
if (JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]))
if (Document *doc = frame->document())
- doc->removeWindowEventListener(AtomicString(args[0]->toString(exec).domString()), listener, args[2]->toBoolean(exec));
+ doc->removeWindowEventListener(AtomicString(args[0]->toString(exec)), listener, args[2]->toBoolean(exec));
return jsUndefined();
case Window::ShowModalDialog:
return showModalDialog(exec, window, args);
if (exec->hadException()) {
JSObject* exception = exec->exception()->toObject(exec);
exec->clearException();
- String message = exception->get(exec, messagePropertyName)->toString(exec).domString();
+ String message = exception->get(exec, messagePropertyName)->toString(exec);
int lineNumber = exception->get(exec, "line")->toInt32(exec);
if (Interpreter::shouldPrintExceptions())
printf("(timer):%s\n", message.deprecatedString().utf8().data());
int Window::installTimeout(const UString& handler, int t, bool singleShot)
{
- return installTimeout(new ScheduledAction(handler.deprecatedString()), t, singleShot);
+ return installTimeout(new ScheduledAction(handler), t, singleShot);
}
int Window::installTimeout(JSValue* func, const List& args, int t, bool singleShot)
JSValue* FrameArray::nameGetter(ExecState*, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
{
- return Window::retrieve(static_cast<FrameArray*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName.domString())));
+ return Window::retrieve(static_cast<FrameArray*>(slot.slotBase())->m_frame->tree()->child(AtomicString(propertyName)));
}
bool FrameArray::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
}
// check for the name or number
- if (m_frame->tree()->child(AtomicString(propertyName.domString()))) {
+ if (m_frame->tree()->child(propertyName)) {
slot.setCustom(this, nameGetter);
return true;
}
if (!m_frame)
return;
- DeprecatedString str = v->toString(exec).deprecatedString();
+ DeprecatedString str = v->toString(exec);
KURL url = m_frame->url();
const HashEntry *entry = Lookup::findEntry(&LocationTable, p);
if (entry)
switch (id) {
case Location::Replace:
{
- DeprecatedString str = args[0]->toString(exec).deprecatedString();
+ DeprecatedString str = args[0]->toString(exec);
Frame* p = Window::retrieveActive(exec)->frame();
if ( p ) {
const Window* window = Window::retrieveWindow(frame);
Frame *p = Window::retrieveActive(exec)->frame();
if (p) {
const Window *window = Window::retrieveWindow(frame);
- DeprecatedString dstUrl = p->document()->completeURL(args[0]->toString(exec).deprecatedString());
+ DeprecatedString dstUrl = p->document()->completeURL(DeprecatedString(args[0]->toString(exec)));
if (!dstUrl.startsWith("javascript:", false) || (window && window->isSafeScript(exec))) {
bool userGesture = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter())->wasRunByUserGesture();
// We want a new history item if this JS was called via a user gesture
s.setPosition(toNode(args[0]), args[1]->toInt32(exec));
break;
case Selection::Modify:
- s.modify(args[0]->toString(exec).domString(), args[1]->toString(exec).domString(), args[2]->toString(exec).domString());
+ s.modify(args[0]->toString(exec), args[1]->toString(exec), args[2]->toString(exec));
break;
case Selection::GetRangeAt:
return toJS(exec, s.getRangeAt(args[0]->toInt32(exec)).get());
-#!/usr/bin/perl
+#!/usr/bin/perl -w
#
# This file is part of the KDE libraries
#
# Boston, MA 02111-1307, USA.
#
+use strict;
+
my $nsFull = $ARGV[1];
my $ns = $nsFull; $ns =~ s/K//;
my $basename = "cssproperties";
my $filegperf = "$basename.gperf";
open IN, $filein or die "Can't open $filein\n";
-open header, ">$fileh" or die "Can't open $fileh\n";
-open out, ">$filegperf" or die "Can't open $filegperf\n";
+open HEADER, ">$fileh" or die "Can't open $fileh\n";
+open OUT, ">$filegperf" or die "Can't open $filegperf\n";
-print out "%{\n/* This file is automatically generated from $filein by cssmakeprops, do not edit */\n#include \"$fileh\"\n%}\n";
-print out "struct css_prop {\n int name;\n int id;\n};\n\n";
-print out "static const struct css_prop *find${ns}Prop (register const char *str, register unsigned int len);\n\n%%\n";
+print OUT "%{\n/* This file is automatically generated from $filein by cssmakeprops, do not edit */\n#include \"$fileh\"\n%}\n";
+print OUT "struct css_prop {\n int name;\n int id;\n};\n\n";
+print OUT "static const struct css_prop *find${ns}Prop (register const char *str, register unsigned int len);\n\n%%\n";
-print header "/* This file is automatically generated from $filein by cssmakeprops, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef ${nsFull}_CSSPROPERTIES_H\n#define ${nsFull}_CSSPROPERTIES_H\n\n";
+print HEADER "/* This file is automatically generated from $filein by cssmakeprops, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef ${nsFull}_CSSPROPERTIES_H\n#define ${nsFull}_CSSPROPERTIES_H\n\n";
my %amap = ();
+my @a = ();
-$num = 0;
+my $num = 0;
if ($nsFull ne "KDOM") {
$num = 10001; # Bigger than all properties from HTML CSS
- print header "#define ${ns}CSS_PROP_INVALID 0\n";
- print header "#define ${ns}CSS_PROP_MIN $num\n";
+ print HEADER "#define ${ns}CSS_PROP_INVALID 0\n";
+ print HEADER "#define ${ns}CSS_PROP_MIN $num\n";
$num = $num - 1;
} else {
- print header "#define CSS_PROP_INVALID 0\n";
- print header "#define CSS_PROP_MIN 1\n";
+ print HEADER "#define CSS_PROP_INVALID 0\n";
+ print HEADER "#define CSS_PROP_MIN 1\n";
}
while (<IN>) {
chomp;
- $prop = $_;
+ my $prop = $_;
if(not($prop =~ /#/) and (length($prop) > 0)) {
$num = $num + 1;
- $up = uc($prop);
+ my $up = uc($prop);
push(@a, $up);
- $pup = $up;
+ my $pup = $up;
$pup =~ s/-/_/g;
$amap{$pup} = $num;
if ($nsFull eq "KDOM") {
- print out $prop . ", CSS_PROP_" . $pup . "\n";
- print header "#define CSS_PROP_" . $pup . " " . $num . "\n";
+ print OUT $prop . ", CSS_PROP_" . $pup . "\n";
+ print HEADER "#define CSS_PROP_" . $pup . " " . $num . "\n";
} else {
- print out $prop . ", ${ns}CSS_PROP_" . $pup . "\n";
- print header "#define ${ns}CSS_PROP_" . $pup . " " . $num . "\n";
+ print OUT $prop . ", ${ns}CSS_PROP_" . $pup . "\n";
+ print HEADER "#define ${ns}CSS_PROP_" . $pup . " " . $num . "\n";
}
}
}
close(IN);
if ($nsFull eq "KDOM") {
- print header "#define CSS_PROP_MAX $num\n";
+ print HEADER "#define CSS_PROP_MAX $num\n";
} else {
- print header "#define ${ns}CSS_PROP_MAX $num\n";
+ print HEADER "#define ${ns}CSS_PROP_MAX $num\n";
}
-print out "%%\n";
-close out;
+print OUT "%%\n";
+close OUT;
-print header "\nnamespace ${nsFull}\n{\n";
-print header " const char *getSVGCSSPropertyName(unsigned short id);\n";
-print header " int getSVGCSSPropertyID(const char *tagStr, int len);\n";
-print header "}\n";
+print HEADER "\nnamespace ${nsFull}\n{\n";
+print HEADER " const char *getSVGCSSPropertyName(unsigned short id);\n";
+print HEADER " int getSVGCSSPropertyID(const char *tagStr, int len);\n";
+print HEADER "}\n";
-print header "\n#endif\n";
-close header;
+print HEADER "\n#endif\n";
+close HEADER;
my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -P -G -D -E -C -o -t -k '*' -Nfind${ns}Prop -Hhash_prop -Wwordlist_prop -Qspool_prop -s 3 $filegperf > $filec");
if ($result) {
my %hmap = ();
open(IN, "< $filec");
while(<IN>) {
- $lookFor = "CSS_PROP_";
+ my $lookFor = "CSS_PROP_";
if ($nsFull ne "KDOM") {
$lookFor = $ns . $lookFor;
}
print OUT "\n\nstatic const unsigned short propList[] = {\n";
print OUT " 65535,\n";
-while(defined ($line = shift @a)) {
+while(defined (my $line = shift @a)) {
my $l = $line;
if(not($l =~ /#/) and (length($l) > 0)) {
}
}
-$lookFor = "CSS_PROP_MAX";
+my $lookFor = "CSS_PROP_MAX";
if ($nsFull ne "KDOM") {
$lookFor = $ns . $lookFor;
}
-#!/usr/bin/perl
+#!/usr/bin/perl -w
#
# This file is part of the KDE libraries
#
# Boston, MA 02111-1307, USA.
#
+use strict;
+
my $nsFull = $ARGV[1];
my $ns = $nsFull; $ns =~ s/K//;
my $basename = "cssvalues";
my $filegperf = "$basename.gperf";
open IN, $filein or die "Can't open $filein\n";
-open header, ">$fileh" or die "Can't open $fileh\n";
-open out, ">$filegperf" or die "Can't open $filegperf\n";
+open HEADER, ">$fileh" or die "Can't open $fileh\n";
+open OUT, ">$filegperf" or die "Can't open $filegperf\n";
-print out "%{\n/* This file is automatically generated from $filein by cssmakevalues, do not edit */\n#include \"$fileh\"\n%}\n";
-print out "struct css_val {\n int name;\n int id;\n};\n\n";
-print out "static const struct css_val *find${ns}Val (register const char *str, register unsigned int len);\n\n%%\n";
+print OUT "%{\n/* This file is automatically generated from $filein by cssmakevalues, do not edit */\n#include \"$fileh\"\n%}\n";
+print OUT "struct css_val {\n int name;\n int id;\n};\n\n";
+print OUT "static const struct css_val *find${ns}Val (register const char *str, register unsigned int len);\n\n%%\n";
-print header "/* This file is automatically generated from $filein by cssmakevalues, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef ${nsFull}_CSSVALUES_H\n#define ${nsFull}_CSSVALUES_H\n\n";
+print HEADER "/* This file is automatically generated from $filein by cssmakevalues, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef ${nsFull}_CSSVALUES_H\n#define ${nsFull}_CSSVALUES_H\n\n";
my %amap = ();
-$num = 0;
+my $num = 0;
if ($nsFull ne "KDOM") {
$num = 10001; # Bigger than all values from HTML CSS
- print header "#define ${ns}CSS_VAL_INVALID 0\n";
- print header "#define ${ns}CSS_VAL_MIN $num\n";
+ print HEADER "#define ${ns}CSS_VAL_INVALID 0\n";
+ print HEADER "#define ${ns}CSS_VAL_MIN $num\n";
$num = $num - 1;
} else {
- print header "#define CSS_VAL_INVALID 0\n";
- print header "#define CSS_VAL_MIN 1\n";
+ print HEADER "#define CSS_VAL_INVALID 0\n";
+ print HEADER "#define CSS_VAL_MIN 1\n";
}
+my @a = ();
+
while (<IN>) {
chomp;
- $prop = $_;
+ my $prop = $_;
if(not($prop =~ /#/) and (length($prop) > 0)) {
$num = $num + 1;
- $up = uc($prop);
+ my $up = uc($prop);
push(@a, $up);
- $pup = $up;
+ my $pup = $up;
$pup =~ s/-/_/g;
$amap{$pup} = $num;
if ($nsFull eq "KDOM") {
- print out $prop . ", CSS_VAL_" . $pup . "\n";
- print header "#define CSS_VAL_" . $pup . " " . $num . "\n";
+ print OUT $prop . ", CSS_VAL_" . $pup . "\n";
+ print HEADER "#define CSS_VAL_" . $pup . " " . $num . "\n";
} else {
- print out $prop . ", ${ns}CSS_VAL_" . $pup . "\n";
- print header "#define ${ns}CSS_VAL_" . $pup . " " . $num . "\n";
+ print OUT $prop . ", ${ns}CSS_VAL_" . $pup . "\n";
+ print HEADER "#define ${ns}CSS_VAL_" . $pup . " " . $num . "\n";
}
}
}
close(IN);
if ($nsFull eq "KDOM") {
- print header "#define CSS_VAL_MAX $num\n";
+ print HEADER "#define CSS_VAL_MAX $num\n";
} else {
- print header "#define ${ns}CSS_VAL_MAX $num\n";
+ print HEADER "#define ${ns}CSS_VAL_MAX $num\n";
}
-print out "%%\n";
-close out;
+print OUT "%%\n";
+close OUT;
-print header "\nnamespace ${nsFull}\n{\n";
-print header " const char* getSVGCSSValueName(unsigned short id);\n";
-print header " int getSVGCSSValueID(const char *tagStr, int len);\n";
-print header "}\n";
+print HEADER "\nnamespace ${nsFull}\n{\n";
+print HEADER " const char* getSVGCSSValueName(unsigned short id);\n";
+print HEADER " int getSVGCSSValueID(const char *tagStr, int len);\n";
+print HEADER "}\n";
-print header "\n#endif\n";
-close header;
+print HEADER "\n#endif\n";
+close HEADER;
my $result = system("/bin/sh", "-c", "gperf -c -a -L 'ANSI-C' -P -G -D -E -C -o -t -k '*' -Nfind${ns}Val -Hhash_val -Wwordlist_val -Qspool_val -s 3 $filegperf > $filec");
if ($result) {
my %hmap = ();
open(IN, "< $filec");
while(<IN>) {
- $lookFor = "CSS_VAL_";
+ my $lookFor = "CSS_VAL_";
if ($nsFull ne "KDOM") {
$lookFor = $ns . $lookFor;
}
print OUT "\n\nstatic const unsigned short valList[] = {\n";
print OUT " 65535,\n";
-while(defined ($line = shift @a)) {
+while(defined (my $line = shift @a)) {
my $l = $line;
if(not($l =~ /#/) and (length($l) > 0)) {
}
}
-$lookFor = "CSS_VAL_MAX";
+my $lookFor = "CSS_VAL_MAX";
if ($nsFull ne "KDOM") {
$lookFor = $ns . $lookFor;
}
${namespace}Element *${namespace}ElementFactory::create${namespace}Element(const QualifiedName& qName, Document* doc, bool createdByParser)
{
if (!doc)
- return 0; // Don't allow elements to ever be made without having a doc.
+ return 0; // Do not allow elements to ever be made without having a doc.
createFunctionMapIfNecessary();
ConstructorFunc func = gFunctionMap->get(qName.localName().impl());
restoreSTDOUT();
}
-
-
void SVGAElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const AtomicString& value(attr->value());
if (attr->name() == SVGNames::targetAttr) {
target()->setBaseVal(value.impl());
} else {
return;
}
url = parseURL(href()->baseVal()).deprecatedString();
- utarget = String(getAttribute(SVGNames::targetAttr)).deprecatedString();
+ utarget = getAttribute(SVGNames::targetAttr).deprecatedString();
if(e && e->button() == 1)
utarget = "_blank";
void SVGAnimateTransformElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
if (attr->name() == SVGNames::typeAttr) {
- if(value == "translate")
+ const String& value = attr->value();
+ if (value == "translate")
m_type = SVG_TRANSFORM_TRANSLATE;
- else if(value == "scale")
+ else if (value == "scale")
m_type = SVG_TRANSFORM_SCALE;
- else if(value == "rotate")
+ else if (value == "rotate")
m_type = SVG_TRANSFORM_ROTATE;
- else if(value == "skewX")
+ else if (value == "skewX")
m_type = SVG_TRANSFORM_SKEWX;
- else if(value == "skewY")
+ else if (value == "skewY")
m_type = SVG_TRANSFORM_SKEWY;
} else {
SVGAnimationElement::parseMappedAttribute(attr);
void SVGAnimationElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name().matches(XLinkNames::hrefAttr))
- m_href = value.deprecatedString();
+ m_href = value.deprecatedString();
else if (attr->name() == SVGNames::attributeNameAttr)
- m_attributeName = value.deprecatedString();
+ m_attributeName = value.deprecatedString();
else if (attr->name() == SVGNames::attributeTypeAttr)
{
if (value == "CSS")
void SVGClipPathElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::clipPathUnitsAttr)
{
if(value == "userSpaceOnUse")
void SVGComponentTransferFunctionElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::typeAttr)
{
if(value == "identity")
bool SVGExternalResourcesRequired::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::externalResourcesRequiredAttr) {
externalResourcesRequired()->setBaseVal(value == "true");
return true;
void SVGFEBlendElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::modeAttr)
{
if(value == "normal")
void SVGFEColorMatrixElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::typeAttr)
{
if(value == "matrix")
void SVGFEComponentTransferElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
in1()->setBaseVal(value.impl());
else
void SVGFECompositeElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::operatorAttr)
{
if(value == "over")
void SVGFEDiffuseLightingElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
in1()->setBaseVal(value.impl());
else if (attr->name() == SVGNames::surfaceScaleAttr)
using namespace WebCore;
-SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const WebCore::QualifiedName& tagName, WebCore::Document* doc) :
+SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* doc) :
SVGFilterPrimitiveStandardAttributes(tagName, doc)
{
m_filterEffect = 0;
return lazy_create<SVGAnimatedNumber>(m_scale, dummy);
}
-KCChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(WebCore::String& key)
+KCChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(const String& key)
{
if(key == "R")
return CS_RED;
return (KCChannelSelectorType)-1;
}
-void SVGFEDisplacementMapElement::parseMappedAttribute(WebCore::MappedAttribute* attr)
+void SVGFEDisplacementMapElement::parseMappedAttribute(MappedAttribute* attr)
{
- WebCore::String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::xChannelSelectorAttr)
xChannelSelector()->setBaseVal(stringToChannel(value));
else if (attr->name() == SVGNames::yChannelSelectorAttr)
return 0;
m_filterEffect->setXChannelSelector((KCChannelSelectorType)(xChannelSelector()->baseVal()));
m_filterEffect->setYChannelSelector((KCChannelSelectorType)(yChannelSelector()->baseVal()));
- m_filterEffect->setIn(WebCore::String(in1()->baseVal()).deprecatedString());
- m_filterEffect->setIn2(WebCore::String(in2()->baseVal()).deprecatedString());
+ m_filterEffect->setIn(String(in1()->baseVal()).deprecatedString());
+ m_filterEffect->setIn2(String(in2()->baseVal()).deprecatedString());
m_filterEffect->setScale(scale()->baseVal());
setStandardAttributes(m_filterEffect);
return m_filterEffect;
Boston, MA 02111-1307, USA.
*/
-
-
#ifndef KSVG_SVGFEDisplacementMapElementImpl_H
#define KSVG_SVGFEDisplacementMapElementImpl_H
#if SVG_SUPPORT
#include "SVGFilterPrimitiveStandardAttributes.h"
#include "KCanvasFilters.h"
-namespace WebCore
-{
+namespace WebCore {
class SVGAnimatedNumber;
class SVGAnimatedString;
class SVGAnimatedEnumeration;
- class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes
- {
-public:
- SVGFEDisplacementMapElement(const WebCore::QualifiedName& tagName, WebCore::Document *doc);
+ class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes {
+ public:
+ SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*);
virtual ~SVGFEDisplacementMapElement();
// 'SVGFEDisplacementMapElement' functions
SVGAnimatedEnumeration* yChannelSelector() const;
SVGAnimatedNumber* scale() const;
- static KCChannelSelectorType stringToChannel(WebCore::String &key);
+ static KCChannelSelectorType stringToChannel(const String&);
// Derived from: 'Element'
- virtual void parseMappedAttribute(WebCore::MappedAttribute *attr);
+ virtual void parseMappedAttribute(MappedAttribute*);
virtual KCanvasFEDisplacementMap* filterEffect() const;
-private:
+ private:
mutable RefPtr<SVGAnimatedString> m_in1;
mutable RefPtr<SVGAnimatedString> m_in2;
mutable RefPtr<SVGAnimatedEnumeration> m_xChannelSelector;
mutable RefPtr<SVGAnimatedEnumeration> m_yChannelSelector;
mutable RefPtr<SVGAnimatedNumber> m_scale;
- mutable KCanvasFEDisplacementMap *m_filterEffect;
+ mutable KCanvasFEDisplacementMap* m_filterEffect;
};
-};
+}
#endif // SVG_SUPPORT
#endif // KSVG_SVGFEDisplacementMapElementImpl_H
-
void SVGFEFloodElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
in1()->setBaseVal(value.impl());
else
void SVGFEGaussianBlurElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::stdDeviationAttr) {
DeprecatedStringList numbers = DeprecatedStringList::split(' ', value.deprecatedString());
stdDeviationX()->setBaseVal(numbers[0].toDouble());
void SVGFEImageElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::preserveAspectRatioAttr)
preserveAspectRatio()->baseVal()->parsePreserveAspectRatio(value.impl());
else
void SVGFELightElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::azimuthAttr)
azimuth()->setBaseVal(value.deprecatedString().toDouble());
else if (attr->name() == SVGNames::elevationAttr)
void SVGFEMergeNodeElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
in1()->setBaseVal(value.impl());
else
void SVGFEOffsetElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::dxAttr)
dx()->setBaseVal(value.deprecatedString().toDouble());
else if (attr->name() == SVGNames::dyAttr)
void SVGFESpecularLightingElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
in1()->setBaseVal(value.impl());
else if (attr->name() == SVGNames::surfaceScaleAttr)
void SVGFETileElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::inAttr)
in1()->setBaseVal(value.impl());
else
void SVGFETurbulenceElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::typeAttr)
{
if(value == "fractalNoise")
void SVGFilterElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::filterUnitsAttr)
{
if(value == "userSpaceOnUse")
void SVGGradientElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::gradientUnitsAttr) {
if(value == "userSpaceOnUse")
gradientUnits()->setBaseVal(SVG_UNIT_TYPE_USERSPACEONUSE);
void SVGMaskElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::xAttr)
x()->baseVal()->setValueAsString(value.impl());
else if (attr->name() == SVGNames::yAttr)
void SVGPolyElement::parseMappedAttribute(MappedAttribute *attr)
{
if (attr->name() == SVGNames::pointsAttr)
- parsePoints(String(attr->value()).deprecatedString());
+ parsePoints(attr->value().deprecatedString());
else
{
if(SVGTests::parseMappedAttribute(attr)) return;
void SVGStopElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::offsetAttr) {
if(value.deprecatedString().endsWith("%"))
offset()->setBaseVal(value.deprecatedString().left(value.length() - 1).toDouble() / 100.);
void SVGStyledElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
// id and class are handled by StyledElement
DeprecatedString qProp = attr->name().localName().deprecatedString();
- int propId = WebCore::getPropertyID(qProp.ascii(), qProp.length());
+ int propId = getPropertyID(qProp.ascii(), qProp.length());
if (propId == 0)
- propId = getSVGCSSPropertyID(qProp.ascii(), qProp.length());
+ propId = SVG::getSVGCSSPropertyID(qProp.ascii(), qProp.length());
if(propId > 0) {
addCSSProperty(attr, propId, value);
setChanged();
bool SVGTests::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::requiredFeaturesAttr) {
requiredFeatures()->reset(value.deprecatedString());
return true;
void SVGTextContentElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
-
//if (attr->name() == SVGNames::lengthAdjustAttr)
// x()->baseVal()->setValueAsString(value.impl());
//else
void SVGTextPositioningElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::xAttr)
x()->baseVal()->parse(value.deprecatedString(), this, LM_WIDTH);
void SVGViewElement::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::viewTargetAttr) {
viewTarget()->reset(value.deprecatedString());
} else {
bool SVGZoomAndPan::parseMappedAttribute(MappedAttribute *attr)
{
- String value(attr->value());
+ const String& value = attr->value();
if (attr->name() == SVGNames::zoomAndPanAttr) {
if(value == "disable")
setZoomAndPan(SVG_ZOOMANDPAN_DISABLE);
UString ustring;
if (!result->getString(ustring))
return false;
- string = ustring.deprecatedString();
+ string = ustring;
return true;
}
d->m_bLoadingMainResource = true;
KURL ref(url);
- ref.setUser(QSTRING_NULL);
- ref.setPass(QSTRING_NULL);
- ref.setRef(QSTRING_NULL);
+ ref.setUser(DeprecatedString());
+ ref.setPass(DeprecatedString());
+ ref.setRef(DeprecatedString());
d->m_referrer = ref.url();
d->m_url = url;
KURL baseurl;
#endif
#include "AtomicString.h"
-#include "StaticConstructors.h"
+#include "StaticConstructors.h"
+#include <kjs/identifier.h>
#include <kxmlcore/HashSet.h>
+using namespace KJS;
+
namespace WebCore {
static HashSet<StringImpl*>* stringTable;
stringTable->remove(r);
}
+StringImpl* AtomicString::add(const KJS::Identifier& str)
+{
+ return add(reinterpret_cast<const QChar*>(str.data()), str.size());
+}
+
+StringImpl* AtomicString::add(const KJS::UString& str)
+{
+ return add(reinterpret_cast<const QChar*>(str.data()), str.size());
+}
+
+AtomicString::operator Identifier() const
+{
+ return domString();
+}
+
+AtomicString::operator UString() const
+{
+ return domString();
+}
DEFINE_GLOBAL(AtomicString, nullAtom)
DEFINE_GLOBAL(AtomicString, emptyAtom, "")
AtomicString(const QChar* s, int length) : m_string(add(s, length)) { }
AtomicString(const unsigned short* s, int length) : m_string(add((QChar*)s, length)) { }
AtomicString(const DeprecatedString& s) : m_string(add(s.unicode(), s.length())) { }
+ AtomicString(const KJS::UString& s) : m_string(add(s)) { }
+ AtomicString(const KJS::Identifier& s) : m_string(add(s)) { }
AtomicString(StringImpl* imp) : m_string(add(imp)) { }
AtomicString(AtomicStringImpl* imp) : m_string(imp) { }
explicit AtomicString(const String& s) : m_string(add(s.impl())) { }
const String& domString() const { return m_string; };
DeprecatedString deprecatedString() const { return m_string.deprecatedString(); };
+ operator KJS::Identifier() const;
+ operator KJS::UString() const;
+
AtomicStringImpl* impl() const { return static_cast<AtomicStringImpl *>(m_string.impl()); }
const QChar* unicode() const { return m_string.unicode(); }
static StringImpl* add(const char*);
static StringImpl* add(const QChar*, int length);
static StringImpl* add(StringImpl*);
+ static StringImpl* add(const KJS::UString&);
+ static StringImpl* add(const KJS::Identifier&);
};
inline bool operator==(const AtomicString& a, const AtomicString& b) { return a.impl() == b.impl(); }
#include "RegularExpression.h"
#include "TextEncoding.h"
#include <kjs/dtoa.h>
+#include <kjs/identifier.h>
#include <stdio.h>
#include <stdarg.h>
#ifdef WIN32
#include "Windows.h"
#endif
+using namespace KJS;
using namespace WebCore;
#define CHECK_FOR_HANDLE_LEAKS 0
return result;
}
+DeprecatedString::DeprecatedString(const Identifier& str)
+{
+ if (str.isNull()) {
+ internalData.deref();
+ dataHandle = makeSharedNullHandle();
+ dataHandle[0]->ref();
+ } else {
+ dataHandle = allocateHandle();
+ *dataHandle = &internalData;
+ internalData.initialize(reinterpret_cast<const QChar*>(str.data()), str.size());
+ }
+}
+
+DeprecatedString::DeprecatedString(const UString& str)
+{
+ if (str.isNull()) {
+ internalData.deref();
+ dataHandle = makeSharedNullHandle();
+ dataHandle[0]->ref();
+ } else {
+ dataHandle = allocateHandle();
+ *dataHandle = &internalData;
+ internalData.initialize(reinterpret_cast<const QChar*>(str.data()), str.size());
+ }
+}
+
+DeprecatedString::operator Identifier() const
+{
+ if (isNull())
+ return Identifier();
+ return Identifier(reinterpret_cast<const KJS::UChar*>(unicode()), length());
+}
+
+DeprecatedString::operator UString() const
+{
+ if (isNull())
+ return UString();
+ return UString(reinterpret_cast<const KJS::UChar*>(unicode()), length());
+}
#endif
#endif
+namespace KJS {
+ class Identifier;
+ class UString;
+}
+
class QChar {
public:
KWQStringData &operator=(const KWQStringData &);
};
-#define QSTRING_NULL DeprecatedString()
-
class DeprecatedString {
public:
- static const char * const null; // not a DeprecatedString as in Qt (can't have static constructor), but close enough to be compatible in most cases
+ static const char * const null;
DeprecatedString();
DeprecatedString(QChar);
DeprecatedString(const QChar *, unsigned);
DeprecatedString(const char *);
DeprecatedString(const char *, int len);
+ DeprecatedString(const KJS::Identifier&);
+ DeprecatedString(const KJS::UString&);
DeprecatedString(const DeprecatedString &);
DeprecatedString &operator=(const DeprecatedString &);
~DeprecatedString();
+ operator KJS::Identifier() const;
+ operator KJS::UString() const;
+
static DeprecatedString fromLatin1(const char *);
static DeprecatedString fromLatin1(const char *, int len);
static DeprecatedString fromUtf8(const char *);
String() { } // gives null string, distinguishable from an empty string
String(const QChar*, unsigned length);
String(const DeprecatedString&);
+ String(const KJS::Identifier&);
+ String(const KJS::UString&);
String(const char*);
String(StringImpl* i) : m_impl(i) { }
+ operator KJS::Identifier() const;
+ operator KJS::UString() const;
+
String& operator +=(const String&);
void insert(const String&, unsigned pos);
#include "config.h"
#include "PlatformString.h"
+#include <kjs/identifier.h>
+
+using namespace KJS;
+
namespace WebCore {
String::String(const QChar* str, unsigned len)
return m_impl->copy();
}
-// ------------------------------------------------------------------------
-
bool String::isEmpty() const
{
return (!m_impl || m_impl->l == 0);
}
#endif
-//-----------------------------------------------------------------------------
-
bool operator==(const String& a, const DeprecatedString& b)
{
unsigned l = a.length();
return false;
}
+String::String(const Identifier& str)
+{
+ if (str.isNull())
+ return;
+
+ if (str.isEmpty())
+ m_impl = StringImpl::empty();
+ else
+ m_impl = new StringImpl(reinterpret_cast<const QChar*>(str.data()), str.size());
+}
+
+String::String(const UString& str)
+{
+ if (str.isNull())
+ return;
+
+ if (str.isEmpty())
+ m_impl = StringImpl::empty();
+ else
+ m_impl = new StringImpl(reinterpret_cast<const QChar*>(str.data()), str.size());
+}
+
+String::operator Identifier() const
+{
+ if (!m_impl)
+ return Identifier();
+ return Identifier(reinterpret_cast<const KJS::UChar*>(m_impl->unicode()), m_impl->length());
+}
+
+String::operator UString() const
+{
+ if (!m_impl)
+ return UString();
+ return UString(reinterpret_cast<const KJS::UChar*>(m_impl->unicode()), m_impl->length());
+}
+
}
#include "AtomicString.h"
#include "Length.h"
+#include <kjs/identifier.h>
#include <kxmlcore/Assertions.h>
#include <string.h>
#include <unicode/ubrk.h>
+using namespace KJS;
using namespace KXMLCore;
namespace WebCore {
return 0;
status = U_ZERO_ERROR;
- ubrk_setText(iterator, reinterpret_cast<const UChar*>(string), length, &status);
+ ubrk_setText(iterator, reinterpret_cast<const ::UChar*>(string), length, &status);
if (status != U_ZERO_ERROR)
return 0;
return -1;
}
-// This was copied from KWQ's DeprecatedString and made to work here w/ small modifications.
+// This was copied from DeprecatedString and made to work here w/ small modifications.
// FIXME comments were from the DeprecatedString version.
int StringImpl::find(const StringImpl* str, int index, bool caseSensitive) const
{
return buffer;
}
+StringImpl::StringImpl(const Identifier& str)
+{
+ initWithQChar(reinterpret_cast<const QChar*>(str.data()), str.size());
+}
+
+StringImpl::StringImpl(const UString& str)
+{
+ initWithQChar(reinterpret_cast<const QChar*>(str.data()), str.size());
+}
+
} // namespace WebCore
namespace KXMLCore {
StringImpl() : l(0), s(0), _hash(0), _inTable(false) { }
public:
StringImpl(const DeprecatedString&);
+ StringImpl(const KJS::Identifier&);
+ StringImpl(const KJS::UString&);
StringImpl(const QChar*, unsigned len);
StringImpl(const char*);
StringImpl(const char*, unsigned len);