Commit 6f3816c3 authored by ddkilzer@apple.com's avatar ddkilzer@apple.com

Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)

WebCore:

2008-11-06  Greg Bolsinga  <bolsinga@apple.com>

        Reviewed by Darin Adler.

        Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
        https://bugs.webkit.org/show_bug.cgi?id=21810

        * bindings/js/GCController.cpp:
        (WebCore::gcController): Changed to leak an object to avoid an exit-time destructor.
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::wrapperSet): Ditto
        * bindings/js/JSInspectedObjectWrapper.cpp:
        (WebCore::wrappers): Ditto
        * bindings/js/JSInspectorCallbackWrapper.cpp:
        (WebCore::wrappers): Ditto
        * bridge/runtime_root.cpp:
        (JSC::Bindings::rootObjectSet): Ditto
        * css/CSSMutableStyleDeclaration.cpp:
        (WebCore::CSSMutableStyleDeclaration::removeProperty): Ditto
        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::cssText): Ditto
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::extractPseudoType): Ditto
        * css/CSSStyleSelector.cpp:
        (WebCore::screenEval): Ditto
        (WebCore::printEval): Ditto
        * dom/DOMImplementation.cpp:
        (WebCore::isSVG10Feature): Ditto
        (WebCore::isSVG11Feature): Ditto
        (WebCore::DOMImplementation::isXMLMIMEType): Ditto
        * dom/Document.cpp:
        (WebCore::Document::hasPrefixNamespaceMismatch): Ditto
        * dom/ScriptElement.cpp:
        (WebCore::isSupportedJavaScriptLanguage): Ditto
        * editing/ApplyStyleCommand.cpp:
        (WebCore::styleSpanClassString): Ditto
        * editing/HTMLInterchange.cpp:
        (WebCore::): Ditto
        * editing/IndentOutdentCommand.cpp:
        (WebCore::indentBlockquoteString): Ditto
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::isInterchangeNewlineNode): Ditto
        (WebCore::isInterchangeConvertedSpaceSpan): Ditto
        * editing/htmlediting.cpp:
        (WebCore::stringWithRebalancedWhitespace): Ditto
        (WebCore::nonBreakingSpaceString): Ditto
        * editing/markup.cpp:
        (WebCore::appendAttributeValue): Ditto
        (WebCore::appendEscapedContent): Ditto
        (WebCore::shouldAddNamespaceAttr): Ditto
        (WebCore::appendNamespace): Ditto
        (WebCore::appendStartMarkup): Ditto
        (WebCore::createMarkup): Ditto
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::type): Ditto
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::isRecognizedTagName): Ditto
        (WebCore::inlineTagList): Ditto
        (WebCore::blockTagList): Ditto
        * html/HTMLFieldSetElement.cpp:
        (WebCore::HTMLFieldSetElement::type): Ditto
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::type): Ditto
        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::type): Ditto
        * html/HTMLLegendElement.cpp:
        (WebCore::HTMLLegendElement::type): Ditto
        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::type): Ditto
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::type): Ditto
        * html/HTMLParser.cpp:
        (WebCore::HTMLParser::getNode): Ditto
        (WebCore::HTMLParser::isHeaderTag): Ditto
        (WebCore::HTMLParser::isResidualStyleTag): Ditto
        (WebCore::HTMLParser::isAffectedByResidualStyle): Ditto
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::type): Ditto
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::type): Ditto
        * inspector/InspectorController.cpp:
        (WebCore::platform): Ditto
        * inspector/JavaScriptDebugServer.cpp:
        (WebCore::JavaScriptDebugServer::shared): Ditto
        * inspector/JavaScriptProfile.cpp:
        (WebCore::profileCache): Ditto
        * inspector/JavaScriptProfileNode.cpp:
        (WebCore::profileNodeCache): Ditto
        * loader/FrameLoader.cpp:
        (WebCore::localSchemes): Ditto
        * loader/appcache/ApplicationCacheStorage.cpp:
        (WebCore::cacheStorage): Ditto
        * loader/archive/ArchiveFactory.cpp:
        (WebCore::archiveMIMETypes): Ditto
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::defaultDatabaseFilename): Ditto
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dragState): Ditto
        * page/Frame.cpp:
        (WebCore::createRegExpForLabels): Ditto
        (WebCore::keepAliveSet): Ditto
        * page/Page.cpp:
        (WebCore::Page::groupName): Ditto
        * page/SecurityOrigin.cpp:
        (WebCore::isDefaultPortForProtocol): Ditto
        (WebCore::SecurityOrigin::databaseIdentifier): Ditto
        * page/mac/FrameMac.mm:
        (WebCore::regExpForLabels): Ditto
        * platform/KURL.cpp:
        (WebCore::blankURL): Ditto
        * platform/graphics/FontCache.cpp:
        (WebCore::alternateFamilyName): Ditto
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::FontCache::getSimilarFontPlatformData): Ditto
        (WebCore::FontCache::getLastResortFallbackFont): Ditto
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::ScrollbarTheme::nativeTheme): Ditto
        * platform/mac/ThemeMac.mm:
        (WebCore::platformTheme): Ditto
        * platform/mac/ThreadCheck.mm:
        (WebCoreReportThreadViolation): Ditto
        * platform/network/NetworkStateNotifier.cpp:
        (WebCore::networkStateNotifier): Ditto
        * platform/network/mac/FormDataStreamMac.mm:
        (WebCore::getStreamFormDataMap): Ditto
        (WebCore::getStreamResourceHandleMap): Ditto
        * platform/network/mac/ResourceResponseMac.mm:
        (WebCore::ResourceResponse::platformLazyInit): Ditto
        * platform/text/TextEncoding.cpp:
        (WebCore::TextEncoding::isJapanese): Ditto
        * rendering/RenderBlock.cpp:
        (WebCore::continuationOutlineTable): Ditto
        * rendering/RenderCounter.cpp:
        (WebCore::counterMaps): Ditto
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::layoutVerticalBox): Ditto
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::markerText): Ditto
        * rendering/RenderScrollbarTheme.cpp:
        (WebCore::RenderScrollbarTheme::renderScrollbarTheme): Ditto
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::systemFont): Ditto
        * rendering/bidi.cpp:
        (WebCore::RenderBlock::checkLinesForTextOverflow): Ditto
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::initialDashboardRegions): Ditto
        (WebCore::RenderStyle::noneDashboardRegions): Ditto
        * storage/LocalStorage.cpp:
        (WebCore::localStorageMap): Ditto
        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::rotateMode): Ditto
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::calcMode): Ditto
        (WebCore::SVGAnimationElement::attributeType): Ditto
        (WebCore::SVGAnimationElement::isAdditive): Ditto
        (WebCore::SVGAnimationElement::isAccumulated): Ditto
        * svg/SVGLangSpace.cpp:
        (WebCore::SVGLangSpace::xmlspace): Ditto
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::contentScriptType): Ditto
        (WebCore::SVGSVGElement::contentStyleType): Ditto
        * svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::type): Ditto
        (WebCore::SVGStyleElement::media): Ditto
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::parseMappedAttribute): Ditto
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::parseClockValue): Ditto
        (WebCore::SVGSMILElement::restart): Ditto
        (WebCore::SVGSMILElement::fill): Ditto
        (WebCore::SVGSMILElement::repeatCount): Ditto
        (WebCore::SVGSMILElement::notifyDependentsIntervalChanged): Ditto
        * svg/graphics/SVGResource.cpp:
        (WebCore::clientMap): Ditto
        * svg/graphics/SVGResourceMarker.cpp:
        (WebCore::SVGResourceMarker::draw): Ditto
        * xml/XMLHttpRequest.cpp:
        (WebCore::preflightResultCache): Ditto
        (WebCore::isSafeRequestHeader): Ditto
        (WebCore::isOnAccessControlResponseHeaderWhitelist): Ditto
        * xml/XPathExpressionNode.cpp:
        (WebCore::XPath::Expression::evaluationContext): Ditto
        * xml/XPathParser.cpp:
        (WebCore::XPath::isAxisName): Ditto
        (WebCore::XPath::isNodeTypeName): Ditto
        * xml/XPathValue.cpp:
        (WebCore::XPath::Value::toNodeSet): Ditto

