⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 293285 in webkit


Ignore:
Timestamp:
Apr 22, 2022, 9:21:25 PM (4 years ago)
Author:
Chris Dumez
Message:

Move global AtomStrings to a common header to promote reuse
https://bugs.webkit.org/show_bug.cgi?id=239585

Reviewed by Geoff Garen and Darin Adler.

Source/WebCore:

  • Headers.cmake:
  • Modules/async-clipboard/Clipboard.cpp:

(WebCore::Clipboard::getType):

  • Modules/mediastream/MediaStreamTrack.cpp:

(WebCore::MediaStreamTrack::contentHint const):
(WebCore::MediaStreamTrack::setContentHint):

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • animation/AnimationEffect.cpp:

(WebCore::AnimationEffect::getTiming const):
(WebCore::AnimationEffect::updateTiming):

  • animation/EffectTiming.h:
  • contentextensions/ContentExtensionParser.cpp:

(WebCore::ContentExtensions::isValidCSSSelector):

  • css/CSSStyleSheet.h:
  • css/FontFace.cpp:

(WebCore::FontFace::display const):

  • css/MediaFeatureNames.cpp:

(WebCore::MediaFeatureNames::init):

  • dom/DataTransfer.cpp:

(WebCore::normalizeType):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::createForInputEvent):
(WebCore::DataTransfer::dropEffect const):

  • dom/Document.cpp:

(WebCore::Document::designMode const):

  • dom/InlineStyleSheetOwner.cpp:

(WebCore::isValidCSSContentType):

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::checkStyleSheet):

  • dom/mac/ImageControlsMac.cpp:
  • editing/FontShadow.cpp:

(WebCore::serializationForCSS):

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):

  • editing/cocoa/DataDetection.mm:
  • editing/cocoa/HTMLConverter.mm:

(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_enterElement):
(HTMLConverter::_processElement):

  • editing/markup.cpp:

(WebCore::createFragmentForTransformToFragment):

  • html/Autocapitalize.cpp:

(WebCore::stringForAutocapitalizeType):

  • html/Autofill.cpp:

(WebCore::AutofillData::createFromHTMLFormControlElement):

  • html/BaseCheckableInputType.cpp:

(WebCore::BaseCheckableInputType::saveFormControlState const):
(WebCore::BaseCheckableInputType::restoreFormControlState):
(WebCore::BaseCheckableInputType::fallbackValue const):

  • html/EnterKeyHint.cpp:

(WebCore::attributeValueForEnterKeyHint):

  • html/HTMLAudioElement.cpp:

(WebCore::HTMLAudioElement::createForLegacyFactoryFunction):

  • html/HTMLButtonElement.cpp:

(WebCore::HTMLButtonElement::formControlType const):

  • html/HTMLElement.cpp:

(WebCore::toValidDirValue):
(WebCore::HTMLElement::contentEditable const):
(WebCore::HTMLElement::setContentEditable):
(WebCore::HTMLElement::setAutocorrect):
(WebCore::plaintextOnlyName): Deleted.

  • html/HTMLFormElement.cpp:

(WebCore::HTMLFormElement::autocomplete const):

  • html/HTMLIFrameElement.cpp:

(WebCore::HTMLIFrameElement::loadingForBindings const):

  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::decoding const):
(WebCore::HTMLImageElement::loadingForBindings const):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::preload const):

  • html/HTMLTextFormControlElement.cpp:

(WebCore::directionString):

  • html/InputMode.cpp:

(WebCore::InputModeNames::none):
(WebCore::InputModeNames::text):
(WebCore::InputModeNames::tel):
(WebCore::InputModeNames::url):
(WebCore::InputModeNames::email):
(WebCore::InputModeNames::search):

  • html/InputTypeNames.cpp:

(WebCore::InputTypeNames::email):
(WebCore::InputTypeNames::reset):
(WebCore::InputTypeNames::search):
(WebCore::InputTypeNames::submit):
(WebCore::InputTypeNames::telephone):
(WebCore::InputTypeNames::text):
(WebCore::InputTypeNames::url):

  • html/shadow/TextControlInnerElements.cpp:

(WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl):

  • html/track/AudioTrack.cpp:

(WebCore::AudioTrack::isValidKind const):
(WebCore::AudioTrack::updateKindFromPrivate):
(WebCore::AudioTrack::alternativeKeyword): Deleted.
(WebCore::AudioTrack::mainKeyword): Deleted.
(WebCore::AudioTrack::commentaryKeyword): Deleted.

  • html/track/AudioTrack.h:
  • html/track/TextTrack.cpp:

(WebCore::TextTrack::TextTrack):
(WebCore::TextTrack::isValidKindKeyword):
(WebCore::TextTrack::kindKeyword const):
(WebCore::TextTrack::subtitlesKeyword): Deleted.
(WebCore::captionsKeyword): Deleted.

  • html/track/TextTrack.h:
  • html/track/VTTCue.cpp:

(WebCore::VTTCue::positionAlign const):
(WebCore::VTTCue::setPositionAlign):
(WebCore::VTTCue::toJSON const):
(WebCore::autoKeyword): Deleted.

  • html/track/VideoTrack.cpp:

(WebCore::VideoTrack::isValidKind const):
(WebCore::VideoTrack::updateKindFromPrivate):
(WebCore::VideoTrack::alternativeKeyword): Deleted.
(WebCore::VideoTrack::captionsKeyword): Deleted.
(WebCore::VideoTrack::mainKeyword): Deleted.
(WebCore::VideoTrack::subtitlesKeyword): Deleted.
(WebCore::VideoTrack::commentaryKeyword): Deleted.

  • html/track/VideoTrack.h:
  • html/track/WebVTTParser.cpp:

(WebCore::WebVTTParser::WebVTTParser):

  • inspector/agents/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):

  • loader/FormSubmission.cpp:

(WebCore::FormSubmission::Attributes::parseEncodingType):

  • loader/NavigationScheduler.cpp:
  • loader/TextResourceDecoder.cpp:

(WebCore::TextResourceDecoder::textFromUTF8):

  • loader/archive/mhtml/MHTMLParser.cpp:

(WebCore::MHTMLParser::addResourceToArchive):

  • loader/cache/CachedCSSStyleSheet.cpp:

(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):

  • mathml/MathMLPresentationElement.cpp:
  • page/CaptionUserPreferencesMediaAF.cpp:

(WebCore::addAudioTrackKindDisplayNameIfNeeded):

  • page/EventSource.cpp:

(WebCore::EventSource::EventSource):

  • page/Page.cpp:

(WebCore::Page::userStyleSheet const):

  • page/PageSerializer.cpp:

(WebCore::PageSerializer::serializeCSSStyleSheet):

  • page/PrintContext.cpp:

(WebCore::PrintContext::pageProperty):

  • page/ProcessWarming.cpp:

(WebCore::ProcessWarming::initializeNames):

  • platform/CommonAtomStrings.cpp: Added.

(WebCore::initializeCommonAtomStrings):

  • platform/CommonAtomStrings.h: Added.

(WebCore::alternativeAtom):
(WebCore::autoAtom):
(WebCore::captionsAtom):
(WebCore::commentaryAtom):
(WebCore::cssContentTypeAtom):
(WebCore::eagerAtom):
(WebCore::emailAtom):
(WebCore::falseAtom):
(WebCore::lazyAtom):
(WebCore::mainAtom):
(WebCore::noneAtom):
(WebCore::offAtom):
(WebCore::onAtom):
(WebCore::plaintextOnlyAtom):
(WebCore::resetAtom):
(WebCore::searchAtom):
(WebCore::submitAtom):
(WebCore::subtitlesAtom):
(WebCore::telAtom):
(WebCore::textAtom):
(WebCore::textPlainContentTypeAtom):
(WebCore::trueAtom):
(WebCore::urlAtom):

  • platform/Pasteboard.cpp:

(WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite):

  • platform/StaticPasteboard.cpp:

(WebCore::StaticPasteboard::writePlainText):

  • platform/animation/Animation.cpp:

(WebCore::Animation::initialName const):

  • platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::load):
(WebCore::textPlain): Deleted.

  • platform/ios/wak/WebCoreThread.mm:

(StartWebThread):

  • platform/network/HTTPParsers.cpp:
  • platform/network/ios/WebCoreURLResponseIOS.h:

(WebCore::shouldUseQuickLookForMIMEType):

  • style/Styleable.cpp:

(WebCore::Styleable::animationListContainsNewlyValidAnimation const):
(WebCore::Styleable::updateCSSAnimations const):

  • svg/SVGAnimateMotionElement.cpp:

(WebCore::SVGAnimateMotionElement::rotateMode const):

  • svg/SVGAnimationElement.cpp:

(WebCore::sumAtom):
(WebCore::SVGAnimationElement::isAdditive const):
(WebCore::SVGAnimationElement::isAccumulated const):

  • svg/SVGFEConvolveMatrixElement.cpp:
  • svg/SVGFEConvolveMatrixElement.h:

(WebCore::SVGPropertyTraits<EdgeModeType>::toString):
(WebCore::SVGPropertyTraits<EdgeModeType>::fromString):

  • svg/SVGMarkerTypes.h:

(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString): Deleted.

  • svg/SVGStyleElement.cpp:

(WebCore::SVGStyleElement::type const):

  • svg/SVGTextPathElement.h:

(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::fromString):

  • svg/animation/SVGSMILElement.cpp:

(WebCore::indefiniteAtom):
(WebCore::SVGSMILElement::parseClockValue):
(WebCore::SVGSMILElement::repeatCount const):

  • svg/properties/SVGPropertyTraits.h:
  • workers/service/context/ServiceWorkerThread.cpp:

(WebCore::m_notificationClient):

  • xml/XPathValue.cpp:

Source/WebKit:

  • GPUProcess/GPUProcess.cpp:

(WebKit::GPUProcess::initializeGPUProcess):

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):

  • Shared/Cocoa/WebKit2InitializeCocoa.mm:

(WebKit::runInitializationCode):

  • Shared/WebKit2Initialize.cpp:

(WebKit::InitializeWebKit2):

  • UIProcess/API/APIContentRuleListStore.cpp:

(API::ContentRuleListStore::compileContentRuleList):

Source/WebKitLegacy/win:

  • WebKitGraphics.cpp:

(makeFont):

Source/WTF:

  • wtf/text/AtomString.cpp:

(WTF::AtomString::init):

  • wtf/text/AtomString.h:

(WTF::xmlnsAtom):
(WTF::trueAtom): Deleted.
(WTF::falseAtom): Deleted.

Tools:

  • TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:

(TestWebKitAPI::makeBackend):

