[WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Jul 2017 04:42:04 +0000 (04:42 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Jul 2017 04:42:04 +0000 (04:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174150

Reviewed by Mark Lam.

Source/WebCore:

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::captionDisplayMode):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::binaryType):
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::controlTypeName):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::language):
(WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
(WebCore::AccessibilityObject::actionVerb):
(WebCore::AccessibilityObject::getAttribute):
(WebCore::AccessibilityObject::placeholderValue):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::accessKey):
(WebCore::AccessibilityObject::ariaLiveRegionRelevant):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessKey):
(WebCore::AccessibilityRenderObject::actionVerb):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
* css/CSSPageRule.cpp:
(WebCore::CSSPageRule::selectorText):
* css/CSSPrimitiveValue.cpp:
(WebCore::valueName):
* css/CSSSelector.cpp:
(WebCore::simpleSelectorSpecificityInternal):
(WebCore::CSSSelector::specificityForPage):
(WebCore::CSSSelector::RareData::RareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::argument):
* css/CSSSelectorList.cpp:
(WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
* css/PageRuleCollector.cpp:
(WebCore::checkPageSelectorComponents):
* css/RuleSet.cpp:
(WebCore::computeMatchBasedOnRuleHash):
(WebCore::RuleSet::addRule):
* css/SelectorChecker.cpp:
(WebCore::tagMatches):
* css/SelectorFilter.cpp:
(WebCore::collectDescendantSelectorIdentifierHashes):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertStringOrAuto):
(WebCore::StyleBuilderConverter::convertStringOrNone):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLocale):
(WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
(WebCore::StyleBuilderCustom::applyValueContent):
(WebCore::StyleBuilderCustom::applyValueAlt):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::namespaceURIFromPrefix):
* css/makeprop.pl:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeCompoundSelector):
(WebCore::CSSSelectorParser::consumeName):
(WebCore::CSSSelectorParser::consumeAttribute):
(WebCore::CSSSelectorParser::defaultNamespace):
(WebCore::CSSSelectorParser::determineNamespace):
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
(WebCore::SelectorCompiler::equalTagNames):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
* dom/Attr.cpp:
(WebCore::Attr::setPrefix):
(WebCore::Attr::attachToElement):
* dom/Attribute.h:
(WebCore::Attribute::nameMatchesFilter):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::nameForProperty):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByTagName):
(WebCore::ContainerNode::getElementsByTagNameNS):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
* dom/DatasetDOMStringMap.cpp:
(WebCore::convertPropertyNameToAttributeName):
* dom/Document.cpp:
(WebCore::createUpgradeCandidateElement):
(WebCore::Document::createElementForBindings):
(WebCore::Document::importNode):
(WebCore::Document::hasValidNamespaceForElements):
(WebCore::Document::processBaseElement):
(WebCore::Document::dir):
(WebCore::Document::bgColor):
(WebCore::Document::fgColor):
(WebCore::Document::alinkColor):
(WebCore::Document::linkColorForBindings):
(WebCore::Document::vlinkColor):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::setBooleanAttribute):
(WebCore::Element::synchronizeAttribute):
(WebCore::Element::getAttribute):
(WebCore::Element::getAttributeNS):
(WebCore::Element::setAttribute):
(WebCore::Element::parserSetAttributes):
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::setPrefix):
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):
(WebCore::Element::removeAttributeInternal):
(WebCore::Element::addAttributeInternal):
(WebCore::Element::removeAttributeNS):
(WebCore::Element::getAttributeNodeNS):
(WebCore::Element::hasAttributeNS):
(WebCore::Element::computeInheritedLanguage):
(WebCore::Element::updateNameForDocument):
(WebCore::Element::updateIdForDocument):
(WebCore::Element::didAddAttribute):
(WebCore::Element::didRemoveAttribute):
(WebCore::Element::cloneAttributesFromElement):
* dom/Element.h:
(WebCore::Element::attributeWithoutSynchronization):
(WebCore::Element::idForStyleResolution):
(WebCore::Element::getIdAttribute):
(WebCore::Element::getNameAttribute):
* dom/EventTarget.cpp:
(WebCore::legacyType):
* dom/MutationRecord.h:
(WebCore::MutationRecord::attributeName):
(WebCore::MutationRecord::attributeNamespace):
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::removeNamedItemNS):
* dom/Node.cpp:
(WebCore::Node::prefix):
(WebCore::Node::localName):
(WebCore::Node::namespaceURI):
(WebCore::Node::checkSetPrefix):
(WebCore::locateDefaultNamespace):
(WebCore::Node::isDefaultNamespace):
(WebCore::Node::lookupNamespaceURI):
(WebCore::locateNamespacePrefix):
(WebCore::Node::lookupPrefix):
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCachedTagCollectionNS):
(WebCore::NodeListsNodeData::addCachedCollection):
(WebCore::NodeListsNodeData::cachedCollection):
(WebCore::NodeListsNodeData::removeCacheWithAtomicName):
(WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
(WebCore::NodeListsNodeData::removeCachedCollection):
* dom/PseudoElement.cpp:
(WebCore::pseudoElementTagName):
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::init):
(WebCore::nullQName):
(WebCore::createQualifiedName):
* dom/QualifiedName.h:
(WebCore::QualifiedName::hasPrefix):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeSingleTagNameSelectorData):
* dom/SlotAssignment.cpp:
(WebCore::slotNameFromAttributeValue):
* dom/SlotAssignment.h:
(WebCore::SlotAssignment::defaultSlotName):
(WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
(WebCore::ShadowRoot::didChangeDefaultSlot):
* dom/TagCollection.cpp:
(WebCore::TagCollection::TagCollection):
(WebCore::HTMLTagCollection::HTMLTagCollection):
* dom/TagCollection.h:
(WebCore::TagCollectionNS::elementMatches):
* dom/make_names.pl:
(printNamesCppFile):
(printDefinitions):
(printFactoryCppFile):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::removeNodeAttribute):
* editing/Editing.cpp:
(WebCore::createHTMLElement):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::shouldAddNamespaceElement):
(WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
(WebCore::MarkupAccumulator::appendNamespace):
(WebCore::MarkupAccumulator::appendOpenTag):
(WebCore::MarkupAccumulator::appendAttribute):
* editing/gtk/EditorGtk.cpp:
(WebCore::elementURL):
* editing/markup.cpp:
(WebCore::AttributeChange::AttributeChange):
* html/Autocapitalize.cpp:
(WebCore::stringForAutocapitalizeType):
* html/Autofill.cpp:
(WebCore::AutofillData::createFromHTMLFormControlElement):
* html/DOMTokenList.h:
(WebCore::DOMTokenList::item):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::name):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::formControlType):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::toggleOpen):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::isCaseSensitiveAttribute):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::eventNameForEventHandlerAttribute):
(WebCore::toValidDirValue):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::name):
(WebCore::HTMLInputElement::updateType):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::doesHaveAttribute):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor):
* html/HTMLParamElement.cpp:
(WebCore::HTMLParamElement::name):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setMultiple):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::scope):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
* html/LabelableElement.cpp:
(WebCore::LabelableElement::labels):
* html/LabelsNodeList.cpp:
(WebCore::LabelsNodeList::~LabelsNodeList):
* html/MediaController.cpp:
(MediaController::playbackState):
(eventNameForReadyState):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/parser/AtomicHTMLToken.h:
(WebCore::AtomicHTMLToken::initializeAttributes):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createElement):
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::stripLeadingAndTrailingHTMLSpaces):
(WebCore::parseHTMLHashNameReference):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::createForeignAttributesMap):
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::InbandTextTrack):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::id):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::captionMenuOffItem):
(WebCore::TextTrack::captionMenuAutomaticItem):
* html/track/TrackBase.cpp:
(WebCore::MediaTrackBase::setKindInternal):
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::scroll):
* html/track/WebVTTElement.cpp:
(WebCore::nodeTypeToTagName):
* html/track/WebVTTElement.h:
* html/track/WebVTTToken.h:
(WebCore::WebVTTToken::StartTag):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* loader/FrameLoader.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::clearFailedLoadURL):
* loader/NavigationAction.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::showModalDialog):
* page/EventHandler.cpp:
(WebCore::eventNameForTouchPointState):
* page/FrameTree.cpp:
(WebCore::FrameTree::setName):
(WebCore::FrameTree::clearName):
* page/Page.cpp:
(WebCore::Page::groupName):
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
* platform/graphics/FontDescription.h:
(WebCore::FontCascadeDescription::initialLocale):
* platform/graphics/FontGenericFamilies.cpp:
(WebCore::genericFontFamilyForScript):
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
* platform/graphics/TrackPrivateBase.h:
(WebCore::TrackPrivateBase::id):
(WebCore::TrackPrivateBase::label):
(WebCore::TrackPrivateBase::language):
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::id):
(WebCore::AVTrackPrivateAVFObjCImpl::label):
(WebCore::AVTrackPrivateAVFObjCImpl::language):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
(WebCore::InbandTextTrackPrivateAVCF::label):
(WebCore::InbandTextTrackPrivateAVCF::language):
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
(WebCore::InbandTextTrackPrivateLegacyAVCF::label):
(WebCore::InbandTextTrackPrivateLegacyAVCF::language):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
(WebCore::InbandTextTrackPrivateAVFObjC::label):
(WebCore::InbandTextTrackPrivateAVFObjC::language):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
(WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
(WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::metadataType):
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
(WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/mediastream/AudioTrackPrivateMediaStream.h:
* platform/mediastream/RealtimeMediaSourceSettings.cpp:
(WebCore::RealtimeMediaSourceSettings::facingMode):
* platform/mediastream/VideoTrackPrivateMediaStream.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::linkSuggestedFilename):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::markerText):
* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::nextOffset):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::textEmphasisMarkString):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialHyphenationString):
(WebCore::RenderStyle::initialTextEmphasisCustomMark):
(WebCore::RenderStyle::initialContentAltText):
(WebCore::RenderStyle::initialLineGrid):
(WebCore::RenderStyle::initialFlowThread):
(WebCore::RenderStyle::initialRegionThread):
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* svg/SVGElement.cpp:
(WebCore::SVGElement::getPresentationAttribute):
* svg/SVGElement.h:
(WebCore::SVGAttributeHashTranslator::hash):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::constructAttributeName):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::requestLicense):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
* xml/XPathStep.cpp:
(WebCore::XPath::nodeMatchesBasicTest):
(WebCore::XPath::Step::nodesInAxis):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::handleNamespaceAttributes):
(WebCore::handleElementAttributes):

Source/WebKit/mac:

* DOM/DOM.mm:
(lookupElementClass):

Source/WTF:

This patch cleans up StringStatics.cpp and remove it from the tree.

1. Move StringImpl methods to appropriate place, "StringImpl.cpp".

StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
StringStatics.cpp. But they should be defined in StringImpl.cpp.
This patch just moves them to StringImpl.cpp.

2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.

Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
We first define them as extern global variables. However, AtomicString has
a non-trivial constructor. Thus, we cannot do this because it requires global
constructor calls. This is why we have StringStatics.cpp. In this file, we
include "StaticConstructors.h". After including this file, all the global
constructor call disabled in Windows. And in GCC environment, we allocate
void* storage for that variable. And we use placement new in AtomicString::init()
to initialize these storage.
However, we already have better way for that: LazyNeverDestroyed. It just allocates
storage like the above. And it does not have any global constructors. Thus
we can just declare it as a global variable. And we initialize them lazily in
AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
And it makes "StringStatics.cpp" unnecessary.
Then, we just move these variables and AtomicString::init() to AtomicString.cpp.

And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::convertASCIICase):
(WTF::AtomicString::fromUTF8Internal):
(WTF::AtomicString::init):
* wtf/text/AtomicString.h:
(WTF::nullAtom):
(WTF::emptyAtom):
(WTF::starAtom):
(WTF::xmlAtom):
(WTF::xmlnsAtom):
(WTF::AtomicString::fromUTF8):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::toAtomicString):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::hashSlowCase):
(WTF::StringImpl::concurrentHash):
* wtf/text/StringStatics.cpp: Removed.

Tools:

* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/TestsController.cpp:
(TestWebKitAPI::TestsController::TestsController):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219237 268f45cc-cd09-0410-ab3c-d52691b4dbfc

149 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/text/AtomicString.cpp
Source/WTF/wtf/text/AtomicString.h
Source/WTF/wtf/text/StringBuilder.h
Source/WTF/wtf/text/StringImpl.cpp
Source/WTF/wtf/text/StringStatics.cpp [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityMediaControls.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/bindings/js/JSCustomElementInterface.cpp
Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/css/CSSPageRule.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSSelector.cpp
Source/WebCore/css/CSSSelector.h
Source/WebCore/css/CSSSelectorList.cpp
Source/WebCore/css/PageRuleCollector.cpp
Source/WebCore/css/RuleSet.cpp
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/SelectorFilter.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/css/makeprop.pl
Source/WebCore/css/parser/CSSParserImpl.cpp
Source/WebCore/css/parser/CSSSelectorParser.cpp
Source/WebCore/cssjit/SelectorCompiler.cpp
Source/WebCore/dom/Attr.cpp
Source/WebCore/dom/Attribute.h
Source/WebCore/dom/ConstantPropertyMap.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/CustomElementReactionQueue.cpp
Source/WebCore/dom/DatasetDOMStringMap.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/MutationRecord.h
Source/WebCore/dom/NamedNodeMap.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/NodeRareData.h
Source/WebCore/dom/PseudoElement.cpp
Source/WebCore/dom/QualifiedName.cpp
Source/WebCore/dom/QualifiedName.h
Source/WebCore/dom/SelectorQuery.cpp
Source/WebCore/dom/SlotAssignment.cpp
Source/WebCore/dom/SlotAssignment.h
Source/WebCore/dom/TagCollection.cpp
Source/WebCore/dom/TagCollection.h
Source/WebCore/dom/make_names.pl
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/Editing.cpp
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/editing/gtk/EditorGtk.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/Autocapitalize.cpp
Source/WebCore/html/Autofill.cpp
Source/WebCore/html/DOMTokenList.h
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLParamElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/LabelableElement.cpp
Source/WebCore/html/LabelsNodeList.cpp
Source/WebCore/html/MediaController.cpp
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/parser/AtomicHTMLToken.h
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/parser/HTMLParserIdioms.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/html/track/InbandTextTrack.cpp
Source/WebCore/html/track/LoadableTextTrack.cpp
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/TrackBase.cpp
Source/WebCore/html/track/VTTRegion.cpp
Source/WebCore/html/track/WebVTTElement.cpp
Source/WebCore/html/track/WebVTTElement.h
Source/WebCore/html/track/WebVTTToken.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/NavigationAction.h
Source/WebCore/loader/PolicyChecker.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FrameTree.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/platform/graphics/ComplexTextController.cpp
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/platform/graphics/FontGenericFamilies.cpp
Source/WebCore/platform/graphics/InbandTextTrackPrivate.h
Source/WebCore/platform/graphics/TrackPrivateBase.h
Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm
Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h
Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp
Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp
Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h
Source/WebCore/platform/graphics/win/FontCacheWin.cpp
Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceSettings.cpp
Source/WebCore/platform/mediastream/VideoTrackPrivateMediaStream.h
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebCore/rendering/TextPainter.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/style/StyleScope.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGElement.h
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/testing/MockCDMFactory.cpp
Source/WebCore/xml/XMLErrors.cpp
Source/WebCore/xml/XPathStep.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/DOM/DOM.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp
Tools/TestWebKitAPI/TestsController.cpp

index 02d86b1..a212001 100644 (file)
@@ -1,3 +1,57 @@
+2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
+        https://bugs.webkit.org/show_bug.cgi?id=174150
+
+        Reviewed by Mark Lam.
+
+        This patch cleans up StringStatics.cpp and remove it from the tree.
+
+        1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
+
+        StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
+        StringStatics.cpp. But they should be defined in StringImpl.cpp.
+        This patch just moves them to StringImpl.cpp.
+
+        2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
+
+        Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
+        We first define them as extern global variables. However, AtomicString has
+        a non-trivial constructor. Thus, we cannot do this because it requires global
+        constructor calls. This is why we have StringStatics.cpp. In this file, we
+        include "StaticConstructors.h". After including this file, all the global
+        constructor call disabled in Windows. And in GCC environment, we allocate
+        void* storage for that variable. And we use placement new in AtomicString::init()
+        to initialize these storage.
+        However, we already have better way for that: LazyNeverDestroyed. It just allocates
+        storage like the above. And it does not have any global constructors. Thus
+        we can just declare it as a global variable. And we initialize them lazily in
+        AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
+        And it makes "StringStatics.cpp" unnecessary.
+        Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
+
+        And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/text/AtomicString.cpp:
+        (WTF::AtomicString::convertASCIICase):
+        (WTF::AtomicString::fromUTF8Internal):
+        (WTF::AtomicString::init):
+        * wtf/text/AtomicString.h:
+        (WTF::nullAtom):
+        (WTF::emptyAtom):
+        (WTF::starAtom):
+        (WTF::xmlAtom):
+        (WTF::xmlnsAtom):
+        (WTF::AtomicString::fromUTF8):
+        * wtf/text/StringBuilder.h:
+        (WTF::StringBuilder::toAtomicString):
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::hashSlowCase):
+        (WTF::StringImpl::concurrentHash):
+        * wtf/text/StringStatics.cpp: Removed.
+
 2017-07-06  Keith Miller  <keith_miller@apple.com>
 
         Add extra insurance to prevent clang from making crash traces sad
index 19052ae..2e96c83 100644 (file)
                A8A47439151A825B004123FF /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47321151A825B004123FF /* CString.cpp */; };
                A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47324151A825B004123FF /* StringBuilder.cpp */; };
                A8A47440151A825B004123FF /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47328151A825B004123FF /* StringImpl.cpp */; };
-               A8A47443151A825B004123FF /* StringStatics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732B151A825B004123FF /* StringStatics.cpp */; };
                A8A47445151A825B004123FF /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732D151A825B004123FF /* WTFString.cpp */; };
                A8A47448151A825B004123FF /* ThreadHolderPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47330151A825B004123FF /* ThreadHolderPthreads.cpp */; };
                A8A4744A151A825B004123FF /* Threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47332151A825B004123FF /* Threading.cpp */; };
                A8A47328151A825B004123FF /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringImpl.cpp; sourceTree = "<group>"; };
                A8A47329151A825B004123FF /* StringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringImpl.h; sourceTree = "<group>"; };
                A8A4732A151A825B004123FF /* StringOperators.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringOperators.h; sourceTree = "<group>"; };
-               A8A4732B151A825B004123FF /* StringStatics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringStatics.cpp; sourceTree = "<group>"; };
                A8A4732C151A825B004123FF /* TextPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPosition.h; sourceTree = "<group>"; };
                A8A4732D151A825B004123FF /* WTFString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WTFString.cpp; sourceTree = "<group>"; };
                A8A4732E151A825B004123FF /* WTFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFString.h; sourceTree = "<group>"; };
                                A8A47328151A825B004123FF /* StringImpl.cpp */,
                                A8A47329151A825B004123FF /* StringImpl.h */,
                                A8A4732A151A825B004123FF /* StringOperators.h */,
-                               A8A4732B151A825B004123FF /* StringStatics.cpp */,
                                93F1993D19D7958D00C2390B /* StringView.cpp */,
                                1A6EB1DF187D0BD30030126F /* StringView.h */,
                                F72BBDB107FA424886178B9E /* SymbolImpl.cpp */,
                                A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */,
                                A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */,
                                0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */,
-                               A8A47443151A825B004123FF /* StringStatics.cpp in Sources */,
                                93F1993E19D7958D00C2390B /* StringView.cpp in Sources */,
                                93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */,
                                93934BD318A1E8C300D0D6A1 /* StringViewObjC.mm in Sources */,