WebKit/mac:

2008-11-06  Greg Bolsinga  <bolsinga@apple.com>

        Reviewed by Darin Adler.

        Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
        https://bugs.webkit.org/show_bug.cgi?id=21810

        * History/WebBackForwardList.mm:
        (backForwardLists): Changed to leak an object to avoid an exit-time destructor.
        * History/WebHistoryItem.mm:
        (historyItemWrappers): Ditto
        * Misc/WebStringTruncator.m:
        (fontFromNSFont): Ditto
        * Plugins/WebBaseNetscapePluginStream.mm:
        (streams): Ditto
        * WebView/WebView.mm:
        (aeDescFromJSValue): Ditto

WebKitTools:

2008-11-06  Greg Bolsinga  <bolsinga@apple.com>

        Reviewed by Darin Adler.

        Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
        https://bugs.webkit.org/show_bug.cgi?id=21810

        Remove .o files from the exclude list that have had their exit-time destructors removed.

        * Scripts/check-for-exit-time-destructors:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6a404a22
2008-11-06 Greg Bolsinga <bolsinga@apple.com>
Reviewed by Darin Adler.
Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors)
https://bugs.webkit.org/show_bug.cgi?id=21810
* bindings/js/GCController.cpp:
(WebCore::gcController): Changed to leak an object to avoid an exit-time destructor.
* bindings/js/JSDOMBinding.cpp:
(WebCore::wrapperSet): Ditto
* bindings/js/JSInspectedObjectWrapper.cpp:
(WebCore::wrappers): Ditto
* bindings/js/JSInspectorCallbackWrapper.cpp:
(WebCore::wrappers): Ditto
* bridge/runtime_root.cpp:
(JSC::Bindings::rootObjectSet): Ditto
* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::removeProperty): Ditto
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::cssText): Ditto
* css/CSSSelector.cpp:
(WebCore::CSSSelector::extractPseudoType): Ditto
* css/CSSStyleSelector.cpp:
(WebCore::screenEval): Ditto
(WebCore::printEval): Ditto
* dom/DOMImplementation.cpp:
(WebCore::isSVG10Feature): Ditto
(WebCore::isSVG11Feature): Ditto
(WebCore::DOMImplementation::isXMLMIMEType): Ditto
* dom/Document.cpp:
(WebCore::Document::hasPrefixNamespaceMismatch): Ditto
* dom/ScriptElement.cpp:
(WebCore::isSupportedJavaScriptLanguage): Ditto
* editing/ApplyStyleCommand.cpp:
(WebCore::styleSpanClassString): Ditto
* editing/HTMLInterchange.cpp:
(WebCore::): Ditto
* editing/IndentOutdentCommand.cpp:
(WebCore::indentBlockquoteString): Ditto
* editing/ReplaceSelectionCommand.cpp:
(WebCore::isInterchangeNewlineNode): Ditto
(WebCore::isInterchangeConvertedSpaceSpan): Ditto
* editing/htmlediting.cpp:
(WebCore::stringWithRebalancedWhitespace): Ditto
(WebCore::nonBreakingSpaceString): Ditto
* editing/markup.cpp:
(WebCore::appendAttributeValue): Ditto
(WebCore::appendEscapedContent): Ditto
(WebCore::shouldAddNamespaceAttr): Ditto
(WebCore::appendNamespace): Ditto
(WebCore::appendStartMarkup): Ditto
(WebCore::createMarkup): Ditto
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::type): Ditto
* html/HTMLElement.cpp:
(WebCore::HTMLElement::isRecognizedTagName): Ditto
(WebCore::inlineTagList): Ditto
(WebCore::blockTagList): Ditto
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::type): Ditto
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::type): Ditto
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::type): Ditto
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::type): Ditto
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::type): Ditto
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::type): Ditto
* html/HTMLParser.cpp:
(WebCore::HTMLParser::getNode): Ditto
(WebCore::HTMLParser::isHeaderTag): Ditto
(WebCore::HTMLParser::isResidualStyleTag): Ditto
(WebCore::HTMLParser::isAffectedByResidualStyle): Ditto
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::type): Ditto
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::type): Ditto
* inspector/InspectorController.cpp:
(WebCore::platform): Ditto
* inspector/JavaScriptDebugServer.cpp:
(WebCore::JavaScriptDebugServer::shared): Ditto
* inspector/JavaScriptProfile.cpp:
(WebCore::profileCache): Ditto
* inspector/JavaScriptProfileNode.cpp:
(WebCore::profileNodeCache): Ditto
* loader/FrameLoader.cpp:
(WebCore::localSchemes): Ditto
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::cacheStorage): Ditto
* loader/archive/ArchiveFactory.cpp:
(WebCore::archiveMIMETypes): Ditto
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::defaultDatabaseFilename): Ditto
* page/EventHandler.cpp:
(WebCore::EventHandler::dragState): Ditto
* page/Frame.cpp:
(WebCore::createRegExpForLabels): Ditto
(WebCore::keepAliveSet): Ditto
* page/Page.cpp:
(WebCore::Page::groupName): Ditto
* page/SecurityOrigin.cpp:
(WebCore::isDefaultPortForProtocol): Ditto
(WebCore::SecurityOrigin::databaseIdentifier): Ditto
* page/mac/FrameMac.mm:
(WebCore::regExpForLabels): Ditto
* platform/KURL.cpp:
(WebCore::blankURL): Ditto
* platform/graphics/FontCache.cpp:
(WebCore::alternateFamilyName): Ditto
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::getSimilarFontPlatformData): Ditto
(WebCore::FontCache::getLastResortFallbackFont): Ditto
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarTheme::nativeTheme): Ditto
* platform/mac/ThemeMac.mm:
(WebCore::platformTheme): Ditto
* platform/mac/ThreadCheck.mm:
(WebCoreReportThreadViolation): Ditto
* platform/network/NetworkStateNotifier.cpp:
(WebCore::networkStateNotifier): Ditto
* platform/network/mac/FormDataStreamMac.mm:
(WebCore::getStreamFormDataMap): Ditto
(WebCore::getStreamResourceHandleMap): Ditto
* platform/network/mac/ResourceResponseMac.mm:
(WebCore::ResourceResponse::platformLazyInit): Ditto
* platform/text/TextEncoding.cpp:
(WebCore::TextEncoding::isJapanese): Ditto
* rendering/RenderBlock.cpp:
(WebCore::continuationOutlineTable): Ditto
* rendering/RenderCounter.cpp:
(WebCore::counterMaps): Ditto
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutVerticalBox): Ditto
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::markerText): Ditto
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::renderScrollbarTheme): Ditto
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemFont): Ditto
* rendering/bidi.cpp:
(WebCore::RenderBlock::checkLinesForTextOverflow): Ditto
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::initialDashboardRegions): Ditto
(WebCore::RenderStyle::noneDashboardRegions): Ditto
* storage/LocalStorage.cpp:
(WebCore::localStorageMap): Ditto
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::rotateMode): Ditto
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::calcMode): Ditto
(WebCore::SVGAnimationElement::attributeType): Ditto
(WebCore::SVGAnimationElement::isAdditive): Ditto
(WebCore::SVGAnimationElement::isAccumulated): Ditto
* svg/SVGLangSpace.cpp:
(WebCore::SVGLangSpace::xmlspace): Ditto
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::contentScriptType): Ditto
(WebCore::SVGSVGElement::contentStyleType): Ditto
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::type): Ditto
(WebCore::SVGStyleElement::media): Ditto
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::parseMappedAttribute): Ditto
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseClockValue): Ditto
(WebCore::SVGSMILElement::restart): Ditto
(WebCore::SVGSMILElement::fill): Ditto
(WebCore::SVGSMILElement::repeatCount): Ditto
(WebCore::SVGSMILElement::notifyDependentsIntervalChanged): Ditto
* svg/graphics/SVGResource.cpp:
(WebCore::clientMap): Ditto
* svg/graphics/SVGResourceMarker.cpp:
(WebCore::SVGResourceMarker::draw): Ditto
* xml/XMLHttpRequest.cpp:
(WebCore::preflightResultCache): Ditto
(WebCore::isSafeRequestHeader): Ditto
(WebCore::isOnAccessControlResponseHeaderWhitelist): Ditto
* xml/XPathExpressionNode.cpp:
(WebCore::XPath::Expression::evaluationContext): Ditto
* xml/XPathParser.cpp:
(WebCore::XPath::isAxisName): Ditto
(WebCore::XPath::isNodeTypeName): Ditto
* xml/XPathValue.cpp:
(WebCore::XPath::Value::toNodeSet): Ditto
2008-11-06 Tor Arne Vestbø <tavestbo@trolltech.com>
Rubber-stamped by Simon Hausmann.
......@@ -52,7 +52,7 @@ static void* collect(void*)
GCController& gcController()
{
static GCController staticGCController;
static GCController& staticGCController = *new GCController;
return staticGCController;
}
......
......@@ -97,10 +97,10 @@ static inline void removeWrappers(const JSWrapperCache&)
static HashSet<DOMObject*>& wrapperSet()
{
#if ENABLE(WORKERS)
static ThreadSpecific<HashSet<DOMObject*> > staticWrapperSet;
static ThreadSpecific<HashSet<DOMObject*> >& staticWrapperSet = *new ThreadSpecific<HashSet<DOMObject*> >;
return *staticWrapperSet;
#else
static HashSet<DOMObject*> staticWrapperSet;
static HashSet<DOMObject*>& staticWrapperSet = *new HashSet<DOMObject*>;
return staticWrapperSet;
#endif
}
......
......@@ -40,7 +40,7 @@ typedef HashMap<JSGlobalObject*, WrapperMap*> GlobalObjectWrapperMap;
static GlobalObjectWrapperMap& wrappers()
{
static GlobalObjectWrapperMap map;
static GlobalObjectWrapperMap& map = *new GlobalObjectWrapperMap;
return map;
}
......
......@@ -38,7 +38,7 @@ typedef HashMap<JSObject*, JSInspectorCallbackWrapper*> WrapperMap;
static WrapperMap& wrappers()
{
static WrapperMap map;
static WrapperMap& map = *new WrapperMap;
return map;
}
......
......@@ -42,7 +42,7 @@ typedef HashSet<RootObject*> RootObjectSet;
static RootObjectSet* rootObjectSet()
{
static RootObjectSet staticRootObjectSet;
static RootObjectSet& staticRootObjectSet = *new RootObjectSet;
return &staticRootObjectSet;
}
......
......@@ -501,7 +501,7 @@ String CSSMutableStyleDeclaration::removeProperty(int propertyID, bool notifyCha
{
ec = 0;
static HashMap<int, PropertyLonghand> shorthandMap;
static HashMap<int, PropertyLonghand>& shorthandMap = *new HashMap<int, PropertyLonghand>;
if (shorthandMap.isEmpty())
initShorthandMap(shorthandMap);
......
......@@ -686,7 +686,7 @@ String CSSPrimitiveValue::cssText() const
// FIXME: Add list-style and separator
break;
case CSS_RECT: {
static const String rectParen("rect(");
static const String& rectParen = *new String("rect(");
Rect* rectVal = getRectValue();
Vector<UChar> result;
......@@ -709,9 +709,9 @@ String CSSPrimitiveValue::cssText() const
}
case CSS_RGBCOLOR:
case CSS_PARSER_HEXCOLOR: {
static const String commaSpace(", ");
static const String rgbParen("rgb(");
static const String rgbaParen("rgba(");
static const String& commaSpace = *new String(", ");
static const String& rgbParen = *new String("rgb(");
static const String& rgbaParen = *new String("rgba(");
RGBA32 rgbColor = m_value.rgbcolor;
if (m_type == CSS_PARSER_HEXCOLOR)
......
......@@ -62,75 +62,75 @@ void CSSSelector::extractPseudoType() const
if (m_match != PseudoClass && m_match != PseudoElement)
return;
static AtomicString active("active");
static AtomicString after("after");
static AtomicString anyLink("-webkit-any-link");
static AtomicString autofill("-webkit-autofill");
static AtomicString before("before");
static AtomicString checked("checked");
static AtomicString fileUploadButton("-webkit-file-upload-button");
static AtomicString disabled("disabled");
static AtomicString readOnly("read-only");
static AtomicString readWrite("read-write");
static AtomicString drag("-webkit-drag");
static AtomicString dragAlias("-khtml-drag"); // was documented with this name in Apple documentation, so keep an alias
static AtomicString empty("empty");
static AtomicString enabled("enabled");
static AtomicString firstChild("first-child");
static AtomicString firstLetter("first-letter");
static AtomicString firstLine("first-line");
static AtomicString firstOfType("first-of-type");
static AtomicString fullPageMedia("-webkit-full-page-media");
static AtomicString nthChild("nth-child(");
static AtomicString nthOfType("nth-of-type(");
static AtomicString nthLastChild("nth-last-child(");
static AtomicString nthLastOfType("nth-last-of-type(");
static AtomicString focus("focus");
static AtomicString hover("hover");
static AtomicString indeterminate("indeterminate");
static AtomicString inputPlaceholder("-webkit-input-placeholder");
static AtomicString lastChild("last-child");
static AtomicString lastOfType("last-of-type");
static AtomicString link("link");
static AtomicString lang("lang(");
static AtomicString mediaControlsPanel("-webkit-media-controls-panel");
static AtomicString mediaControlsMuteButton("-webkit-media-controls-mute-button");
static AtomicString mediaControlsPlayButton("-webkit-media-controls-play-button");
static AtomicString mediaControlsTimeDisplay("-webkit-media-controls-time-display");
static AtomicString mediaControlsTimeline("-webkit-media-controls-timeline");
static AtomicString mediaControlsSeekBackButton("-webkit-media-controls-seek-back-button");
static AtomicString mediaControlsSeekForwardButton("-webkit-media-controls-seek-forward-button");
static AtomicString mediaControlsFullscreenButton("-webkit-media-controls-fullscreen-button");
static AtomicString notStr("not(");
static AtomicString onlyChild("only-child");
static AtomicString onlyOfType("only-of-type");
static AtomicString resizer("-webkit-resizer");
static AtomicString root("root");
static AtomicString scrollbar("-webkit-scrollbar");
static AtomicString scrollbarButton("-webkit-scrollbar-button");
static AtomicString scrollbarCorner("-webkit-scrollbar-corner");
static AtomicString scrollbarThumb("-webkit-scrollbar-thumb");
static AtomicString scrollbarTrack("-webkit-scrollbar-track");
static AtomicString scrollbarTrackPiece("-webkit-scrollbar-track-piece");
static AtomicString searchCancelButton("-webkit-search-cancel-button");
static AtomicString searchDecoration("-webkit-search-decoration");
static AtomicString searchResultsDecoration("-webkit-search-results-decoration");
static AtomicString searchResultsButton("-webkit-search-results-button");
static AtomicString selection("selection");
static AtomicString sliderThumb("-webkit-slider-thumb");
static AtomicString target("target");
static AtomicString visited("visited");
static AtomicString windowInactive("window-inactive");
static AtomicString decrement("decrement");
static AtomicString increment("increment");
static AtomicString start("start");
static AtomicString end("end");
static AtomicString horizontal("horizontal");
static AtomicString vertical("vertical");
static AtomicString doubleButton("double-button");
static AtomicString singleButton("single-button");
static AtomicString noButton("no-button");
static AtomicString cornerPresent("corner-present");
static AtomicString& active = *new AtomicString("active");
static AtomicString& after = *new AtomicString("after");
static AtomicString& anyLink = *new AtomicString("-webkit-any-link");
static AtomicString& autofill = *new AtomicString("-webkit-autofill");
static AtomicString& before = *new AtomicString("before");
static AtomicString& checked = *new AtomicString("checked");
static AtomicString& fileUploadButton = *new AtomicString("-webkit-file-upload-button");
static AtomicString& disabled = *new AtomicString("disabled");
static AtomicString& readOnly = *new AtomicString("read-only");
static AtomicString& readWrite = *new AtomicString("read-write");
static AtomicString& drag = *new AtomicString("-webkit-drag");
static AtomicString& dragAlias = *new AtomicString("-khtml-drag"); // was documented with this name in Apple documentation, so keep an alias
static AtomicString& empty = *new AtomicString("empty");
static AtomicString& enabled = *new AtomicString("enabled");
static AtomicString& firstChild = *new AtomicString("first-child");
static AtomicString& firstLetter = *new AtomicString("first-letter");
static AtomicString& firstLine = *new AtomicString("first-line");
static AtomicString& firstOfType = *new AtomicString("first-of-type");
static AtomicString& fullPageMedia = *new AtomicString("-webkit-full-page-media");
static AtomicString& nthChild = *new AtomicString("nth-child(");
static AtomicString& nthOfType = *new AtomicString("nth-of-type(");
static AtomicString& nthLastChild = *new AtomicString("nth-last-child(");
static AtomicString& nthLastOfType = *new AtomicString("nth-last-of-type(");
static AtomicString& focus = *new AtomicString("focus");
static AtomicString& hover = *new AtomicString("hover");
static AtomicString& indeterminate = *new AtomicString("indeterminate");
static AtomicString& inputPlaceholder = *new AtomicString("-webkit-input-placeholder");
static AtomicString& lastChild = *new AtomicString("last-child");
static AtomicString& lastOfType = *new AtomicString("last-of-type");
static AtomicString& link = *new AtomicString("link");
static AtomicString& lang = *new AtomicString("lang(");
static AtomicString& mediaControlsPanel = *new AtomicString("-webkit-media-controls-panel");
static AtomicString& mediaControlsMuteButton = *new AtomicString("-webkit-media-controls-mute-button");
static AtomicString& mediaControlsPlayButton = *new AtomicString("-webkit-media-controls-play-button");
static AtomicString& mediaControlsTimeDisplay = *new AtomicString("-webkit-media-controls-time-display");
static AtomicString& mediaControlsTimeline = *new AtomicString("-webkit-media-controls-timeline");
static AtomicString& mediaControlsSeekBackButton = *new AtomicString("-webkit-media-controls-seek-back-button");
static AtomicString& mediaControlsSeekForwardButton = *new AtomicString("-webkit-media-controls-seek-forward-button");
static AtomicString& mediaControlsFullscreenButton = *new AtomicString("-webkit-media-controls-fullscreen-button");
static AtomicString& notStr = *new AtomicString("not(");
static AtomicString& onlyChild = *new AtomicString("only-child");
static AtomicString& onlyOfType = *new AtomicString("only-of-type");
static AtomicString& resizer = *new AtomicString("-webkit-resizer");
static AtomicString& root = *new AtomicString("root");
static AtomicString& scrollbar = *new AtomicString("-webkit-scrollbar");
static AtomicString& scrollbarButton = *new AtomicString("-webkit-scrollbar-button");
static AtomicString& scrollbarCorner = *new AtomicString("-webkit-scrollbar-corner");
static AtomicString& scrollbarThumb = *new AtomicString("-webkit-scrollbar-thumb");
static AtomicString& scrollbarTrack = *new AtomicString("-webkit-scrollbar-track");
static AtomicString& scrollbarTrackPiece = *new AtomicString("-webkit-scrollbar-track-piece");
static AtomicString& searchCancelButton = *new AtomicString("-webkit-search-cancel-button");
static AtomicString& searchDecoration = *new AtomicString("-webkit-search-decoration");
static AtomicString& searchResultsDecoration = *new AtomicString("-webkit-search-results-decoration");
static AtomicString& searchResultsButton = *new AtomicString("-webkit-search-results-button");
static AtomicString& selection = *new AtomicString("selection");
static AtomicString& sliderThumb = *new AtomicString("-webkit-slider-thumb");
static AtomicString& target = *new AtomicString("target");
static AtomicString& visited = *new AtomicString("visited");
static AtomicString& windowInactive = *new AtomicString("window-inactive");
static AtomicString& decrement = *new AtomicString("decrement");
static AtomicString& increment = *new AtomicString("increment");
static AtomicString& start = *new AtomicString("start");
static AtomicString& end = *new AtomicString("end");
static AtomicString& horizontal = *new AtomicString("horizontal");
static AtomicString& vertical = *new AtomicString("vertical");
static AtomicString& doubleButton = *new AtomicString("double-button");
static AtomicString& singleButton = *new AtomicString("single-button");
static AtomicString& noButton = *new AtomicString("no-button");
static AtomicString& cornerPresent = *new AtomicString("corner-present");
bool element = false; // pseudo-element
bool compat = false; // single colon compatbility mode
......
......@@ -372,13 +372,13 @@ static bool elementCanUseSimpleDefaultStyle(Element* e)
static const MediaQueryEvaluator& screenEval()
{
static const MediaQueryEvaluator staticScreenEval("screen");
static const MediaQueryEvaluator& staticScreenEval = *new MediaQueryEvaluator("screen");
return staticScreenEval;
}
static const MediaQueryEvaluator& printEval()
{
static const MediaQueryEvaluator staticPrintEval("print");
static const MediaQueryEvaluator& staticPrintEval = *new MediaQueryEvaluator("print");
return staticPrintEval;
}
......
......@@ -64,7 +64,7 @@ static void addString(HashSet<String, CaseFoldingHash>& set, const char* string)
static bool isSVG10Feature(const String &feature)
{
static bool initialized = false;
static HashSet<String, CaseFoldingHash> svgFeatures;
static HashSet<String, CaseFoldingHash>& svgFeatures = *new HashSet<String, CaseFoldingHash>;
if (!initialized) {
#if ENABLE(SVG_USE) && ENABLE(SVG_FOREIGN_OBJECT) && ENABLE(SVG_FILTER) && ENABLE(SVG_FONTS)
addString(svgFeatures, "svg");
......@@ -89,7 +89,7 @@ static bool isSVG10Feature(const String &feature)
static bool isSVG11Feature(const String &feature)
{
static bool initialized = false;
static HashSet<String, CaseFoldingHash> svgFeatures;
static HashSet<String, CaseFoldingHash>& svgFeatures = *new HashSet<String, CaseFoldingHash>;
if (!initialized) {
// Sadly, we cannot claim to implement any of the SVG 1.1 generic feature sets
// lack of Font and Filter support.
......@@ -274,7 +274,7 @@ bool DOMImplementation::isXMLMIMEType(const String& mimeType)
if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "text/xsl")
return true;
static const char* validChars = "[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]"; // per RFCs: 3023, 2045
static RegularExpression xmlTypeRegExp(String("^") + validChars + "+/" + validChars + "+\\+xml$");
static RegularExpression& xmlTypeRegExp = *new RegularExpression(String("^") + validChars + "+/" + validChars + "+\\+xml$");
return xmlTypeRegExp.match(mimeType) > -1;
}
......
......@@ -713,9 +713,9 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
bool Document::hasPrefixNamespaceMismatch(const QualifiedName& qName)
{
static const AtomicString xmlnsNamespaceURI("http://www.w3.org/2000/xmlns/");
static const AtomicString xmlns("xmlns");
static const AtomicString xml("xml");
static const AtomicString& xmlnsNamespaceURI = *new AtomicString("http://www.w3.org/2000/xmlns/");
static const AtomicString& xmlns = *new AtomicString("xmlns");
static const AtomicString& xml = *new AtomicString("xml");
// These checks are from DOM Core Level 2, createElementNS
// http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS
......
......@@ -91,7 +91,7 @@ void ScriptElement::handleSourceAttribute(ScriptElementData& data, const String&
// Helper function
static bool isSupportedJavaScriptLanguage(const String& language)
{
static HashSet<String, CaseFoldingHash> languages;
static HashSet<String, CaseFoldingHash>& languages = *new HashSet<String, CaseFoldingHash>;
if (languages.isEmpty()) {
languages.add("javascript");
languages.add("javascript");
......
......@@ -216,7 +216,7 @@ bool StyleChange::currentlyHasStyle(const Position &pos, const CSSProperty *prop
static String &styleSpanClassString()
{
static String styleSpanClassString = AppleStyleSpanClass;
static String& styleSpanClassString = *new String(AppleStyleSpanClass);
return styleSpanClassString;
}
......
......@@ -36,7 +36,7 @@ namespace {
String convertedSpaceString()
{
static String convertedSpaceString;
static String& convertedSpaceString = *new String;
if (convertedSpaceString.isNull()) {
convertedSpaceString = "<span class=\"";
convertedSpaceString += AppleConvertedSpace;
......
......@@ -43,7 +43,7 @@ using namespace HTMLNames;
static String indentBlockquoteString()
{
static String string = "webkit-indent-blockquote";
static String& string = *new String("webkit-indent-blockquote");
return string;
}
......
......@@ -89,14 +89,14 @@ private:
static bool isInterchangeNewlineNode(const Node *node)
{
static String interchangeNewlineClassString(AppleInterchangeNewline);
static String& interchangeNewlineClassString = *new String(AppleInterchangeNewline);
return node && node->hasTagName(brTag) &&
static_cast<const Element *>(node)->getAttribute(classAttr) == interchangeNewlineClassString;
}
static bool isInterchangeConvertedSpaceSpan(const Node *node)
{
static String convertedSpaceSpanClassString(AppleConvertedSpace);
static String& convertedSpaceSpanClassString = *new String(AppleConvertedSpace);
return node->isHTMLElement() &&
static_cast<const HTMLElement *>(node)->getAttribute(classAttr) == convertedSpaceSpanClassString;
}
......
......@@ -364,9 +364,9 @@ int maxDeepOffset(const Node *node)
String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph)
{
static String twoSpaces(" ");
static String nbsp("\xa0");
static String pattern(" \xa0");
static String& twoSpaces = *new String(" ");
static String& nbsp = *new String("\xa0");
static String& pattern = *new String(" \xa0");
String rebalancedString = string;
......@@ -393,7 +393,7 @@ bool isTableStructureNode(const Node *node)
const String& nonBreakingSpaceString()
{
static String nonBreakingSpaceString = String(&noBreakSpace, 1);
static String& nonBreakingSpaceString = *new String(&noBreakSpace, 1);
return nonBreakingSpaceString;
}
......
......@@ -94,11 +94,11 @@ static void appendAttributeValue(Vector<UChar>& result, const String& attr, bool
unsigned len = attr.length();
unsigned lastCopiedFrom = 0;
static const String ampEntity("&amp;");
static const String gtEntity("&gt;");
static const String ltEntity("&lt;");
static const String quotEntity("&quot;");
static const String nbspEntity("&nbsp;");
static const String& ampEntity = *new String("&amp;");
static const String& gtEntity = *new String("&gt;");
static const String& ltEntity = *new String("&lt;");
static const String& quotEntity = *new String("&quot;");