Location:
trunk
Files:
88 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r293279 r293285  
     12022-04-22  Chris Dumez  <cdumez@apple.com>
     2
     3        Move global AtomStrings to a common header to promote reuse
     4        https://bugs.webkit.org/show_bug.cgi?id=239585
     5
     6        Reviewed by Geoff Garen and Darin Adler.
     7
     8        * wtf/text/AtomString.cpp:
     9        (WTF::AtomString::init):
     10        * wtf/text/AtomString.h:
     11        (WTF::xmlnsAtom):
     12        (WTF::trueAtom): Deleted.
     13        (WTF::falseAtom): Deleted.
     14
    1152022-04-22  Diego Pino Garcia  <dpino@igalia.com>
    216
  • trunk/Source/WTF/wtf/text/AtomString.cpp

    r293129 r293285  
    138138WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlAtomData;
    139139WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlnsAtomData;
    140 WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> trueAtomData;
    141 WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> falseAtomData;
    142140
    143141void AtomString::init()
     
    160158        xmlAtomData.constructWithoutAccessCheck("xml", AtomString::ConstructFromLiteral);
    161159        xmlnsAtomData.constructWithoutAccessCheck("xmlns", AtomString::ConstructFromLiteral);
    162         trueAtomData.constructWithoutAccessCheck("true", AtomString::ConstructFromLiteral);
    163         falseAtomData.constructWithoutAccessCheck("false", AtomString::ConstructFromLiteral);
    164160    });
    165161}
  • trunk/Source/WTF/wtf/text/AtomString.h

    r293129 r293285  
    294294extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlAtomData;
    295295extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlnsAtomData;
    296 extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> trueAtomData;
    297 extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> falseAtomData;
    298296
    299297inline const AtomString& nullAtom() { return nullAtomData.get(); }
     
    302300inline const AtomString& xmlAtom() { return xmlAtomData.get(); }
    303301inline const AtomString& xmlnsAtom() { return xmlnsAtomData.get(); }
    304 inline const AtomString& trueAtom() { return trueAtomData.get(); }
    305 inline const AtomString& falseAtom() { return falseAtomData.get(); }
    306302
    307303inline AtomString AtomString::fromUTF8(const char* characters, size_t length)
     
    363359using WTF::nullAtom;
    364360using WTF::emptyAtom;
    365 using WTF::falseAtom;
    366361using WTF::starAtom;
    367 using WTF::trueAtom;
    368362using WTF::xmlAtom;
    369363using WTF::xmlnsAtom;
  • trunk/Source/WebCore/ChangeLog

    r293279 r293285  
     12022-04-22  Chris Dumez  <cdumez@apple.com>
     2
     3        Move global AtomStrings to a common header to promote reuse
     4        https://bugs.webkit.org/show_bug.cgi?id=239585
     5
     6        Reviewed by Geoff Garen and Darin Adler.
     7
     8        * Headers.cmake:
     9        * Modules/async-clipboard/Clipboard.cpp:
     10        (WebCore::Clipboard::getType):
     11        * Modules/mediastream/MediaStreamTrack.cpp:
     12        (WebCore::MediaStreamTrack::contentHint const):
     13        (WebCore::MediaStreamTrack::setContentHint):
     14        * Sources.txt:
     15        * WebCore.xcodeproj/project.pbxproj:
     16        * animation/AnimationEffect.cpp:
     17        (WebCore::AnimationEffect::getTiming const):
     18        (WebCore::AnimationEffect::updateTiming):
     19        * animation/EffectTiming.h:
     20        * contentextensions/ContentExtensionParser.cpp:
     21        (WebCore::ContentExtensions::isValidCSSSelector):
     22        * css/CSSStyleSheet.h:
     23        * css/FontFace.cpp:
     24        (WebCore::FontFace::display const):
     25        * css/MediaFeatureNames.cpp:
     26        (WebCore::MediaFeatureNames::init):
     27        * dom/DataTransfer.cpp:
     28        (WebCore::normalizeType):
     29        (WebCore::DataTransfer::setDataFromItemList):
     30        (WebCore::DataTransfer::createForInputEvent):
     31        (WebCore::DataTransfer::dropEffect const):
     32        * dom/Document.cpp:
     33        (WebCore::Document::designMode const):
     34        * dom/InlineStyleSheetOwner.cpp:
     35        (WebCore::isValidCSSContentType):
     36        * dom/ProcessingInstruction.cpp:
     37        (WebCore::ProcessingInstruction::checkStyleSheet):
     38        * dom/mac/ImageControlsMac.cpp:
     39        * editing/FontShadow.cpp:
     40        (WebCore::serializationForCSS):
     41        * editing/ReplaceSelectionCommand.cpp:
     42        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
     43        * editing/cocoa/DataDetection.mm:
     44        * editing/cocoa/HTMLConverter.mm:
     45        (HTMLConverterCaches::propertyValueForNode):
     46        (HTMLConverter::computedAttributesForElement):
     47        (HTMLConverter::_enterElement):
     48        (HTMLConverter::_processElement):
     49        * editing/markup.cpp:
     50        (WebCore::createFragmentForTransformToFragment):
     51        * html/Autocapitalize.cpp:
     52        (WebCore::stringForAutocapitalizeType):
     53        * html/Autofill.cpp:
     54        (WebCore::AutofillData::createFromHTMLFormControlElement):
     55        * html/BaseCheckableInputType.cpp:
     56        (WebCore::BaseCheckableInputType::saveFormControlState const):
     57        (WebCore::BaseCheckableInputType::restoreFormControlState):
     58        (WebCore::BaseCheckableInputType::fallbackValue const):
     59        * html/EnterKeyHint.cpp:
     60        (WebCore::attributeValueForEnterKeyHint):
     61        * html/HTMLAudioElement.cpp:
     62        (WebCore::HTMLAudioElement::createForLegacyFactoryFunction):
     63        * html/HTMLButtonElement.cpp:
     64        (WebCore::HTMLButtonElement::formControlType const):
     65        * html/HTMLElement.cpp:
     66        (WebCore::toValidDirValue):
     67        (WebCore::HTMLElement::contentEditable const):
     68        (WebCore::HTMLElement::setContentEditable):
     69        (WebCore::HTMLElement::setAutocorrect):
     70        (WebCore::plaintextOnlyName): Deleted.
     71        * html/HTMLFormElement.cpp:
     72        (WebCore::HTMLFormElement::autocomplete const):
     73        * html/HTMLIFrameElement.cpp:
     74        (WebCore::HTMLIFrameElement::loadingForBindings const):
     75        * html/HTMLImageElement.cpp:
     76        (WebCore::HTMLImageElement::decoding const):
     77        (WebCore::HTMLImageElement::loadingForBindings const):
     78        * html/HTMLMediaElement.cpp:
     79        (WebCore::HTMLMediaElement::preload const):
     80        * html/HTMLTextFormControlElement.cpp:
     81        (WebCore::directionString):
     82        * html/InputMode.cpp:
     83        (WebCore::InputModeNames::none):
     84        (WebCore::InputModeNames::text):
     85        (WebCore::InputModeNames::tel):
     86        (WebCore::InputModeNames::url):
     87        (WebCore::InputModeNames::email):
     88        (WebCore::InputModeNames::search):
     89        * html/InputTypeNames.cpp:
     90        (WebCore::InputTypeNames::email):
     91        (WebCore::InputTypeNames::reset):
     92        (WebCore::InputTypeNames::search):
     93        (WebCore::InputTypeNames::submit):
     94        (WebCore::InputTypeNames::telephone):
     95        (WebCore::InputTypeNames::text):
     96        (WebCore::InputTypeNames::url):
     97        * html/shadow/TextControlInnerElements.cpp:
     98        (WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl):
     99        * html/track/AudioTrack.cpp:
     100        (WebCore::AudioTrack::isValidKind const):
     101        (WebCore::AudioTrack::updateKindFromPrivate):
     102        (WebCore::AudioTrack::alternativeKeyword): Deleted.
     103        (WebCore::AudioTrack::mainKeyword): Deleted.
     104        (WebCore::AudioTrack::commentaryKeyword): Deleted.
     105        * html/track/AudioTrack.h:
     106        * html/track/TextTrack.cpp:
     107        (WebCore::TextTrack::TextTrack):
     108        (WebCore::TextTrack::isValidKindKeyword):
     109        (WebCore::TextTrack::kindKeyword const):
     110        (WebCore::TextTrack::subtitlesKeyword): Deleted.
     111        (WebCore::captionsKeyword): Deleted.
     112        * html/track/TextTrack.h:
     113        * html/track/VTTCue.cpp:
     114        (WebCore::VTTCue::positionAlign const):
     115        (WebCore::VTTCue::setPositionAlign):
     116        (WebCore::VTTCue::toJSON const):
     117        (WebCore::autoKeyword): Deleted.
     118        * html/track/VideoTrack.cpp:
     119        (WebCore::VideoTrack::isValidKind const):
     120        (WebCore::VideoTrack::updateKindFromPrivate):
     121        (WebCore::VideoTrack::alternativeKeyword): Deleted.
     122        (WebCore::VideoTrack::captionsKeyword): Deleted.
     123        (WebCore::VideoTrack::mainKeyword): Deleted.
     124        (WebCore::VideoTrack::subtitlesKeyword): Deleted.
     125        (WebCore::VideoTrack::commentaryKeyword): Deleted.
     126        * html/track/VideoTrack.h:
     127        * html/track/WebVTTParser.cpp:
     128        (WebCore::WebVTTParser::WebVTTParser):
     129        * inspector/agents/InspectorCSSAgent.cpp:
     130        (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
     131        * loader/FormSubmission.cpp:
     132        (WebCore::FormSubmission::Attributes::parseEncodingType):
     133        * loader/NavigationScheduler.cpp:
     134        * loader/TextResourceDecoder.cpp:
     135        (WebCore::TextResourceDecoder::textFromUTF8):
     136        * loader/archive/mhtml/MHTMLParser.cpp:
     137        (WebCore::MHTMLParser::addResourceToArchive):
     138        * loader/cache/CachedCSSStyleSheet.cpp:
     139        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
     140        * mathml/MathMLPresentationElement.cpp:
     141        * page/CaptionUserPreferencesMediaAF.cpp:
     142        (WebCore::addAudioTrackKindDisplayNameIfNeeded):
     143        * page/EventSource.cpp:
     144        (WebCore::EventSource::EventSource):
     145        * page/Page.cpp:
     146        (WebCore::Page::userStyleSheet const):
     147        * page/PageSerializer.cpp:
     148        (WebCore::PageSerializer::serializeCSSStyleSheet):
     149        * page/PrintContext.cpp:
     150        (WebCore::PrintContext::pageProperty):
     151        * page/ProcessWarming.cpp:
     152        (WebCore::ProcessWarming::initializeNames):
     153        * platform/CommonAtomStrings.cpp: Added.
     154        (WebCore::initializeCommonAtomStrings):
     155        * platform/CommonAtomStrings.h: Added.
     156        (WebCore::alternativeAtom):
     157        (WebCore::autoAtom):
     158        (WebCore::captionsAtom):
     159        (WebCore::commentaryAtom):
     160        (WebCore::cssContentTypeAtom):
     161        (WebCore::eagerAtom):
     162        (WebCore::emailAtom):
     163        (WebCore::falseAtom):
     164        (WebCore::lazyAtom):
     165        (WebCore::mainAtom):
     166        (WebCore::noneAtom):
     167        (WebCore::offAtom):
     168        (WebCore::onAtom):
     169        (WebCore::plaintextOnlyAtom):
     170        (WebCore::resetAtom):
     171        (WebCore::searchAtom):
     172        (WebCore::submitAtom):
     173        (WebCore::subtitlesAtom):
     174        (WebCore::telAtom):
     175        (WebCore::textAtom):
     176        (WebCore::textPlainContentTypeAtom):
     177        (WebCore::trueAtom):
     178        (WebCore::urlAtom):
     179        * platform/Pasteboard.cpp:
     180        (WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite):
     181        * platform/StaticPasteboard.cpp:
     182        (WebCore::StaticPasteboard::writePlainText):
     183        * platform/animation/Animation.cpp:
     184        (WebCore::Animation::initialName const):
     185        * platform/graphics/MediaPlayer.cpp:
     186        (WebCore::MediaPlayer::load):
     187        (WebCore::textPlain): Deleted.
     188        * platform/ios/wak/WebCoreThread.mm:
     189        (StartWebThread):
     190        * platform/network/HTTPParsers.cpp:
     191        * platform/network/ios/WebCoreURLResponseIOS.h:
     192        (WebCore::shouldUseQuickLookForMIMEType):
     193        * style/Styleable.cpp:
     194        (WebCore::Styleable::animationListContainsNewlyValidAnimation const):
     195        (WebCore::Styleable::updateCSSAnimations const):
     196        * svg/SVGAnimateMotionElement.cpp:
     197        (WebCore::SVGAnimateMotionElement::rotateMode const):
     198        * svg/SVGAnimationElement.cpp:
     199        (WebCore::sumAtom):
     200        (WebCore::SVGAnimationElement::isAdditive const):
     201        (WebCore::SVGAnimationElement::isAccumulated const):
     202        * svg/SVGFEConvolveMatrixElement.cpp:
     203        * svg/SVGFEConvolveMatrixElement.h:
     204        (WebCore::SVGPropertyTraits<EdgeModeType>::toString):
     205        (WebCore::SVGPropertyTraits<EdgeModeType>::fromString):
     206        * svg/SVGMarkerTypes.h:
     207        (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
     208        (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString):
     209        (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString): Deleted.
     210        * svg/SVGStyleElement.cpp:
     211        (WebCore::SVGStyleElement::type const):
     212        * svg/SVGTextPathElement.h:
     213        (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
     214        (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::fromString):
     215        * svg/animation/SVGSMILElement.cpp:
     216        (WebCore::indefiniteAtom):
     217        (WebCore::SVGSMILElement::parseClockValue):
     218        (WebCore::SVGSMILElement::repeatCount const):
     219        * svg/properties/SVGPropertyTraits.h:
     220        * workers/service/context/ServiceWorkerThread.cpp:
     221        (WebCore::m_notificationClient):
     222        * xml/XPathValue.cpp:
     223
    12242022-04-22  Diego Pino Garcia  <dpino@igalia.com>
    2225
  • trunk/Source/WebCore/Headers.cmake

    r293251 r293285  
    12431243    platform/ColorChooser.h
    12441244    platform/ColorChooserClient.h
     1245    platform/CommonAtomStrings.h
    12451246    platform/ContentFilterUnblockHandler.h
    12461247    platform/ContentType.h
  • trunk/Source/WebCore/Modules/async-clipboard/Clipboard.cpp

    r290026 r293285  
    2929#include "ClipboardImageReader.h"
    3030#include "ClipboardItem.h"
     31#include "CommonAtomStrings.h"
    3132#include "Document.h"
    3233#include "Editor.h"
     
    235236    }
    236237
    237     if (type == "text/plain"_s) {
     238    if (type == textPlainContentTypeAtom()) {
    238239        PasteboardPlainText plainTextReader;
    239240        activePasteboard().read(plainTextReader, PlainTextURLReadingPolicy::IgnoreURL, itemIndex);
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp

    r292027 r293285  
    3131#if ENABLE(MEDIA_STREAM)
    3232
     33#include "CommonAtomStrings.h"
    3334#include "Document.h"
    3435#include "Event.h"
     
    137138    static MainThreadNeverDestroyed<const AtomString> musicHint("music", AtomString::ConstructFromLiteral);
    138139    static MainThreadNeverDestroyed<const AtomString> detailHint("detail", AtomString::ConstructFromLiteral);
    139     static MainThreadNeverDestroyed<const AtomString> textHint("text", AtomString::ConstructFromLiteral);
    140140    static MainThreadNeverDestroyed<const AtomString> motionHint("motion", AtomString::ConstructFromLiteral);
    141141
     
    152152        return detailHint;
    153153    case MediaStreamTrackPrivate::HintValue::Text:
    154         return textHint;
     154        return textAtom();
    155155    default:
    156156        return emptyAtom();
     
    177177        else if (hintValue == "motion")
    178178            value = MediaStreamTrackPrivate::HintValue::Motion;
    179         else if (hintValue == "text")
     179        else if (hintValue == textAtom())
    180180            value = MediaStreamTrackPrivate::HintValue::Text;
    181181        else
  • trunk/Source/WebCore/Sources.txt

    r293251 r293285  
    18691869page/scrolling/ScrollingTreeStickyNode.cpp
    18701870page/scrolling/ThreadedScrollingTree.cpp
     1871platform/CommonAtomStrings.cpp
    18711872platform/ContentType.cpp
    18721873platform/ContextMenu.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r293251 r293285  
    27342734                839AAFED1A0C0C8D00605F99 /* HTMLWBRElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */; };
    27352735                839BE6D524F58762004DF50F /* IIRFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 839BE6D224F58755004DF50F /* IIRFilter.h */; };
     2736                839C69D02810D11D00E69BAD /* CommonAtomStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 839C69CE2810D11C00E69BAD /* CommonAtomStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
    27362737                83A2ABDB24D86DE000E2D73D /* DelayOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A2ABD824D86DC600E2D73D /* DelayOptions.h */; };
    27372738                83A8AC401FABBFE5002064AC /* ServiceWorkerIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A8AC3E1FABBFD1002064AC /* ServiceWorkerIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1230812309                839BE6D224F58755004DF50F /* IIRFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IIRFilter.h; sourceTree = "<group>"; };
    1230912310                839BE6D424F58755004DF50F /* IIRFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IIRFilter.cpp; sourceTree = "<group>"; };
     12311                839C69CD2810D11C00E69BAD /* CommonAtomStrings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonAtomStrings.cpp; sourceTree = "<group>"; };
     12312                839C69CE2810D11C00E69BAD /* CommonAtomStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonAtomStrings.h; sourceTree = "<group>"; };
    1231012313                83A2ABD824D86DC600E2D73D /* DelayOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DelayOptions.h; sourceTree = "<group>"; };
    1231112314                83A2ABDA24D86DC700E2D73D /* DelayOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DelayOptions.idl; sourceTree = "<group>"; };
     
    3018230185                                C37CDEBC149EF2030042090D /* ColorChooserClient.h */,
    3018330186                                BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */,
     30187                                839C69CD2810D11C00E69BAD /* CommonAtomStrings.cpp */,
     30188                                839C69CE2810D11C00E69BAD /* CommonAtomStrings.h */,
    3018430189                                A14090FC1AA51E480091191A /* ContentFilterUnblockHandler.h */,
    3018530190                                41D015C90F4B5C71004A662F /* ContentType.cpp */,
     
    3408134086                                A584FE2618637DAB00843B10 /* CommandLineAPIModuleSource.h in Headers */,
    3408234087                                6550B6A2099DF0270090D781 /* Comment.h in Headers */,
     34088                                839C69D02810D11D00E69BAD /* CommonAtomStrings.h in Headers */,
    3408334089                                57E664FC1E73703300765536 /* CommonCryptoDERUtilities.h in Headers */,
    3408434090                                E1FE137518402A6700892F13 /* CommonCryptoUtilities.h in Headers */,
  • trunk/Source/WebCore/animation/AnimationEffect.cpp

    r291863 r293285  
    2828
    2929#include "CSSAnimation.h"
     30#include "CommonAtomStrings.h"
    3031#include "FillMode.h"
    3132#include "JSComputedEffectTiming.h"
     
    7071    timing.iterations = m_iterations;
    7172    if (m_iterationDuration == 0_s)
    72         timing.duration = "auto"_s;
     73        timing.duration = autoAtom();
    7374    else
    7475        timing.duration = secondsToWebAnimationsAPITime(m_iterationDuration);
     
    400401                return Exception { TypeError };
    401402        } else {
    402             if (std::get<String>(timing->duration.value()) != "auto")
     403            if (std::get<String>(timing->duration.value()) != autoAtom())
    403404                return Exception { TypeError };
    404405        }
  • trunk/Source/WebCore/animation/EffectTiming.h

    r291863 r293285  
    2626#pragma once
    2727
     28#include "CommonAtomStrings.h"
    2829#include "FillMode.h"
    2930#include "PlaybackDirection.h"
     
    3435
    3536struct EffectTiming {
    36     std::variant<double, String> duration { "auto"_s };
     37    std::variant<double, String> duration { autoAtom() };
    3738    double delay { 0 };
    3839    double endDelay { 0 };
  • trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp

    r293056 r293285  
    3131#include "CSSParser.h"
    3232#include "CSSSelectorList.h"
     33#include "CommonAtomStrings.h"
    3334#include "ContentExtensionError.h"
    3435#include "ContentExtensionRule.h"
     
    204205{
    205206    ASSERT(isMainThread());
    206     AtomString::init();
     207    initializeCommonAtomStrings();
    207208    QualifiedName::init();
    208209    CSSParserContext context(HTMLQuirksMode);
  • trunk/Source/WebCore/css/CSSStyleSheet.h

    r293232 r293285  
    2222
    2323#include "CSSRuleList.h"
     24#include "CommonAtomStrings.h"
    2425#include "ExceptionOr.h"
    2526#include "StyleSheet.h"
     
    140141
    141142    bool isCSSStyleSheet() const final { return true; }
    142     String type() const final { return "text/css"_s; }
     143    String type() const final { return cssContentTypeAtom(); }
    143144
    144145    Ref<StyleSheetContents> m_contents;
  • trunk/Source/WebCore/css/FontFace.cpp

    r291863 r293285  
    406406    const auto& loadingBehaviorWrapped = m_backing->loadingBehavior();
    407407    if (!loadingBehaviorWrapped)
    408         return "auto"_s;
     408        return autoAtom();
    409409    return context.cssValuePool().createValue(loadingBehaviorWrapped.value())->cssText();
    410410}
  • trunk/Source/WebCore/css/MediaFeatureNames.cpp

    r246490 r293285  
    2222#include "MediaFeatureNames.h"
    2323
     24#include "CommonAtomStrings.h"
     25
    2426namespace WebCore {
    2527namespace MediaFeatureNames {
     
    3335    static bool initialized;
    3436    if (!initialized) {
    35         AtomString::init();
     37        initializeCommonAtomStrings();
    3638#define INITIALIZE_GLOBAL(name, string) name.construct(string, AtomString::ConstructFromLiteral);
    3739        CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(INITIALIZE_GLOBAL)
  • trunk/Source/WebCore/dom/DataTransfer.cpp

    r292487 r293285  
    2929#include "CachedImage.h"
    3030#include "CachedImageClient.h"
     31#include "CommonAtomStrings.h"
    3132#include "DataTransferItem.h"
    3233#include "DataTransferItemList.h"
     
    128129    String lowercaseType = stripLeadingAndTrailingHTMLSpaces(type).convertToASCIILowercase();
    129130    if (lowercaseType == "text" || lowercaseType.startsWith("text/plain;"))
    130         return "text/plain"_s;
     131        return textPlainContentTypeAtom();
    131132    if (lowercaseType == "url" || lowercaseType.startsWith("text/uri-list;"))
    132133        return "text/uri-list"_s;
     
    266267        if (url.isValid())
    267268            sanitizedData = url.string();
    268     } else if (type == "text/plain")
     269    } else if (type == textPlainContentTypeAtom())
    269270        sanitizedData = data; // Nothing to sanitize.
    270271
     
    429430{
    430431    auto pasteboard = makeUnique<StaticPasteboard>();
    431     pasteboard->writeString("text/plain"_s, plainText);
     432    pasteboard->writeString(textPlainContentTypeAtom(), plainText);
    432433    pasteboard->writeString("text/html"_s, htmlText);
    433434    return adoptRef(*new DataTransfer(StoreMode::Readonly, WTFMove(pasteboard), Type::InputEvent));
     
    468469String DataTransfer::dropEffect() const
    469470{
    470     return "none"_s;
     471    return noneAtom();
    471472}
    472473
  • trunk/Source/WebCore/dom/Document.cpp

    r293202 r293285  
    4747#include "ChromeClient.h"
    4848#include "Comment.h"
     49#include "CommonAtomStrings.h"
    4950#include "CommonVM.h"
    5051#include "ComposedTreeIterator.h"
     
    60106011String Document::designMode() const
    60116012{
    6012     return inDesignMode() ? "on"_s : "off"_s;
     6013    return inDesignMode() ? onAtom() : offAtom();
    60136014}
    60146015
  • trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp

    r288617 r293285  
    2222#include "InlineStyleSheetOwner.h"
    2323
     24#include "CommonAtomStrings.h"
    2425#include "ContentSecurityPolicy.h"
    2526#include "ElementInlines.h"
     
    152153    // even though other things are case sensitive in that context. MIME types should never be case sensitive.
    153154    // We should verify this and then remove the isHTMLElement check here.
    154     static MainThreadNeverDestroyed<const AtomString> cssContentType("text/css", AtomString::ConstructFromLiteral);
    155     return element.isHTMLElement() ? equalLettersIgnoringASCIICase(type, "text/css") : type == cssContentType;
     155    return element.isHTMLElement() ? equalLettersIgnoringASCIICase(type, "text/css") : type == cssContentTypeAtom();
    156156}
    157157
  • trunk/Source/WebCore/dom/ProcessingInstruction.cpp

    r293059 r293285  
    2828#include "CachedResourceRequest.h"
    2929#include "CachedXSLStyleSheet.h"
     30#include "CommonAtomStrings.h"
    3031#include "DocumentInlines.h"
    3132#include "Frame.h"
     
    9596        String type = attributes->get<HashTranslatorASCIILiteral>("type"_s);
    9697
    97         m_isCSS = type.isEmpty() || type == "text/css";
     98        m_isCSS = type.isEmpty() || type == cssContentTypeAtom();
    9899#if ENABLE(XSLT)
    99100        m_isXSL = type == "text/xml" || type == "text/xsl" || type == "application/xml" || type == "application/xhtml+xml" || type == "application/rss+xml" || type == "application/atom+xml";
  • trunk/Source/WebCore/dom/mac/ImageControlsMac.cpp

    r293129 r293285  
    2929#include "Chrome.h"
    3030#include "ChromeClient.h"
     31#include "CommonAtomStrings.h"
    3132#include "ContextMenuController.h"
    3233#include "ElementInlines.h"
  • trunk/Source/WebCore/editing/FontShadow.cpp

    r286630 r293285  
    2828
    2929#include "ColorSerialization.h"
     30#include "CommonAtomStrings.h"
    3031#include <wtf/text/StringBuilder.h>
    3132
     
    3536{
    3637    if (shadow.offset.isZero() && !shadow.blurRadius)
    37         return "none"_s;
     38        return noneAtom();
    3839
    3940    if (!shadow.color.isValid())
    40         return "none"_s;
     41        return noneAtom();
    4142
    4243    StringBuilder builder;
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r293059 r293285  
    3434#include "CSSComputedStyleDeclaration.h"
    3535#include "CSSStyleDeclaration.h"
     36#include "CommonAtomStrings.h"
    3637#include "DOMWrapperWorld.h"
    3738#include "DataTransfer.h"
     
    719720                element->cssomStyle().setPropertyInternal(CSSPropertyDisplay, "inline"_s, false);
    720721            if (element->renderer() && element->renderer()->style().isFloating())
    721                 element->cssomStyle().setPropertyInternal(CSSPropertyFloat, "none"_s, false);
     722                element->cssomStyle().setPropertyInternal(CSSPropertyFloat, noneAtom(), false);
    722723        }
    723724    }
  • trunk/Source/WebCore/editing/cocoa/DataDetection.mm

    r293129 r293285  
    3333#import "ColorConversion.h"
    3434#import "ColorSerialization.h"
     35#import "CommonAtomStrings.h"
    3536#import "DataDetectionResultsStorage.h"
    3637#import "Editing.h"
  • trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm

    r293042 r293285  
    3535#import "ColorCocoa.h"
    3636#import "ColorMac.h"
     37#import "CommonAtomStrings.h"
    3738#import "ComposedTreeIterator.h"
    3839#import "Document.h"
     
    598599    case CSSPropertyDisplay:
    599600        if (element.hasTagName(headTag) || element.hasTagName(scriptTag) || element.hasTagName(appletTag) || element.hasTagName(noframesTag))
    600             return "none"_s;
     601            return noneAtom();
    601602        else if (element.hasTagName(addressTag) || element.hasTagName(blockquoteTag) || element.hasTagName(bodyTag) || element.hasTagName(centerTag)
    602603             || element.hasTagName(ddTag) || element.hasTagName(dirTag) || element.hasTagName(divTag) || element.hasTagName(dlTag)
     
    10181019    String letterSpacing = _caches->propertyValueForNode(element, CSSPropertyLetterSpacing);
    10191020    if (fontKerning.length() || letterSpacing.length()) {
    1020         if (fontKerning == "none")
     1021        if (fontKerning == noneAtom())
    10211022            [attrs setObject:@0.0 forKey:NSKernAttributeName];
    10221023        else {
     
    11111112        String hyphenation = _caches->propertyValueForNode(coreBlockElement, CSSPropertyWebkitHyphens);
    11121113        if (hyphenation.length()) {
    1113             if (hyphenation == "auto")
     1114            if (hyphenation == autoAtom())
    11141115                [paragraphStyle setHyphenationFactor:1.0];
    11151116            else
     
    16111612    if (element.hasTagName(headTag) && !embedded)
    16121613        _processHeadElement(element);
    1613     else if (!displayValue.length() || !(displayValue == "none" || displayValue == "table-column" || displayValue == "table-column-group")) {
     1614    else if (!displayValue.length() || !(displayValue == noneAtom() || displayValue == "table-column" || displayValue == "table-column-group")) {
    16141615        if (_caches->isBlockElement(element) && !element.hasTagName(brTag) && !(displayValue == "table-cell" && [_textTables count] == 0)
    16151616            && !([_textLists count] > 0 && displayValue == "block" && !element.hasTagName(liTag) && !element.hasTagName(ulTag) && !element.hasTagName(olTag)))
     
    18661867        if (is<HTMLInputElement>(element)) {
    18671868            HTMLInputElement& inputElement = downcast<HTMLInputElement>(element);
    1868             if (inputElement.type() == "text") {
     1869            if (inputElement.type() == textAtom()) {
    18691870                NSString *value = inputElement.value();
    18701871                if (value && [value length] > 0)
  • trunk/Source/WebCore/editing/markup.cpp

    r293059 r293285  
    3838#include "ChildListMutationScope.h"
    3939#include "Comment.h"
     40#include "CommonAtomStrings.h"
    4041#include "ComposedTreeIterator.h"
    4142#include "DocumentFragment.h"
     
    12861287        auto fakeBody = HTMLBodyElement::create(outputDoc);
    12871288        fragment->parseHTML(WTFMove(sourceString), fakeBody.ptr());
    1288     } else if (sourceMIMEType == "text/plain")
     1289    } else if (sourceMIMEType == textPlainContentTypeAtom())
    12891290        fragment->parserAppendChild(Text::create(outputDoc, WTFMove(sourceString)));
    12901291    else {
  • trunk/Source/WebCore/html/Autocapitalize.cpp

    r262665 r293285  
    2929#if ENABLE(AUTOCAPITALIZE)
    3030
     31#include "CommonAtomStrings.h"
    3132#include <wtf/NeverDestroyed.h>
    3233
     
    5758    case AutocapitalizeType::Default:
    5859        return nullAtom();
    59     case AutocapitalizeType::None: {
    60         static MainThreadNeverDestroyed<const AtomString> valueNone("none", AtomString::ConstructFromLiteral);
    61         return valueNone;
    62     }
     60    case AutocapitalizeType::None:
     61        return noneAtom();
    6362    case AutocapitalizeType::Sentences: {
    6463        static MainThreadNeverDestroyed<const AtomString> valueSentences("sentences", AtomString::ConstructFromLiteral);
  • trunk/Source/WebCore/html/Autofill.cpp

    r292963 r293285  
    2727#include "Autofill.h"
    2828
     29#include "CommonAtomStrings.h"
    2930#include "ElementInlines.h"
    3031#include "HTMLFormControlElement.h"
     
    137138AutofillData AutofillData::createFromHTMLFormControlElement(const HTMLFormControlElement& element)
    138139{
    139     static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
    140     static MainThreadNeverDestroyed<const AtomString> off("off", AtomString::ConstructFromLiteral);
    141 
    142140    // Label: Default
    143141    // 26. Let the element's IDL-exposed autofill value be the empty string, and its autofill hint set and autofill scope be empty.
     
    150148       
    151149        auto form = element.form();
    152         if (form && form->autocomplete() == off)
    153             return { off, emptyString() };
    154         return { on, emptyString() };
     150        if (form && form->autocomplete() == offAtom())
     151            return { offAtom(), emptyString() };
     152        return { onAtom(), emptyString() };
    155153    };
    156154
     
    200198    // Then, abort these steps.
    201199    if (category == AutofillCategory::Off)
    202         return { off, off.get().string() };
     200        return { offAtom(), offAtom().string() };
    203201
    204202    // 8. If category is Automatic, let the element's autofill field name be the string "on",
     
    206204    // "on". Then, abort these steps.
    207205    if (category == AutofillCategory::Automatic)
    208         return { on, on.get().string() };
     206        return { onAtom(), onAtom().string() };
    209207
    210208    // 9. Let scope tokens be an empty list.
  • trunk/Source/WebCore/html/BaseCheckableInputType.cpp

    r291396 r293285  
    3333#include "BaseCheckableInputType.h"
    3434
     35#include "CommonAtomStrings.h"
    3536#include "DOMFormData.h"
    3637#include "FormController.h"
     
    4748{
    4849    ASSERT(element());
    49     return { element()->checked() ? "on"_s : "off"_s };
     50    return { element()->checked() ? onAtom() : offAtom() };
    5051}
    5152
     
    5354{
    5455    ASSERT(element());
    55     element()->setChecked(state[0] == "on");
     56    element()->setChecked(state[0] == onAtom());
    5657}
    5758
     
    100101String BaseCheckableInputType::fallbackValue() const
    101102{
    102     static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
    103     return on.get();
     103    return onAtom();
    104104}
    105105
  • trunk/Source/WebCore/html/EnterKeyHint.cpp

    r291992 r293285  
    2626#include "config.h"
    2727#include "EnterKeyHint.h"
     28
     29#include "CommonAtomStrings.h"
    2830
    2931namespace WebCore {
     
    6466        return "previous"_s;
    6567    case EnterKeyHint::Search:
    66         return "search"_s;
     68        return searchAtom();
    6769    case EnterKeyHint::Send:
    6870        return "send"_s;
  • trunk/Source/WebCore/html/HTMLAudioElement.cpp

    r292810 r293285  
    3030#include "HTMLAudioElement.h"
    3131
     32#include "CommonAtomStrings.h"
    3233#include "HTMLNames.h"
    3334#include <wtf/IsoMallocInlines.h>
     
    5556{
    5657    auto element = create(audioTag, document, false);
    57     element->setAttributeWithoutSynchronization(preloadAttr, "auto"_s);
     58    element->setAttributeWithoutSynchronization(preloadAttr, autoAtom());
    5859    element->setAttributeWithoutSynchronization(srcAttr, src);
    5960    return element;
  • trunk/Source/WebCore/html/HTMLButtonElement.cpp

    r292960 r293285  
    2727#include "HTMLButtonElement.h"
    2828
     29#include "CommonAtomStrings.h"
    2930#include "DOMFormData.h"
    3031#include "ElementInlines.h"
     
    8384{
    8485    switch (m_type) {
    85         case SUBMIT: {
    86             static MainThreadNeverDestroyed<const AtomString> submit("submit", AtomString::ConstructFromLiteral);
    87             return submit;
    88         }
    89         case BUTTON:
    90             return HTMLNames::buttonTag->localName();
    91         case RESET: {
    92             static MainThreadNeverDestroyed<const AtomString> reset("reset", AtomString::ConstructFromLiteral);
    93             return reset;
    94         }
     86    case SUBMIT:
     87        return submitAtom();
     88    case BUTTON:
     89        return HTMLNames::buttonTag->localName();
     90    case RESET:
     91        return resetAtom();
    9592    }
    9693
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r293129 r293285  
    3333#include "Chrome.h"
    3434#include "ChromeClient.h"
     35#include "CommonAtomStrings.h"
    3536#include "DOMTokenList.h"
    3637#include "DocumentFragment.h"
     
    416417    static MainThreadNeverDestroyed<const AtomString> ltrValue("ltr", AtomString::ConstructFromLiteral);
    417418    static MainThreadNeverDestroyed<const AtomString> rtlValue("rtl", AtomString::ConstructFromLiteral);
    418     static MainThreadNeverDestroyed<const AtomString> autoValue("auto", AtomString::ConstructFromLiteral);
    419419    if (equalLettersIgnoringASCIICase(value, "ltr"))
    420420        return ltrValue;
     
    422422        return rtlValue;
    423423    if (equalLettersIgnoringASCIICase(value, "auto"))
    424         return autoValue;
     424        return autoAtom();
    425425    return nullAtom();
    426426}
     
    579579        return falseAtom();
    580580    case ContentEditableType::PlaintextOnly:
    581         return "plaintext-only"_s;
     581        return plaintextOnlyAtom();
    582582    }
    583583    return "inherit"_s;
    584 }
    585 
    586 static const AtomString& plaintextOnlyName()
    587 {
    588     static MainThreadNeverDestroyed<const AtomString> plaintextOnlyValue("plaintext-only", AtomString::ConstructFromLiteral);
    589     return plaintextOnlyValue.get();
    590584}
    591585
     
    597591        setAttributeWithoutSynchronization(contenteditableAttr, falseAtom());
    598592    else if (equalLettersIgnoringASCIICase(enabled, "plaintext-only"))
    599         setAttributeWithoutSynchronization(contenteditableAttr, plaintextOnlyName());
     593        setAttributeWithoutSynchronization(contenteditableAttr, plaintextOnlyAtom());
    600594    else if (equalLettersIgnoringASCIICase(enabled, "inherit"))
    601595        removeAttribute(contenteditableAttr);
     
    10651059void HTMLElement::setAutocorrect(bool autocorrect)
    10661060{
    1067     static MainThreadNeverDestroyed<const AtomString> onName("on", AtomString::ConstructFromLiteral);
    1068     static MainThreadNeverDestroyed<const AtomString> offName("off", AtomString::ConstructFromLiteral);
    1069     setAttributeWithoutSynchronization(autocorrectAttr, autocorrect ? onName.get() : offName.get());
     1061    setAttributeWithoutSynchronization(autocorrectAttr, autocorrect ? onAtom() : offAtom());
    10701062}
    10711063
  • trunk/Source/WebCore/html/HTMLFormElement.cpp

    r292960 r293285  
    2626#include "HTMLFormElement.h"
    2727
     28#include "CommonAtomStrings.h"
    2829#include "DOMFormData.h"
    2930#include "DOMTokenList.h"
     
    10131014const AtomString& HTMLFormElement::autocomplete() const
    10141015{
    1015     static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);
    1016     static MainThreadNeverDestroyed<const AtomString> off("off", AtomString::ConstructFromLiteral);
    1017 
    1018     return equalIgnoringASCIICase(attributeWithoutSynchronization(autocompleteAttr), "off") ? off : on;
     1016    return equalLettersIgnoringASCIICase(attributeWithoutSynchronization(autocompleteAttr), "off") ? offAtom() : onAtom();
    10191017}
    10201018
  • trunk/Source/WebCore/html/HTMLIFrameElement.cpp

    r283851 r293285  
    2727
    2828#include "CSSPropertyNames.h"
     29#include "CommonAtomStrings.h"
    2930#include "DOMTokenList.h"
    3031#include "ElementInlines.h"
     
    158159const AtomString& HTMLIFrameElement::loadingForBindings() const
    159160{
    160     static MainThreadNeverDestroyed<const AtomString> eager("eager", AtomString::ConstructFromLiteral);
    161     static MainThreadNeverDestroyed<const AtomString> lazy("lazy", AtomString::ConstructFromLiteral);
    162     return equalLettersIgnoringASCIICase(attributeWithoutSynchronization(HTMLNames::loadingAttr), "lazy") ? lazy : eager;
     161    return equalLettersIgnoringASCIICase(attributeWithoutSynchronization(HTMLNames::loadingAttr), "lazy") ? lazyAtom() : eagerAtom();
    163162}
    164163
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r293042 r293285  
    2929#include "Chrome.h"
    3030#include "ChromeClient.h"
     31#include "CommonAtomStrings.h"
    3132#include "Editor.h"
    3233#include "ElementIterator.h"
     
    675676        break;
    676677    }
    677     return "auto"_s;
     678    return autoAtom();
    678679}
    679680
     
    897898const AtomString& HTMLImageElement::loadingForBindings() const
    898899{
    899     static MainThreadNeverDestroyed<const AtomString> eager("eager", AtomString::ConstructFromLiteral);
    900     static MainThreadNeverDestroyed<const AtomString> lazy("lazy", AtomString::ConstructFromLiteral);
    901900    auto& attributeValue = attributeWithoutSynchronization(HTMLNames::loadingAttr);
    902     return hasLazyLoadableAttributeValue(attributeValue) ? lazy : eager;
     901    return hasLazyLoadableAttributeValue(attributeValue) ? lazyAtom() : eagerAtom();
    903902}
    904903
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r293170 r293285  
    4040#include "Chrome.h"
    4141#include "ChromeClient.h"
     42#include "CommonAtomStrings.h"
    4243#include "CommonVM.h"
    4344#include "ContentRuleListResults.h"
     
    36503651    // "preload" - On getting: none. On setting: ignored.
    36513652    if (m_mediaStreamSrcObject)
    3652         return "none"_s;
     3653        return noneAtom();
    36533654#endif
    36543655
    36553656    switch (m_preload) {
    36563657    case MediaPlayer::Preload::None:
    3657         return "none"_s;
     3658        return noneAtom();
    36583659    case MediaPlayer::Preload::MetaData:
    36593660        return "metadata"_s;
    36603661    case MediaPlayer::Preload::Auto:
    3661         return "auto"_s;
     3662        return autoAtom();
    36623663    }
    36633664
  • trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp

    r293059 r293285  
    2929#include "CSSPrimitiveValueMappings.h"
    3030#include "ChromeClient.h"
     31#include "CommonAtomStrings.h"
    3132#include "DocumentInlines.h"
    3233#include "Editing.h"
     
    435436static const AtomString& directionString(TextFieldSelectionDirection direction)
    436437{
    437     static MainThreadNeverDestroyed<const AtomString> none("none", AtomString::ConstructFromLiteral);
    438438    static MainThreadNeverDestroyed<const AtomString> forward("forward", AtomString::ConstructFromLiteral);
    439439    static MainThreadNeverDestroyed<const AtomString> backward("backward", AtomString::ConstructFromLiteral);
     
    441441    switch (direction) {
    442442    case SelectionHasNoDirection:
    443         return none;
     443        return noneAtom();
    444444    case SelectionHasForwardDirection:
    445445        return forward;
     
    449449
    450450    ASSERT_NOT_REACHED();
    451     return none;
     451    return noneAtom();
    452452}
    453453
  • trunk/Source/WebCore/html/InputMode.cpp

    r261013 r293285  
    2727#include "InputMode.h"
    2828
     29#include "CommonAtomStrings.h"
    2930#include <wtf/NeverDestroyed.h>
    3031
     
    8384const AtomString& none()
    8485{
    85     static MainThreadNeverDestroyed<const AtomString> mode("none", AtomString::ConstructFromLiteral);
    86     return mode;
     86    return noneAtom();
    8787}
    8888
    8989const AtomString& text()
    9090{
    91     static MainThreadNeverDestroyed<const AtomString> mode("text", AtomString::ConstructFromLiteral);
    92     return mode;
     91    return textAtom();
    9392}
    9493
    9594const AtomString& tel()
    9695{
    97     static MainThreadNeverDestroyed<const AtomString> mode("tel", AtomString::ConstructFromLiteral);
    98     return mode;
     96    return telAtom();
    9997}
    10098
    10199const AtomString& url()
    102100{
    103     static MainThreadNeverDestroyed<const AtomString> mode("url", AtomString::ConstructFromLiteral);
    104     return mode;
     101    return urlAtom();
    105102}
    106103
    107104const AtomString& email()
    108105{
    109     static MainThreadNeverDestroyed<const AtomString> mode("email", AtomString::ConstructFromLiteral);
    110     return mode;
     106    return emailAtom();
    111107}
    112108
     
    125121const AtomString& search()
    126122{
    127     static MainThreadNeverDestroyed<const AtomString> mode("search", AtomString::ConstructFromLiteral);
    128     return mode;
     123    return searchAtom();
    129124}
    130125
  • trunk/Source/WebCore/html/InputTypeNames.cpp

    r293086 r293285  
    2323#include "InputTypeNames.h"
    2424
     25#include "CommonAtomStrings.h"
    2526#include "HTMLNames.h"
    2627#include <wtf/NeverDestroyed.h>
     
    6465const AtomString& email()
    6566{
    66     static MainThreadNeverDestroyed<const AtomString> name("email", AtomString::ConstructFromLiteral);
    67     return name;
     67    return emailAtom();
    6868}
    6969
     
    118118const AtomString& reset()
    119119{
    120     static MainThreadNeverDestroyed<const AtomString> name("reset", AtomString::ConstructFromLiteral);
    121     return name;
     120    return resetAtom();
    122121}
    123122
    124123const AtomString& search()
    125124{
    126     static MainThreadNeverDestroyed<const AtomString> name("search", AtomString::ConstructFromLiteral);
    127     return name;
     125    return searchAtom();
    128126}
    129127
    130128const AtomString& submit()
    131129{
    132     static MainThreadNeverDestroyed<const AtomString> name("submit", AtomString::ConstructFromLiteral);
    133     return name;
     130    return submitAtom();
    134131}
    135132
    136133const AtomString& telephone()
    137134{
    138     static MainThreadNeverDestroyed<const AtomString> name("tel", AtomString::ConstructFromLiteral);
    139     return name;
     135    return telAtom();
    140136}
    141137
    142138const AtomString& text()
    143139{
    144     static MainThreadNeverDestroyed<const AtomString> name("text", AtomString::ConstructFromLiteral);
    145     return name;
     140    return textAtom();
    146141}
    147142
     
    154149const AtomString& url()
    155150{
    156     static MainThreadNeverDestroyed<const AtomString> name("url", AtomString::ConstructFromLiteral);
    157     return name;
     151    return urlAtom();
    158152}
    159153
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r293129 r293285  
    3030#include "CSSPrimitiveValue.h"
    3131#include "CSSToLengthConversionData.h"
     32#include "CommonAtomStrings.h"
    3233#include "Document.h"
    3334#include "EventNames.h"
     
    151152void TextControlInnerTextElement::updateInnerTextElementEditabilityImpl(bool isEditable, bool initialization)
    152153{
    153     static MainThreadNeverDestroyed<const AtomString> plainTextOnlyName("plaintext-only", AtomString::ConstructFromLiteral);
    154     const auto& value = isEditable ? plainTextOnlyName.get() : falseAtom();
     154    const auto& value = isEditable ? plaintextOnlyAtom() : falseAtom();
    155155    if (initialization) {
    156156        Vector<Attribute> attributes { Attribute(contenteditableAttr, value) };
  • trunk/Source/WebCore/html/track/AudioTrack.cpp

    r287574 r293285  
    3939#include "AudioTrackList.h"
    4040#include "AudioTrackPrivate.h"
     41#include "CommonAtomStrings.h"
    4142#include <wtf/NeverDestroyed.h>
    4243
    4344namespace WebCore {
    44 
    45 const AtomString& AudioTrack::alternativeKeyword()
    46 {
    47     static MainThreadNeverDestroyed<const AtomString> alternative("alternative", AtomString::ConstructFromLiteral);
    48     return alternative;
    49 }
    5045
    5146const AtomString& AudioTrack::descriptionKeyword()
     
    5550}
    5651
    57 const AtomString& AudioTrack::mainKeyword()
    58 {
    59     static MainThreadNeverDestroyed<const AtomString> main("main", AtomString::ConstructFromLiteral);
    60     return main;
    61 }
    62 
    6352const AtomString& AudioTrack::mainDescKeyword()
    6453{
     
    7160    static MainThreadNeverDestroyed<const AtomString> translation("translation", AtomString::ConstructFromLiteral);
    7261    return translation;
    73 }
    74 
    75 const AtomString& AudioTrack::commentaryKeyword()
    76 {
    77     static MainThreadNeverDestroyed<const AtomString> commentary("commentary", AtomString::ConstructFromLiteral);
    78     return commentary;
    7962}
    8063
     
    124107bool AudioTrack::isValidKind(const AtomString& value) const
    125108{
    126     return value == alternativeKeyword()
    127         || value == commentaryKeyword()
     109    return value == alternativeAtom()
     110        || value == commentaryAtom()
    128111        || value == descriptionKeyword()
    129         || value == mainKeyword()
     112        || value == mainAtom()
    130113        || value == mainDescKeyword()
    131114        || value == translationKeyword();
     
    209192    switch (m_private->kind()) {
    210193    case AudioTrackPrivate::Alternative:
    211         setKind(AudioTrack::alternativeKeyword());
     194        setKind(alternativeAtom());
    212195        break;
    213196    case AudioTrackPrivate::Description:
     
    215198        break;
    216199    case AudioTrackPrivate::Main:
    217         setKind(AudioTrack::mainKeyword());
     200        setKind(mainAtom());
    218201        break;
    219202    case AudioTrackPrivate::MainDesc:
     
    224207        break;
    225208    case AudioTrackPrivate::Commentary:
    226         setKind(AudioTrack::commentaryKeyword());
     209        setKind(commentaryAtom());
    227210        break;
    228211    case AudioTrackPrivate::None:
  • trunk/Source/WebCore/html/track/AudioTrack.h

    r287574 r293285  
    4747    virtual ~AudioTrack();
    4848
    49     static const AtomString& alternativeKeyword();
    5049    static const AtomString& descriptionKeyword();
    51     static const AtomString& mainKeyword();
    5250    static const AtomString& mainDescKeyword();
    5351    static const AtomString& translationKeyword();
    54     static const AtomString& commentaryKeyword();
    5552
    5653    bool enabled() const final { return m_enabled; }
  • trunk/Source/WebCore/html/track/TextTrack.cpp

    r292810 r293285  
    5151WTF_MAKE_ISO_ALLOCATED_IMPL(TextTrack);
    5252
    53 const AtomString& TextTrack::subtitlesKeyword()
    54 {
    55     static MainThreadNeverDestroyed<const AtomString> subtitles("subtitles", AtomString::ConstructFromLiteral);
    56     return subtitles;
    57 }
    58 
    59 static const AtomString& captionsKeyword()
    60 {
    61     static MainThreadNeverDestroyed<const AtomString> captions("captions", AtomString::ConstructFromLiteral);
    62     return captions;
    63 }
    64 
    6553static const AtomString& descriptionsKeyword()
    6654{
     
    10492    , m_trackType(type)
    10593{
    106     if (kind == captionsKeyword())
     94    if (kind == captionsAtom())
    10795        m_kind = Kind::Captions;
    10896    else if (kind == chaptersKeyword())
     
    168156bool TextTrack::isValidKindKeyword(const AtomString& value)
    169157{
    170     if (value == subtitlesKeyword())
     158    if (value == subtitlesAtom())
    171159        return true;
    172     if (value == captionsKeyword())
     160    if (value == captionsAtom())
    173161        return true;
    174162    if (value == descriptionsKeyword())
     
    188176    switch (m_kind) {
    189177    case Kind::Captions:
    190         return captionsKeyword();
     178        return captionsAtom();
    191179    case Kind::Chapters:
    192180        return chaptersKeyword();
     
    198186        return metadataKeyword();
    199187    case Kind::Subtitles:
    200         return subtitlesKeyword();
     188        return subtitlesAtom();
    201189    }
    202190    ASSERT_NOT_REACHED();
    203     return subtitlesKeyword();
     191    return subtitlesAtom();
    204192}
    205193
  • trunk/Source/WebCore/html/track/TextTrack.h

    r283237 r293285  
    5454    static TextTrack& captionMenuAutomaticItem();
    5555
    56     static const AtomString& subtitlesKeyword();
    5756    static bool isValidKindKeyword(const AtomString&);
    5857
  • trunk/Source/WebCore/html/track/VTTCue.cpp

    r293059 r293285  
    3737#include "CSSPropertyNames.h"
    3838#include "CSSValueKeywords.h"
     39#include "CommonAtomStrings.h"
    3940#include "DocumentFragment.h"
    4041#include "ElementInlines.h"
     
    138139}
    139140
    140 static const String& autoKeyword()
    141 {
    142     static NeverDestroyed<const String> autoX(MAKE_STATIC_STRING_IMPL("auto"));
    143     return autoX;
    144 }
    145 
    146141// ----------------------------
    147142
     
    478473        return lineRightKeyword();
    479474    case PositionAlignmentLignAuto:
    480         return autoKeyword();
     475        return autoAtom();
    481476    default:
    482477        ASSERT_NOT_REACHED();
     
    494489    else if (value == lineRightKeyword())
    495490        positionAlignment = PositionAlignmentLignRight;
    496     else if (value == autoKeyword())
     491    else if (value == autoAtom())
    497492        positionAlignment = PositionAlignmentLignAuto;
    498493    else
     
    13301325    object.setBoolean("snapToLines"_s, snapToLines());
    13311326    if (m_linePosition)
    1332         object.setString("line"_s, "auto"_s);
     1327        object.setString("line"_s, autoAtom());
    13331328    else
    13341329        object.setDouble("line"_s, *m_linePosition);
     
    13361331        object.setDouble("position"_s, *m_textPosition);
    13371332    else
    1338         object.setString("position"_s, "auto"_s);
     1333        object.setString("position"_s, autoAtom());
    13391334    object.setInteger("size"_s, m_cueSize);
    13401335    object.setString("align"_s, align());
  • trunk/Source/WebCore/html/track/VideoTrack.cpp

    r287574 r293285  
    3535#if ENABLE(VIDEO)
    3636
     37#include "CommonAtomStrings.h"
    3738#include "VideoTrackClient.h"
    3839#include "VideoTrackConfiguration.h"
     
    4748namespace WebCore {
    4849
    49 const AtomString& VideoTrack::alternativeKeyword()
    50 {
    51     static MainThreadNeverDestroyed<const AtomString> alternative("alternative", AtomString::ConstructFromLiteral);
    52     return alternative;
    53 }
    54 
    55 const AtomString& VideoTrack::captionsKeyword()
    56 {
    57     static MainThreadNeverDestroyed<const AtomString> captions("captions", AtomString::ConstructFromLiteral);
    58     return captions;
    59 }
    60 
    61 const AtomString& VideoTrack::mainKeyword()
    62 {
    63     static MainThreadNeverDestroyed<const AtomString> captions("main", AtomString::ConstructFromLiteral);
    64     return captions;
    65 }
    66 
    6750const AtomString& VideoTrack::signKeyword()
    6851{
    6952    static MainThreadNeverDestroyed<const AtomString> sign("sign", AtomString::ConstructFromLiteral);
    7053    return sign;
    71 }
    72 
    73 const AtomString& VideoTrack::subtitlesKeyword()
    74 {
    75     static MainThreadNeverDestroyed<const AtomString> subtitles("subtitles", AtomString::ConstructFromLiteral);
    76     return subtitles;
    77 }
    78 
    79 const AtomString& VideoTrack::commentaryKeyword()
    80 {
    81     static MainThreadNeverDestroyed<const AtomString> commentary("commentary", AtomString::ConstructFromLiteral);
    82     return commentary;
    8354}
    8455
     
    11990bool VideoTrack::isValidKind(const AtomString& value) const
    12091{
    121     return value == alternativeKeyword()
    122         || value == commentaryKeyword()
    123         || value == captionsKeyword()
    124         || value == mainKeyword()
     92    return value == alternativeAtom()
     93        || value == commentaryAtom()
     94        || value == captionsAtom()
     95        || value == mainAtom()
    12596        || value == signKeyword()
    126         || value == subtitlesKeyword();
     97        || value == subtitlesAtom();
    12798}
    12899
     
    242213    switch (m_private->kind()) {
    243214    case VideoTrackPrivate::Alternative:
    244         setKind(VideoTrack::alternativeKeyword());
     215        setKind(alternativeAtom());
    245216        return;
    246217    case VideoTrackPrivate::Captions:
    247         setKind(VideoTrack::captionsKeyword());
     218        setKind(captionsAtom());
    248219        return;
    249220    case VideoTrackPrivate::Main:
    250         setKind(VideoTrack::mainKeyword());
     221        setKind(mainAtom());
    251222        return;
    252223    case VideoTrackPrivate::Sign:
     
    254225        return;
    255226    case VideoTrackPrivate::Subtitles:
    256         setKind(VideoTrack::subtitlesKeyword());
     227        setKind(subtitlesAtom());
    257228        return;
    258229    case VideoTrackPrivate::Commentary:
    259         setKind(VideoTrack::commentaryKeyword());
     230        setKind(commentaryAtom());
    260231        return;
    261232    case VideoTrackPrivate::None:
  • trunk/Source/WebCore/html/track/VideoTrack.h

    r287574 r293285  
    5050    virtual ~VideoTrack();
    5151
    52     static const AtomString& alternativeKeyword();
    53     static const AtomString& captionsKeyword();
    54     static const AtomString& mainKeyword();
    5552    static const AtomString& signKeyword();
    56     static const AtomString& subtitlesKeyword();
    57     static const AtomString& commentaryKeyword();
    5853
    5954    bool selected() const { return m_selected; }
  • trunk/Source/WebCore/html/track/WebVTTParser.cpp

    r293059 r293285  
    3636#if ENABLE(VIDEO)
    3737
     38#include "CommonAtomStrings.h"
    3839#include "Document.h"
    3940#include "HTMLParserIdioms.h"
     
    9394WebVTTParser::WebVTTParser(WebVTTParserClient& client, Document& document)
    9495    : m_document(document)
    95     , m_decoder(TextResourceDecoder::create("text/plain"_s, PAL::UTF8Encoding()))
     96    , m_decoder(TextResourceDecoder::create(textPlainContentTypeAtom(), PAL::UTF8Encoding()))
    9697    , m_client(client)
    9798{
  • trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp

    r293086 r293285  
    3838#include "CSSStyleSheet.h"
    3939#include "CSSValueKeywords.h"
     40#include "CommonAtomStrings.h"
    4041#include "ContainerNode.h"
    4142#include "ContentSecurityPolicy.h"
     
    783784
    784785    auto styleElement = HTMLStyleElement::create(document);
    785     styleElement->setAttributeWithoutSynchronization(HTMLNames::typeAttr, AtomString("text/css", AtomString::ConstructFromLiteral));
     786    styleElement->setAttributeWithoutSynchronization(HTMLNames::typeAttr, cssContentTypeAtom());
    786787
    787788    ContainerNode* targetNode;
  • trunk/Source/WebCore/loader/FormSubmission.cpp

    r293056 r293285  
    3333#include "FormSubmission.h"
    3434
     35#include "CommonAtomStrings.h"
    3536#include "ContentSecurityPolicy.h"
    3637#include "DOMFormData.h"
     
    104105        return "multipart/form-data"_s;
    105106    if (equalLettersIgnoringASCIICase(type, "text/plain"))
    106         return "text/plain"_s;
     107        return textPlainContentTypeAtom();
    107108    return "application/x-www-form-urlencoded"_s;
    108109}
  • trunk/Source/WebCore/loader/NavigationScheduler.cpp

    r292139 r293285  
    3434
    3535#include "BackForwardController.h"
     36#include "CommonAtomStrings.h"
    3637#include "CommonVM.h"
    3738#include "DOMWindow.h"
     
    378379        UserGestureIndicator gestureIndicator { userGestureToForward() };
    379380
    380         ResourceResponse replacementResponse { m_originDocument.url(), "text/plain"_s, 0, "UTF-8"_s };
     381        ResourceResponse replacementResponse { m_originDocument.url(), textPlainContentTypeAtom(), 0, "UTF-8"_s };
    381382        SubstituteData replacementData { SharedBuffer::create(), m_originDocument.url(), replacementResponse, SubstituteData::SessionHistoryVisibility::Hidden };
    382383
  • trunk/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp

    r290350 r293285  
    3434#include "MHTMLParser.h"
    3535
     36#include "CommonAtomStrings.h"
    3637#include "MHTMLArchive.h"
    3738#include "MIMEHeader.h"
     
    120121{
    121122    const String& mimeType = resource->mimeType();
    122     if (!MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType) || MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) || mimeType == "text/css") {
     123    if (!MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType) || MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) || mimeType == cssContentTypeAtom()) {
    123124        m_resources.append(resource);
    124125        return;
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp

    r292801 r293285  
    2929#include "CachedResourceRequest.h"
    3030#include "CachedStyleSheetClient.h"
     31#include "CommonAtomStrings.h"
    3132#include "HTTPHeaderNames.h"
    3233#include "HTTPParsers.h"
     
    4142CachedCSSStyleSheet::CachedCSSStyleSheet(CachedResourceRequest&& request, PAL::SessionID sessionID, const CookieJar* cookieJar)
    4243    : CachedResource(WTFMove(request), Type::CSSStyleSheet, sessionID, cookieJar)
    43     , m_decoder(TextResourceDecoder::create("text/css"_s, request.charset()))
     44    , m_decoder(TextResourceDecoder::create(cssContentTypeAtom(), request.charset()))
    4445{
    4546}
  • trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp

    r293129 r293285  
    3131#if ENABLE(MATHML)
    3232
     33#include "CommonAtomStrings.h"
    3334#include "ElementIterator.h"
    3435#include "HTMLHtmlElement.h"
  • trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp

    r292945 r293285  
    3131#include "AudioTrackList.h"
    3232#include "ColorSerialization.h"
     33#include "CommonAtomStrings.h"
    3334#include "FloatConversion.h"
    3435#include "HTMLMediaElement.h"
     
    731732        return addAudioTrackKindDescriptionsSuffix(text);
    732733
    733     if (track.kind() == AudioTrack::commentaryKeyword() && !text.contains(audioTrackKindCommentaryDisplayName()))
     734    if (track.kind() == commentaryAtom() && !text.contains(audioTrackKindCommentaryDisplayName()))
    734735        return addAudioTrackKindCommentarySuffix(text);
    735736
  • trunk/Source/WebCore/page/Page.cpp

    r292939 r293285  
    3838#include "Chrome.h"
    3939#include "ChromeClient.h"
     40#include "CommonAtomStrings.h"
    4041#include "ConstantPropertyMap.h"
    4142#include "ContextMenuClient.h"
     
    20672068        return m_userStyleSheet;
    20682069
    2069     m_userStyleSheet = TextResourceDecoder::create("text/css"_s)->decodeAndFlush(data->data(), data->size());
     2070    m_userStyleSheet = TextResourceDecoder::create(cssContentTypeAtom())->decodeAndFlush(data->data(), data->size());
    20702071
    20712072    return m_userStyleSheet;
  • trunk/Source/WebCore/page/PageSerializer.cpp

    r290394 r293285  
    3737#include "CSSStyleRule.h"
    3838#include "CachedImage.h"
     39#include "CommonAtomStrings.h"
    3940#include "DocumentInlines.h"
    4041#include "ElementInlines.h"
     
    261262        PAL::TextEncoding textEncoding(styleSheet->contents().charset());
    262263        ASSERT(textEncoding.isValid());
    263         m_resources.append({ url, "text/css"_s, SharedBuffer::create(textEncoding.encode(cssText.toString(), PAL::UnencodableHandling::Entities)) });
     264        m_resources.append({ url, cssContentTypeAtom(), SharedBuffer::create(textEncoding.encode(cssText.toString(), PAL::UnencodableHandling::Entities)) });
    264265        m_resourceURLs.add(url);
    265266    }
  • trunk/Source/WebCore/page/PrintContext.cpp

    r288245 r293285  
    2222#include "PrintContext.h"
    2323
     24#include "CommonAtomStrings.h"
    2425#include "ElementTraversal.h"
    2526#include "GraphicsContext.h"
     
    363364    if (!strcmp(propertyName, "margin-left")) {
    364365        if (style->marginLeft().isAuto())
    365             return "auto"_s;
     366            return autoAtom();
    366367        return String::number(style->marginLeft().value());
    367368    }
  • trunk/Source/WebCore/page/ProcessWarming.cpp

    r290901 r293285  
    2727#include "ProcessWarming.h"
    2828
     29#include "CommonAtomStrings.h"
    2930#include "CommonVM.h"
    3031#include "Font.h"
     
    5152void ProcessWarming::initializeNames()
    5253{
    53     AtomString::init();
     54    initializeCommonAtomStrings();
    5455    HTMLNames::init();
    5556    QualifiedName::init();
  • trunk/Source/WebCore/platform/CommonAtomStrings.cpp

    r293279 r293285  
    11/*
    2  * Copyright (C) 2021 Apple Inc. All rights reserved.
     2 * Copyright (C) 2022 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2525
    2626#include "config.h"
    27 #include "FontShadow.h"
    28 
    29 #include "ColorSerialization.h"
    30 #include <wtf/text/StringBuilder.h>
     27#include "CommonAtomStrings.h"
    3128
    3229namespace WebCore {
    3330
    34 String serializationForCSS(const FontShadow& shadow)
     31#define DEFINE_COMMON_ATOM(atomName, atomValue) \
     32    MainThreadLazyNeverDestroyed<const AtomString> atomName ## AtomData;
     33#define INITIALIZE_COMMON_ATOM(atomName, atomValue) \
     34    atomName ## AtomData.constructWithoutAccessCheck(atomValue, AtomString::ConstructFromLiteral);
     35
     36WEBCORE_COMMON_ATOM_STRINGS_FOR_EACH_KEYWORD(DEFINE_COMMON_ATOM)
     37
     38void initializeCommonAtomStrings()
    3539{
    36     if (shadow.offset.isZero() && !shadow.blurRadius)
    37         return "none"_s;
     40    // Initialization is not thread safe, so this function must be called from the main thread first.
     41    ASSERT(isUIThread());
    3842
    39     if (!shadow.color.isValid())
    40         return "none"_s;
     43    static std::once_flag initializeKey;
     44    std::call_once(initializeKey, [] {
     45        AtomString::init();
    4146
    42     StringBuilder builder;
    43     builder.append(shadow.offset.width(), "px ");
    44     builder.append(shadow.offset.height(), "px ");
    45     builder.append(serializationForCSS(shadow.color));
    46     if (shadow.blurRadius)
    47         builder.append(" ", shadow.blurRadius, "px");
    48     return builder.toString();
     47        WEBCORE_COMMON_ATOM_STRINGS_FOR_EACH_KEYWORD(INITIALIZE_COMMON_ATOM)
     48    });
    4949}
    5050
     51#undef DEFINE_COMMON_ATOM
     52#undef INITIALIZE_COMMON_ATOM
     53
    5154} // namespace WebCore
  • trunk/Source/WebCore/platform/CommonAtomStrings.h

    r293279 r293285  
    11/*
    2  * Copyright (C) 2021 Apple Inc. All rights reserved.
     2 * Copyright (C) 2022 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #include "config.h"
    27 #include "FontShadow.h"
     26#pragma once
    2827
    29 #include "ColorSerialization.h"
    30 #include <wtf/text/StringBuilder.h>
     28#include <wtf/NeverDestroyed.h>
     29#include <wtf/text/AtomString.h>
    3130
    3231namespace WebCore {
    3332
    34 String serializationForCSS(const FontShadow& shadow)
    35 {
    36     if (shadow.offset.isZero() && !shadow.blurRadius)
    37         return "none"_s;
     33#define WEBCORE_COMMON_ATOM_STRINGS_FOR_EACH_KEYWORD(macro) \
     34    macro(alternative, "alternative") \
     35    macro(auto, "auto") \
     36    macro(captions, "captions") \
     37    macro(commentary, "commentary") \
     38    macro(cssContentType, "text/css") \
     39    macro(eager, "eager") \
     40    macro(email, "email") \
     41    macro(false, "false") \
     42    macro(lazy, "lazy") \
     43    macro(main, "main") \
     44    macro(none, "none") \
     45    macro(off, "off") \
     46    macro(on, "on") \
     47    macro(plaintextOnly, "plaintext-only") \
     48    macro(reset, "reset") \
     49    macro(search, "search") \
     50    macro(submit, "submit") \
     51    macro(subtitles, "subtitles") \
     52    macro(tel, "tel") \
     53    macro(text, "text") \
     54    macro(textPlainContentType, "text/plain") \
     55    macro(true, "true") \
     56    macro(url, "url")
    3857
    39     if (!shadow.color.isValid())
    40         return "none"_s;
    4158
    42     StringBuilder builder;
    43     builder.append(shadow.offset.width(), "px ");
    44     builder.append(shadow.offset.height(), "px ");
    45     builder.append(serializationForCSS(shadow.color));
    46     if (shadow.blurRadius)
    47         builder.append(" ", shadow.blurRadius, "px");
    48     return builder.toString();
    49 }
     59#define DECLARE_COMMON_ATOM(atomName, atomValue) \
     60    extern MainThreadLazyNeverDestroyed<const AtomString> atomName ## AtomData; \
     61    inline const AtomString& atomName ## Atom() { return atomName ## AtomData.get(); }
     62
     63WEBCORE_COMMON_ATOM_STRINGS_FOR_EACH_KEYWORD(DECLARE_COMMON_ATOM)
     64
     65#undef DECLARE_COMMON_ATOM
     66
     67WEBCORE_EXPORT void initializeCommonAtomStrings();
    5068
    5169} // namespace WebCore
  • trunk/Source/WebCore/platform/Pasteboard.cpp

    r287021 r293285  
    2727#include "Pasteboard.h"
    2828
     29#include "CommonAtomStrings.h"
    2930#include "PasteboardStrategy.h"
    3031#include "PlatformStrategies.h"
     
    4546bool Pasteboard::isSafeTypeForDOMToReadAndWrite(const String& type)
    4647{
    47     return type == "text/plain" || type == "text/html" || type == "text/uri-list";
     48    return type == textPlainContentTypeAtom() || type == "text/html" || type == "text/uri-list";
    4849}
    4950
  • trunk/Source/WebCore/platform/StaticPasteboard.cpp

    r287021 r293285  
    2727#include "StaticPasteboard.h"
    2828
     29#include "CommonAtomStrings.h"
    2930#include "SharedBuffer.h"
    3031
     
    111112void StaticPasteboard::writePlainText(const String& text, SmartReplaceOption)
    112113{
    113     m_customData.writeString("text/plain"_s, text);
     114    m_customData.writeString(textPlainContentTypeAtom(), text);
    114115}
    115116
  • trunk/Source/WebCore/platform/animation/Animation.cpp

    r288433 r293285  
    2323#include "Animation.h"
    2424
     25#include "CommonAtomStrings.h"
    2526#include <wtf/NeverDestroyed.h>
    2627#include <wtf/text/TextStream.h>
     
    130131auto Animation::initialName() -> const Name&
    131132{
    132     static NeverDestroyed<Name> initialValue { Name { MAKE_STATIC_STRING_IMPL("none"), true } };
     133    static NeverDestroyed<Name> initialValue { Name { noneAtom(), true } };
    133134    return initialValue;
    134135}
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r293008 r293285  
    2929#if ENABLE(VIDEO)
    3030
     31#include "CommonAtomStrings.h"
    3132#include "ContentType.h"
    3233#include "DeprecatedGlobalSettings.h"
     
    332333}
    333334
    334 static const AtomString& textPlain()
    335 {
    336     static MainThreadNeverDestroyed<const AtomString> textPlain("text/plain", AtomString::ConstructFromLiteral);
    337     return textPlain;
    338 }
    339 
    340335const MediaPlayerPrivateInterface* MediaPlayer::playerPrivate() const
    341336{
     
    486481    // If the MIME type is missing or is not meaningful, try to figure it out from the URL.
    487482    AtomString containerType = m_contentType.containerType();
    488     if (containerType.isEmpty() || containerType == applicationOctetStream() || containerType == textPlain()) {
     483    if (containerType.isEmpty() || containerType == applicationOctetStream() || containerType == textPlainContentTypeAtom()) {
    489484        if (m_url.protocolIsData())
    490485            m_contentType = ContentType(mimeTypeFromDataURL(m_url.string()));
  • trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm

    r287848 r293285  
    2929#if PLATFORM(IOS_FAMILY)
    3030
     31#import "CommonAtomStrings.h"
    3132#import "CommonVM.h"
    3233#import "FloatingPointEnvironment.h"
     
    692693
    693694    // Initialize AtomString on the main thread.
    694     WTF::AtomString::init();
     695    WebCore::initializeCommonAtomStrings();
    695696
    696697    // Initialize ThreadGlobalData on the main UI thread so that the WebCore thread
  • trunk/Source/WebCore/platform/network/HTTPParsers.cpp

    r293129 r293285  
    3434#include "HTTPParsers.h"
    3535
     36#include "CommonAtomStrings.h"
    3637#include "HTTPHeaderField.h"
    3738#include "HTTPHeaderNames.h"
  • trunk/Source/WebCore/style/Styleable.cpp

    r292561 r293285  
    3434#include "CSSPropertyAnimation.h"
    3535#include "CSSTransition.h"
     36#include "CommonAtomStrings.h"
    3637#include "DeclarativeAnimation.h"
    3738#include "Document.h"
     
    258259    for (auto& animation : animations) {
    259260        auto& name = animation->name().string;
    260         if (name != "none" && !name.isEmpty() && keyframeEffectStack.containsInvalidCSSAnimationName(name) && keyframesRuleExistsForAnimation(element, animation.get(), name))
     261        if (name != noneAtom() && !name.isEmpty() && keyframeEffectStack.containsInvalidCSSAnimationName(name) && keyframesRuleExistsForAnimation(element, animation.get(), name))
    261262            return true;
    262263    }
     
    303304
    304305            auto& animationName = currentAnimation->name().string;
    305             if (animationName == "none" || animationName.isEmpty())
     306            if (animationName == noneAtom() || animationName.isEmpty())
    306307                continue;
    307308
  • trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp

    r291788 r293285  
    2424
    2525#include "AffineTransform.h"
     26#include "CommonAtomStrings.h"
    2627#include "ElementIterator.h"
    2728#include "PathTraversalState.h"
     
    111112SVGAnimateMotionElement::RotateMode SVGAnimateMotionElement::rotateMode() const
    112113{
    113     static MainThreadNeverDestroyed<const AtomString> autoVal("auto", AtomString::ConstructFromLiteral);
    114114    static MainThreadNeverDestroyed<const AtomString> autoReverse("auto-reverse", AtomString::ConstructFromLiteral);
    115     const AtomString& rotate = getAttribute(SVGNames::rotateAttr);
    116     if (rotate == autoVal)
     115    auto& rotate = getAttribute(SVGNames::rotateAttr);
     116    if (rotate == autoAtom())
    117117        return RotateAuto;
    118118    if (rotate == autoReverse)
  • trunk/Source/WebCore/svg/SVGAnimationElement.cpp

    r292951 r293285  
    320320}
    321321
     322static const AtomString& sumAtom()
     323{
     324    static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
     325    return sum;
     326}
     327
    322328bool SVGAnimationElement::isAdditive() const
    323329{
    324     static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
    325330    const AtomString& value = attributeWithoutSynchronization(SVGNames::additiveAttr);
    326     return value == sum || animationMode() == AnimationMode::By;
     331    return value == sumAtom() || animationMode() == AnimationMode::By;
    327332}
    328333
    329334bool SVGAnimationElement::isAccumulated() const
    330335{
    331     static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);
    332336    const AtomString& value = attributeWithoutSynchronization(SVGNames::accumulateAttr);
    333     return value == sum && animationMode() != AnimationMode::To;
     337    return value == sumAtom() && animationMode() != AnimationMode::To;
    334338}
    335339
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp

    r293129 r293285  
    2222#include "SVGFEConvolveMatrixElement.h"
    2323
     24#include "CommonAtomStrings.h"
    2425#include "FEConvolveMatrix.h"
    2526#include "SVGNames.h"
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h

    r292512 r293285  
    2121#pragma once
    2222
     23#include "CommonAtomStrings.h"
    2324#include "FEConvolveMatrix.h"
    2425#include "SVGFilterPrimitiveStandardAttributes.h"
     
    4142            return "wrap"_s;
    4243        case EdgeModeType::None:
    43             return "none"_s;
     44            return noneAtom();
    4445        }
    4546
     
    5455        if (value == "wrap")
    5556            return EdgeModeType::Wrap;
    56         if (value == "none")
     57        if (value == noneAtom())
    5758            return EdgeModeType::None;
    5859        return EdgeModeType::Unknown;
  • trunk/Source/WebCore/svg/SVGMarkerTypes.h

    r252444 r293285  
    2626#pragma once
    2727
     28#include "CommonAtomStrings.h"
    2829#include "SVGAngleValue.h"
    2930#include "SVGPropertyTraits.h"
     
    7677template<>
    7778struct SVGPropertyTraits<SVGMarkerOrientType> {
    78     static const String autoString()
    79     {
    80         static const NeverDestroyed<String> autoString = MAKE_STATIC_STRING_IMPL("auto");
    81         return autoString;
    82     }
    8379    static const String autoStartReverseString()
    8480    {
     
    8985    static SVGMarkerOrientType fromString(const String& string)
    9086    {
    91         if (string == autoString())
     87        if (string == autoAtom())
    9288            return SVGMarkerOrientAuto;
    9389        if (string == autoStartReverseString())
     
    9894    {
    9995        if (type == SVGMarkerOrientAuto)
    100             return autoString();
     96            return autoAtom();
    10197        if (type == SVGMarkerOrientAutoStartReverse)
    10298            return autoStartReverseString();
  • trunk/Source/WebCore/svg/SVGStyleElement.cpp

    r285186 r293285  
    2525
    2626#include "CSSStyleSheet.h"
     27#include "CommonAtomStrings.h"
    2728#include "Document.h"
    2829#include "SVGElementInlines.h"
     
    6667const AtomString& SVGStyleElement::type() const
    6768{
    68     static MainThreadNeverDestroyed<const AtomString> defaultValue("text/css", AtomString::ConstructFromLiteral);
    69     const AtomString& n = getAttribute(SVGNames::typeAttr);
    70     return n.isNull() ? defaultValue.get() : n;
     69    auto& typeValue = getAttribute(SVGNames::typeAttr);
     70    return typeValue.isNull() ? cssContentTypeAtom() : typeValue;
    7171}
    7272
  • trunk/Source/WebCore/svg/SVGTextPathElement.h

    r260415 r293285  
    2121#pragma once
    2222
     23#include "CommonAtomStrings.h"
    2324#include "SVGNames.h"
    2425#include "SVGTextContentElement.h"
     
    7879            return emptyString();
    7980        case SVGTextPathSpacingAuto:
    80             return "auto"_s;
     81            return autoAtom();
    8182        case SVGTextPathSpacingExact:
    8283            return "exact"_s;
     
    8990    static SVGTextPathSpacingType fromString(const String& value)
    9091    {
    91         if (value == "auto")
     92        if (value == autoAtom())
    9293            return SVGTextPathSpacingAuto;
    9394        if (value == "exact")
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp

    r292857 r293285  
    6969}
    7070
     71static const AtomString& indefiniteAtom()
     72{
     73    static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
     74    return indefiniteValue;
     75}
     76
    7177// This is used for duration type time values that can't be negative.
    7278static const double invalidCachedTime = -1.;
     
    339345
    340346    auto parse = data.stripWhiteSpace();
    341 
    342     static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
    343     if (parse == indefiniteValue.get())
     347    if (parse == indefiniteAtom())
    344348        return SMILTime::indefinite();
    345349
     
    699703        return SMILTime::unresolved();
    700704
    701     static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral);
    702     if (value == indefiniteValue)
     705    if (value == indefiniteAtom())
    703706        return SMILTime::indefinite();
    704707    bool ok;
  • trunk/Source/WebCore/svg/properties/SVGPropertyTraits.h

    r293129 r293285  
    2525#include "Color.h"
    2626#include "ColorSerialization.h"
     27#include "CommonAtomStrings.h"
    2728#include "FloatPoint.h"
    2829#include "FloatRect.h"
  • trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp

    r292861 r293285  
    3030
    3131#include "CacheStorageProvider.h"
     32#include "CommonAtomStrings.h"
    3233#include "ContentSecurityPolicyResponseHeaders.h"
    3334#include "EventLoop.h"
     
    114115{
    115116    ASSERT(isMainThread());
    116     AtomString::init();
     117    initializeCommonAtomStrings();
    117118}
    118119
  • trunk/Source/WebCore/xml/XPathValue.cpp

    r293129 r293285  
    2828#include "XPathValue.h"
    2929
     30#include "CommonAtomStrings.h"
    3031#include "XPathExpressionNode.h"
    3132#include "XPathUtil.h"
  • trunk/Source/WebKit/ChangeLog

    r293231 r293285  
     12022-04-22  Chris Dumez  <cdumez@apple.com>
     2
     3        Move global AtomStrings to a common header to promote reuse
     4        https://bugs.webkit.org/show_bug.cgi?id=239585
     5
     6        Reviewed by Geoff Garen and Darin Adler.
     7
     8        * GPUProcess/GPUProcess.cpp:
     9        (WebKit::GPUProcess::initializeGPUProcess):
     10        * NetworkProcess/NetworkProcess.cpp:
     11        (WebKit::NetworkProcess::initializeNetworkProcess):
     12        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
     13        (WebKit::runInitializationCode):
     14        * Shared/WebKit2Initialize.cpp:
     15        (WebKit::InitializeWebKit2):
     16        * UIProcess/API/APIContentRuleListStore.cpp:
     17        (API::ContentRuleListStore::compileContentRuleList):
     18
    1192022-04-22  Aditya Keerthi  <akeerthi@apple.com>
    220
  • trunk/Source/WebKit/GPUProcess/GPUProcess.cpp

    r292611 r293285  
    4444#include "WebPageProxyMessages.h"
    4545#include "WebProcessPoolMessages.h"
     46#include <WebCore/CommonAtomStrings.h>
    4647#include <WebCore/DeprecatedGlobalSettings.h>
    4748#include <WebCore/LogInitialization.h>
     
    227228    RELEASE_LOG(Process, "%p - GPUProcess::initializeGPUProcess:", this);
    228229    WTF::Thread::setCurrentThreadIsUserInitiated();
    229     AtomString::init();
     230    WebCore::initializeCommonAtomStrings();
    230231
    231232    auto& memoryPressureHandler = MemoryPressureHandler::singleton();
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r293202 r293285  
    6666#include "WebsiteDataType.h"
    6767#include <WebCore/ClientOrigin.h>
     68#include <WebCore/CommonAtomStrings.h>
    6869#include <WebCore/CookieJar.h>
    6970#include <WebCore/DNS.h>
     
    318319
    319320    WTF::Thread::setCurrentThreadIsUserInitiated();
    320     AtomString::init();
     321    WebCore::initializeCommonAtomStrings();
    321322
    322323    m_suppressMemoryPressureHandler = parameters.shouldSuppressMemoryPressureHandler;
  • trunk/Source/WebKit/Shared/Cocoa/WebKit2InitializeCocoa.mm

    r292870 r293285  
    2828
    2929#import <JavaScriptCore/InitializeThreading.h>
     30#import <WebCore/CommonAtomStrings.h>
    3031#import <WebCore/WebCoreJITOperations.h>
    3132#import <mutex>
     
    5051    RELEASE_ASSERT_WITH_MESSAGE([NSThread isMainThread], "InitializeWebKit2 should be called on the main thread");
    5152
    52     AtomString::init();
     53    WebCore::initializeCommonAtomStrings();
    5354#if PLATFORM(IOS_FAMILY)
    5455    InitWebCoreThreadSystemInterface();
  • trunk/Source/WebKit/Shared/WebKit2Initialize.cpp

    r292870 r293285  
    2929#include "LogInitialization.h"
    3030#include <JavaScriptCore/InitializeThreading.h>
     31#include <WebCore/CommonAtomStrings.h>
    3132#include <WebCore/LogInitialization.h>
    3233#include <WebCore/WebCoreJITOperations.h>
     
    4546    JSC::initialize();
    4647    WTF::initializeMainThread();
    47     AtomString::init();
     48    WebCore::initializeCommonAtomStrings();
    4849
    4950    WTF::RefCountedBase::enableThreadingChecksGlobally();
  • trunk/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp

    r292197 r293285  
    3434#include "SharedMemory.h"
    3535#include "WebCompiledContentRuleList.h"
     36#include <WebCore/CommonAtomStrings.h>
    3637#include <WebCore/ContentExtensionCompiler.h>
    3738#include <WebCore/ContentExtensionError.h>
     
    546547{
    547548    ASSERT(RunLoop::isMain());
    548     AtomString::init();
     549    WebCore::initializeCommonAtomStrings();
    549550    WebCore::QualifiedName::init();
    550551   
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r293205 r293285  
     12022-04-22  Chris Dumez  <cdumez@apple.com>
     2
     3        Move global AtomStrings to a common header to promote reuse
     4        https://bugs.webkit.org/show_bug.cgi?id=239585
     5
     6        Reviewed by Geoff Garen and Darin Adler.
     7
     8        * WebKitGraphics.cpp:
     9        (makeFont):
     10
    1112022-04-21  Brent Fulgham  <bfulgham@apple.com>
    212
  • trunk/Source/WebKitLegacy/win/WebKitGraphics.cpp

    r246490 r293285  
    3131#include "WebPreferences.h"
    3232
     33#include <WebCore/CommonAtomStrings.h>
    3334#include <WebCore/FontCascade.h>
    3435#include <WebCore/FontDescription.h>
     
    4748static FontCascade makeFont(const WebFontDescription& description)
    4849{
    49     AtomString::init();
     50    WebCore::initializeCommonAtomStrings();
    5051
    5152    String fontFamilyString(description.family, description.familyLength);
  • trunk/Tools/ChangeLog

    r293231 r293285  
     12022-04-22  Chris Dumez  <cdumez@apple.com>
     2
     3        Move global AtomStrings to a common header to promote reuse
     4        https://bugs.webkit.org/show_bug.cgi?id=239585
     5
     6        Reviewed by Geoff Garen and Darin Adler.
     7
     8        * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
     9        (TestWebKitAPI::makeBackend):
     10
    1112022-04-22  Aditya Keerthi  <akeerthi@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp

    r292879 r293285  
    3131#include <JavaScriptCore/InitializeThreading.h>
    3232#include <WebCore/CombinedURLFilters.h>
     33#include <WebCore/CommonAtomStrings.h>
    3334#include <WebCore/ContentExtensionActions.h>
    3435#include <WebCore/ContentExtensionCompiler.h>
     
    213214ContentExtensions::ContentExtensionsBackend makeBackend(String&& json)
    214215{
    215     AtomString::init();
     216    WebCore::initializeCommonAtomStrings();
    216217    auto extension = InMemoryCompiledContentExtension::create(WTFMove(json));
    217218    ContentExtensions::ContentExtensionsBackend backend;
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/FontShadowTests.cpp

    r286630 r293285  
    2727
    2828#include "Test.h"
     29#include <WebCore/CommonAtomStrings.h>
    2930#include <WebCore/FontShadow.h>
     31#include <wtf/text/AtomString.h>
    3032
    3133using namespace WebCore;
     
    3335namespace TestWebKitAPI {
    3436
    35 TEST(FontShadow, InvalidColor)
     37class FontShadowTest : public testing::Test {
     38public:
     39    void SetUp() override
     40    {
     41        WebCore::initializeCommonAtomStrings();
     42    }
     43};
     44
     45TEST_F(FontShadowTest, InvalidColor)
    3646{
    3747    FontShadow fontShadow;
     
    4353}
    4454
    45 TEST(FontShadow, NoOffsetOrBlurRadius)
     55TEST_F(FontShadowTest, NoOffsetOrBlurRadius)
    4656{
    4757    FontShadow fontShadow;
     
    5464}
    5565
    56 TEST(FontShadow, NoOffset)
     66TEST_F(FontShadowTest, NoOffset)
    5767{
    5868    FontShadow fontShadow;
     
    6474}
    6575
    66 TEST(FontShadow, NegativeOffset)
     76TEST_F(FontShadowTest, NegativeOffset)
    6777{
    6878    FontShadow fontShadow;
     
    7383}
    7484
    75 TEST(FontShadow, NoBlurRadius)
     85TEST_F(FontShadowTest, NoBlurRadius)
    7686{
    7787    FontShadow fontShadow;
     
    8393}
    8494
    85 TEST(FontShadow, NegativeBlurRadius)
     95TEST_F(FontShadowTest, NegativeBlurRadius)
    8696{
    8797    FontShadow fontShadow;
     
    92102}
    93103
    94 TEST(FontShadow, AllNegative)
     104TEST_F(FontShadowTest, AllNegative)
    95105{
    96106    FontShadow fontShadow;
Note: See TracChangeset for help on using the changeset viewer.