index a36b4d0..936afb5 100644 (file)
@@ -276,7 +276,6 @@ set(WTF_SOURCES
     text/CString.cpp
     text/StringBuilder.cpp
     text/StringImpl.cpp
-    text/StringStatics.cpp
     text/StringView.cpp
     text/SymbolImpl.cpp
     text/SymbolRegistry.cpp
index cd8ef8f..9800564 100644 (file)
 #include "AtomicString.h"
 
 #include "IntegerToStringConversion.h"
+#include "MainThread.h"
+#include "NeverDestroyed.h"
 #include "dtoa.h"
 
-#if USE(WEB_THREAD)
-#include "Lock.h"
-#endif
-
 namespace WTF {
 
 template<AtomicString::CaseConvertType type>
@@ -37,7 +35,7 @@ ALWAYS_INLINE AtomicString AtomicString::convertASCIICase() const
 {
     StringImpl* impl = this->impl();
     if (UNLIKELY(!impl))
-        return nullAtom;
+        return nullAtom();
 
     // Convert short strings without allocating a new StringImpl, since
     // there's a good chance these strings are already in the atomic
@@ -112,7 +110,7 @@ AtomicString AtomicString::fromUTF8Internal(const char* charactersStart, const c
 {
     auto impl = AtomicStringImpl::addUTF8(charactersStart, charactersEnd);
     if (!impl)
-        return nullAtom;
+        return nullAtom();
     return impl.get();
 }
 
@@ -123,4 +121,25 @@ void AtomicString::show() const
 }
 #endif
 
+WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> nullAtomData;
+WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> emptyAtomData;
+WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> starAtomData;
+WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> xmlAtomData;
+WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> xmlnsAtomData;
+
+void AtomicString::init()
+{
+    static std::once_flag initializeKey;
+    std::call_once(initializeKey, [] {
+        // Initialization is not thread safe, so this function must be called from the main thread first.
+        ASSERT(isUIThread());
+
+        nullAtomData.construct();
+        emptyAtomData.construct("");
+        starAtomData.construct("*", AtomicString::ConstructFromLiteral);
+        xmlAtomData.construct("xml", AtomicString::ConstructFromLiteral);
+        xmlnsAtomData.construct("xmlns", AtomicString::ConstructFromLiteral);
+    });
+}
+
 } // namespace WTF
index 91bb20a..acffaae 100644 (file)
@@ -22,6 +22,7 @@
 #define AtomicString_h
 
 #include <utility>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/text/AtomicStringImpl.h>
 #include <wtf/text/IntegerToStringConversion.h>
 #include <wtf/text/WTFString.h>
@@ -304,31 +305,35 @@ inline AtomicString::AtomicString(NSString* s)
 
 // Define external global variables for the commonly used atomic strings.
 // These are only usable from the main thread.
-#ifndef ATOMICSTRING_HIDE_GLOBALS
-extern const WTF_EXPORTDATA AtomicString nullAtom;
-extern const WTF_EXPORTDATA AtomicString emptyAtom;
-extern const WTF_EXPORTDATA AtomicString starAtom;
-extern const WTF_EXPORTDATA AtomicString xmlAtom;
-extern const WTF_EXPORTDATA AtomicString xmlnsAtom;
+extern WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> nullAtomData;
+extern WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> emptyAtomData;
+extern WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> starAtomData;
+extern WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> xmlAtomData;
+extern WTF_EXPORTDATA LazyNeverDestroyed<AtomicString> xmlnsAtomData;
+
+inline const AtomicString& nullAtom() { return nullAtomData.get(); }
+inline const AtomicString& emptyAtom() { return emptyAtomData.get(); }
+inline const AtomicString& starAtom() { return starAtomData.get(); }
+inline const AtomicString& xmlAtom() { return xmlAtomData.get(); }
+inline const AtomicString& xmlnsAtom() { return xmlnsAtomData.get(); }
 
 inline AtomicString AtomicString::fromUTF8(const char* characters, size_t length)
 {
     if (!characters)
-        return nullAtom;
+        return nullAtom();
     if (!length)
-        return emptyAtom;
+        return emptyAtom();
     return fromUTF8Internal(characters, characters + length);
 }
 
 inline AtomicString AtomicString::fromUTF8(const char* characters)
 {
     if (!characters)
-        return nullAtom;
+        return nullAtom();
     if (!*characters)
-        return emptyAtom;
+        return emptyAtom();
     return fromUTF8Internal(characters, nullptr);
 }
-#endif
 
 // AtomicStringHash is the default hash for AtomicString
 template<typename T> struct DefaultHash;
index d02737a..7bd441a 100644 (file)
@@ -205,7 +205,7 @@ public:
     AtomicString toAtomicString() const
     {
         if (!m_length)
-            return emptyAtom;
+            return emptyAtom();
 
         // If the buffer is sufficiently over-allocated, make a new AtomicString from a copy so its buffer is not so large.
         if (canShrink()) {
index 9ff0ed3..5f865a4 100644 (file)
@@ -2140,6 +2140,26 @@ CString StringImpl::utf8(ConversionMode mode) const
     return utf8ForRange(0, length(), mode);
 }
 
+NEVER_INLINE unsigned StringImpl::hashSlowCase() const
+{
+    if (is8Bit())
+        setHash(StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length));
+    else
+        setHash(StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length));
+    return existingHash();
+}
+
+unsigned StringImpl::concurrentHash() const
+{
+    unsigned hash;
+    if (is8Bit())
+        hash = StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length);
+    else
+        hash = StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length);
+    ASSERT(((hash << s_flagCount) >> s_flagCount) == hash);
+    return hash;
+}
+
 bool equalIgnoringNullity(const UChar* a, size_t aLength, StringImpl* b)
 {
     if (!b)
diff --git a/Source/WTF/wtf/text/StringStatics.cpp b/Source/WTF/wtf/text/StringStatics.cpp
deleted file mode 100644 (file)
index 0c2119c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2010, 2016 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
-#define ATOMICSTRING_HIDE_GLOBALS 1
-#endif
-
-#include "AtomicString.h"
-#include "MainThread.h"
-#include "NeverDestroyed.h"
-#include "StaticConstructors.h"
-#include "StringImpl.h"
-
-#if USE(WEB_THREAD)
-#include <pthread.h>
-#endif
-
-namespace WTF {
-
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, nullAtom)
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, emptyAtom)
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, starAtom)
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlAtom)
-WTF_EXPORTDATA DEFINE_GLOBAL(AtomicString, xmlnsAtom)
-
-NEVER_INLINE unsigned StringImpl::hashSlowCase() const
-{
-    if (is8Bit())
-        setHash(StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length));
-    else
-        setHash(StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length));
-    return existingHash();
-}
-
-unsigned StringImpl::concurrentHash() const
-{
-    unsigned hash;
-    if (is8Bit())
-        hash = StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length);
-    else
-        hash = StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length);
-    ASSERT(((hash << s_flagCount) >> s_flagCount) == hash);
-    return hash;
-}
-
-void AtomicString::init()
-{
-    static bool initialized;
-    if (!initialized) {
-        // Initialization is not thread safe, so this function must be called from the main thread first.
-        ASSERT(isUIThread());
-
-        // Use placement new to initialize the globals.
-        new (NotNull, (void*)&nullAtom) AtomicString;
-        new (NotNull, (void*)&emptyAtom) AtomicString("");
-        new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFromLiteral);
-        new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFromLiteral);
-        new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::ConstructFromLiteral);
-
-        initialized = true;
-    }
-}
-
-}
index 22ffe37..e98905d 100644 (file)
@@ -1,3 +1,383 @@
+2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
+        https://bugs.webkit.org/show_bug.cgi?id=174150
+
+        Reviewed by Mark Lam.
+
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::captionDisplayMode):
+        * Modules/mediastream/RTCDataChannel.cpp:
+        (WebCore::RTCDataChannel::binaryType):
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::createFromRenderer):
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaControl::controlTypeName):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::language):
+        (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
+        (WebCore::AccessibilityObject::actionVerb):
+        (WebCore::AccessibilityObject::getAttribute):
+        (WebCore::AccessibilityObject::placeholderValue):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::accessKey):
+        (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessKey):
+        (WebCore::AccessibilityRenderObject::actionVerb):
+        * bindings/js/JSCustomElementInterface.cpp:
+        (WebCore::JSCustomElementInterface::constructElementWithFallback):
+        * bindings/js/JSCustomElementRegistryCustom.cpp:
+        (WebCore::JSCustomElementRegistry::define):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDefaultValue):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
+        * css/CSSPageRule.cpp:
+        (WebCore::CSSPageRule::selectorText):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::valueName):
+        * css/CSSSelector.cpp:
+        (WebCore::simpleSelectorSpecificityInternal):
+        (WebCore::CSSSelector::specificityForPage):
+        (WebCore::CSSSelector::RareData::RareData):
+        * css/CSSSelector.h:
+        (WebCore::CSSSelector::argument):
+        * css/CSSSelectorList.cpp:
+        (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
+        * css/PageRuleCollector.cpp:
+        (WebCore::checkPageSelectorComponents):
+        * css/RuleSet.cpp:
+        (WebCore::computeMatchBasedOnRuleHash):
+        (WebCore::RuleSet::addRule):
+        * css/SelectorChecker.cpp:
+        (WebCore::tagMatches):
+        * css/SelectorFilter.cpp:
+        (WebCore::collectDescendantSelectorIdentifierHashes):
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertStringOrAuto):
+        (WebCore::StyleBuilderConverter::convertStringOrNone):
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
+        (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
+        (WebCore::StyleBuilderCustom::applyValueContent):
+        (WebCore::StyleBuilderCustom::applyValueAlt):
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::StyleSheetContents):
+        (WebCore::StyleSheetContents::namespaceURIFromPrefix):
+        * css/makeprop.pl:
+        * css/parser/CSSParserImpl.cpp:
+        (WebCore::CSSParserImpl::parsePageSelector):
+        * css/parser/CSSSelectorParser.cpp:
+        (WebCore::CSSSelectorParser::consumeCompoundSelector):
+        (WebCore::CSSSelectorParser::consumeName):
+        (WebCore::CSSSelectorParser::consumeAttribute):
+        (WebCore::CSSSelectorParser::defaultNamespace):
+        (WebCore::CSSSelectorParser::determineNamespace):
+        (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
+        (WebCore::SelectorCompiler::equalTagNames):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
+        * dom/Attr.cpp:
+        (WebCore::Attr::setPrefix):
+        (WebCore::Attr::attachToElement):
+        * dom/Attribute.h:
+        (WebCore::Attribute::nameMatchesFilter):
+        * dom/ConstantPropertyMap.cpp:
+        (WebCore::ConstantPropertyMap::nameForProperty):
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::getElementsByTagName):
+        (WebCore::ContainerNode::getElementsByTagNameNS):
+        * dom/CustomElementReactionQueue.cpp:
+        (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
+        * dom/DatasetDOMStringMap.cpp:
+        (WebCore::convertPropertyNameToAttributeName):
+        * dom/Document.cpp:
+        (WebCore::createUpgradeCandidateElement):
+        (WebCore::Document::createElementForBindings):
+        (WebCore::Document::importNode):
+        (WebCore::Document::hasValidNamespaceForElements):
+        (WebCore::Document::processBaseElement):
+        (WebCore::Document::dir):
+        (WebCore::Document::bgColor):
+        (WebCore::Document::fgColor):
+        (WebCore::Document::alinkColor):
+        (WebCore::Document::linkColorForBindings):
+        (WebCore::Document::vlinkColor):
+        * dom/Document.h:
+        * dom/Element.cpp:
+        (WebCore::Element::setBooleanAttribute):
+        (WebCore::Element::synchronizeAttribute):
+        (WebCore::Element::getAttribute):
+        (WebCore::Element::getAttributeNS):
+        (WebCore::Element::setAttribute):
+        (WebCore::Element::parserSetAttributes):
+        (WebCore::Element::didMoveToNewDocument):
+        (WebCore::Element::setPrefix):
+        (WebCore::Element::insertedInto):
+        (WebCore::Element::removedFrom):
+        (WebCore::Element::removeAttributeInternal):
+        (WebCore::Element::addAttributeInternal):
+        (WebCore::Element::removeAttributeNS):
+        (WebCore::Element::getAttributeNodeNS):
+        (WebCore::Element::hasAttributeNS):
+        (WebCore::Element::computeInheritedLanguage):
+        (WebCore::Element::updateNameForDocument):
+        (WebCore::Element::updateIdForDocument):
+        (WebCore::Element::didAddAttribute):
+        (WebCore::Element::didRemoveAttribute):
+        (WebCore::Element::cloneAttributesFromElement):
+        * dom/Element.h:
+        (WebCore::Element::attributeWithoutSynchronization):
+        (WebCore::Element::idForStyleResolution):
+        (WebCore::Element::getIdAttribute):
+        (WebCore::Element::getNameAttribute):
+        * dom/EventTarget.cpp:
+        (WebCore::legacyType):
+        * dom/MutationRecord.h:
+        (WebCore::MutationRecord::attributeName):
+        (WebCore::MutationRecord::attributeNamespace):
+        * dom/NamedNodeMap.cpp:
+        (WebCore::NamedNodeMap::removeNamedItemNS):
+        * dom/Node.cpp:
+        (WebCore::Node::prefix):
+        (WebCore::Node::localName):
+        (WebCore::Node::namespaceURI):
+        (WebCore::Node::checkSetPrefix):
+        (WebCore::locateDefaultNamespace):
+        (WebCore::Node::isDefaultNamespace):
+        (WebCore::Node::lookupNamespaceURI):
+        (WebCore::locateNamespacePrefix):
+        (WebCore::Node::lookupPrefix):
+        * dom/NodeRareData.h:
+        (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
+        (WebCore::NodeListsNodeData::addCachedCollection):
+        (WebCore::NodeListsNodeData::cachedCollection):
+        (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
+        (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
+        (WebCore::NodeListsNodeData::removeCachedCollection):
+        * dom/PseudoElement.cpp:
+        (WebCore::pseudoElementTagName):
+        * dom/QualifiedName.cpp:
+        (WebCore::QualifiedName::init):
+        (WebCore::nullQName):
+        (WebCore::createQualifiedName):
+        * dom/QualifiedName.h:
+        (WebCore::QualifiedName::hasPrefix):
+        * dom/SelectorQuery.cpp:
+        (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
+        * dom/SlotAssignment.cpp:
+        (WebCore::slotNameFromAttributeValue):
+        * dom/SlotAssignment.h:
+        (WebCore::SlotAssignment::defaultSlotName):
+        (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
+        (WebCore::ShadowRoot::didChangeDefaultSlot):
+        * dom/TagCollection.cpp:
+        (WebCore::TagCollection::TagCollection):
+        (WebCore::HTMLTagCollection::HTMLTagCollection):
+        * dom/TagCollection.h:
+        (WebCore::TagCollectionNS::elementMatches):
+        * dom/make_names.pl:
+        (printNamesCppFile):
+        (printDefinitions):
+        (printFactoryCppFile):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::removeNodeAttribute):
+        * editing/Editing.cpp:
+        (WebCore::createHTMLElement):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
+        (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
+        (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
+        (WebCore::MarkupAccumulator::appendNamespace):
+        (WebCore::MarkupAccumulator::appendOpenTag):
+        (WebCore::MarkupAccumulator::appendAttribute):
+        * editing/gtk/EditorGtk.cpp:
+        (WebCore::elementURL):
+        * editing/markup.cpp:
+        (WebCore::AttributeChange::AttributeChange):
+        * html/Autocapitalize.cpp:
+        (WebCore::stringForAutocapitalizeType):
+        * html/Autofill.cpp:
+        (WebCore::AutofillData::createFromHTMLFormControlElement):
+        * html/DOMTokenList.h:
+        (WebCore::DOMTokenList::item):
+        * html/FormAssociatedElement.cpp:
+        (WebCore::FormAssociatedElement::name):
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::formControlType):
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::HTMLDetailsElement::toggleOpen):
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::isCaseSensitiveAttribute):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
+        (WebCore::toValidDirValue):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::name):
+        (WebCore::HTMLInputElement::updateType):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::doesHaveAttribute):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::createForJSConstructor):
+        * html/HTMLParamElement.cpp:
+        (WebCore::HTMLParamElement::name):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::setMultiple):
+        * html/HTMLTableCellElement.cpp:
+        (WebCore::HTMLTableCellElement::scope):
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
+        * html/LabelableElement.cpp:
+        (WebCore::LabelableElement::labels):
+        * html/LabelsNodeList.cpp:
+        (WebCore::LabelsNodeList::~LabelsNodeList):
+        * html/MediaController.cpp:
+        (MediaController::playbackState):
+        (eventNameForReadyState):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::createDocumentStructure):
+        * html/parser/AtomicHTMLToken.h:
+        (WebCore::AtomicHTMLToken::initializeAttributes):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::createElement):
+        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::stripLeadingAndTrailingHTMLSpaces):
+        (WebCore::parseHTMLHashNameReference):
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::createForeignAttributesMap):
+        * html/track/InbandTextTrack.cpp:
+        (WebCore::InbandTextTrack::InbandTextTrack):
+        * html/track/LoadableTextTrack.cpp:
+        (WebCore::LoadableTextTrack::id):
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::captionMenuOffItem):
+        (WebCore::TextTrack::captionMenuAutomaticItem):
+        * html/track/TrackBase.cpp:
+        (WebCore::MediaTrackBase::setKindInternal):
+        * html/track/VTTRegion.cpp:
+        (WebCore::VTTRegion::scroll):
+        * html/track/WebVTTElement.cpp:
+        (WebCore::nodeTypeToTagName):
+        * html/track/WebVTTElement.h:
+        * html/track/WebVTTToken.h:
+        (WebCore::WebVTTToken::StartTag):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clear):
+        * loader/FrameLoader.h:
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::clearFailedLoadURL):
+        * loader/NavigationAction.h:
+        * loader/PolicyChecker.cpp:
+        (WebCore::PolicyChecker::checkNavigationPolicy):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::showModalDialog):
+        * page/EventHandler.cpp:
+        (WebCore::eventNameForTouchPointState):
+        * page/FrameTree.cpp:
+        (WebCore::FrameTree::setName):
+        (WebCore::FrameTree::clearName):
+        * page/Page.cpp:
+        (WebCore::Page::groupName):
+        * platform/graphics/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::offsetForPosition):
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::alternateFamilyName):
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontCascadeDescription::initialLocale):
+        * platform/graphics/FontGenericFamilies.cpp:
+        (WebCore::genericFontFamilyForScript):
+        * platform/graphics/InbandTextTrackPrivate.h:
+        (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
+        * platform/graphics/TrackPrivateBase.h:
+        (WebCore::TrackPrivateBase::id):
+        (WebCore::TrackPrivateBase::label):
+        (WebCore::TrackPrivateBase::language):
+        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
+        (WebCore::AVTrackPrivateAVFObjCImpl::id):
+        (WebCore::AVTrackPrivateAVFObjCImpl::label):
+        (WebCore::AVTrackPrivateAVFObjCImpl::language):
+        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
+        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
+        (WebCore::InbandTextTrackPrivateAVCF::label):
+        (WebCore::InbandTextTrackPrivateAVCF::language):
+        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
+        (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
+        (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
+        (WebCore::InbandTextTrackPrivateAVFObjC::label):
+        (WebCore::InbandTextTrackPrivateAVFObjC::language):
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
+        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
+        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::metadataType):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
+        (WebCore::FontCascadeDescription::effectiveFamilyAt):
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
+        (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/mediastream/AudioTrackPrivateMediaStream.h:
+        * platform/mediastream/RealtimeMediaSourceSettings.cpp:
+        (WebCore::RealtimeMediaSourceSettings::facingMode):
+        * platform/mediastream/VideoTrackPrivateMediaStream.h:
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::linkSuggestedFilename):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint):
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::markerText):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::previousOffset):
+        (WebCore::RenderText::nextOffset):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::RenderTreeAsText::writeRenderObject):
+        * rendering/TextPainter.cpp:
+        (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::textEmphasisMarkString):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::initialHyphenationString):
+        (WebCore::RenderStyle::initialTextEmphasisCustomMark):
+        (WebCore::RenderStyle::initialContentAltText):
+        (WebCore::RenderStyle::initialLineGrid):
+        (WebCore::RenderStyle::initialFlowThread):
+        (WebCore::RenderStyle::initialRegionThread):
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::collectActiveStyleSheets):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::getPresentationAttribute):
+        * svg/SVGElement.h:
+        (WebCore::SVGAttributeHashTranslator::hash):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::constructAttributeName):
+        * testing/MockCDMFactory.cpp:
+        (WebCore::MockCDMInstance::requestLicense):
+        * xml/XMLErrors.cpp:
+        (WebCore::createXHTMLParserErrorHeader):
+        * xml/XPathStep.cpp:
+        (WebCore::XPath::nodeMatchesBasicTest):
+        (WebCore::XPath::Step::nodesInAxis):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::XMLDocumentParser):
+        (WebCore::handleNamespaceAttributes):
+        (WebCore::handleElementAttributes):
+
 2017-07-06  Chris Dumez  <cdumez@apple.com>
 
         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
index 9599013..9f20104 100644 (file)
@@ -130,7 +130,7 @@ AtomicString MediaControlsHost::captionDisplayMode() const
 {
     Page* page = m_mediaElement->document().page();
     if (!page)
-        return emptyAtom;
+        return emptyAtom();
 
     switch (page->group().captionPreferences().captionDisplayMode()) {
     case CaptionUserPreferences::Automatic:
@@ -143,7 +143,7 @@ AtomicString MediaControlsHost::captionDisplayMode() const
         return manualKeyword();
     default:
         ASSERT_NOT_REACHED();
-        return emptyAtom;
+        return emptyAtom();
     }
 }
 
index a03bc2b..17f2dd4 100644 (file)
@@ -90,7 +90,7 @@ const AtomicString& RTCDataChannel::binaryType() const
     }
 
     ASSERT_NOT_REACHED();
-    return emptyAtom;
+    return emptyAtom();
 }
 
 ExceptionOr<void> RTCDataChannel::setBinaryType(const AtomicString& binaryType)
index 4fb763f..1ad5d84 100644 (file)
@@ -400,7 +400,7 @@ AccessibilityObject* AXObjectCache::get(Node* node)
 }
 
 // FIXME: This probably belongs on Node.
-// FIXME: This should take a const char*, but one caller passes nullAtom.
+// FIXME: This should take a const char*, but one caller passes nullAtom().
 bool nodeHasRole(Node* node, const String& role)
 {
     if (!node || !is<Element>(node))
@@ -423,7 +423,7 @@ static Ref<AccessibilityObject> createFromRenderer(RenderObject* renderer)
     // If the node is aria role="list" or the aria role is empty and its a
     // ul/ol/dl type (it shouldn't be a list if aria says otherwise).
     if (node && ((nodeHasRole(node, "list") || nodeHasRole(node, "directory"))
-                      || (nodeHasRole(node, nullAtom) && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(dlTag)))))
+                      || (nodeHasRole(node, nullAtom()) && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(dlTag)))))
         return AccessibilityList::create(renderer);
 
     // aria tables
@@ -440,7 +440,7 @@ static Ref<AccessibilityObject> createFromRenderer(RenderObject* renderer)
     if (nodeHasRole(node, "treeitem"))
         return AccessibilityTreeItem::create(renderer);
 
-    if (node && is<HTMLLabelElement>(node) && nodeHasRole(node, nullAtom))
+    if (node && is<HTMLLabelElement>(node) && nodeHasRole(node, nullAtom()))
         return AccessibilityLabel::create(renderer);
 
 #if ENABLE(VIDEO)
index f1d50fc..083ccc7 100644 (file)
@@ -135,7 +135,7 @@ const String& AccessibilityMediaControl::controlTypeName() const
         break;
     }
 
-    return nullAtom;
+    return nullAtom();
 }
 
 void AccessibilityMediaControl::accessibilityText(Vector<AccessibilityText>& textOrder)
index 4aff022..94fabaf 100644 (file)
@@ -1053,7 +1053,7 @@ String AccessibilityObject::language() const
         Document* doc = document();
         if (doc)
             return doc->contentLanguage();
-        return nullAtom;
+        return nullAtom();
     }
     
     return parent->language();
@@ -1933,7 +1933,7 @@ const String AccessibilityObject::defaultLiveRegionStatusForRole(AccessibilityRo
     case ApplicationMarqueeRole:
         return ASCIILiteral("off");
     default:
-        return nullAtom;
+        return nullAtom();
     }
 }
     
@@ -1974,10 +1974,10 @@ const String& AccessibilityObject::actionVerb() const
     case ListItemRole:
         return listItemAction;
     default:
-        return nullAtom;
+        return nullAtom();
     }
 #else
-    return nullAtom;
+    return nullAtom();
 #endif
 }
 #endif
@@ -2138,7 +2138,7 @@ const AtomicString& AccessibilityObject::getAttribute(const QualifiedName& attri
 {
     if (Element* element = this->element())
         return element->attributeWithoutSynchronization(attribute);
-    return nullAtom;
+    return nullAtom();
 }
     
 // Lacking concrete evidence of orientation, horizontal means width > height. vertical is height > width;
@@ -2477,7 +2477,7 @@ const AtomicString& AccessibilityObject::placeholderValue() const
     if (!ariaPlaceholder.isEmpty())
         return ariaPlaceholder;
     
-    return nullAtom;
+    return nullAtom();
 }
     
 bool AccessibilityObject::isInsideARIALiveRegion() const
index d3c1a17..303ad22 100644 (file)
@@ -816,7 +816,7 @@ public:
     virtual URL url() const { return URL(); }
     virtual VisibleSelection selection() const { return VisibleSelection(); }
     virtual String selectedText() const { return String(); }
-    virtual const AtomicString& accessKey() const { return nullAtom; }
+    virtual const AtomicString& accessKey() const { return nullAtom(); }
     const String& actionVerb() const;
     virtual Widget* widget() const { return nullptr; }
     virtual Widget* widgetForAttachmentView() const { return nullptr; }
@@ -973,7 +973,7 @@ public:
     bool supportsARIALiveRegion() const;
     bool isInsideARIALiveRegion() const;
     virtual const String ariaLiveRegionStatus() const { return String(); }
-    virtual const AtomicString& ariaLiveRegionRelevant() const { return nullAtom; }
+    virtual const AtomicString& ariaLiveRegionRelevant() const { return nullAtom(); }
     virtual bool ariaLiveRegionAtomic() const { return false; }
     virtual bool isBusy() const { return false; }
     static const String defaultLiveRegionStatusForRole(AccessibilityRole);
index 47b2128..6e83cfa 100644 (file)
@@ -1505,7 +1505,7 @@ const AtomicString& AccessibilityRenderObject::accessKey() const
 {
     Node* node = m_renderer->node();
     if (!is<Element>(node))
-        return nullAtom;
+        return nullAtom();
     return downcast<Element>(*node).getAttribute(accesskeyAttr);
 }
 
@@ -3464,10 +3464,10 @@ const String& AccessibilityRenderObject::actionVerb() const
     case WebCoreLinkRole:
         return linkAction;
     default:
-        return nullAtom;
+        return nullAtom();
     }
 #else
-    return nullAtom;
+    return nullAtom();
 #endif
 }
     
index d52a9f2..c60b05a 100644 (file)
@@ -65,7 +65,7 @@ Ref<Element> JSCustomElementInterface::constructElementWithFallback(Document& do
     if (auto element = tryToConstructCustomElement(document, localName))
         return element.releaseNonNull();
 
-    auto element = HTMLUnknownElement::create(QualifiedName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI), document);
+    auto element = HTMLUnknownElement::create(QualifiedName(nullAtom(), localName, HTMLNames::xhtmlNamespaceURI), document);
     element->setIsCustomElementUpgradeCandidate();
     element->setIsFailedCustomElement(*this);
 
@@ -75,7 +75,7 @@ Ref<Element> JSCustomElementInterface::constructElementWithFallback(Document& do
 Ref<Element> JSCustomElementInterface::constructElementWithFallback(Document& document, const QualifiedName& name)
 {
     if (auto element = tryToConstructCustomElement(document, name.localName())) {
-        if (name.prefix() != nullAtom)
+        if (name.prefix() != nullAtom())
             element->setPrefix(name.prefix());
         return element.releaseNonNull();
     }
index 038f056..1e82a13 100644 (file)
@@ -126,7 +126,7 @@ JSValue JSCustomElementRegistry::define(ExecState& state)
         return throwTypeError(&state, scope, ASCIILiteral("Custom element constructor's prototype must be an object"));
     JSObject& prototypeObject = *asObject(prototypeValue);
 
-    QualifiedName name(nullAtom, localName, HTMLNames::xhtmlNamespaceURI);
+    QualifiedName name(nullAtom(), localName, HTMLNames::xhtmlNamespaceURI);
     auto elementInterface = JSCustomElementInterface::create(name, constructor, globalObject());
 
     auto* connectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&vm, "connectedCallback"));
index 7059c55..59c750f 100644 (file)
@@ -2125,9 +2125,9 @@ sub GenerateDefaultValue
     if ($codeGenerator->IsStringType($type)) {
         my $useAtomicString = $type->extendedAttributes->{AtomicString};
         if ($defaultValue eq "null") {
-            return $useAtomicString ? "nullAtom" : "String()";
+            return $useAtomicString ? "nullAtom()" : "String()";
         } elsif ($defaultValue eq "\"\"") {
-            return $useAtomicString ? "emptyAtom" : "emptyString()";
+            return $useAtomicString ? "emptyAtom()" : "emptyString()";
         } else {
             return $useAtomicString ? "AtomicString(${defaultValue}, AtomicString::ConstructFromLiteral)" : "ASCIILiteral(${defaultValue})";
         }
index dc9cff5..41260c9 100644 (file)
@@ -6011,7 +6011,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalAt
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto str = state->argument(0).isUndefined() ? nullAtom : convert<IDLAtomicStringAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(0));
+    auto str = state->argument(0).isUndefined() ? nullAtom() : convert<IDLAtomicStringAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalAtomicString(WTFMove(str));
     return JSValue::encode(jsUndefined());
@@ -6091,7 +6091,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalAt
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto str = state->argument(0).isUndefined() ? nullAtom : convert<IDLAtomicStringAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(0));
+    auto str = state->argument(0).isUndefined() ? nullAtom() : convert<IDLAtomicStringAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalAtomicStringIsNull(WTFMove(str));
     return JSValue::encode(jsUndefined());
@@ -6139,7 +6139,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionMethodWithOptionalAt
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto str = state->argument(0).isUndefined() ? emptyAtom : convert<IDLAtomicStringAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(0));
+    auto str = state->argument(0).isUndefined() ? emptyAtom() : convert<IDLAtomicStringAdaptor<IDLDOMString>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalAtomicStringIsEmptyString(WTFMove(str));
     return JSValue::encode(jsUndefined());
index e1012b0..47cf456 100644 (file)
@@ -59,7 +59,7 @@ String CSSPageRule::selectorText() const
     const CSSSelector* selector = m_pageRule->selector();
     if (selector) {
         String pageSpecification = selector->selectorText();
-        if (!pageSpecification.isEmpty() && pageSpecification != starAtom) {
+        if (!pageSpecification.isEmpty() && pageSpecification != starAtom()) {
             text.append(' ');
             text.append(pageSpecification);
         }
index 6488f41..d6f6a0b 100644 (file)
@@ -282,7 +282,7 @@ static const AtomicString& valueName(CSSValueID valueID)
     ASSERT_ARG(valueID, valueID < numCSSValueKeywords);
 
     if (valueID < 0)
-        return nullAtom;
+        return nullAtom();
 
     static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords]; // Leaked intentionally.
     AtomicString& keywordString = keywordStrings[valueID];
index 6938b61..2eb0d04 100644 (file)
@@ -140,7 +140,7 @@ static unsigned simpleSelectorSpecificityInternal(const CSSSelector& simpleSelec
     case CSSSelector::End:
         return static_cast<unsigned>(SelectorSpecificityIncrement::ClassB);
     case CSSSelector::Tag:
-        return (simpleSelector.tagQName().localName() != starAtom) ? static_cast<unsigned>(SelectorSpecificityIncrement::ClassC) : 0;
+        return (simpleSelector.tagQName().localName() != starAtom()) ? static_cast<unsigned>(SelectorSpecificityIncrement::ClassC) : 0;
     case CSSSelector::PseudoElement:
         return static_cast<unsigned>(SelectorSpecificityIncrement::ClassC);
     case CSSSelector::Unknown:
@@ -246,7 +246,7 @@ unsigned CSSSelector::specificityForPage() const
     for (const CSSSelector* component = this; component; component = component->tagHistory()) {
         switch (component->match()) {
         case Tag:
-            s += tagQName().localName() == starAtom ? 0 : 4;
+            s += tagQName().localName() == starAtom() ? 0 : 4;
             break;
         case PagePseudoClass:
             switch (component->pagePseudoClassType()) {
@@ -826,7 +826,7 @@ CSSSelector::RareData::RareData(AtomicString&& value)
     , m_a(0)
     , m_b(0)
     , m_attribute(anyQName())
-    , m_argument(nullAtom)
+    , m_argument(nullAtom())
 {
 }
 
index 56d7b26..4bfc246 100644 (file)
@@ -235,7 +235,7 @@ namespace WebCore {
         const AtomicString& serializingValue() const;
         const QualifiedName& attribute() const;
         const AtomicString& attributeCanonicalLocalName() const;
-        const AtomicString& argument() const { return m_hasRareData ? m_data.m_rareData->m_argument : nullAtom; }
+        const AtomicString& argument() const { return m_hasRareData ? m_data.m_rareData->m_argument : nullAtom(); }
         bool attributeValueMatchingIsCaseInsensitive() const;
         const Vector<AtomicString>* langArgumentList() const { return m_hasRareData ? m_data.m_rareData->m_langArgumentList.get() : nullptr; }
         const CSSSelectorList* selectorList() const { return m_hasRareData ? m_data.m_rareData->m_selectorList.get() : nullptr; }
index fd7e134..17ab7ad 100644 (file)
@@ -171,9 +171,9 @@ class SelectorNeedsNamespaceResolutionFunctor {
 public:
     bool operator()(const CSSSelector* selector)
     {
-        if (selector->match() == CSSSelector::Tag && !selector->tagQName().prefix().isEmpty() && selector->tagQName().prefix() != starAtom)
+        if (selector->match() == CSSSelector::Tag && !selector->tagQName().prefix().isEmpty() && selector->tagQName().prefix() != starAtom())
             return true;
-        if (selector->isAttributeSelector() && !selector->attribute().prefix().isEmpty() && selector->attribute().prefix() != starAtom)
+        if (selector->isAttributeSelector() && !selector->attribute().prefix().isEmpty() && selector->attribute().prefix() != starAtom())
             return true;
         return false;
     }
index b82c887..d530334 100644 (file)
@@ -95,7 +95,7 @@ static bool checkPageSelectorComponents(const CSSSelector* selector, bool isLeft
     for (const CSSSelector* component = selector; component; component = component->tagHistory()) {
         if (component->match() == CSSSelector::Tag) {
             const AtomicString& localName = component->tagQName().localName();
-            if (localName != starAtom && localName != pageName)
+            if (localName != starAtom() && localName != pageName)
                 return false;
         } else if (component->match() == CSSSelector::PagePseudoClass) {
             CSSSelector::PagePseudoClassType pseudoType = component->pagePseudoClassType();
index 6d927d3..91b63f8 100644 (file)
@@ -62,7 +62,7 @@ static inline MatchBasedOnRuleHash computeMatchBasedOnRuleHash(const CSSSelector
     if (selector.match() == CSSSelector::Tag) {
         const QualifiedName& tagQualifiedName = selector.tagQName();
         const AtomicString& selectorNamespace = tagQualifiedName.namespaceURI();
-        if (selectorNamespace == starAtom || selectorNamespace == xhtmlNamespaceURI) {
+        if (selectorNamespace == starAtom() || selectorNamespace == xhtmlNamespaceURI) {
             if (tagQualifiedName == anyQName())
                 return MatchBasedOnRuleHash::Universal;
             return MatchBasedOnRuleHash::ClassC;
@@ -246,7 +246,7 @@ void RuleSet::addRule(StyleRule* rule, unsigned selectorIndex, AddRuleFlags addR
             break;
         }
         case CSSSelector::Tag:
-            if (selector->tagQName().localName() != starAtom)
+            if (selector->tagQName().localName() != starAtom())
                 tagSelector = selector;
             break;
         case CSSSelector::PseudoElement:
index 9be331f..ff04b15 100644 (file)
@@ -643,10 +643,10 @@ static inline bool tagMatches(const Element& element, const CSSSelector& simpleS
 
     const AtomicString& localName = (element.isHTMLElement() && element.document().isHTMLDocument()) ? simpleSelector.tagLowercaseLocalName() : tagQName.localName();
 
-    if (localName != starAtom && localName != element.localName())
+    if (localName != starAtom() && localName != element.localName())
         return false;
     const AtomicString& namespaceURI = tagQName.namespaceURI();
-    return namespaceURI == starAtom || namespaceURI == element.namespaceURI();
+    return namespaceURI == starAtom() || namespaceURI == element.namespaceURI();
 }
 
 bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalContext& context, PseudoIdSet& dynamicPseudoIdSet, MatchType& matchType, unsigned& specificity) const
index 772ad0e..2bd313f 100644 (file)
@@ -109,7 +109,7 @@ static inline void collectDescendantSelectorIdentifierHashes(const CSSSelector*
         break;
     case CSSSelector::Tag: {
         const AtomicString& tagLowercaseLocalName = selector->tagLowercaseLocalName();
-        if (tagLowercaseLocalName != starAtom)
+        if (tagLowercaseLocalName != starAtom())
             (*hash++) = tagLowercaseLocalName.impl()->existingHash() * TagNameSalt;
         break;
     }
index 231f6c1..7c2005f 100644 (file)
@@ -457,14 +457,14 @@ inline String StyleBuilderConverter::convertString(StyleResolver&, const CSSValu
 inline String StyleBuilderConverter::convertStringOrAuto(StyleResolver& styleResolver, const CSSValue& value)
 {
     if (downcast<CSSPrimitiveValue>(value).valueID() == CSSValueAuto)
-        return nullAtom;
+        return nullAtom();
     return convertString(styleResolver, value);
 }
 
 inline String StyleBuilderConverter::convertStringOrNone(StyleResolver& styleResolver, const CSSValue& value)
 {
     if (downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone)
-        return nullAtom;
+        return nullAtom();
     return convertString(styleResolver, value);
 }
 
index 9e1d44e..474a87b 100644 (file)
@@ -722,7 +722,7 @@ inline void StyleBuilderCustom::applyValueWebkitLocale(StyleResolver& styleResol
 
     FontCascadeDescription fontDescription = styleResolver.style()->fontDescription();
     if (primitiveValue.valueID() == CSSValueAuto)
-        fontDescription.setLocale(nullAtom);
+        fontDescription.setLocale(nullAtom());
     else
         fontDescription.setLocale(primitiveValue.stringValue());
     styleResolver.setFontDescription(fontDescription);
@@ -1055,7 +1055,7 @@ inline void StyleBuilderCustom::applyValueWebkitTextEmphasisStyle(StyleResolver&
             else
                 styleResolver.style()->setTextEmphasisMark(value);
         }
-        styleResolver.style()->setTextEmphasisCustomMark(nullAtom);
+        styleResolver.style()->setTextEmphasisCustomMark(nullAtom());
         return;
     }
 
@@ -1067,7 +1067,7 @@ inline void StyleBuilderCustom::applyValueWebkitTextEmphasisStyle(StyleResolver&
         return;
     }
 
-    styleResolver.style()->setTextEmphasisCustomMark(nullAtom);
+    styleResolver.style()->setTextEmphasisCustomMark(nullAtom());
 
     if (primitiveValue.valueID() == CSSValueFilled || primitiveValue.valueID() == CSSValueOpen) {
         styleResolver.style()->setTextEmphasisFill(primitiveValue);
@@ -1385,9 +1385,9 @@ inline void StyleBuilderCustom::applyValueContent(StyleResolver& styleResolver,
                 styleResolver.style()->setHasAttrContent();
             else
                 const_cast<RenderStyle*>(styleResolver.parentStyle())->setHasAttrContent();
-            QualifiedName attr(nullAtom, contentValue.stringValue().impl(), nullAtom);
+            QualifiedName attr(nullAtom(), contentValue.stringValue().impl(), nullAtom());
             const AtomicString& value = styleResolver.element()->getAttribute(attr);
-            styleResolver.style()->setContent(value.isNull() ? emptyAtom : value.impl(), didSet);
+            styleResolver.style()->setContent(value.isNull() ? emptyAtom() : value.impl(), didSet);
             didSet = true;
             // Register the fact that the attribute value affects the style.
             styleResolver.ruleSets().mutableFeatures().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
@@ -1783,15 +1783,15 @@ void StyleBuilderCustom::applyValueAlt(StyleResolver& styleResolver, CSSValue& v
         else
             const_cast<RenderStyle*>(styleResolver.parentStyle())->setUnique();
 
-        QualifiedName attr(nullAtom, primitiveValue.stringValue(), nullAtom);
+        QualifiedName attr(nullAtom(), primitiveValue.stringValue(), nullAtom());
         const AtomicString& value = styleResolver.element()->getAttribute(attr);
-        styleResolver.style()->setContentAltText(value.isNull() ? emptyAtom : value);
+        styleResolver.style()->setContentAltText(value.isNull() ? emptyAtom() : value);
 
         // Register the fact that the attribute value affects the style.
         styleResolver.ruleSets().mutableFeatures().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
         styleResolver.ruleSets().mutableFeatures().attributeLocalNamesInRules.add(attr.localName().impl());
     } else
-        styleResolver.style()->setContentAltText(emptyAtom);
+        styleResolver.style()->setContentAltText(emptyAtom());
 }
 
 inline void StyleBuilderCustom::applyValueWillChange(StyleResolver& styleResolver, CSSValue& value)
index d23ab90..4163dc0 100644 (file)
@@ -68,7 +68,7 @@ unsigned StyleSheetContents::estimatedSizeInBytes() const
 StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule, const String& originalURL, const CSSParserContext& context)
     : m_ownerRule(ownerRule)
     , m_originalURL(originalURL)
-    , m_defaultNamespace(starAtom)
+    , m_defaultNamespace(starAtom())
     , m_isUserStyleSheet(ownerRule && ownerRule->parentStyleSheet() && ownerRule->parentStyleSheet()->isUserStyleSheet())
     , m_parserContext(context)
 {
@@ -311,7 +311,7 @@ const AtomicString& StyleSheetContents::namespaceURIFromPrefix(const AtomicStrin
 {
     PrefixNamespaceURIMap::const_iterator it = m_namespaces.find(prefix);
     if (it == m_namespaces.end())
-        return nullAtom;
+        return nullAtom();
     return it->value;
 }
 
index 9dce40b..7b3c4f9 100755 (executable)
@@ -336,10 +336,10 @@ const char* getPropertyName(CSSPropertyID id)
 const AtomicString& getPropertyNameAtomicString(CSSPropertyID id)
 {
     if (id < firstCSSProperty)
-        return nullAtom;
+        return nullAtom();
     int index = id - firstCSSProperty;
     if (index >= numCSSProperties)
-        return nullAtom;
+        return nullAtom();
 
     static AtomicString* propertyStrings = new AtomicString[numCSSProperties]; // Intentionally never destroyed.
     AtomicString& propertyString = propertyStrings[index];
index 7584cf8..106310d 100644 (file)
@@ -280,7 +280,7 @@ CSSSelectorList CSSParserImpl::parsePageSelector(CSSParserTokenRange range, Styl
 
     std::unique_ptr<CSSParserSelector> selector;
     if (!typeSelector.isNull() && pseudo.isNull())
-        selector = std::unique_ptr<CSSParserSelector>(new CSSParserSelector(QualifiedName(nullAtom, typeSelector, styleSheet->defaultNamespace())));
+        selector = std::unique_ptr<CSSParserSelector>(new CSSParserSelector(QualifiedName(nullAtom(), typeSelector, styleSheet->defaultNamespace())));
     else {
         selector = std::unique_ptr<CSSParserSelector>(new CSSParserSelector);
         if (!pseudo.isNull()) {
@@ -289,7 +289,7 @@ CSSSelectorList CSSParserImpl::parsePageSelector(CSSParserTokenRange range, Styl
                 return CSSSelectorList();
         }
         if (!typeSelector.isNull())
-            selector->prependTagSelector(QualifiedName(nullAtom, typeSelector, styleSheet->defaultNamespace()));
+            selector->prependTagSelector(QualifiedName(nullAtom(), typeSelector, styleSheet->defaultNamespace()));
     }
 
     selector->setForPage();
index 90730cc..14e1c92 100644 (file)
@@ -302,7 +302,7 @@ std::unique_ptr<CSSParserSelector> CSSSelectorParser::consumeCompoundSelector(CS
             return nullptr;
         }
         if (namespaceURI == defaultNamespace())
-            namespacePrefix = nullAtom;
+            namespacePrefix = nullAtom();
         
         CSSParserSelector* rawSelector = new CSSParserSelector(QualifiedName(namespacePrefix, elementName, namespaceURI));
         std::unique_ptr<CSSParserSelector> selector = std::unique_ptr<CSSParserSelector>(rawSelector);
@@ -333,19 +333,19 @@ std::unique_ptr<CSSParserSelector> CSSSelectorParser::consumeSimpleSelector(CSSP
 
 bool CSSSelectorParser::consumeName(CSSParserTokenRange& range, AtomicString& name, AtomicString& namespacePrefix)
 {
-    name = nullAtom;
-    namespacePrefix = nullAtom;
+    name = nullAtom();
+    namespacePrefix = nullAtom();
 
     const CSSParserToken& firstToken = range.peek();
     if (firstToken.type() == IdentToken) {
         name = firstToken.value().toAtomicString();
         range.consume();
     } else if (firstToken.type() == DelimiterToken && firstToken.delimiter() == '*') {
-        name = starAtom;
+        name = starAtom();
         range.consume();
     } else if (firstToken.type() == DelimiterToken && firstToken.delimiter() == '|') {
         // This is an empty namespace, which'll get assigned this value below
-        name = emptyAtom;
+        name = emptyAtom();
     } else
         return false;
 
@@ -358,10 +358,10 @@ bool CSSSelectorParser::consumeName(CSSParserTokenRange& range, AtomicString& na
     if (nameToken.type() == IdentToken) {
         name = nameToken.value().toAtomicString();
     } else if (nameToken.type() == DelimiterToken && nameToken.delimiter() == '*')
-        name = starAtom;
+        name = starAtom();
     else {
-        name = nullAtom;
-        namespacePrefix = nullAtom;
+        name = nullAtom();
+        namespacePrefix = nullAtom();
         return false;
     }
 
@@ -421,7 +421,7 @@ std::unique_ptr<CSSParserSelector> CSSSelectorParser::consumeAttribute(CSSParser
         return nullptr;
 
     QualifiedName qualifiedName = namespacePrefix.isNull()
-        ? QualifiedName(nullAtom, attributeName, nullAtom)
+        ? QualifiedName(nullAtom(), attributeName, nullAtom())
         : QualifiedName(namespacePrefix, attributeName, namespaceURI);
 
     std::unique_ptr<CSSParserSelector> selector = std::unique_ptr<CSSParserSelector>(new CSSParserSelector());
@@ -803,7 +803,7 @@ bool CSSSelectorParser::consumeANPlusB(CSSParserTokenRange& range, std::pair<int
 const AtomicString& CSSSelectorParser::defaultNamespace() const
 {
     if (!m_styleSheet)
-        return starAtom;
+        return starAtom();
     return m_styleSheet->defaultNamespace();
 }
 
@@ -812,11 +812,11 @@ const AtomicString& CSSSelectorParser::determineNamespace(const AtomicString& pr
     if (prefix.isNull())
         return defaultNamespace();
     if (prefix.isEmpty())
-        return emptyAtom; // No namespace. If an element/attribute has a namespace, we won't match it.
-    if (prefix == starAtom)
-        return starAtom; // We'll match any namespace.
+        return emptyAtom(); // No namespace. If an element/attribute has a namespace, we won't match it.
+    if (prefix == starAtom())
+        return starAtom(); // We'll match any namespace.
     if (!m_styleSheet)
-        return nullAtom; // Cannot resolve prefix to namespace without a stylesheet, syntax error.
+        return nullAtom(); // Cannot resolve prefix to namespace without a stylesheet, syntax error.
     return m_styleSheet->namespaceURIFromPrefix(prefix);
 }
 
@@ -824,10 +824,10 @@ void CSSSelectorParser::prependTypeSelectorIfNeeded(const AtomicString& namespac
 {
     bool isShadowDOM = compoundSelector->needsImplicitShadowCombinatorForMatching();
     
-    if (elementName.isNull() && defaultNamespace() == starAtom && !isShadowDOM)
+    if (elementName.isNull() && defaultNamespace() == starAtom() && !isShadowDOM)
         return;
 
-    AtomicString determinedElementName = elementName.isNull() ? starAtom : elementName;
+    AtomicString determinedElementName = elementName.isNull() ? starAtom() : elementName;
     AtomicString namespaceURI = determineNamespace(namespacePrefix);
     if (namespaceURI.isNull()) {
         m_failedParsing = true;
@@ -835,7 +835,7 @@ void CSSSelectorParser::prependTypeSelectorIfNeeded(const AtomicString& namespac
     }
     AtomicString determinedPrefix = namespacePrefix;
     if (namespaceURI == defaultNamespace())
-        determinedPrefix = nullAtom;
+        determinedPrefix = nullAtom();
     QualifiedName tag = QualifiedName(determinedPrefix, determinedElementName, namespaceURI);
 
     // *:host never matches, so we can't discard the *,
@@ -848,7 +848,7 @@ void CSSSelectorParser::prependTypeSelectorIfNeeded(const AtomicString& namespac
     // the pseudo element.
     bool explicitForHost = compoundSelector->isHostPseudoSelector() && !elementName.isNull();
     if (tag != anyQName() || explicitForHost || isShadowDOM)
-        compoundSelector->prependTagSelector(tag, determinedPrefix == nullAtom && determinedElementName == starAtom && !explicitForHost);
+        compoundSelector->prependTagSelector(tag, determinedPrefix == nullAtom() && determinedElementName == starAtom() && !explicitForHost);
 }
 
 std::unique_ptr<CSSParserSelector> CSSSelectorParser::addSimpleSelectorToCompound(std::unique_ptr<CSSParserSelector> compoundSelector, std::unique_ptr<CSSParserSelector> simpleSelector)
index 6d5846a..36fea29 100644 (file)
@@ -1046,7 +1046,7 @@ static FunctionType constructFragments(const CSSSelector* rootSelector, Selector
 
 static inline bool attributeNameTestingRequiresNamespaceRegister(const CSSSelector& attributeSelector)
 {
-    return attributeSelector.attribute().prefix() != starAtom && !attributeSelector.attribute().namespaceURI().isNull();
+    return attributeSelector.attribute().prefix() != starAtom() && !attributeSelector.attribute().namespaceURI().isNull();
 }
 
 static inline bool attributeValueTestingRequiresExtraRegister(const AttributeMatchingInfo& attributeInfo)
@@ -1386,7 +1386,7 @@ static inline TagNameEquality equalTagNames(const CSSSelector* lhs, const CSSSel
 
     const AtomicString& lhsLocalName = lhsQualifiedName.localName();
     const AtomicString& rhsLocalName = rhsQualifiedName.localName();
-    if (lhsLocalName != starAtom && rhsLocalName != starAtom) {
+    if (lhsLocalName != starAtom() && rhsLocalName != starAtom()) {
         const AtomicString& lhsLowercaseLocalName = lhs->tagLowercaseLocalName();
         const AtomicString& rhsLowercaseLocalName = rhs->tagLowercaseLocalName();
 
@@ -1400,7 +1400,7 @@ static inline TagNameEquality equalTagNames(const CSSSelector* lhs, const CSSSel
 
     const AtomicString& lhsNamespaceURI = lhsQualifiedName.namespaceURI();
     const AtomicString& rhsNamespaceURI = rhsQualifiedName.namespaceURI();
-    if (lhsNamespaceURI != starAtom && rhsNamespaceURI != starAtom) {
+    if (lhsNamespaceURI != starAtom() && rhsNamespaceURI != starAtom()) {
         if (lhsNamespaceURI != rhsNamespaceURI)
             return TagNameEquality::StrictlyNotEqual;
         return TagNameEquality::StrictlyEqual;
@@ -2800,7 +2800,7 @@ void SelectorCodeGenerator::generateElementAttributeMatching(Assembler::JumpList
         LocalRegister qualifiedNameImpl(m_registerAllocator);
         m_assembler.loadPtr(Assembler::Address(currentAttributeAddress, Attribute::nameMemoryOffset()), qualifiedNameImpl);
 
-        bool shouldCheckNamespace = attributeSelector.attribute().prefix() != starAtom;
+        bool shouldCheckNamespace = attributeSelector.attribute().prefix() != starAtom();
         if (shouldCheckNamespace) {
             Assembler::Jump nameDoesNotMatch = m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(qualifiedNameImpl, QualifiedName::QualifiedNameImpl::localNameMemoryOffset()), localNameToMatch);
 
@@ -3391,7 +3391,7 @@ inline void SelectorCodeGenerator::generateElementHasTagName(Assembler::JumpList
     m_assembler.loadPtr(Assembler::Address(elementAddressRegister, Element::tagQNameMemoryOffset() + QualifiedName::implMemoryOffset()), qualifiedNameImpl);
 
     const AtomicString& selectorLocalName = nameToMatch.localName();
-    if (selectorLocalName != starAtom) {
+    if (selectorLocalName != starAtom()) {
         const AtomicString& lowercaseLocalName = tagMatchingSelector.tagLowercaseLocalName();
 
         if (selectorLocalName == lowercaseLocalName) {
@@ -3421,7 +3421,7 @@ inline void SelectorCodeGenerator::generateElementHasTagName(Assembler::JumpList
     }
 
     const AtomicString& selectorNamespaceURI = nameToMatch.namespaceURI();
-    if (selectorNamespaceURI != starAtom) {
+    if (selectorNamespaceURI != starAtom()) {
         // Generate namespaceURI == element->namespaceURI().
         LocalRegister constantRegister(m_registerAllocator);
         m_assembler.move(Assembler::TrustedImmPtr(selectorNamespaceURI.impl()), constantRegister);
index d458c16..7329842 100644 (file)
@@ -74,10 +74,10 @@ ExceptionOr<void> Attr::setPrefix(const AtomicString& prefix)
     if (result.hasException())
         return result.releaseException();
 
-    if ((prefix == xmlnsAtom && namespaceURI() != XMLNSNames::xmlnsNamespaceURI) || qualifiedName() == xmlnsAtom)
+    if ((prefix == xmlnsAtom() && namespaceURI() != XMLNSNames::xmlnsNamespaceURI) || qualifiedName() == xmlnsAtom())
         return Exception { NAMESPACE_ERR };
 
-    const AtomicString& newPrefix = prefix.isEmpty() ? nullAtom : prefix;
+    const AtomicString& newPrefix = prefix.isEmpty() ? nullAtom() : prefix;
     if (m_element)
         elementAttribute().setPrefix(newPrefix);
     m_name.setPrefix(newPrefix);
@@ -141,7 +141,7 @@ void Attr::attachToElement(Element& element)
 {
     ASSERT(!m_element);
     m_element = &element;
-    m_standaloneValue = nullAtom;
+    m_standaloneValue = nullAtom();
     setTreeScopeRecursively(element.treeScope());
 }
 
index 72dbed6..456c286 100644 (file)
@@ -78,7 +78,7 @@ inline bool Attribute::nameMatchesFilter(const QualifiedName& name, const Atomic
 {
     if (filterLocalName != name.localName())
         return false;
-    return filterPrefix == starAtom || filterNamespaceURI == name.namespaceURI();
+    return filterPrefix == starAtom() || filterNamespaceURI == name.namespaceURI();
 }
 
 inline bool Attribute::matches(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI) const
index 9595351..41fee77 100644 (file)
@@ -66,7 +66,7 @@ const AtomicString& ConstantPropertyMap::nameForProperty(ConstantProperty proper
         return safeAreaInsetLeftName;
     }
 
-    return nullAtom;
+    return nullAtom();
 }
 
 void ConstantPropertyMap::setValueForProperty(ConstantProperty property, Ref<CSSVariableData>&& data)
index b6c5483..fd81683 100644 (file)
@@ -897,7 +897,7 @@ Ref<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicString& qual
 {
     ASSERT(!qualifiedName.isNull());
 
-    if (qualifiedName == starAtom)
+    if (qualifiedName == starAtom())
         return ensureRareData().ensureNodeLists().addCachedCollection<AllDescendantsCollection>(*this, AllDescendants);
 
     if (document().isHTMLDocument())
@@ -908,7 +908,7 @@ Ref<HTMLCollection> ContainerNode::getElementsByTagName(const AtomicString& qual
 Ref<HTMLCollection> ContainerNode::getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName)
 {
     ASSERT(!localName.isNull());
-    return ensureRareData().ensureNodeLists().addCachedTagCollectionNS(*this, namespaceURI.isEmpty() ? nullAtom : namespaceURI, localName);
+    return ensureRareData().ensureNodeLists().addCachedTagCollectionNS(*this, namespaceURI.isEmpty() ? nullAtom() : namespaceURI, localName);
 }
 
 Ref<NodeList> ContainerNode::getElementsByName(const String& elementName)
index a7dab97..eb4646b 100644 (file)
@@ -187,7 +187,7 @@ void CustomElementReactionQueue::enqueuePostUpgradeReactions(Element& element)
     if (element.hasAttributes()) {
         for (auto& attribute : element.attributesIterator()) {
             if (queue->m_interface->observesAttribute(attribute.localName()))
-                queue->m_items.append({attribute.name(), nullAtom, attribute.value()});
+                queue->m_items.append({attribute.name(), nullAtom(), attribute.value()});
         }
     }
 
index 8fc1f9c..61d2048 100644 (file)
@@ -133,7 +133,7 @@ static inline AtomicString convertPropertyNameToAttributeName(const StringImpl&
 static AtomicString convertPropertyNameToAttributeName(const String& name)
 {
     if (name.isNull())
-        return nullAtom;
+        return nullAtom();
 
     StringImpl* nameImpl = name.impl();
     if (nameImpl->is8Bit())
index 34c263b..6b7be42 100644 (file)
@@ -854,7 +854,7 @@ static ALWAYS_INLINE Ref<HTMLElement> createUpgradeCandidateElement(Document& do
 
 static ALWAYS_INLINE Ref<HTMLElement> createUpgradeCandidateElement(Document& document, const AtomicString& localName)
 {
-    return createUpgradeCandidateElement(document, QualifiedName { nullAtom, localName, xhtmlNamespaceURI });
+    return createUpgradeCandidateElement(document, QualifiedName { nullAtom(), localName, xhtmlNamespaceURI });
 }
 
 static inline bool isValidHTMLElementName(const AtomicString& localName)
@@ -899,7 +899,7 @@ ExceptionOr<Ref<Element>> Document::createElementForBindings(const AtomicString&
     if (!isValidName(name))
         return Exception { INVALID_CHARACTER_ERR };
 
-    return createElement(QualifiedName(nullAtom, name, nullAtom), false);
+    return createElement(QualifiedName(nullAtom(), name, nullAtom()), false);
 }
 
 Ref<DocumentFragment> Document::createDocumentFragment()
@@ -962,7 +962,7 @@ ExceptionOr<Ref<Node>> Document::importNode(Node& nodeToImport, bool deep)
 
     case ATTRIBUTE_NODE:
         // FIXME: This will "Attr::normalize" child nodes of Attr.
-        return Ref<Node> { Attr::create(*this, QualifiedName(nullAtom, downcast<Attr>(nodeToImport).name(), nullAtom), downcast<Attr>(nodeToImport).value()) };
+        return Ref<Node> { Attr::create(*this, QualifiedName(nullAtom(), downcast<Attr>(nodeToImport).name(), nullAtom()), downcast<Attr>(nodeToImport).value()) };
 
     case DOCUMENT_NODE: // Can't import a document into another document.
     case DOCUMENT_TYPE_NODE: // FIXME: Support cloning a DocumentType node per DOM4.
@@ -1017,13 +1017,13 @@ bool Document::hasValidNamespaceForElements(const QualifiedName& qName)
     // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS
     if (!qName.prefix().isEmpty() && qName.namespaceURI().isNull()) // createElementNS(null, "html:div")
         return false;
-    if (qName.prefix() == xmlAtom && qName.namespaceURI() != XMLNames::xmlNamespaceURI) // createElementNS("http://www.example.com", "xml:lang")
+    if (qName.prefix() == xmlAtom() && qName.namespaceURI() != XMLNames::xmlNamespaceURI) // createElementNS("http://www.example.com", "xml:lang")
         return false;
 
     // Required by DOM Level 3 Core and unspecified by DOM Level 2 Core:
     // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
     // createElementNS("http://www.w3.org/2000/xmlns/", "foo:bar"), createElementNS(null, "xmlns:bar"), createElementNS(null, "xmlns")
-    if (qName.prefix() == xmlnsAtom || (qName.prefix().isEmpty() && qName.localName() == xmlnsAtom))
+    if (qName.prefix() == xmlnsAtom() || (qName.prefix().isEmpty() && qName.localName() == xmlnsAtom()))
         return qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI;
     return qName.namespaceURI() != XMLNSNames::xmlnsNamespaceURI;
 }
@@ -3052,7 +3052,7 @@ void Document::processBaseElement()
         updateBaseURL();
     }
 
-    m_baseTarget = target ? *target : nullAtom;
+    m_baseTarget = target ? *target : nullAtom();
 }
 
 String Document::userAgent(const URL& url) const
@@ -7085,7 +7085,7 @@ const AtomicString& Document::dir() const
 {
     auto* documentElement = this->documentElement();
     if (!is<HTMLHtmlElement>(documentElement))
-        return nullAtom;
+        return nullAtom();
     return downcast<HTMLHtmlElement>(*documentElement).dir();
 }
 
@@ -7164,7 +7164,7 @@ const AtomicString& Document::bgColor() const
 {
     auto* bodyElement = body();
     if (!bodyElement)
-        return emptyAtom;
+        return emptyAtom();
     return bodyElement->attributeWithoutSynchronization(bgcolorAttr);
 }
 
@@ -7178,7 +7178,7 @@ const AtomicString& Document::fgColor() const
 {
     auto* bodyElement = body();
     if (!bodyElement)
-        return emptyAtom;
+        return emptyAtom();
     return bodyElement->attributeWithoutSynchronization(textAttr);
 }
 
@@ -7192,7 +7192,7 @@ const AtomicString& Document::alinkColor() const
 {
     auto* bodyElement = body();
     if (!bodyElement)
-        return emptyAtom;
+        return emptyAtom();
     return bodyElement->attributeWithoutSynchronization(alinkAttr);
 }
 
@@ -7206,7 +7206,7 @@ const AtomicString& Document::linkColorForBindings() const
 {
     auto* bodyElement = body();
     if (!bodyElement)
-        return emptyAtom;
+        return emptyAtom();
     return bodyElement->attributeWithoutSynchronization(linkAttr);
 }
 
@@ -7220,7 +7220,7 @@ const AtomicString& Document::vlinkColor() const
 {
     auto* bodyElement = body();
     if (!bodyElement)
-        return emptyAtom;
+        return emptyAtom();
     return bodyElement->attributeWithoutSynchronization(vlinkAttr);
 }
 
index 5a1a7dd..9f3e5d8 100644 (file)
@@ -1246,7 +1246,7 @@ public:
     bool inRenderTreeUpdate() const { return m_inRenderTreeUpdate; }
 
     // Return a Locale for the default locale if the argument is null or empty.
-    Locale& getCachedLocale(const AtomicString& locale = nullAtom);
+    Locale& getCachedLocale(const AtomicString& locale = nullAtom());
 
     const Document* templateDocument() const;
     Document& ensureTemplateDocument();
index c644840..2097d72 100644 (file)
@@ -402,7 +402,7 @@ bool Element::removeAttribute(const QualifiedName& name)
 void Element::setBooleanAttribute(const QualifiedName& name, bool value)
 {
     if (value)
-        setAttribute(name, emptyAtom);
+        setAttribute(name, emptyAtom());
     else
         removeAttribute(name);
 }
@@ -479,18 +479,18 @@ ALWAYS_INLINE void Element::synchronizeAttribute(const AtomicString& localName)
     if (elementData()->animatedSVGAttributesAreDirty()) {
         // We're not passing a namespace argument on purpose. SVGNames::*Attr are defined w/o namespaces as well.
         ASSERT_WITH_SECURITY_IMPLICATION(isSVGElement());
-        downcast<SVGElement>(*this).synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom));
+        downcast<SVGElement>(*this).synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom(), localName, nullAtom()));
     }
 }
 
 const AtomicString& Element::getAttribute(const QualifiedName& name) const
 {
     if (!elementData())
-        return nullAtom;
+        return nullAtom();
     synchronizeAttribute(name);
     if (const Attribute* attribute = findAttributeByName(name))
         return attribute->value();
-    return nullAtom;
+    return nullAtom();
 }
 
 Vector<String> Element::getAttributeNames() const
@@ -1213,16 +1213,16 @@ IntRect Element::screenRect() const
 const AtomicString& Element::getAttribute(const AtomicString& localName) const
 {
     if (!elementData())
-        return nullAtom;
+        return nullAtom();
     synchronizeAttribute(localName);
     if (const Attribute* attribute = elementData()->findAttributeByName(localName, shouldIgnoreAttributeCase(*this)))
         return attribute->value();
-    return nullAtom;
+    return nullAtom();
 }
 
 const AtomicString& Element::getAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName) const
 {
-    return getAttribute(QualifiedName(nullAtom, localName, namespaceURI));
+    return getAttribute(QualifiedName(nullAtom(), localName, namespaceURI));
 }
 
 ExceptionOr<void> Element::setAttribute(const AtomicString& localName, const AtomicString& value)
@@ -1233,7 +1233,7 @@ ExceptionOr<void> Element::setAttribute(const AtomicString& localName, const Ato
     synchronizeAttribute(localName);
     auto caseAdjustedLocalName = shouldIgnoreAttributeCase(*this) ? localName.convertToASCIILowercase() : localName;
     unsigned index = elementData() ? elementData()->findAttributeIndexByName(caseAdjustedLocalName, false) : ElementData::attributeNotFound;
-    auto name = index != ElementData::attributeNotFound ? attributeAt(index).name() : QualifiedName { nullAtom, caseAdjustedLocalName, nullAtom };
+    auto name = index != ElementData::attributeNotFound ? attributeAt(index).name() : QualifiedName { nullAtom(), caseAdjustedLocalName, nullAtom() };
     setAttributeInternal(index, name, value, NotInSynchronizationOfLazyAttribute);
 
     return { };
@@ -1528,7 +1528,7 @@ void Element::parserSetAttributes(const Vector<Attribute>& attributeVector)
 
     // Use attributeVector instead of m_elementData because attributeChanged might modify m_elementData.
     for (const auto& attribute : attributeVector)
-        attributeChanged(attribute.name(), nullAtom, attribute.value(), ModifiedDirectly);
+        attributeChanged(attribute.name(), nullAtom(), attribute.value(), ModifiedDirectly);
 }
 
 void Element::parserDidSetAttributes()
@@ -1543,9 +1543,9 @@ void Element::didMoveToNewDocument(Document& oldDocument, Document& newDocument)
     if (oldDocument.inQuirksMode() != document().inQuirksMode()) {
         // ElementData::m_classNames or ElementData::m_idForStyleResolution need to be updated with the right case.
         if (hasID())
-            attributeChanged(idAttr, nullAtom, getIdAttribute());
+            attributeChanged(idAttr, nullAtom(), getIdAttribute());
         if (hasClass())
-            attributeChanged(classAttr, nullAtom, getAttribute(classAttr));
+            attributeChanged(classAttr, nullAtom(), getAttribute(classAttr));
     }
 
     if (UNLIKELY(isDefinedCustomElement()))
@@ -1587,7 +1587,7 @@ ExceptionOr<void> Element::setPrefix(const AtomicString& prefix)
     if (result.hasException())
         return result.releaseException();
 
-    m_tagName.setPrefix(prefix.isEmpty() ? nullAtom : prefix);
+    m_tagName.setPrefix(prefix.isEmpty() ? nullAtom() : prefix);
     return { };
 }
 
@@ -1639,22 +1639,22 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode& insertio
     const AtomicString& idValue = getIdAttribute();
     if (!idValue.isNull()) {
         if (newScope)
-            updateIdForTreeScope(*newScope, nullAtom, idValue);
+            updateIdForTreeScope(*newScope, nullAtom(), idValue);
         if (newDocument)
-            updateIdForDocument(*newDocument, nullAtom, idValue, AlwaysUpdateHTMLDocumentNamedItemMaps);
+            updateIdForDocument(*newDocument, nullAtom(), idValue, AlwaysUpdateHTMLDocumentNamedItemMaps);
     }
 
     const AtomicString& nameValue = getNameAttribute();
     if (!nameValue.isNull()) {
         if (newScope)
-            updateNameForTreeScope(*newScope, nullAtom, nameValue);
+            updateNameForTreeScope(*newScope, nullAtom(), nameValue);
         if (newDocument)
-            updateNameForDocument(*newDocument, nullAtom, nameValue);
+            updateNameForDocument(*newDocument, nullAtom(), nameValue);
     }
 
     if (newScope && hasTagName(labelTag)) {
         if (newScope->shouldCacheLabelsByForAttribute())
-            updateLabel(*newScope, nullAtom, attributeWithoutSynchronization(forAttr));
+            updateLabel(*newScope, nullAtom(), attributeWithoutSynchronization(forAttr));
     }
 
     if (becomeConnected) {
@@ -1693,22 +1693,22 @@ void Element::removedFrom(ContainerNode& insertionPoint)
         const AtomicString& idValue = getIdAttribute();
         if (!idValue.isNull()) {
             if (oldScope)
-                updateIdForTreeScope(*oldScope, idValue, nullAtom);
+                updateIdForTreeScope(*oldScope, idValue, nullAtom());
             if (oldDocument)
-                updateIdForDocument(*oldDocument, idValue, nullAtom, AlwaysUpdateHTMLDocumentNamedItemMaps);
+                updateIdForDocument(*oldDocument, idValue, nullAtom(), AlwaysUpdateHTMLDocumentNamedItemMaps);
         }
 
         const AtomicString& nameValue = getNameAttribute();
         if (!nameValue.isNull()) {
             if (oldScope)
-                updateNameForTreeScope(*oldScope, nameValue, nullAtom);
+                updateNameForTreeScope(*oldScope, nameValue, nullAtom());
             if (oldDocument)
-                updateNameForDocument(*oldDocument, nameValue, nullAtom);
+                updateNameForDocument(*oldDocument, nameValue, nullAtom());
         }
 
         if (oldScope && hasTagName(labelTag)) {
             if (oldScope->shouldCacheLabelsByForAttribute())
-                updateLabel(*oldScope, attributeWithoutSynchronization(forAttr), nullAtom);
+                updateLabel(*oldScope, attributeWithoutSynchronization(forAttr), nullAtom());
         }
 
         if (becomeDisconnected && UNLIKELY(isDefinedCustomElement()))
@@ -2283,10 +2283,10 @@ void Element::removeAttributeInternal(unsigned index, SynchronizationOfLazyAttri
     }
 
     if (!valueBeingRemoved.isNull())
-        willModifyAttribute(name, valueBeingRemoved, nullAtom);
+        willModifyAttribute(name, valueBeingRemoved, nullAtom());
 
     {
-        Style::AttributeChangeInvalidation styleInvalidation(*this, name, valueBeingRemoved, nullAtom);
+        Style::AttributeChangeInvalidation styleInvalidation(*this, name, valueBeingRemoved, nullAtom());
         elementData.removeAttribute(index);
     }
 
@@ -2300,9 +2300,9 @@ void Element::addAttributeInternal(const QualifiedName& name, const AtomicString
         return;
     }
 
-    willModifyAttribute(name, nullAtom, value);
+    willModifyAttribute(name, nullAtom(), value);
     {
-        Style::AttributeChangeInvalidation styleInvalidation(*this, name, nullAtom, value);
+        Style::AttributeChangeInvalidation styleInvalidation(*this, name, nullAtom(), value);
         ensureUniqueElementData().addAttribute(name, value);
     }
     didAddAttribute(name, value);
@@ -2327,7 +2327,7 @@ bool Element::removeAttribute(const AtomicString& name)
 
 bool Element::removeAttributeNS(const AtomicString& namespaceURI, const AtomicString& localName)
 {
-    return removeAttribute(QualifiedName(nullAtom, localName, namespaceURI));
+    return removeAttribute(QualifiedName(nullAtom(), localName, namespaceURI));
 }
 
 RefPtr<Attr> Element::getAttributeNode(const AtomicString& localName)
@@ -2345,7 +2345,7 @@ RefPtr<Attr> Element::getAttributeNodeNS(const AtomicString& namespaceURI, const
 {
     if (!elementData())
         return 0;
-    QualifiedName qName(nullAtom, localName, namespaceURI);
+    QualifiedName qName(nullAtom(), localName, namespaceURI);
     synchronizeAttribute(qName);
     const Attribute* attribute = elementData()->findAttributeByName(qName);
     if (!attribute)
@@ -2365,7 +2365,7 @@ bool Element::hasAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
 {
     if (!elementData())
         return false;
-    QualifiedName qName(nullAtom, localName, namespaceURI);
+    QualifiedName qName(nullAtom(), localName, namespaceURI);
     synchronizeAttribute(qName);
     return elementData()->findAttributeByName(qName);
 }
@@ -2868,7 +2868,7 @@ AtomicString Element::computeInheritedLanguage() const
         }
     }
 
-    return nullAtom;
+    return nullAtom();
 }
 
 Locale& Element::locale() const
@@ -3262,7 +3262,7 @@ void Element::updateNameForDocument(HTMLDocument& document, const AtomicString&
         return;
 
     if (WindowNameCollection::elementMatchesIfNameAttributeMatch(*this)) {
-        const AtomicString& id = WindowNameCollection::elementMatchesIfIdAttributeMatch(*this) ? getIdAttribute() : nullAtom;
+        const AtomicString& id = WindowNameCollection::elementMatchesIfIdAttributeMatch(*this) ? getIdAttribute() : nullAtom();
         if (!oldName.isEmpty() && oldName != id)
             document.removeWindowNamedItem(*oldName.impl(), *this);
         if (!newName.isEmpty() && newName != id)
@@ -3270,7 +3270,7 @@ void Element::updateNameForDocument(HTMLDocument& document, const AtomicString&
     }
 
     if (DocumentNameCollection::elementMatchesIfNameAttributeMatch(*this)) {
-        const AtomicString& id = DocumentNameCollection::elementMatchesIfIdAttributeMatch(*this) ? getIdAttribute() : nullAtom;
+        const AtomicString& id = DocumentNameCollection::elementMatchesIfIdAttributeMatch(*this) ? getIdAttribute() : nullAtom();
         if (!oldName.isEmpty() && oldName != id)
             document.removeDocumentNamedItem(*oldName.impl(), *this);
         if (!newName.isEmpty() && newName != id)
@@ -3315,7 +3315,7 @@ void Element::updateIdForDocument(HTMLDocument& document, const AtomicString& ol
         return;
 
     if (WindowNameCollection::elementMatchesIfIdAttributeMatch(*this)) {
-        const AtomicString& name = condition == UpdateHTMLDocumentNamedItemMapsOnlyIfDiffersFromNameAttribute && WindowNameCollection::elementMatchesIfNameAttributeMatch(*this) ? getNameAttribute() : nullAtom;
+        const AtomicString& name = condition == UpdateHTMLDocumentNamedItemMapsOnlyIfDiffersFromNameAttribute && WindowNameCollection::elementMatchesIfNameAttributeMatch(*this) ? getNameAttribute() : nullAtom();
         if (!oldId.isEmpty() && oldId != name)
             document.removeWindowNamedItem(*oldId.impl(), *this);
         if (!newId.isEmpty() && newId != name)
@@ -3323,7 +3323,7 @@ void Element::updateIdForDocument(HTMLDocument& document, const AtomicString& ol
     }
 
     if (DocumentNameCollection::elementMatchesIfIdAttributeMatch(*this)) {
-        const AtomicString& name = condition == UpdateHTMLDocumentNamedItemMapsOnlyIfDiffersFromNameAttribute && DocumentNameCollection::elementMatchesIfNameAttributeMatch(*this) ? getNameAttribute() : nullAtom;
+        const AtomicString& name = condition == UpdateHTMLDocumentNamedItemMapsOnlyIfDiffersFromNameAttribute && DocumentNameCollection::elementMatchesIfNameAttributeMatch(*this) ? getNameAttribute() : nullAtom();
         if (!oldId.isEmpty() && oldId != name)
             document.removeDocumentNamedItem(*oldId.impl(), *this);
         if (!newId.isEmpty() && newId != name)
@@ -3366,7 +3366,7 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
 
 void Element::didAddAttribute(const QualifiedName& name, const AtomicString& value)
 {
-    attributeChanged(name, nullAtom, value);
+    attributeChanged(name, nullAtom(), value);
     InspectorInstrumentation::didModifyDOMAttr(document(), *this, name.localName(), value);
     dispatchSubtreeModifiedEvent();
 }
@@ -3380,7 +3380,7 @@ void Element::didModifyAttribute(const QualifiedName& name, const AtomicString&
 
 void Element::didRemoveAttribute(const QualifiedName& name, const AtomicString& oldValue)
 {
-    attributeChanged(name, oldValue, nullAtom);
+    attributeChanged(name, oldValue, nullAtom());
     InspectorInstrumentation::didRemoveDOMAttr(document(), *this, name.localName());
     dispatchSubtreeModifiedEvent();
 }
@@ -3574,7 +3574,7 @@ void Element::cloneAttributesFromElement(const Element& other)
         m_elementData = other.m_elementData->makeUniqueCopy();
 
     for (const Attribute& attribute : attributesIterator())
-        attributeChanged(attribute.name(), nullAtom, attribute.value(), ModifiedByCloning);
+        attributeChanged(attribute.name(), nullAtom(), attribute.value(), ModifiedByCloning);
 }
 
 void Element::cloneDataFromElement(const Element& other)
index 012bbd8..3ff5570 100644 (file)
@@ -722,7 +722,7 @@ inline const AtomicString& Element::attributeWithoutSynchronization(const Qualif
         if (const Attribute* attribute = findAttributeByName(name))
             return attribute->value();
     }
-    return nullAtom;
+    return nullAtom();
 }
 
 inline bool Element::hasAttributesWithoutUpdate() const
@@ -732,21 +732,21 @@ inline bool Element::hasAttributesWithoutUpdate() const
 
 inline const AtomicString& Element::idForStyleResolution() const
 {
-    return hasID() ? elementData()->idForStyleResolution() : nullAtom;
+    return hasID() ? elementData()->idForStyleResolution() : nullAtom();
 }
 
 inline const AtomicString& Element::getIdAttribute() const
 {
     if (hasID())
         return elementData()->findAttributeByName(HTMLNames::idAttr)->value();
-    return nullAtom;
+    return nullAtom();
 }
 
 inline const AtomicString& Element::getNameAttribute() const
 {
     if (hasName())
         return elementData()->findAttributeByName(HTMLNames::nameAttr)->value();
-    return nullAtom;
+    return nullAtom();
 }
 
 inline void Element::setIdAttribute(const AtomicString& value)
index f187229..7f7dc03 100644 (file)
@@ -191,7 +191,7 @@ static const AtomicString& legacyType(const Event& event)
     if (event.type() == eventNames().wheelEvent)
         return eventNames().mousewheelEvent;
 
-    return nullAtom;
+    return nullAtom();
 }
 
 bool EventTarget::fireEventListeners(Event& event)
index 60bbfab..ad848e7 100644 (file)
@@ -61,8 +61,8 @@ public:
     virtual Node* previousSibling() { return 0; }
     virtual Node* nextSibling() { return 0; }
 
-    virtual const AtomicString& attributeName() { return nullAtom; }
-    virtual const AtomicString& attributeNamespace() { return nullAtom; }
+    virtual const AtomicString& attributeName() { return nullAtom(); }
+    virtual const AtomicString& attributeNamespace() { return nullAtom(); }
 
     virtual String oldValue() { return String(); }
 };
index bcfa227..22cefea 100644 (file)
@@ -83,7 +83,7 @@ ExceptionOr<Ref<Attr>> NamedNodeMap::removeNamedItemNS(const AtomicString& names
 {
     if (!m_element.hasAttributes())
         return Exception { NOT_FOUND_ERR };
-    auto index = m_element.findAttributeIndexByName(QualifiedName { nullAtom, localName, namespaceURI });
+    auto index = m_element.findAttributeIndexByName(QualifiedName { nullAtom(), localName, namespaceURI });
     if (index == ElementData::attributeNotFound)
         return Exception { NOT_FOUND_ERR };
     return m_element.detachAttribute(index);
index 2d69b29..97897de 100644 (file)
@@ -629,7 +629,7 @@ ExceptionOr<Ref<Node>> Node::cloneNodeForBindings(bool deep)
 const AtomicString& Node::prefix() const
 {
     // For nodes other than elements and attributes, the prefix is always null
-    return nullAtom;
+    return nullAtom();
 }
 
 ExceptionOr<void> Node::setPrefix(const AtomicString&)
@@ -642,12 +642,12 @@ ExceptionOr<void> Node::setPrefix(const AtomicString&)
 
 const AtomicString& Node::localName() const
 {
-    return nullAtom;
+    return nullAtom();
 }
 
 const AtomicString& Node::namespaceURI() const
 {
-    return nullAtom;
+    return nullAtom();
 }
 
 bool Node::isContentEditable()
@@ -931,7 +931,7 @@ ExceptionOr<void> Node::checkSetPrefix(const AtomicString& prefix)
     auto& namespaceURI = this->namespaceURI();
     if (namespaceURI.isEmpty() && !prefix.isEmpty())
         return Exception { NAMESPACE_ERR };
-    if (prefix == xmlAtom && namespaceURI != XMLNames::xmlNamespaceURI)
+    if (prefix == xmlAtom() && namespaceURI != XMLNames::xmlNamespaceURI)
         return Exception { NAMESPACE_ERR };
 
     // Attribute-specific checks are in Attr::setPrefix().
@@ -1392,44 +1392,44 @@ static const AtomicString& locateDefaultNamespace(const Node& node, const Atomic
                 if (attribute.namespaceURI() != XMLNSNames::xmlnsNamespaceURI)
                     continue;
 
-                if ((prefix.isNull() && attribute.prefix().isNull() && attribute.localName() == xmlnsAtom) || (attribute.prefix() == xmlnsAtom && attribute.localName() == prefix)) {
+                if ((prefix.isNull() && attribute.prefix().isNull() && attribute.localName() == xmlnsAtom()) || (attribute.prefix() == xmlnsAtom() && attribute.localName() == prefix)) {
                     auto& result = attribute.value();
-                    return result.isEmpty() ? nullAtom : result;
+                    return result.isEmpty() ? nullAtom() : result;
                 }
             }
         }
         auto* parent = node.parentElement();
-        return parent ? locateDefaultNamespace(*parent, prefix) : nullAtom;
+        return parent ? locateDefaultNamespace(*parent, prefix) : nullAtom();
     }
     case Node::DOCUMENT_NODE:
         if (auto* documentElement = downcast<Document>(node).documentElement())
             return locateDefaultNamespace(*documentElement, prefix);
-        return nullAtom;
+        return nullAtom();
     case Node::DOCUMENT_TYPE_NODE:
     case Node::DOCUMENT_FRAGMENT_NODE:
-        return nullAtom;
+        return nullAtom();
     case Node::ATTRIBUTE_NODE:
         if (auto* ownerElement = downcast<Attr>(node).ownerElement())
             return locateDefaultNamespace(*ownerElement, prefix);
-        return nullAtom;
+        return nullAtom();
     default:
         if (auto* parent = node.parentElement())
             return locateDefaultNamespace(*parent, prefix);
-        return nullAtom;
+        return nullAtom();
     }
 }
 
 // https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
 bool Node::isDefaultNamespace(const AtomicString& potentiallyEmptyNamespace) const
 {
-    const AtomicString& namespaceURI = potentiallyEmptyNamespace.isEmpty() ? nullAtom : potentiallyEmptyNamespace;
-    return locateDefaultNamespace(*this, nullAtom) == namespaceURI;
+    const AtomicString& namespaceURI = potentiallyEmptyNamespace.isEmpty() ? nullAtom() : potentiallyEmptyNamespace;
+    return locateDefaultNamespace(*this, nullAtom()) == namespaceURI;
 }
 
 // https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri
 const AtomicString& Node::lookupNamespaceURI(const AtomicString& potentiallyEmptyPrefix) const
 {
-    const AtomicString& prefix = potentiallyEmptyPrefix.isEmpty() ? nullAtom : potentiallyEmptyPrefix;
+    const AtomicString& prefix = potentiallyEmptyPrefix.isEmpty() ? nullAtom() : potentiallyEmptyPrefix;
     return locateDefaultNamespace(*this, prefix);
 }
 
@@ -1441,19 +1441,19 @@ static const AtomicString& locateNamespacePrefix(const Element& element, const A
 
     if (element.hasAttributes()) {
         for (auto& attribute : element.attributesIterator()) {
-            if (attribute.prefix() == xmlnsAtom && attribute.value() == namespaceURI)
+            if (attribute.prefix() == xmlnsAtom() && attribute.value() == namespaceURI)
                 return attribute.localName();
         }
     }
     auto* parent = element.parentElement();
-    return parent ? locateNamespacePrefix(*parent, namespaceURI) : nullAtom;
+    return parent ? locateNamespacePrefix(*parent, namespaceURI) : nullAtom();
 }
 
 // https://dom.spec.whatwg.org/#dom-node-lookupprefix
 const AtomicString& Node::lookupPrefix(const AtomicString& namespaceURI) const
 {
     if (namespaceURI.isEmpty())
-        return nullAtom;
+        return nullAtom();
     
     switch (nodeType()) {
     case ELEMENT_NODE:
@@ -1461,18 +1461,18 @@ const AtomicString& Node::lookupPrefix(const AtomicString& namespaceURI) const
     case DOCUMENT_NODE:
         if (auto* documentElement = downcast<Document>(*this).documentElement())
             return locateNamespacePrefix(*documentElement, namespaceURI);
-        return nullAtom;
+        return nullAtom();
     case DOCUMENT_FRAGMENT_NODE:
     case DOCUMENT_TYPE_NODE:
-        return nullAtom;
+        return nullAtom();
     case ATTRIBUTE_NODE:
         if (auto* ownerElement = downcast<Attr>(*this).ownerElement())
             return locateNamespacePrefix(*ownerElement, namespaceURI);
-        return nullAtom;
+        return nullAtom();
     default:
         if (auto* parent = parentElement())
             return locateNamespacePrefix(*parent, namespaceURI);
-        return nullAtom;
+        return nullAtom();
     }
 }
 
index 6803fb0..3be876c 100644 (file)
@@ -122,7 +122,7 @@ public:
 
     ALWAYS_INLINE Ref<TagCollectionNS> addCachedTagCollectionNS(ContainerNode& node, const AtomicString& namespaceURI, const AtomicString& localName)
     {
-        QualifiedName name(nullAtom, localName, namespaceURI);
+        QualifiedName name(nullAtom(), localName, namespaceURI);
         TagCollectionNSCache::AddResult result = m_tagCollectionNSCache.fastAdd(name, nullptr);
         if (!result.isNewEntry)
             return *result.iterator->value;
@@ -147,7 +147,7 @@ public:
     template<typename T, typename ContainerType>
     ALWAYS_INLINE Ref<T> addCachedCollection(ContainerType& container, CollectionType collectionType)
     {
-        CollectionCacheMap::AddResult result = m_cachedCollections.fastAdd(namedCollectionKey(collectionType, starAtom), nullptr);
+        CollectionCacheMap::AddResult result = m_cachedCollections.fastAdd(namedCollectionKey(collectionType, starAtom()), nullptr);
         if (!result.isNewEntry)
             return static_cast<T&>(*result.iterator->value);
 
@@ -159,11 +159,11 @@ public:
     template<typename T>
     T* cachedCollection(CollectionType collectionType)
     {
-        return static_cast<T*>(m_cachedCollections.get(namedCollectionKey(collectionType, starAtom)));
+        return static_cast<T*>(m_cachedCollections.get(namedCollectionKey(collectionType, starAtom())));
     }
 
     template <class NodeListType>
-    void removeCacheWithAtomicName(NodeListType* list, const AtomicString& name = starAtom)
+    void removeCacheWithAtomicName(NodeListType* list, const AtomicString& name = starAtom())
     {
         ASSERT(list == m_atomicNameCaches.get(namedNodeListKey<NodeListType>(name)));
         if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNode()))
@@ -173,14 +173,14 @@ public:
 
     void removeCachedTagCollectionNS(HTMLCollection& collection, const AtomicString& namespaceURI, const AtomicString& localName)
     {
-        QualifiedName name(nullAtom, localName, namespaceURI);
+        QualifiedName name(nullAtom(), localName, namespaceURI);
         ASSERT(&collection == m_tagCollectionNSCache.get(name));
         if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(collection.ownerNode()))
             return;
         m_tagCollectionNSCache.remove(name);
     }
 
-    void removeCachedCollection(HTMLCollection* collection, const AtomicString& name = starAtom)
+    void removeCachedCollection(HTMLCollection* collection, const AtomicString& name = starAtom())
     {
         ASSERT(collection == m_cachedCollections.get(namedCollectionKey(collection->type(), name)));
         if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(collection->ownerNode()))
index b86addf..cbadbee 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 
 const QualifiedName& pseudoElementTagName()
 {
-    static NeverDestroyed<QualifiedName> name(nullAtom, "<pseudo>", nullAtom);
+    static NeverDestroyed<QualifiedName> name(nullAtom(), "<pseudo>", nullAtom());
     return name;
 }
 
index 4cf5671..9467634 100644 (file)
@@ -45,7 +45,7 @@ QualifiedName::QualifiedNameImpl::~QualifiedNameImpl()
 }
 
 // Global init routines
-DEFINE_GLOBAL(QualifiedName, anyName, nullAtom, starAtom, starAtom)
+DEFINE_GLOBAL(QualifiedName, anyName, nullAtom(), starAtom(), starAtom())
 
 void QualifiedName::init()
 {
@@ -55,13 +55,13 @@ void QualifiedName::init()
 
     // Use placement new to initialize the globals.
     AtomicString::init();
-    new (NotNull, (void*)&anyName) QualifiedName(nullAtom, starAtom, starAtom);
+    new (NotNull, (void*)&anyName) QualifiedName(nullAtom(), starAtom(), starAtom());
     initialized = true;
 }
 
 const QualifiedName& nullQName()
 {
-    static NeverDestroyed<QualifiedName> nullName(nullAtom, nullAtom, nullAtom);
+    static NeverDestroyed<QualifiedName> nullName(nullAtom(), nullAtom(), nullAtom());
     return nullName;
 }
 
@@ -80,12 +80,12 @@ unsigned QualifiedName::QualifiedNameImpl::computeHash() const
 
 void createQualifiedName(void* targetAddress, StringImpl* name, const AtomicString& nameNamespace)
 {
-    new (NotNull, reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicString(name), nameNamespace);
+    new (NotNull, reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom(), AtomicString(name), nameNamespace);
 }
 
 void createQualifiedName(void* targetAddress, StringImpl* name)
 {
-    new (NotNull, reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicString(name), nullAtom);
+    new (NotNull, reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom(), AtomicString(name), nullAtom());
 }
 
 }
index ce03e9a..08fa2b6 100644 (file)
@@ -81,7 +81,7 @@ public:
 
     bool matches(const QualifiedName& other) const { return m_impl == other.m_impl || (localName() == other.localName() && namespaceURI() == other.namespaceURI()); }
 
-    bool hasPrefix() const { return m_impl->m_prefix != nullAtom; }
+    bool hasPrefix() const { return m_impl->m_prefix != nullAtom(); }
     void setPrefix(const AtomicString& prefix) { *this = QualifiedName(prefix, localName(), namespaceURI()); }
 
     const AtomicString& prefix() const { return m_impl->m_prefix; }
index f49bc30..1213a5d 100644 (file)
@@ -336,8 +336,8 @@ ALWAYS_INLINE void SelectorDataList::executeSingleTagNameSelectorData(const Cont
     const AtomicString& selectorLowercaseLocalName = selectorData.selector->tagLowercaseLocalName();
     const AtomicString& selectorNamespaceURI = tagQualifiedName.namespaceURI();
 
-    if (selectorNamespaceURI == starAtom) {
-        if (selectorLocalName != starAtom) {
+    if (selectorNamespaceURI == starAtom()) {
+        if (selectorLocalName != starAtom()) {
             // Common case: name defined, selectorNamespaceURI is a wildcard.
             elementsForLocalName<SelectorQueryTrait>(rootNode, selectorLocalName, selectorLowercaseLocalName, output);
         } else {
@@ -345,7 +345,7 @@ ALWAYS_INLINE void SelectorDataList::executeSingleTagNameSelectorData(const Cont
             anyElement<SelectorQueryTrait>(rootNode, output);
         }
     } else {
-        // Fallback: NamespaceURI is set, selectorLocalName may be starAtom.
+        // Fallback: NamespaceURI is set, selectorLocalName may be starAtom().
         for (auto& element : elementDescendants(const_cast<ContainerNode&>(rootNode))) {
             if (element.namespaceURI() == selectorNamespaceURI && localNameMatches(element, selectorLocalName, selectorLowercaseLocalName)) {
                 SelectorQueryTrait::appendOutputForElement(output, &element);
index 956407a..27a6955 100644 (file)
@@ -37,7 +37,7 @@ using namespace HTMLNames;
 
 static const AtomicString& slotNameFromAttributeValue(const AtomicString& value)
 {
-    return value == nullAtom ? SlotAssignment::defaultSlotName() : value;
+    return value == nullAtom() ? SlotAssignment::defaultSlotName() : value;
 }
 
 static const AtomicString& slotNameFromSlotAttribute(const Node& child)
index e5ce9a7..6d59f4e 100644 (file)
@@ -45,7 +45,7 @@ public:
     SlotAssignment();
     virtual ~SlotAssignment();
 
-    static const AtomicString& defaultSlotName() { return emptyAtom; }
+    static const AtomicString& defaultSlotName() { return emptyAtom(); }
 
     HTMLSlotElement* findAssignedSlot(const Node&, ShadowRoot&);
 
@@ -99,13 +99,13 @@ private:
 inline void ShadowRoot::didRemoveAllChildrenOfShadowHost()
 {
     if (m_slotAssignment) // FIXME: This is incorrect when there were no elements or text nodes removed.
-        m_slotAssignment->didChangeSlot(nullAtom, *this);
+        m_slotAssignment->didChangeSlot(nullAtom(), *this);
 }
 
 inline void ShadowRoot::didChangeDefaultSlot()
 {
     if (m_slotAssignment)
-        m_slotAssignment->didChangeSlot(nullAtom, *this);
+        m_slotAssignment->didChangeSlot(nullAtom(), *this);
 }
 
 inline void ShadowRoot::hostChildElementDidChange(const Element& childElement)
index 7f9f403..b05b9d1 100644 (file)
@@ -45,7 +45,7 @@ TagCollection::TagCollection(ContainerNode& rootNode, const AtomicString& qualif
     : CachedHTMLCollection<TagCollection, CollectionTypeTraits<ByTag>::traversalType>(rootNode, ByTag)
     , m_qualifiedName(qualifiedName)
 {
-    ASSERT(qualifiedName != starAtom);
+    ASSERT(qualifiedName != starAtom());
 }
 
 TagCollection::~TagCollection()
@@ -58,7 +58,7 @@ HTMLTagCollection::HTMLTagCollection(ContainerNode& rootNode, const AtomicString
     , m_qualifiedName(qualifiedName)
     , m_loweredQualifiedName(qualifiedName.convertToASCIILowercase())
 {
-    ASSERT(qualifiedName != starAtom);
+    ASSERT(qualifiedName != starAtom());
 }
 
 HTMLTagCollection::~HTMLTagCollection()
index 2c02747..777e8ad 100644 (file)
@@ -88,9 +88,9 @@ inline bool TagCollection::elementMatches(Element& element) const
 
 inline bool TagCollectionNS::elementMatches(Element& element) const
 {
-    if (m_localName != starAtom && m_localName != element.localName())
+    if (m_localName != starAtom() && m_localName != element.localName())
         return false;
-    return m_namespaceURI == starAtom || m_namespaceURI == element.namespaceURI();
+    return m_namespaceURI == starAtom() || m_namespaceURI == element.namespaceURI();
 }
 
 inline bool HTMLTagCollection::elementMatches(Element& element) const
index 7073a18..82bcc5e 100755 (executable)
@@ -806,11 +806,11 @@ sub printNamesCppFile
     print F StaticString::GenerateStringAsserts(\%allStrings);
 
     if (keys %allTags) {
-        my $tagsNamespace = $parameters{tagsNullNamespace} ? "nullAtom" : "${lowercaseNamespacePrefix}NS";
+        my $tagsNamespace = $parameters{tagsNullNamespace} ? "nullAtom()" : "${lowercaseNamespacePrefix}NS";
         printDefinitions($F, \%allTags, "tags", $tagsNamespace);
     }
     if (keys %allAttrs) {
-        my $attrsNamespace = $parameters{attrsNullNamespace} ? "nullAtom" : "${lowercaseNamespacePrefix}NS";
+        my $attrsNamespace = $parameters{attrsNullNamespace} ? "nullAtom()" : "${lowercaseNamespacePrefix}NS";
         printDefinitions($F, \%allAttrs, "attributes", $attrsNamespace);
     }
 
@@ -921,7 +921,7 @@ print F <<END
     for (auto& entry : ${type}Table)
 END
 ;
-    if ($namespaceURI eq "nullAtom") {
+    if ($namespaceURI eq "nullAtom()") {
         print F "        createQualifiedName(entry.targetAddress, &entry.name);\n";
     } else {
         print F "        createQualifiedName(entry.targetAddress, &entry.name, $namespaceURI);\n";
@@ -1063,7 +1063,7 @@ Ref<$parameters{namespace}Element> $parameters{namespace}ElementFactory::createE
         const auto& name = *entry.qualifiedName;
         return entry.function($argumentList);
     }
-    return $parameters{fallbackInterfaceName}::create(QualifiedName(nullAtom, localName, ${lowercaseNamespacePrefix}NamespaceURI), document);
+    return $parameters{fallbackInterfaceName}::create(QualifiedName(nullAtom(), localName, ${lowercaseNamespacePrefix}NamespaceURI), document);
 }
 
 Ref<$parameters{namespace}Element> $parameters{namespace}ElementFactory::createElement(const QualifiedName& name, Document& document$formElementArgumentForDefinition, bool createdByParser)
index 450bb4f..87df516 100644 (file)
@@ -837,7 +837,7 @@ void CompositeEditCommand::deleteSelection(const VisibleSelection &selection, bo
 
 void CompositeEditCommand::removeNodeAttribute(Element& element, const QualifiedName& attribute)
 {
-    setNodeAttribute(element, attribute, nullAtom);
+    setNodeAttribute(element, attribute, nullAtom());
 }
 
 void CompositeEditCommand::setNodeAttribute(Element& element, const QualifiedName& attribute, const AtomicString& value)
index bde1510..574097a 100644 (file)
@@ -890,7 +890,7 @@ Ref<HTMLElement> createHTMLElement(Document& document, const QualifiedName& name
 
 Ref<HTMLElement> createHTMLElement(Document& document, const AtomicString& tagName)
 {
-    return createHTMLElement(document, QualifiedName(nullAtom, tagName, xhtmlNamespaceURI));
+    return createHTMLElement(document, QualifiedName(nullAtom(), tagName, xhtmlNamespaceURI));
 }
 
 bool isTabSpanNode(const Node* node)
index ae16aae..979ce53 100644 (file)
@@ -149,8 +149,8 @@ void MarkupAccumulator::serializeNodesWithNamespaces(Node& targetNode, EChildren
         namespaceHash = *namespaces;
     else if (inXMLFragmentSerialization()) {
         // Make sure xml prefix and namespace are always known to uphold the constraints listed at http://www.w3.org/TR/xml-names11/#xmlReserved.
-        namespaceHash.set(xmlAtom.impl(), XMLNames::xmlNamespaceURI.impl());
-        namespaceHash.set(XMLNames::xmlNamespaceURI.impl(), xmlAtom.impl());
+        namespaceHash.set(xmlAtom().impl(), XMLNames::xmlNamespaceURI.impl());
+        namespaceHash.set(XMLNames::xmlNamespaceURI.impl(), xmlAtom().impl());
     }
 
     if (!childrenOnly)
@@ -255,7 +255,7 @@ bool MarkupAccumulator::shouldAddNamespaceElement(const Element& element)
     // Don't add namespace attribute if it is already defined for this elem.
     const AtomicString& prefix = element.prefix();
     if (prefix.isEmpty())
-        return !element.hasAttribute(xmlnsAtom);
+        return !element.hasAttribute(xmlnsAtom());
 
     static NeverDestroyed<String> xmlnsWithColon(MAKE_STATIC_STRING_IMPL("xmlns:"));
     return !element.hasAttribute(xmlnsWithColon.get() + prefix);
@@ -267,12 +267,12 @@ bool MarkupAccumulator::shouldAddNamespaceAttribute(const Attribute& attribute,
 
     // Don't add namespace attributes twice
     // HTML Parser will create xmlns attributes without namespace for HTML elements, allow those as well.
-    if (attribute.name().localName() == xmlnsAtom && (attribute.namespaceURI().isEmpty() || attribute.namespaceURI() == XMLNSNames::xmlnsNamespaceURI)) {
-        namespaces.set(emptyAtom.impl(), attribute.value().impl());
+    if (attribute.name().localName() == xmlnsAtom() && (attribute.namespaceURI().isEmpty() || attribute.namespaceURI() == XMLNSNames::xmlnsNamespaceURI)) {
+        namespaces.set(emptyAtom().impl(), attribute.value().impl());
         return false;
     }
 
-    QualifiedName xmlnsPrefixAttr(xmlnsAtom, attribute.localName(), XMLNSNames::xmlnsNamespaceURI);
+    QualifiedName xmlnsPrefixAttr(xmlnsAtom(), attribute.localName(), XMLNSNames::xmlnsNamespaceURI);
     if (attribute.name() == xmlnsPrefixAttr) {
         namespaces.set(attribute.localName().impl(), attribute.value().impl());
         namespaces.set(attribute.value().impl(), attribute.localName().impl());
@@ -287,16 +287,16 @@ void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicStrin
     namespaces.checkConsistency();
     if (namespaceURI.isEmpty()) {
         // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-serialization-algorithm
-        if (allowEmptyDefaultNS && namespaces.get(emptyAtom.impl())) {
+        if (allowEmptyDefaultNS && namespaces.get(emptyAtom().impl())) {
             result.append(' ');
-            result.append(xmlnsAtom.string());
+            result.append(xmlnsAtom().string());
             result.appendLiteral("=\"\"");
         }
         return;
     }
 
-    // Use emptyAtoms's impl() for both null and empty strings since the HashMap can't handle 0 as a key
-    AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl();
+    // Use emptyAtom()s's impl() for both null and empty strings since the HashMap can't handle 0 as a key
+    AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom().impl() : prefix.impl();
     AtomicStringImpl* foundNS = namespaces.get(pre);
     if (foundNS != namespaceURI.impl()) {
         namespaces.set(pre, namespaceURI.impl());
@@ -307,7 +307,7 @@ void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicStrin
         if (namespaceURI.impl() == XMLNames::xmlNamespaceURI.impl())
             return;
         result.append(' ');
-        result.append(xmlnsAtom.string());
+        result.append(xmlnsAtom().string());
         if (!prefix.isEmpty()) {
             result.append(':');
             result.append(prefix);
@@ -443,7 +443,7 @@ void MarkupAccumulator::appendOpenTag(StringBuilder& result, const Element& elem
         // a default namespace declaration to make this namespace well-formed. However, http://www.w3.org/TR/xml-names11/#xmlReserved states
         // "The prefix xml MUST NOT be declared as the default namespace.", so use the xml prefix explicitly.
         if (element.namespaceURI() == XMLNames::xmlNamespaceURI) {
-            result.append(xmlAtom);
+            result.append(xmlAtom());
             result.append(':');
         }
     }
@@ -500,7 +500,7 @@ void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& el
         if (!attribute.namespaceURI().isEmpty()) {
             if (attribute.namespaceURI() == XMLNames::xmlNamespaceURI) {
                 // Always use xml as prefix if the namespace is the XML namespace.
-                prefixedName.setPrefix(xmlAtom);
+                prefixedName.setPrefix(xmlAtom());
             } else {
                 AtomicStringImpl* foundNS = namespaces && attribute.prefix().impl() ? namespaces->get(attribute.prefix().impl()) : 0;
                 bool prefixIsAlreadyMappedToOtherNS = foundNS && foundNS != attribute.namespaceURI().impl();
@@ -509,7 +509,7 @@ void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& el
                         prefixedName.setPrefix(AtomicString(prefix));
                     else {
                         bool shouldBeDeclaredUsingAppendNamespace = !attribute.prefix().isEmpty() && !foundNS;
-                        if (!shouldBeDeclaredUsingAppendNamespace && attribute.localName() != xmlnsAtom && namespaces)
+                        if (!shouldBeDeclaredUsingAppendNamespace && attribute.localName() != xmlnsAtom() && namespaces)
                             generateUniquePrefix(prefixedName, *namespaces);
                     }
                 }
index b987fa2..7a15384 100644 (file)
@@ -103,7 +103,7 @@ static const AtomicString& elementURL(Element& element)
         return element.attributeWithoutSynchronization(XLinkNames::hrefAttr);
     if (is<HTMLEmbedElement>(element) || is<HTMLObjectElement>(element))
         return element.imageSourceURL();
-    return nullAtom;
+    return nullAtom();
 }
 
 static bool getImageForElement(Element& element, RefPtr<Image>& image)
index a4f8513..d70fb15 100644 (file)
@@ -75,7 +75,7 @@ static bool propertyMissingOrEqualToNone(StyleProperties*, CSSPropertyID);
 class AttributeChange {
 public:
     AttributeChange()
-        : m_name(nullAtom, nullAtom, nullAtom)
+        : m_name(nullAtom(), nullAtom(), nullAtom())
     {
     }
 
index 1402d45..2f87a35 100644 (file)
@@ -53,7 +53,7 @@ const AtomicString& stringForAutocapitalizeType(AutocapitalizeType type)
 {
     switch (type) {
     case AutocapitalizeTypeDefault:
-        return nullAtom;
+        return nullAtom();
     case AutocapitalizeTypeNone: {
         static NeverDestroyed<const AtomicString> valueNone("none", AtomicString::ConstructFromLiteral);
         return valueNone;
@@ -73,7 +73,7 @@ const AtomicString& stringForAutocapitalizeType(AutocapitalizeType type)
     }
 
     ASSERT_NOT_REACHED();
-    return nullAtom;
+    return nullAtom();
 }
 
 } // namespace WebCore
index 6a9212f..16118a8 100644 (file)
@@ -175,7 +175,7 @@ AutofillData AutofillData::createFromHTMLFormControlElement(const HTMLFormContro
     const AtomicString& attributeValue = element.attributeWithoutSynchronization(HTMLNames::autocompleteAttr);
 
     // 1. If the element has no autocomplete attribute, then jump to the step labeled default.
-    if (attributeValue == nullAtom)
+    if (attributeValue == nullAtom())
         return defaultLabel();
 
     // 2. Let tokens be the result of splitting the attribute's value on spaces.
index 53ac5e2..21fb46f 100644 (file)
@@ -84,7 +84,7 @@ inline unsigned DOMTokenList::length() const
 inline const AtomicString& DOMTokenList::item(unsigned index) const
 {
     auto& tokens = this->tokens();
-    return index < tokens.size() ? tokens[index] : nullAtom;
+    return index < tokens.size() ? tokens[index] : nullAtom();
 }
 
 } // namespace WebCore
index 84068a8..0b4177c 100644 (file)
@@ -282,7 +282,7 @@ void FormAssociatedElement::formAttributeTargetChanged()
 const AtomicString& FormAssociatedElement::name() const
 {
     const AtomicString& name = asHTMLElement().getNameAttribute();
-    return name.isNull() ? emptyAtom : name;
+    return name.isNull() ? emptyAtom() : name;
 }
 
 bool FormAssociatedElement::isFormControlElementWithState() const
index c7913e1..6bc7829 100644 (file)
@@ -79,7 +79,7 @@ const AtomicString& HTMLButtonElement::formControlType() const
     }
 
     ASSERT_NOT_REACHED();
-    return emptyAtom;
+    return emptyAtom();
 }
 
 bool HTMLButtonElement::isPresentationAttribute(const QualifiedName& name) const
index 7775ce3..c3f4984 100644 (file)
@@ -165,7 +165,7 @@ void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicS
 
 void HTMLDetailsElement::toggleOpen()
 {
-    setAttributeWithoutSynchronization(openAttr, m_isOpen ? nullAtom : emptyAtom);
+    setAttributeWithoutSynchronization(openAttr, m_isOpen ? nullAtom() : emptyAtom());
 
     // We need to post to the document because toggling this element will delete it.
     if (AXObjectCache* cache = document().existingAXObjectCache())
index f0dee3d..e305c48 100644 (file)
@@ -236,7 +236,7 @@ void HTMLDocument::removeWindowNamedItem(const AtomicStringImpl& name, Element&
 bool HTMLDocument::isCaseSensitiveAttribute(const QualifiedName& attributeName)
 {
     static HashSet<AtomicStringImpl*>* htmlCaseInsensitiveAttributesSet = createHtmlCaseInsensitiveAttributesSet();
-    bool isPossibleHTMLAttr = !attributeName.hasPrefix() && (attributeName.namespaceURI() == nullAtom);
+    bool isPossibleHTMLAttr = !attributeName.hasPrefix() && (attributeName.namespaceURI() == nullAtom());
     return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(attributeName.localName().impl());
 }
 
index d35a69d..0e9e0b0 100644 (file)
@@ -369,15 +369,15 @@ const AtomicString& HTMLElement::eventNameForEventHandlerAttribute(const Qualifi
 
     // Event handler attributes have no namespace.
     if (!attributeName.namespaceURI().isNull())
-        return nullAtom;
+        return nullAtom();
 
     // Fast early return for names that don't start with "on".
     AtomicStringImpl& localName = *attributeName.localName().impl();
     if (localName.length() < 3 || localName[0] != 'o' || localName[1] != 'n')
-        return nullAtom;
+        return nullAtom();
 
     auto it = map.find(&localName);
-    return it == map.end() ? nullAtom : it->value;
+    return it == map.end() ? nullAtom() : it->value;
 }
 
 const AtomicString& HTMLElement::eventNameForEventHandlerAttribute(const QualifiedName& attributeName)
@@ -489,7 +489,7 @@ static inline const AtomicString& toValidDirValue(const AtomicString& value)
         return rtlValue;
     if (equalLettersIgnoringASCIICase(value, "auto"))
         return autoValue;
-    return nullAtom;
+    return nullAtom();
 }
 
 const AtomicString& HTMLElement::dir() const
index 0cd6e2a..82147a2 100644 (file)
@@ -176,7 +176,7 @@ ImageCandidate HTMLImageElement::bestFitSourceFromPictureElement()
             continue;
 
         auto sourceSize = SizesAttributeParser(source.attributeWithoutSynchronization(sizesAttr).string(), document()).length();
-        auto candidate = bestFitSourceForImageAttributes(document().deviceScaleFactor(), nullAtom, srcset, sourceSize);
+        auto candidate = bestFitSourceForImageAttributes(document().deviceScaleFactor(), nullAtom(), srcset, sourceSize);
         if (!candidate.isEmpty())
             return candidate;
     }
index 8cae82b..3efa5e7 100644 (file)
@@ -166,7 +166,7 @@ HTMLInputElement::~HTMLInputElement()
 
 const AtomicString& HTMLInputElement::name() const
 {
-    return m_name.isNull() ? emptyAtom : m_name;
+    return m_name.isNull() ? emptyAtom() : m_name;
 }
 
 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState(const FormControlState& state)
@@ -526,11 +526,11 @@ void HTMLInputElement::updateType()
         ASSERT(elementData());
         // FIXME: We don't have the old attribute values so we pretend that we didn't have the old values.
         if (const Attribute* height = findAttributeByName(heightAttr))
-            attributeChanged(heightAttr, nullAtom, height->value());
+            attributeChanged(heightAttr, nullAtom(), height->value());
         if (const Attribute* width = findAttributeByName(widthAttr))
-            attributeChanged(widthAttr, nullAtom, width->value());
+            attributeChanged(widthAttr, nullAtom(), width->value());
         if (const Attribute* align = findAttributeByName(alignAttr))
-            attributeChanged(alignAttr, nullAtom, align->value());
+            attributeChanged(alignAttr, nullAtom(), align->value());
     }
 
     if (form() && wasSuccessfulSubmitButtonCandidate != m_inputType->canBeSuccessfulSubmitButton())
index d1cb504..2804ec8 100644 (file)
@@ -7312,7 +7312,7 @@ bool HTMLMediaElement::effectiveMuted() const
 
 bool HTMLMediaElement::doesHaveAttribute(const AtomicString& attribute, AtomicString* value) const
 {
-    QualifiedName attributeName(nullAtom, attribute, nullAtom);
+    QualifiedName attributeName(nullAtom(), attribute, nullAtom());
 
     auto& elementValue = attributeWithoutSynchronization(attributeName);
     if (elementValue.isNull())
index 860276e..0512ff2 100644 (file)
@@ -78,7 +78,7 @@ ExceptionOr<Ref<HTMLOptionElement>> HTMLOptionElement::createForJSConstructor(Do
     if (!value.isNull())
         element->setValue(value);
     if (defaultSelected)
-        element->setAttributeWithoutSynchronization(selectedAttr, emptyAtom);
+        element->setAttributeWithoutSynchronization(selectedAttr, emptyAtom());
     element->setSelected(selected);
 
     return WTFMove(element);
index 08fbf1d..ed9a180 100644 (file)
@@ -45,7 +45,7 @@ String HTMLParamElement::name() const
 {
     if (hasName())
         return getNameAttribute();
-    return document().isHTMLDocument() ? emptyAtom : getIdAttribute();
+    return document().isHTMLDocument() ? emptyAtom() : getIdAttribute();
 }
 
 String HTMLParamElement::value() const
index f4c6143..eade72f 100644 (file)
@@ -392,7 +392,7 @@ void HTMLSelectElement::setMultiple(bool multiple)
 {
     bool oldMultiple = this->multiple();
     int oldSelectedIndex = selectedIndex();
-    setAttributeWithoutSynchronization(multipleAttr, multiple ? emptyAtom : nullAtom);
+    setAttributeWithoutSynchronization(multipleAttr, multiple ? emptyAtom() : nullAtom());
 
     // Restore selectedIndex after changing the multiple flag to preserve
     // selection as single-line and multi-line has different defaults.
index 46beaae..fd6f66d 100644 (file)
@@ -181,7 +181,7 @@ const AtomicString& HTMLTableCellElement::scope() const
         return rowgroup;
     if (equalIgnoringASCIICase(value, colgroup))
         return colgroup;
-    return emptyAtom;
+    return emptyAtom();
 }
 
 void HTMLTableCellElement::setScope(const AtomicString& scope)
index b67c54d..c0a7f59 100644 (file)
@@ -279,7 +279,7 @@ const AtomicString& HTMLTrackElement::mediaElementCrossOriginAttribute() const
 {
     if (HTMLMediaElement* parent = mediaElement())
         return parent->attributeWithoutSynchronization(HTMLNames::crossoriginAttr);
-    return nullAtom;
+    return nullAtom();
 }
 
 void HTMLTrackElement::textTrackKindChanged(TextTrack& track)
index 7f3f70e..27f6caf 100644 (file)
@@ -45,7 +45,7 @@ RefPtr<NodeList> LabelableElement::labels()
     if (!supportLabels())
         return nullptr;
 
-    return ensureRareData().ensureNodeLists().addCacheWithAtomicName<LabelsNodeList>(*this, starAtom);
+    return ensureRareData().ensureNodeLists().addCacheWithAtomicName<LabelsNodeList>(*this, starAtom());
 }
 
 } // namespace Webcore
index 2738515..c7a3f98 100644 (file)
@@ -40,7 +40,7 @@ LabelsNodeList::LabelsNodeList(LabelableElement& forNode)
 
 LabelsNodeList::~LabelsNodeList()
 {
-    ownerNode().nodeLists()->removeCacheWithAtomicName(this, starAtom);
+    ownerNode().nodeLists()->removeCacheWithAtomicName(this, starAtom());
 } 
     
 bool LabelsNodeList::elementMatches(Element& testNode) const
index e977aec..3db03d7 100644 (file)
@@ -317,7 +317,7 @@ const AtomicString& MediaController::playbackState() const
         return playbackStateEnded();
     default:
         ASSERT_NOT_REACHED();
-        return nullAtom;
+        return nullAtom();
     }
 }
 
@@ -342,7 +342,7 @@ static AtomicString eventNameForReadyState(MediaControllerInterface::ReadyState
         return eventNames().canplaythroughEvent;
     default:
         ASSERT_NOT_REACHED();
-        return nullAtom;
+        return nullAtom();
     }
 }
 
index 9b3b9bf..37dfbd9 100644 (file)
@@ -106,9 +106,9 @@ void MediaDocumentParser::createDocumentStructure()
 
     auto videoElement = HTMLVideoElement::create(document);
     m_mediaElement = videoElement.ptr();
-    videoElement->setAttributeWithoutSynchronization(controlsAttr, emptyAtom);
-    videoElement->setAttributeWithoutSynchronization(autoplayAttr, emptyAtom);
-    videoElement->setAttributeWithoutSynchronization(playsinlineAttr, emptyAtom);
+    videoElement->setAttributeWithoutSynchronization(controlsAttr, emptyAtom());
+    videoElement->setAttributeWithoutSynchronization(autoplayAttr, emptyAtom());
+    videoElement->setAttributeWithoutSynchronization(playsinlineAttr, emptyAtom());
     videoElement->setAttributeWithoutSynchronization(srcAttr, document.url().string());
     if (auto* loader = document.loader())
         videoElement->setAttributeWithoutSynchronization(typeAttr, loader->responseMIMEType());
index d09afbc..d1f309f 100644 (file)
@@ -206,7 +206,7 @@ inline void AtomicHTMLToken::initializeAttributes(const HTMLToken::AttributeList
 
         // FIXME: This is N^2 for the number of attributes.
         if (!hasAttribute(m_attributes, localName))
-            m_attributes.uncheckedAppend(Attribute(QualifiedName(nullAtom, localName, nullAtom), AtomicString(attribute.value)));
+            m_attributes.uncheckedAppend(Attribute(QualifiedName(nullAtom(), localName, nullAtom()), AtomicString(attribute.value)));
     }
 }
 
index b15990a..0924551 100644 (file)
@@ -641,7 +641,7 @@ void HTMLConstructionSite::takeAllChildrenAndReparent(HTMLStackItem& newParent,
 
 Ref<Element> HTMLConstructionSite::createElement(AtomicHTMLToken& token, const AtomicString& namespaceURI)
 {
-    QualifiedName tagName(nullAtom, token.name(), namespaceURI);
+    QualifiedName tagName(nullAtom(), token.name(), namespaceURI);
     auto element = ownerDocumentForCurrentNode().createElement(tagName, true);
     setAttributes(element, token, m_parserContentPolicy);
     return element;
@@ -676,7 +676,7 @@ RefPtr<Element> HTMLConstructionSite::createHTMLElementOrFindCustomElementInterf
             }
         }
 
-        QualifiedName qualifiedName(nullAtom, localName, xhtmlNamespaceURI);
+        QualifiedName qualifiedName(nullAtom(), localName, xhtmlNamespaceURI);
         if (Document::validateCustomElementName(localName) == CustomElementNameValidationStatus::Valid) {
             element = HTMLElement::create(qualifiedName, ownerDocument);
             element->setIsCustomElementUpgradeCandidate();
index 8b3ad08..47c1966 100644 (file)
@@ -47,7 +47,7 @@ static String stripLeadingAndTrailingHTMLSpaces(String string, CharType characte
     }
 
     if (numLeadingSpaces == length)
-        return string.isNull() ? string : emptyAtom.string();
+        return string.isNull() ? string : emptyAtom().string();
 
     for (; numTrailingSpaces < length; ++numTrailingSpaces) {
         if (isNotHTMLSpace(characters[length - numTrailingSpaces - 1]))
@@ -67,7 +67,7 @@ String stripLeadingAndTrailingHTMLSpaces(const String& string)
     unsigned length = string.length();
 
     if (!length)
-        return string.isNull() ? string : emptyAtom.string();
+        return string.isNull() ? string : emptyAtom().string();
 
     if (string.is8Bit())
         return stripLeadingAndTrailingHTMLSpaces(string, string.characters8(), length);
@@ -462,7 +462,7 @@ AtomicString parseHTMLHashNameReference(StringView usemap)
 {
     size_t numberSignIndex = usemap.find('#');
     if (numberSignIndex == notFound)
-        return nullAtom;
+        return nullAtom();
     return usemap.substring(numberSignIndex + 1).toAtomicString();
 }
 
index 4b22f4f..f4f806f 100644 (file)
@@ -541,10 +541,10 @@ static HashMap<AtomicString, QualifiedName> createForeignAttributesMap()
 
     AtomicString xlinkName("xlink", AtomicString::ConstructFromLiteral);
     addNamesWithPrefix(map, xlinkName, XLinkNames::getXLinkAttrs(), XLinkNames::XLinkAttrsCount);
-    addNamesWithPrefix(map, xmlAtom, XMLNames::getXMLAttrs(), XMLNames::XMLAttrsCount);
+    addNamesWithPrefix(map, xmlAtom(), XMLNames::getXMLAttrs(), XMLNames::XMLAttrsCount);
 
-    map.add(WTF::xmlnsAtom, XMLNSNames::xmlnsAttr);
-    map.add("xmlns:xlink", QualifiedName(xmlnsAtom, xlinkName, XMLNSNames::xmlnsNamespaceURI));
+    map.add(WTF::xmlnsAtom(), XMLNSNames::xmlnsAttr);
+    map.add("xmlns:xlink", QualifiedName(xmlnsAtom(), xlinkName, XMLNSNames::xmlnsNamespaceURI));
 
     return map;
 }
index bd65e54..43241a2 100644 (file)
@@ -51,7 +51,7 @@ Ref<InbandTextTrack> InbandTextTrack::create(ScriptExecutionContext& context, Te
 }
 
 InbandTextTrack::InbandTextTrack(ScriptExecutionContext& context, TextTrackClient& client, InbandTextTrackPrivate& trackPrivate)
-    : TextTrack(&context, &client, emptyAtom, trackPrivate.id(), trackPrivate.label(), trackPrivate.language(), InBand)
+    : TextTrack(&context, &client, emptyAtom(), trackPrivate.id(), trackPrivate.label(), trackPrivate.language(), InBand)
     , m_private(trackPrivate)
 {
     m_private->setClient(this);
index 43995a0..cb98885 100644 (file)
@@ -127,7 +127,7 @@ void LoadableTextTrack::newRegionsAvailable(TextTrackLoader* loader)
 AtomicString LoadableTextTrack::id() const
 {
     if (!m_trackElement)
-        return emptyAtom;
+        return emptyAtom();
     return m_trackElement->attributeWithoutSynchronization(idAttr);
 }
 
index 7628d66..e664e38 100644 (file)
@@ -84,13 +84,13 @@ static const AtomicString& forcedKeyword()
 
 TextTrack* TextTrack::captionMenuOffItem()
 {
-    static TextTrack& off = TextTrack::create(nullptr, nullptr, "off menu item", emptyAtom, emptyAtom, emptyAtom).leakRef();
+    static TextTrack& off = TextTrack::create(nullptr, nullptr, "off menu item", emptyAtom(), emptyAtom(), emptyAtom()).leakRef();
     return &off;
 }
 
 TextTrack* TextTrack::captionMenuAutomaticItem()
 {
-    static TextTrack& automatic = TextTrack::create(nullptr, nullptr, "automatic menu item", emptyAtom, emptyAtom, emptyAtom).leakRef();
+    static TextTrack& automatic = TextTrack::create(nullptr, nullptr, "automatic menu item", emptyAtom(), emptyAtom(), emptyAtom()).leakRef();
     return &automatic;
 }
 
index bc95111..7ea4e05 100644 (file)
@@ -149,7 +149,7 @@ void MediaTrackBase::setKindInternal(const AtomicString& kind)
     if (isValidKind(kind))
         m_kind = kind;
     else
-        m_kind = emptyAtom;
+        m_kind = emptyAtom();
 }
 
 } // namespace WebCore
index 5214a79..e379860 100644 (file)
@@ -135,7 +135,7 @@ static const AtomicString& upKeyword()
 
 const AtomicString& VTTRegion::scroll() const
 {
-    return m_scroll ? upKeyword() : emptyAtom;
+    return m_scroll ? upKeyword() : emptyAtom();
 }
 
 ExceptionOr<void> VTTRegion::setScroll(const AtomicString& value)
index f434032..1528c9e 100644 (file)
@@ -37,14 +37,14 @@ namespace WebCore {
 
 static const QualifiedName& nodeTypeToTagName(WebVTTNodeType nodeType)
 {
-    static NeverDestroyed<QualifiedName> cTag(nullAtom, "c", nullAtom);
-    static NeverDestroyed<QualifiedName> vTag(nullAtom, "v", nullAtom);
-    static NeverDestroyed<QualifiedName> langTag(nullAtom, "lang", nullAtom);
-    static NeverDestroyed<QualifiedName> bTag(nullAtom, "b", nullAtom);
-    static NeverDestroyed<QualifiedName> uTag(nullAtom, "u", nullAtom);
-    static NeverDestroyed<QualifiedName> iTag(nullAtom, "i", nullAtom);
-    static NeverDestroyed<QualifiedName> rubyTag(nullAtom, "ruby", nullAtom);
-    static NeverDestroyed<QualifiedName> rtTag(nullAtom, "rt", nullAtom);
+    static NeverDestroyed<QualifiedName> cTag(nullAtom(), "c", nullAtom());
+    static NeverDestroyed<QualifiedName> vTag(nullAtom(), "v", nullAtom());
+    static NeverDestroyed<QualifiedName> langTag(nullAtom(), "lang", nullAtom());
+    static NeverDestroyed<QualifiedName> bTag(nullAtom(), "b", nullAtom());
+    static NeverDestroyed<QualifiedName> uTag(nullAtom(), "u", nullAtom());
+    static NeverDestroyed<QualifiedName> iTag(nullAtom(), "i", nullAtom());
+    static NeverDestroyed<QualifiedName> rubyTag(nullAtom(), "ruby", nullAtom());
+    static NeverDestroyed<QualifiedName> rtTag(nullAtom(), "rt", nullAtom());
     switch (nodeType) {
     case WebVTTNodeTypeClass:
         return cTag;
index a08f424..bc19e67 100644 (file)
@@ -62,13 +62,13 @@ public:
 
     static const QualifiedName& voiceAttributeName()
     {
-        static NeverDestroyed<QualifiedName> voiceAttr(nullAtom, "voice", nullAtom);
+        static NeverDestroyed<QualifiedName> voiceAttr(nullAtom(), "voice", nullAtom());
         return voiceAttr;
     }
     
     static const QualifiedName& langAttributeName()
     {
-        static NeverDestroyed<QualifiedName> voiceAttr(nullAtom, "lang", nullAtom);
+        static NeverDestroyed<QualifiedName> voiceAttr(nullAtom(), "lang", nullAtom());
         return voiceAttr;
     }
 
index 317e100..9600945 100644 (file)
@@ -58,7 +58,7 @@ public:
         return WebVTTToken(Type::Character, characterData);
     }
 
-    static WebVTTToken StartTag(const String& tagName, const AtomicString& classes = emptyAtom, const AtomicString& annotation = emptyAtom)
+    static WebVTTToken StartTag(const String& tagName, const AtomicString& classes = emptyAtom(), const AtomicString& annotation = emptyAtom())
     {
         WebVTTToken token(Type::StartTag, tagName);
         token.m_classes = classes;
index 48d7da8..50d42bd 100644 (file)
@@ -627,7 +627,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool
         m_frame.script().clearWindowProxiesNotMatchingDOMWindow(newDocument->domWindow(), m_frame.document()->pageCacheState() == Document::AboutToEnterPageCache);
 
         if (shouldClearWindowName(m_frame, *newDocument))
-            m_frame.tree().setName(nullAtom);
+            m_frame.tree().setName(nullAtom());
     }
 
     m_frame.selection().prepareForDestruction();
index 349652b..e93f96e 100644 (file)
@@ -118,7 +118,7 @@ public:
     unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ClientCredentialPolicy, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data);
 
     void changeLocation(FrameLoadRequest&&);
-    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom);
+    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom());
     void submitForm(Ref<FormSubmission>&&);
 
     WEBCORE_EXPORT void reload(OptionSet<ReloadOption> = { });
index 27c0b73..07d083b 100644 (file)
@@ -471,7 +471,7 @@ void ImageLoader::elementDidMoveToNewDocument()
 
 inline void ImageLoader::clearFailedLoadURL()
 {
-    m_failedLoadURL = nullAtom;
+    m_failedLoadURL = nullAtom();
 }
 
 }
index b457d19..a53997a 100644 (file)
@@ -41,8 +41,8 @@ class Event;
 class NavigationAction {
 public:
     NavigationAction();
-    WEBCORE_EXPORT NavigationAction(Document&, const ResourceRequest&, NavigationType = NavigationType::Other, ShouldOpenExternalURLsPolicy = ShouldOpenExternalURLsPolicy::ShouldNotAllow, Event* = nullptr, const AtomicString& downloadAttribute = nullAtom);
-    NavigationAction(Document&, const ResourceRequest&, FrameLoadType, bool isFormSubmission, Event* = nullptr, ShouldOpenExternalURLsPolicy = ShouldOpenExternalURLsPolicy::ShouldNotAllow, const AtomicString& downloadAttribute = nullAtom);
+    WEBCORE_EXPORT NavigationAction(Document&, const ResourceRequest&, NavigationType = NavigationType::Other, ShouldOpenExternalURLsPolicy = ShouldOpenExternalURLsPolicy::ShouldNotAllow, Event* = nullptr, const AtomicString& downloadAttribute = nullAtom());
+    NavigationAction(Document&, const ResourceRequest&, FrameLoadType, bool isFormSubmission, Event* = nullptr, ShouldOpenExternalURLsPolicy = ShouldOpenExternalURLsPolicy::ShouldNotAllow, const AtomicString& downloadAttribute = nullAtom());
 
     WEBCORE_EXPORT ~NavigationAction();
 
index dbeda87..cf2ea32 100644 (file)
@@ -146,7 +146,7 @@ void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, bool d
 #endif
 
     m_delegateIsDecidingNavigationPolicy = true;
-    m_suggestedFilename = action.downloadAttribute().isEmpty() ? nullAtom : action.downloadAttribute();
+    m_suggestedFilename = action.downloadAttribute().isEmpty() ? nullAtom() : action.downloadAttribute();
     m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, request, formState, [this](PolicyAction action) {
         continueAfterNavigationPolicy(action);
     });
index 803af6f..35c822f 100644 (file)
@@ -2326,7 +2326,7 @@ void DOMWindow::showModalDialog(const String& urlString, const String& dialogFea
     if (!canShowModalDialog(*m_frame) || !firstWindow.allowPopUp())
         return;
 
-    RefPtr<Frame> dialogFrame = createWindow(urlString, emptyAtom, parseDialogFeatures(dialogFeaturesString, screenAvailableRect(m_frame->view())), activeWindow, *firstFrame, *m_frame, prepareDialogFunction);
+    RefPtr<Frame> dialogFrame = createWindow(urlString, emptyAtom(), parseDialogFeatures(dialogFeaturesString, screenAvailableRect(m_frame->view())), activeWindow, *firstFrame, *m_frame, prepareDialogFunction);
     if (!dialogFrame)
         return;
     dialogFrame->page()->chrome().runModal();
index 8c26829..e978429 100644 (file)
@@ -3944,7 +3944,7 @@ static const AtomicString& eventNameForTouchPointState(PlatformTouchPoint::State
         // TouchStationary state is not converted to touch events, so fall through to assert.
     default:
         ASSERT_NOT_REACHED();
-        return emptyAtom;
+        return emptyAtom();
     }
 }
 
index 1e34a80..30d1dcd 100644 (file)
@@ -48,14 +48,14 @@ void FrameTree::setName(const AtomicString& name)
         m_uniqueName = name;
         return;
     }
-    m_uniqueName = nullAtom; // Remove our old frame name so it's not considered in uniqueChildName.
+    m_uniqueName = nullAtom(); // Remove our old frame name so it's not considered in uniqueChildName.
     m_uniqueName = parent()->tree().uniqueChildName(name);
 }
 
 void FrameTree::clearName()
 {
-    m_name = nullAtom;
-    m_uniqueName = nullAtom;
+    m_name = nullAtom();
+    m_uniqueName = nullAtom();
 }
 
 Frame* FrameTree::parent() const 
index bdf3ffe..196f6e4 100644 (file)
@@ -556,7 +556,7 @@ void Page::setGroupName(const String& name)
 
 const String& Page::groupName() const
 {
-    return m_group ? m_group->name() : nullAtom.string();
+    return m_group ? m_group->name() : nullAtom().string();
 }
 
 void Page::initGroup()
index b8c240d..907bdc5 100644 (file)
@@ -217,7 +217,7 @@ unsigned ComplexTextController::offsetForPosition(float h, bool includePartialGl
                 // could use the glyph's "ligature carets". This is available in CoreText via CTFontGetLigatureCaretPositions().
                 unsigned hitIndex = hitGlyphStart + (hitGlyphEnd - hitGlyphStart) * (m_run.ltr() ? x / adjustedAdvance : 1 - x / adjustedAdvance);
                 unsigned stringLength = complexTextRun.stringLength();
-                CachedTextBreakIterator cursorPositionIterator(StringView(complexTextRun.characters(), stringLength), TextBreakIterator::Mode::Caret, nullAtom);
+                CachedTextBreakIterator cursorPositionIterator(StringView(complexTextRun.characters(), stringLength), TextBreakIterator::Mode::Caret, nullAtom());
                 unsigned clusterStart;
                 if (cursorPositionIterator.isBoundary(hitIndex))
                     clusterStart = hitIndex;
index 510fecf..b7a816a 100644 (file)
@@ -225,7 +225,7 @@ const AtomicString& FontCache::alternateFamilyName(const AtomicString& familyNam
         break;
     }
 
-    return nullAtom;
+    return nullAtom();
 }
 
 FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription, const AtomicString& passedFamilyName,
index 5f5590f..786faa6 100644 (file)
@@ -303,7 +303,7 @@ public:
     static FontVariantCaps initialVariantCaps() { return FontVariantCaps::Normal; }
     static FontVariantAlternates initialVariantAlternates() { return FontVariantAlternates::Normal; }
     static FontOpticalSizing initialOpticalSizing() { return FontOpticalSizing::Enabled; }
-    static const AtomicString& initialLocale() { return nullAtom; }
+    static const AtomicString& initialLocale() { return nullAtom(); }
 
 private:
     RefCountedArray<AtomicString> m_families { 1 };
index 655eee3..81d1200 100644 (file)
@@ -84,7 +84,7 @@ static const AtomicString& genericFontFamilyForScript(const ScriptFontFamilyMap&
     }
     if (script != USCRIPT_COMMON)
         return genericFontFamilyForScript(fontMap, USCRIPT_COMMON);
-    return emptyAtom;
+    return emptyAtom();
 }
 
 FontGenericFamilies::FontGenericFamilies()
index 363bec2..882db35 100644 (file)
@@ -69,10 +69,10 @@ public:
     virtual bool isMainProgramContent() const { return true; }
     virtual bool isEasyToRead() const { return false; }
     virtual bool isDefault() const { return false; }
-    AtomicString label() const override { return emptyAtom; }
-    AtomicString language() const override { return emptyAtom; }
-    AtomicString id() const override { return emptyAtom; }
-    virtual AtomicString inBandMetadataTrackDispatchType() const { return emptyAtom; }
+    AtomicString label() const override { return emptyAtom(); }
+    AtomicString language() const override { return emptyAtom(); }
+    AtomicString id() const override { return emptyAtom(); }
+    virtual AtomicString inBandMetadataTrackDispatchType() const { return emptyAtom(); }
 
     virtual int textTrackIndex() const { return 0; }
 
index a865ceb..1921a85 100644 (file)
@@ -52,9 +52,9 @@ public:
 
     virtual TrackPrivateBaseClient* client() const = 0;
 
-    virtual AtomicString id() const { return emptyAtom; }
-    virtual AtomicString label() const { return emptyAtom; }
-    virtual AtomicString language() const { return emptyAtom; }
+    virtual AtomicString id() const { return emptyAtom(); }
+    virtual AtomicString label() const { return emptyAtom(); }
+    virtual AtomicString language() const { return emptyAtom(); }
 
     virtual int trackIndex() const { return 0; }
 
index c5ff43b..2aafa1c 100644 (file)
@@ -184,7 +184,7 @@ AtomicString AVTrackPrivateAVFObjCImpl::id() const
     if (m_mediaSelectionOption)
         return [[m_mediaSelectionOption->avMediaSelectionOption() optionID] stringValue];
     ASSERT_NOT_REACHED();
-    return emptyAtom;
+    return emptyAtom();
 }
 
 AtomicString AVTrackPrivateAVFObjCImpl::label() const
@@ -199,7 +199,7 @@ AtomicString AVTrackPrivateAVFObjCImpl::label() const
 
     NSArray *titles = [AVMetadataItem metadataItemsFromArray:commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon];
     if (![titles count])
-        return emptyAtom;
+        return emptyAtom();
 
     // If possible, return a title in one of the user's preferred languages.
     NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
@@ -216,7 +216,7 @@ AtomicString AVTrackPrivateAVFObjCImpl::language() const
         return languageForAVMediaSelectionOption(m_mediaSelectionOption->avMediaSelectionOption());
 
     ASSERT_NOT_REACHED();
-    return emptyAtom;
+    return emptyAtom();
 }
 
 String AVTrackPrivateAVFObjCImpl::languageForAVAssetTrack(AVAssetTrack* track)
index 52fd9a6..7378974 100644 (file)
@@ -41,7 +41,7 @@ struct IncompleteMetaDataCue {
 
 class InbandMetadataTextTrackPrivateAVF : public InbandTextTrackPrivate {
 public:
-    static Ref<InbandMetadataTextTrackPrivateAVF> create(Kind, CueFormat, const AtomicString& id = emptyAtom);
+    static Ref<InbandMetadataTextTrackPrivateAVF> create(Kind, CueFormat, const AtomicString& id = emptyAtom());
 
     ~InbandMetadataTextTrackPrivateAVF();
 
index 5682a99..e75d1c2 100644 (file)
@@ -140,18 +140,18 @@ bool InbandTextTrackPrivateAVCF::isEasyToRead() const
 AtomicString InbandTextTrackPrivateAVCF::label() const
 {
     if (!m_mediaSelectionOption)
-        return emptyAtom;
+        return emptyAtom();
 
     RetainPtr<CFStringRef> title;
 
     RetainPtr<CFArrayRef> commonMetaData = adoptCF(AVCFMediaSelectionOptionCopyCommonMetadata(mediaSelectionOption()));
     RetainPtr<CFArrayRef> titles = adoptCF(AVCFMetadataItemCopyItemsWithKeyAndKeySpace(commonMetaData.get(), AVCFMetadataCommonKeyTitle, AVCFMetadataKeySpaceCommon));
     if (!titles)
-        return emptyAtom;
+        return emptyAtom();
 
     CFIndex titlesCount = CFArrayGetCount(titles.get());
     if (!titlesCount)
-        return emptyAtom;
+        return emptyAtom();
 
     // If possible, return a title in one of the user's preferred languages.
     RetainPtr<CFArrayRef> preferredLanguages = adoptCF(CFLocaleCopyPreferredLanguages());
@@ -167,17 +167,17 @@ AtomicString InbandTextTrackPrivateAVCF::label() const
         title = adoptCF(AVCFMetadataItemCopyStringValue(titleMetadata));
     }
 
-    return title ? AtomicString(title.get()) : emptyAtom;
+    return title ? AtomicString(title.get()) : emptyAtom();
 }
 
 AtomicString InbandTextTrackPrivateAVCF::language() const
 {
     if (!m_mediaSelectionOption)
-        return emptyAtom;
+        return emptyAtom();
 
     RetainPtr<CFLocaleRef> locale = adoptCF(AVCFMediaSelectionOptionCopyLocale(mediaSelectionOption()));
     if (!locale)
-        return emptyAtom;
+        return emptyAtom();
 
     return CFLocaleGetIdentifier(locale.get());
 }
index ab491e9..47e38e5 100644 (file)
@@ -86,7 +86,7 @@ bool InbandTextTrackPrivateLegacyAVCF::isEasyToRead() const
 AtomicString InbandTextTrackPrivateLegacyAVCF::label() const
 {
     if (!m_playerItemTrack)
-        return emptyAtom;
+        return emptyAtom();
 
     RetainPtr<CFStringRef> title;
 
@@ -109,13 +109,13 @@ AtomicString InbandTextTrackPrivateLegacyAVCF::label() const
         }
     }
 
-    return title ? AtomicString(title.get()) : emptyAtom;
+    return title ? AtomicString(title.get()) : emptyAtom();
 }
 
 AtomicString InbandTextTrackPrivateLegacyAVCF::language() const
 {
     if (!m_playerItemTrack)
-        return emptyAtom;
+        return emptyAtom();
 
     RetainPtr<AVCFAssetTrackRef> assetTrack = adoptCF(AVCFPlayerItemTrackCopyAssetTrack(m_playerItemTrack.get()));
     RetainPtr<CFStringRef> languageCode = adoptCF(AVCFAssetTrackCopyLanguageCode(assetTrack.get()));
index f4d8c99..a4ec36a 100644 (file)
@@ -166,7 +166,7 @@ bool InbandTextTrackPrivateAVFObjC::isEasyToRead() const
 AtomicString InbandTextTrackPrivateAVFObjC::label() const
 {
     if (!m_mediaSelectionOption)
-        return emptyAtom;
+        return emptyAtom();
 
     NSString *title = 0;
 
@@ -181,13 +181,13 @@ AtomicString InbandTextTrackPrivateAVFObjC::label() const
             title = [[titles objectAtIndex:0] stringValue];
     }
 
-    return title ? AtomicString(title) : emptyAtom;
+    return title ? AtomicString(title) : emptyAtom();
 }
 
 AtomicString InbandTextTrackPrivateAVFObjC::language() const
 {
     if (!m_mediaSelectionOption)
-        return emptyAtom;
+        return emptyAtom();
 
     return [[m_mediaSelectionOption.get() locale] localeIdentifier];
 }
index bc558d7..30e38fa 100644 (file)
@@ -97,7 +97,7 @@ bool InbandTextTrackPrivateLegacyAVFObjC::isEasyToRead() const
 AtomicString InbandTextTrackPrivateLegacyAVFObjC::label() const
 {
     if (!m_playerItemTrack)
-        return emptyAtom;
+        return emptyAtom();
 
     NSString *title = 0;
 
@@ -112,13 +112,13 @@ AtomicString InbandTextTrackPrivateLegacyAVFObjC::label() const
             title = [[titles objectAtIndex:0] stringValue];
     }
 
-    return title ? AtomicString(title) : emptyAtom;
+    return title ? AtomicString(title) : emptyAtom();
 }
 
 AtomicString InbandTextTrackPrivateLegacyAVFObjC::language() const
 {
     if (!m_playerItemTrack)
-        return emptyAtom;
+        return emptyAtom();
 
     NSString *languageCode = [[m_playerItemTrack assetTrack] languageCode];
     RetainPtr<NSLocale> locale = adoptNS([[NSLocale alloc] initWithLocaleIdentifier:languageCode]);
index 6fdf61d..643c055 100644 (file)
@@ -3113,7 +3113,7 @@ static const AtomicString& metadataType(NSString *avMetadataKeySpace)
     if ([avMetadataKeySpace isEqualToString:AVMetadataKeySpaceID3])
         return id3Metadata;
 
-    return emptyAtom;
+    return emptyAtom();
 }
 
 #endif
@@ -3151,7 +3151,7 @@ void MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(RetainPtr<NSArray> me
         if (CMTIME_IS_VALID(item.duration))
             end = start + toMediaTime(item.duration);
 
-        AtomicString type = nullAtom;
+        AtomicString type = nullAtom();
         if (item.keySpace)
             type = metadataType(item.keySpace);
 
index 86f7de4..af2121a 100644 (file)
@@ -1405,7 +1405,7 @@ const AtomicString& FontCache::platformAlternateFamilyName(const AtomicString& f
         break;
     }
 
-    return nullAtom;
+    return nullAtom();
 }
 
 }
index 969db3e..31c15c4 100644 (file)
@@ -344,7 +344,7 @@ FontFamilySpecification FontCascadeDescription::effectiveFamilyAt(unsigned index
             --index;
     }
     ASSERT_NOT_REACHED();
-    return nullAtom;
+    return nullAtom();
 }
 
 }
index 756b399..6f57ae4 100644 (file)
@@ -387,7 +387,7 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe
 
 const AtomicString& FontCache::platformAlternateFamilyName(const AtomicString&)
 {
-    return nullAtom;
+    return nullAtom();
 }
 
 }
index 942392a..5260bee 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
 
 class InbandMetadataTextTrackPrivateGStreamer : public InbandTextTrackPrivate {
 public:
-    static Ref<InbandMetadataTextTrackPrivateGStreamer> create(Kind kind, CueFormat cueFormat, const AtomicString& id = emptyAtom)
+    static Ref<InbandMetadataTextTrackPrivateGStreamer> create(Kind kind, CueFormat cueFormat, const AtomicString& id = emptyAtom())
     {
         return adoptRef(*new InbandMetadataTextTrackPrivateGStreamer(kind, cueFormat, id));
     }
index 8f78b9d..781b6f8 100644 (file)
@@ -677,7 +677,7 @@ const AtomicString& FontCache::platformAlternateFamilyName(const AtomicString& f
             return microsoftSansSerif;
         break;
     }
-    return nullAtom;
+    return nullAtom();
 }
 
 }
index f3e1c3d..be47695 100644 (file)
@@ -43,7 +43,7 @@ public:
     Kind kind() const override { return Kind::Main; }
     AtomicString id() const override { return m_id; }
     AtomicString label() const override { return m_label; }
-    AtomicString language() const override { return emptyAtom; }
+    AtomicString language() const override { return emptyAtom(); }
     int trackIndex() const override { return m_index; }
 
     void setTrackIndex(int index) { m_index = index; }
index 7872901..0e38684 100644 (file)
@@ -72,11 +72,11 @@ const AtomicString& RealtimeMediaSourceSettings::facingMode(RealtimeMediaSourceS
     case RealtimeMediaSourceSettings::Right:
         return rightFacing();
     case RealtimeMediaSourceSettings::Unknown:
-        return emptyAtom;
+        return emptyAtom();
     }
     
     ASSERT_NOT_REACHED();
-    return emptyAtom;
+    return emptyAtom();
 }
 
 RealtimeMediaSourceSettings::VideoFacingMode RealtimeMediaSourceSettings::videoFacingModeEnum(const String& mode)
index 19a6b66..4b86c1b 100644 (file)
@@ -59,7 +59,7 @@ private:
     Kind kind() const final { return Kind::Main; }
     AtomicString id() const final { return m_id; }
     AtomicString label() const final { return m_label; }
-    AtomicString language() const final { return emptyAtom; }
+    AtomicString language() const final { return emptyAtom(); }
     int trackIndex() const final { return m_index; }
 
     Ref<MediaStreamTrackPrivate> m_streamTrack;
index ba49407..7f7c139 100644 (file)
@@ -788,7 +788,7 @@ String HitTestResult::linkSuggestedFilename() const
 {
     auto* urlElement = URLElement();
     if (!is<HTMLAnchorElement>(urlElement))
-        return nullAtom;
+        return nullAtom();
     return ResourceResponse::sanitizeSuggestedFilename(urlElement->attributeWithoutSynchronization(HTMLNames::downloadAttr));
 }
 
index fc87ebf..eb5d649 100644 (file)
@@ -528,7 +528,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
     float emphasisMarkOffset = 0;
     bool emphasisMarkAbove;
     bool hasTextEmphasis = emphasisMarkExistsAndIsAbove(lineStyle, emphasisMarkAbove);
-    const AtomicString& emphasisMark = hasTextEmphasis ? lineStyle.textEmphasisMarkString() : nullAtom;
+    const AtomicString& emphasisMark = hasTextEmphasis ? lineStyle.textEmphasisMarkString() : nullAtom();
     if (!emphasisMark.isEmpty())
         emphasisMarkOffset = emphasisMarkAbove ? -font.fontMetrics().ascent() - font.emphasisMarkDescent(emphasisMark) : font.fontMetrics().descent() + font.emphasisMarkAscent(emphasisMark);
 
index 0e06f65..b650779 100644 (file)
@@ -458,7 +458,7 @@ const String& RenderListItem::markerText() const
 {
     if (m_marker)
         return m_marker->text();
-    return nullAtom.string();
+    return nullAtom().string();
 }
 
 String RenderListItem::markerTextWithSuffix() const
index 073115b..92af0d7 100644 (file)
@@ -1534,7 +1534,7 @@ int RenderText::previousOffset(int current) const
         return current - 1;
 
     StringImpl* textImpl = m_text.impl();
-    CachedTextBreakIterator iterator(StringView(textImpl->characters16(), textImpl->length()), TextBreakIterator::Mode::Caret, nullAtom);
+    CachedTextBreakIterator iterator(StringView(textImpl->characters16(), textImpl->length()), TextBreakIterator::Mode::Caret, nullAtom());
     auto result = iterator.preceding(current).value_or(current - 1);
     return result;
 }
@@ -1707,7 +1707,7 @@ int RenderText::nextOffset(int current) const
         return current + 1;
 
     StringImpl* textImpl = m_text.impl();
-    CachedTextBreakIterator iterator(StringView(textImpl->characters16(), textImpl->length()), TextBreakIterator::Mode::Caret, nullAtom);
+    CachedTextBreakIterator iterator(StringView(textImpl->characters16(), textImpl->length()), TextBreakIterator::Mode::Caret, nullAtom());
     auto result = iterator.following(current).value_or(current + 1);
     return result;
 }
index cc3fa23..7d348da 100644 (file)
@@ -190,7 +190,7 @@ void RenderTreeAsText::writeRenderObject(TextStream& ts, const RenderObject& o,
         String tagName = getTagName(o.node());
         // FIXME: Temporary hack to make tests pass by simulating the old generated content output.
         if (o.isPseudoElement() || (o.parent() && o.parent()->isPseudoElement()))
-            tagName = emptyAtom;
+            tagName = emptyAtom();
         if (!tagName.isEmpty()) {
             ts << " {" << tagName << "}";
             // flag empty or unstyled AppleStyleSpan because we never
index 6e79a08..219177f 100644 (file)
@@ -125,7 +125,7 @@ void TextPainter::paintTextAndEmphasisMarksIfNeeded(const TextRun& textRun, cons
 {
     if (paintStyle.paintOrder == PaintOrder::Normal) {
         // FIXME: Truncate right-to-left text correctly.
-        paintTextWithShadows(shadow, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom, 0, paintStyle.strokeWidth > 0);
+        paintTextWithShadows(shadow, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, paintStyle.strokeWidth > 0);
     } else {
         bool paintShadow = true;
         auto textDrawingMode = m_context.textDrawingMode();
@@ -134,13 +134,13 @@ void TextPainter::paintTextAndEmphasisMarksIfNeeded(const TextRun& textRun, cons
             switch (order) {
             case PaintType::Fill:
                 m_context.setTextDrawingMode(textDrawingMode & ~TextModeStroke);
-                paintTextWithShadows(paintShadow ? shadow : nullptr, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom, 0, false);
+                paintTextWithShadows(paintShadow ? shadow : nullptr, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, false);
                 paintShadow = false;
                 m_context.setTextDrawingMode(textDrawingMode);
                 break;
             case PaintType::Stroke:
                 m_context.setTextDrawingMode(textDrawingMode & ~TextModeFill);
-                paintTextWithShadows(paintShadow ? shadow : nullptr, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom, 0, paintStyle.strokeWidth > 0);
+                paintTextWithShadows(paintShadow ? shadow : nullptr, *m_font, textRun, boxRect, textOrigin, startOffset, endOffset, nullAtom(), 0, paintStyle.strokeWidth > 0);
                 paintShadow = false;
                 m_context.setTextDrawingMode(textDrawingMode);
                 break;
index 0be2d73..ce51d3f 100644 (file)
@@ -1330,7 +1330,7 @@ const AtomicString& RenderStyle::textEmphasisMarkString() const
 {
     switch (textEmphasisMark()) {
     case TextEmphasisMarkNone:
-        return nullAtom;
+        return nullAtom();
     case TextEmphasisMarkCustom:
         return textEmphasisCustomMark();
     case TextEmphasisMarkDot: {
@@ -1360,11 +1360,11 @@ const AtomicString& RenderStyle::textEmphasisMarkString() const
     }
     case TextEmphasisMarkAuto:
         ASSERT_NOT_REACHED();
-        return nullAtom;
+        return nullAtom();
     }
 
     ASSERT_NOT_REACHED();
-    return nullAtom;
+    return nullAtom();
 }
 
 #if ENABLE(DASHBOARD_SUPPORT)
index fc14ce5..4b215a9 100644 (file)
@@ -1522,7 +1522,7 @@ public:
     static short initialHyphenationLimitBefore() { return -1; }
     static short initialHyphenationLimitAfter() { return -1; }
     static short initialHyphenationLimitLines() { return -1; }
-    static const AtomicString& initialHyphenationString() { return nullAtom; }
+    static const AtomicString& initialHyphenationString() { return nullAtom(); }
     static EBorderFit initialBorderFit() { return BorderFitBorder; }
     static EResize initialResize() { return RESIZE_NONE; }
     static ControlPart initialAppearance() { return NoControlPart; }
@@ -1549,7 +1549,7 @@ public:
     static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
     static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
     static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
-    static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
+    static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom(); }
     static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver | TextEmphasisPositionRight; }
     static RubyPosition initialRubyPosition() { return RubyPositionBefore; }
     static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
@@ -1562,7 +1562,7 @@ public:
     static StyleImage* initialMaskBoxImageSource() { return nullptr; }
     static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
     static QuotesData* initialQuotes() { return nullptr; }
-    static const AtomicString& initialContentAltText() { return emptyAtom; }
+    static const AtomicString& initialContentAltText() { return emptyAtom(); }
 
 #if ENABLE(CSS3_TEXT)
     static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
@@ -1637,12 +1637,12 @@ public:
 
     static unsigned initialTabSize() { return 8; }
 
-    static const AtomicString& initialLineGrid() { return nullAtom; }
+    static const AtomicString& initialLineGrid() { return nullAtom(); }
     static LineSnap initialLineSnap() { return LineSnapNone; }
     static LineAlign initialLineAlign() { return LineAlignNone; }
 
-    static const AtomicString& initialFlowThread() { return nullAtom; }
-    static const AtomicString& initialRegionThread() { return nullAtom; }
+    static const AtomicString& initialFlowThread() { return nullAtom(); }
+    static const AtomicString& initialRegionThread() { return nullAtom(); }
     static RegionFragment initialRegionFragment() { return AutoRegionFragment; }
 
     static IntSize initialInitialLetter() { return IntSize(); }
index a47faea..17690cc 100644 (file)
@@ -332,7 +332,7 @@ void Scope::collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>& sheets)
                     continue;
                 }
                 if (!linkElement.sheet())
-                    title = nullAtom;
+                    title = nullAtom();
             }
             // Get the current preferred styleset. This is the
             // set of sheets that will be enabled.
index b9f8b6b..5d87163 100644 (file)
@@ -1032,7 +1032,7 @@ RefPtr<DeprecatedCSSOMValue> SVGElement::getPresentationAttribute(const String&
     if (!hasAttributesWithoutUpdate())
         return 0;
 
-    QualifiedName attributeName(nullAtom, name, nullAtom);
+    QualifiedName attributeName(nullAtom(), name, nullAtom());
     const Attribute* attribute = findAttributeByName(attributeName);
     if (!attribute)
         return 0;
index 283e6c8..0903e46 100644 (file)
@@ -218,7 +218,7 @@ struct SVGAttributeHashTranslator {
     static unsigned hash(const QualifiedName& key)
     {
         if (key.hasPrefix()) {
-            QualifiedNameComponents components = { nullAtom.impl(), key.localName().impl(), key.namespaceURI().impl() };
+            QualifiedNameComponents components = { nullAtom().impl(), key.localName().impl(), key.namespaceURI().impl() };
             return hashComponents(components);
         }
         return DefaultHash<QualifiedName>::Hash::hash(key);
index c51fca9..33c28f2 100644 (file)
@@ -142,8 +142,8 @@ void SVGUseElement::transferSizeAttributesToTargetClone(SVGElement& shadowElemen
         // Spec (<use> on <svg>): If attributes width and/or height are provided on the 'use' element, then these
         // values will override the corresponding attributes on the 'svg' in the generated tree.
         SVGElement* correspondingElement = shadowElement.correspondingElement();
-        shadowElement.setAttribute(SVGNames::widthAttr, (widthIsValid() && width().valueInSpecifiedUnits()) ? AtomicString(width().valueAsString()) : (correspondingElement ? correspondingElement->getAttribute(SVGNames::widthAttr) : nullAtom));
-        shadowElement.setAttribute(SVGNames::heightAttr, (heightIsValid() && height().valueInSpecifiedUnits()) ? AtomicString(height().valueAsString()) : (correspondingElement ? correspondingElement->getAttribute(SVGNames::heightAttr) : nullAtom));
+        shadowElement.setAttribute(SVGNames::widthAttr, (widthIsValid() && width().valueInSpecifiedUnits()) ? AtomicString(width().valueAsString()) : (correspondingElement ? correspondingElement->getAttribute(SVGNames::widthAttr) : nullAtom()));
+        shadowElement.setAttribute(SVGNames::heightAttr, (heightIsValid() && height().valueInSpecifiedUnits()) ? AtomicString(height().valueAsString()) : (correspondingElement ? correspondingElement->getAttribute(SVGNames::heightAttr) : nullAtom()));
     }
 }
 
index a04be3f..44c8910 100644 (file)
@@ -216,13 +216,13 @@ inline QualifiedName SVGSMILElement::constructAttributeName() const
     std::tie(prefix, localName) = parseResult.releaseReturnValue();
 
     if (prefix.isNull())
-        return { nullAtom, localName, nullAtom };
+        return { nullAtom(), localName, nullAtom() };
 
     auto namespaceURI = lookupNamespaceURI(prefix);
     if (namespaceURI.isEmpty())
         return anyQName();
 
-    return { nullAtom, localName, namespaceURI };
+    return { nullAtom(), localName, namespaceURI };
 }
 
 inline void SVGSMILElement::updateAttributeName()
index e9a9d04..6890065 100644 (file)
@@ -269,7 +269,7 @@ void MockCDMInstance::requestLicense(LicenseType licenseType, const AtomicString
 {
     MockCDMFactory* factory = m_cdm ? m_cdm->factory() : nullptr;
     if (!factory) {
-        callback(SharedBuffer::create(), emptyAtom, false, SuccessValue::Failed);
+        callback(SharedBuffer::create(), emptyAtom(), false, SuccessValue::Failed);
         return;
     }
 
index d967f13..b1432d1 100644 (file)
@@ -89,7 +89,7 @@ void XMLErrors::appendErrorMessage(const String& typeString, TextPosition positi
 
 static inline Ref<Element> createXHTMLParserErrorHeader(Document& document, const String& errorMessages)
 {
-    Ref<Element> reportElement = document.createElement(QualifiedName(nullAtom, "parsererror", xhtmlNamespaceURI), true);
+    Ref<Element> reportElement = document.createElement(QualifiedName(nullAtom(), "parsererror", xhtmlNamespaceURI), true);
 
     Vector<Attribute> reportAttributes;
     reportAttributes.append(Attribute(styleAttr, "display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black"));
index c557e13..8c927bf 100644 (file)
@@ -184,7 +184,7 @@ inline bool nodeMatchesBasicTest(Node& node, Step::Axis axis, const Step::NodeTe
                 if (node.namespaceURI() == XMLNSNames::xmlnsNamespaceURI)
                     return false;
 
-                if (name == starAtom)
+                if (name == starAtom())
                     return namespaceURI.isEmpty() || node.namespaceURI() == namespaceURI;
 
                 return node.localName() == name && node.namespaceURI() == namespaceURI;
@@ -198,7 +198,7 @@ inline bool nodeMatchesBasicTest(Node& node, Step::Axis axis, const Step::NodeTe
             if (!is<Element>(node))
                 return false;
 
-            if (name == starAtom)
+            if (name == starAtom())
                 return namespaceURI.isEmpty() || namespaceURI == node.namespaceURI();
 
             if (is<HTMLDocument>(node.document())) {
@@ -342,7 +342,7 @@ void Step::nodesInAxis(Node& context, NodeSet& nodes) const
             Element& contextElement = downcast<Element>(context);
 
             // Avoid lazily creating attribute nodes for attributes that we do not need anyway.
-            if (m_nodeTest.m_kind == NodeTest::NameTest && m_nodeTest.m_data != starAtom) {
+            if (m_nodeTest.m_kind == NodeTest::NameTest && m_nodeTest.m_data != starAtom()) {
                 auto attr = contextElement.getAttributeNodeNS(m_nodeTest.m_namespaceURI, m_nodeTest.m_data);
                 if (attr && attr->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { // In XPath land, namespace nodes are not accessible on the attribute axis.
                     if (nodeMatches(*attr, AttributeAxis, m_nodeTest)) // Still need to check merged predicates.
index bf827ea..dd73c0c 100644 (file)
@@ -600,9 +600,9 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment& fragment, Element* parent
         Element* element = elemStack.last();
         if (element->hasAttributes()) {
             for (const Attribute& attribute : element->attributesIterator()) {
-                if (attribute.localName() == xmlnsAtom)
+                if (attribute.localName() == xmlnsAtom())
                     m_defaultNamespaceURI = attribute.value();
-                else if (attribute.prefix() == xmlnsAtom)
+                else if (attribute.prefix() == xmlnsAtom())
                     m_prefixToNamespaceMap.set(attribute.localName(), attribute.value());
             }
         }
@@ -695,7 +695,7 @@ static inline bool handleNamespaceAttributes(Vector<Attribute>& prefixedAttribut
 {
     xmlSAX2Namespace* namespaces = reinterpret_cast<xmlSAX2Namespace*>(libxmlNamespaces);
     for (int i = 0; i < numNamespaces; i++) {
-        AtomicString namespaceQName = xmlnsAtom;
+        AtomicString namespaceQName = xmlnsAtom();
         AtomicString namespaceURI = toAtomicString(namespaces[i].uri);
         if (namespaces[i].prefix)
             namespaceQName = "xmlns:" + toString(namespaces[i].prefix);
@@ -725,7 +725,7 @@ static inline bool handleElementAttributes(Vector<Attribute>& prefixedAttributes
         int valueLength = static_cast<int>(attributes[i].end - attributes[i].value);
         AtomicString attrValue = toAtomicString(attributes[i].value, valueLength);
         String attrPrefix = toString(attributes[i].prefix);
-        AtomicString attrURI = attrPrefix.isEmpty() ? nullAtom : toAtomicString(attributes[i].uri);
+        AtomicString attrURI = attrPrefix.isEmpty() ? nullAtom() : toAtomicString(attributes[i].uri);
         AtomicString attrQName = attrPrefix.isEmpty() ? toAtomicString(attributes[i].localname) : attrPrefix + ":" + toString(attributes[i].localname);
 
         auto result = Element::parseAttributeName(attrURI, attrQName);
index 75b67ca..3836bbc 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
+        https://bugs.webkit.org/show_bug.cgi?id=174150
+
+        Reviewed by Mark Lam.
+
+        * DOM/DOM.mm:
+        (lookupElementClass):
+
 2017-07-06  Brady Eidson  <beidson@apple.com>
 
         Add logging to first attempt to use the WebIconDatabase class.
index 0ffa197..b2f0743 100644 (file)
@@ -164,7 +164,7 @@ static Class lookupElementClass(const QualifiedName& tag)
 {
     // Do a special lookup to ignore element prefixes
     if (tag.hasPrefix())
-        return elementClassMap->get(QualifiedName(nullAtom, tag.localName(), tag.namespaceURI()).impl());
+        return elementClassMap->get(QualifiedName(nullAtom(), tag.localName(), tag.namespaceURI()).impl());
     
     return elementClassMap->get(tag.impl());
 }
index 38717a5..0d83c21 100644 (file)
@@ -1,3 +1,15 @@
+2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
+        https://bugs.webkit.org/show_bug.cgi?id=174150
+
+        Reviewed by Mark Lam.
+
+        * TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/TestsController.cpp:
+        (TestWebKitAPI::TestsController::TestsController):
+
 2017-07-06  Lucas Forschler  <lforschler@apple.com>
 
         Enabling uploading archives to S3.
index 11bf359..6b8e05c 100644 (file)
@@ -293,45 +293,45 @@ TEST(StringBuilderTest, ToAtomicStringOnEmpty)
     { // Default constructed.
         StringBuilder builder;
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
     { // With capacity.
         StringBuilder builder;
         builder.reserveCapacity(64);
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
     { // AtomicString constructed from a null string.
         StringBuilder builder;
         builder.append(String());
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
     { // AtomicString constructed from an empty string.
         StringBuilder builder;
         builder.append(emptyString());
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
     { // AtomicString constructed from an empty StringBuilder.
         StringBuilder builder;
         StringBuilder emptyBuilder;
         builder.append(emptyBuilder);
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
     { // AtomicString constructed from an empty char* string.
         StringBuilder builder;
         builder.append("", 0);
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
     { // Cleared StringBuilder.
         StringBuilder builder;
         builder.appendLiteral("WebKit");
         builder.clear();
         AtomicString atomicString = builder.toAtomicString();
-        ASSERT_EQ(emptyAtom, atomicString);
+        ASSERT_EQ(emptyAtom(), atomicString);
     }
 }
 
index 913305d..bc556ed 100644 (file)
@@ -26,7 +26,9 @@
 #include "config.h"
 #include "TestsController.h"
 
+#include <wtf/MainThread.h>
 #include <wtf/Threading.h>
+#include <wtf/text/AtomicString.h>
 
 namespace TestWebKitAPI {
 
@@ -67,6 +69,8 @@ TestsController::TestsController()
     // We should make sure that all objects tested either initialize threading or inherit from
     // ThreadSafeRefCounted so that we don't have to initialize threading at all here.
     WTF::initializeThreading();
+    WTF::initializeMainThread();
+    AtomicString::init();
 }
 
 bool TestsController::run(int argc, char** argv)