Changeset 293285 in webkit
- Timestamp:
- Apr 22, 2022, 9:21:25 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 88 edited
- 2 copied
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/text/AtomString.cpp (modified) (2 diffs)
-
Source/WTF/wtf/text/AtomString.h (modified) (3 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Headers.cmake (modified) (1 diff)
-
Source/WebCore/Modules/async-clipboard/Clipboard.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp (modified) (4 diffs)
-
Source/WebCore/Sources.txt (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Source/WebCore/animation/AnimationEffect.cpp (modified) (3 diffs)
-
Source/WebCore/animation/EffectTiming.h (modified) (2 diffs)
-
Source/WebCore/contentextensions/ContentExtensionParser.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSStyleSheet.h (modified) (2 diffs)
-
Source/WebCore/css/FontFace.cpp (modified) (1 diff)
-
Source/WebCore/css/MediaFeatureNames.cpp (modified) (2 diffs)
-
Source/WebCore/dom/DataTransfer.cpp (modified) (5 diffs)
-
Source/WebCore/dom/Document.cpp (modified) (2 diffs)
-
Source/WebCore/dom/InlineStyleSheetOwner.cpp (modified) (2 diffs)
-
Source/WebCore/dom/ProcessingInstruction.cpp (modified) (2 diffs)
-
Source/WebCore/dom/mac/ImageControlsMac.cpp (modified) (1 diff)
-
Source/WebCore/editing/FontShadow.cpp (modified) (2 diffs)
-
Source/WebCore/editing/ReplaceSelectionCommand.cpp (modified) (2 diffs)
-
Source/WebCore/editing/cocoa/DataDetection.mm (modified) (1 diff)
-
Source/WebCore/editing/cocoa/HTMLConverter.mm (modified) (6 diffs)
-
Source/WebCore/editing/markup.cpp (modified) (2 diffs)
-
Source/WebCore/html/Autocapitalize.cpp (modified) (2 diffs)
-
Source/WebCore/html/Autofill.cpp (modified) (5 diffs)
-
Source/WebCore/html/BaseCheckableInputType.cpp (modified) (4 diffs)
-
Source/WebCore/html/EnterKeyHint.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLAudioElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLButtonElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLElement.cpp (modified) (6 diffs)
-
Source/WebCore/html/HTMLFormElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLIFrameElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLImageElement.cpp (modified) (3 diffs)
-
Source/WebCore/html/HTMLMediaElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLTextFormControlElement.cpp (modified) (4 diffs)
-
Source/WebCore/html/InputMode.cpp (modified) (3 diffs)
-
Source/WebCore/html/InputTypeNames.cpp (modified) (4 diffs)
-
Source/WebCore/html/shadow/TextControlInnerElements.cpp (modified) (2 diffs)
-
Source/WebCore/html/track/AudioTrack.cpp (modified) (7 diffs)
-
Source/WebCore/html/track/AudioTrack.h (modified) (1 diff)
-
Source/WebCore/html/track/TextTrack.cpp (modified) (5 diffs)
-
Source/WebCore/html/track/TextTrack.h (modified) (1 diff)
-
Source/WebCore/html/track/VTTCue.cpp (modified) (6 diffs)
-
Source/WebCore/html/track/VideoTrack.cpp (modified) (5 diffs)
-
Source/WebCore/html/track/VideoTrack.h (modified) (1 diff)
-
Source/WebCore/html/track/WebVTTParser.cpp (modified) (2 diffs)
-
Source/WebCore/inspector/agents/InspectorCSSAgent.cpp (modified) (2 diffs)
-
Source/WebCore/loader/FormSubmission.cpp (modified) (2 diffs)
-
Source/WebCore/loader/NavigationScheduler.cpp (modified) (2 diffs)
-
Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp (modified) (2 diffs)
-
Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (modified) (2 diffs)
-
Source/WebCore/mathml/MathMLPresentationElement.cpp (modified) (1 diff)
-
Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (modified) (2 diffs)
-
Source/WebCore/page/Page.cpp (modified) (2 diffs)
-
Source/WebCore/page/PageSerializer.cpp (modified) (2 diffs)
-
Source/WebCore/page/PrintContext.cpp (modified) (2 diffs)
-
Source/WebCore/page/ProcessWarming.cpp (modified) (2 diffs)
-
Source/WebCore/platform/CommonAtomStrings.cpp (copied) (copied from trunk/Source/WebCore/editing/FontShadow.cpp ) (2 diffs)
-
Source/WebCore/platform/CommonAtomStrings.h (copied) (copied from trunk/Source/WebCore/editing/FontShadow.cpp ) (2 diffs)
-
Source/WebCore/platform/Pasteboard.cpp (modified) (2 diffs)
-
Source/WebCore/platform/StaticPasteboard.cpp (modified) (2 diffs)
-
Source/WebCore/platform/animation/Animation.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/MediaPlayer.cpp (modified) (3 diffs)
-
Source/WebCore/platform/ios/wak/WebCoreThread.mm (modified) (2 diffs)
-
Source/WebCore/platform/network/HTTPParsers.cpp (modified) (1 diff)
-
Source/WebCore/style/Styleable.cpp (modified) (3 diffs)
-
Source/WebCore/svg/SVGAnimateMotionElement.cpp (modified) (2 diffs)
-
Source/WebCore/svg/SVGAnimationElement.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGFEConvolveMatrixElement.h (modified) (3 diffs)
-
Source/WebCore/svg/SVGMarkerTypes.h (modified) (4 diffs)
-
Source/WebCore/svg/SVGStyleElement.cpp (modified) (2 diffs)
-
Source/WebCore/svg/SVGTextPathElement.h (modified) (3 diffs)
-
Source/WebCore/svg/animation/SVGSMILElement.cpp (modified) (3 diffs)
-
Source/WebCore/svg/properties/SVGPropertyTraits.h (modified) (1 diff)
-
Source/WebCore/workers/service/context/ServiceWorkerThread.cpp (modified) (2 diffs)
-
Source/WebCore/xml/XPathValue.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/GPUProcess/GPUProcess.cpp (modified) (2 diffs)
-
Source/WebKit/NetworkProcess/NetworkProcess.cpp (modified) (2 diffs)
-
Source/WebKit/Shared/Cocoa/WebKit2InitializeCocoa.mm (modified) (2 diffs)
-
Source/WebKit/Shared/WebKit2Initialize.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp (modified) (2 diffs)
-
Source/WebKitLegacy/win/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/win/WebKitGraphics.cpp (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebCore/FontShadowTests.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r293279 r293285 1 2022-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 1 15 2022-04-22 Diego Pino Garcia <dpino@igalia.com> 2 16 -
trunk/Source/WTF/wtf/text/AtomString.cpp
r293129 r293285 138 138 WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlAtomData; 139 139 WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlnsAtomData; 140 WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> trueAtomData;141 WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> falseAtomData;142 140 143 141 void AtomString::init() … … 160 158 xmlAtomData.constructWithoutAccessCheck("xml", AtomString::ConstructFromLiteral); 161 159 xmlnsAtomData.constructWithoutAccessCheck("xmlns", AtomString::ConstructFromLiteral); 162 trueAtomData.constructWithoutAccessCheck("true", AtomString::ConstructFromLiteral);163 falseAtomData.constructWithoutAccessCheck("false", AtomString::ConstructFromLiteral);164 160 }); 165 161 } -
trunk/Source/WTF/wtf/text/AtomString.h
r293129 r293285 294 294 extern WTF_EXPORT_PRIVATE MainThreadLazyNeverDestroyed<const AtomString> xmlAtomData; 295 295 extern 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;298 296 299 297 inline const AtomString& nullAtom() { return nullAtomData.get(); } … … 302 300 inline const AtomString& xmlAtom() { return xmlAtomData.get(); } 303 301 inline const AtomString& xmlnsAtom() { return xmlnsAtomData.get(); } 304 inline const AtomString& trueAtom() { return trueAtomData.get(); }305 inline const AtomString& falseAtom() { return falseAtomData.get(); }306 302 307 303 inline AtomString AtomString::fromUTF8(const char* characters, size_t length) … … 363 359 using WTF::nullAtom; 364 360 using WTF::emptyAtom; 365 using WTF::falseAtom;366 361 using WTF::starAtom; 367 using WTF::trueAtom;368 362 using WTF::xmlAtom; 369 363 using WTF::xmlnsAtom; -
trunk/Source/WebCore/ChangeLog
r293279 r293285 1 2022-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 1 224 2022-04-22 Diego Pino Garcia <dpino@igalia.com> 2 225 -
trunk/Source/WebCore/Headers.cmake
r293251 r293285 1243 1243 platform/ColorChooser.h 1244 1244 platform/ColorChooserClient.h 1245 platform/CommonAtomStrings.h 1245 1246 platform/ContentFilterUnblockHandler.h 1246 1247 platform/ContentType.h -
trunk/Source/WebCore/Modules/async-clipboard/Clipboard.cpp
r290026 r293285 29 29 #include "ClipboardImageReader.h" 30 30 #include "ClipboardItem.h" 31 #include "CommonAtomStrings.h" 31 32 #include "Document.h" 32 33 #include "Editor.h" … … 235 236 } 236 237 237 if (type == "text/plain"_s) {238 if (type == textPlainContentTypeAtom()) { 238 239 PasteboardPlainText plainTextReader; 239 240 activePasteboard().read(plainTextReader, PlainTextURLReadingPolicy::IgnoreURL, itemIndex); -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
r292027 r293285 31 31 #if ENABLE(MEDIA_STREAM) 32 32 33 #include "CommonAtomStrings.h" 33 34 #include "Document.h" 34 35 #include "Event.h" … … 137 138 static MainThreadNeverDestroyed<const AtomString> musicHint("music", AtomString::ConstructFromLiteral); 138 139 static MainThreadNeverDestroyed<const AtomString> detailHint("detail", AtomString::ConstructFromLiteral); 139 static MainThreadNeverDestroyed<const AtomString> textHint("text", AtomString::ConstructFromLiteral);140 140 static MainThreadNeverDestroyed<const AtomString> motionHint("motion", AtomString::ConstructFromLiteral); 141 141 … … 152 152 return detailHint; 153 153 case MediaStreamTrackPrivate::HintValue::Text: 154 return text Hint;154 return textAtom(); 155 155 default: 156 156 return emptyAtom(); … … 177 177 else if (hintValue == "motion") 178 178 value = MediaStreamTrackPrivate::HintValue::Motion; 179 else if (hintValue == "text")179 else if (hintValue == textAtom()) 180 180 value = MediaStreamTrackPrivate::HintValue::Text; 181 181 else -
trunk/Source/WebCore/Sources.txt
r293251 r293285 1869 1869 page/scrolling/ScrollingTreeStickyNode.cpp 1870 1870 page/scrolling/ThreadedScrollingTree.cpp 1871 platform/CommonAtomStrings.cpp 1871 1872 platform/ContentType.cpp 1872 1873 platform/ContextMenu.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r293251 r293285 2734 2734 839AAFED1A0C0C8D00605F99 /* HTMLWBRElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */; }; 2735 2735 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, ); }; }; 2736 2737 83A2ABDB24D86DE000E2D73D /* DelayOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A2ABD824D86DC600E2D73D /* DelayOptions.h */; }; 2737 2738 83A8AC401FABBFE5002064AC /* ServiceWorkerIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A8AC3E1FABBFD1002064AC /* ServiceWorkerIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 12308 12309 839BE6D224F58755004DF50F /* IIRFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IIRFilter.h; sourceTree = "<group>"; }; 12309 12310 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>"; }; 12310 12313 83A2ABD824D86DC600E2D73D /* DelayOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DelayOptions.h; sourceTree = "<group>"; }; 12311 12314 83A2ABDA24D86DC700E2D73D /* DelayOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DelayOptions.idl; sourceTree = "<group>"; }; … … 30182 30185 C37CDEBC149EF2030042090D /* ColorChooserClient.h */, 30183 30186 BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */, 30187 839C69CD2810D11C00E69BAD /* CommonAtomStrings.cpp */, 30188 839C69CE2810D11C00E69BAD /* CommonAtomStrings.h */, 30184 30189 A14090FC1AA51E480091191A /* ContentFilterUnblockHandler.h */, 30185 30190 41D015C90F4B5C71004A662F /* ContentType.cpp */, … … 34081 34086 A584FE2618637DAB00843B10 /* CommandLineAPIModuleSource.h in Headers */, 34082 34087 6550B6A2099DF0270090D781 /* Comment.h in Headers */, 34088 839C69D02810D11D00E69BAD /* CommonAtomStrings.h in Headers */, 34083 34089 57E664FC1E73703300765536 /* CommonCryptoDERUtilities.h in Headers */, 34084 34090 E1FE137518402A6700892F13 /* CommonCryptoUtilities.h in Headers */, -
trunk/Source/WebCore/animation/AnimationEffect.cpp
r291863 r293285 28 28 29 29 #include "CSSAnimation.h" 30 #include "CommonAtomStrings.h" 30 31 #include "FillMode.h" 31 32 #include "JSComputedEffectTiming.h" … … 70 71 timing.iterations = m_iterations; 71 72 if (m_iterationDuration == 0_s) 72 timing.duration = "auto"_s;73 timing.duration = autoAtom(); 73 74 else 74 75 timing.duration = secondsToWebAnimationsAPITime(m_iterationDuration); … … 400 401 return Exception { TypeError }; 401 402 } else { 402 if (std::get<String>(timing->duration.value()) != "auto")403 if (std::get<String>(timing->duration.value()) != autoAtom()) 403 404 return Exception { TypeError }; 404 405 } -
trunk/Source/WebCore/animation/EffectTiming.h
r291863 r293285 26 26 #pragma once 27 27 28 #include "CommonAtomStrings.h" 28 29 #include "FillMode.h" 29 30 #include "PlaybackDirection.h" … … 34 35 35 36 struct EffectTiming { 36 std::variant<double, String> duration { "auto"_s};37 std::variant<double, String> duration { autoAtom() }; 37 38 double delay { 0 }; 38 39 double endDelay { 0 }; -
trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp
r293056 r293285 31 31 #include "CSSParser.h" 32 32 #include "CSSSelectorList.h" 33 #include "CommonAtomStrings.h" 33 34 #include "ContentExtensionError.h" 34 35 #include "ContentExtensionRule.h" … … 204 205 { 205 206 ASSERT(isMainThread()); 206 AtomString::init();207 initializeCommonAtomStrings(); 207 208 QualifiedName::init(); 208 209 CSSParserContext context(HTMLQuirksMode); -
trunk/Source/WebCore/css/CSSStyleSheet.h
r293232 r293285 22 22 23 23 #include "CSSRuleList.h" 24 #include "CommonAtomStrings.h" 24 25 #include "ExceptionOr.h" 25 26 #include "StyleSheet.h" … … 140 141 141 142 bool isCSSStyleSheet() const final { return true; } 142 String type() const final { return "text/css"_s; }143 String type() const final { return cssContentTypeAtom(); } 143 144 144 145 Ref<StyleSheetContents> m_contents; -
trunk/Source/WebCore/css/FontFace.cpp
r291863 r293285 406 406 const auto& loadingBehaviorWrapped = m_backing->loadingBehavior(); 407 407 if (!loadingBehaviorWrapped) 408 return "auto"_s;408 return autoAtom(); 409 409 return context.cssValuePool().createValue(loadingBehaviorWrapped.value())->cssText(); 410 410 } -
trunk/Source/WebCore/css/MediaFeatureNames.cpp
r246490 r293285 22 22 #include "MediaFeatureNames.h" 23 23 24 #include "CommonAtomStrings.h" 25 24 26 namespace WebCore { 25 27 namespace MediaFeatureNames { … … 33 35 static bool initialized; 34 36 if (!initialized) { 35 AtomString::init();37 initializeCommonAtomStrings(); 36 38 #define INITIALIZE_GLOBAL(name, string) name.construct(string, AtomString::ConstructFromLiteral); 37 39 CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(INITIALIZE_GLOBAL) -
trunk/Source/WebCore/dom/DataTransfer.cpp
r292487 r293285 29 29 #include "CachedImage.h" 30 30 #include "CachedImageClient.h" 31 #include "CommonAtomStrings.h" 31 32 #include "DataTransferItem.h" 32 33 #include "DataTransferItemList.h" … … 128 129 String lowercaseType = stripLeadingAndTrailingHTMLSpaces(type).convertToASCIILowercase(); 129 130 if (lowercaseType == "text" || lowercaseType.startsWith("text/plain;")) 130 return "text/plain"_s;131 return textPlainContentTypeAtom(); 131 132 if (lowercaseType == "url" || lowercaseType.startsWith("text/uri-list;")) 132 133 return "text/uri-list"_s; … … 266 267 if (url.isValid()) 267 268 sanitizedData = url.string(); 268 } else if (type == "text/plain")269 } else if (type == textPlainContentTypeAtom()) 269 270 sanitizedData = data; // Nothing to sanitize. 270 271 … … 429 430 { 430 431 auto pasteboard = makeUnique<StaticPasteboard>(); 431 pasteboard->writeString( "text/plain"_s, plainText);432 pasteboard->writeString(textPlainContentTypeAtom(), plainText); 432 433 pasteboard->writeString("text/html"_s, htmlText); 433 434 return adoptRef(*new DataTransfer(StoreMode::Readonly, WTFMove(pasteboard), Type::InputEvent)); … … 468 469 String DataTransfer::dropEffect() const 469 470 { 470 return "none"_s;471 return noneAtom(); 471 472 } 472 473 -
trunk/Source/WebCore/dom/Document.cpp
r293202 r293285 47 47 #include "ChromeClient.h" 48 48 #include "Comment.h" 49 #include "CommonAtomStrings.h" 49 50 #include "CommonVM.h" 50 51 #include "ComposedTreeIterator.h" … … 6010 6011 String Document::designMode() const 6011 6012 { 6012 return inDesignMode() ? "on"_s : "off"_s;6013 return inDesignMode() ? onAtom() : offAtom(); 6013 6014 } 6014 6015 -
trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp
r288617 r293285 22 22 #include "InlineStyleSheetOwner.h" 23 23 24 #include "CommonAtomStrings.h" 24 25 #include "ContentSecurityPolicy.h" 25 26 #include "ElementInlines.h" … … 152 153 // even though other things are case sensitive in that context. MIME types should never be case sensitive. 153 154 // 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(); 156 156 } 157 157 -
trunk/Source/WebCore/dom/ProcessingInstruction.cpp
r293059 r293285 28 28 #include "CachedResourceRequest.h" 29 29 #include "CachedXSLStyleSheet.h" 30 #include "CommonAtomStrings.h" 30 31 #include "DocumentInlines.h" 31 32 #include "Frame.h" … … 95 96 String type = attributes->get<HashTranslatorASCIILiteral>("type"_s); 96 97 97 m_isCSS = type.isEmpty() || type == "text/css";98 m_isCSS = type.isEmpty() || type == cssContentTypeAtom(); 98 99 #if ENABLE(XSLT) 99 100 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 29 29 #include "Chrome.h" 30 30 #include "ChromeClient.h" 31 #include "CommonAtomStrings.h" 31 32 #include "ContextMenuController.h" 32 33 #include "ElementInlines.h" -
trunk/Source/WebCore/editing/FontShadow.cpp
r286630 r293285 28 28 29 29 #include "ColorSerialization.h" 30 #include "CommonAtomStrings.h" 30 31 #include <wtf/text/StringBuilder.h> 31 32 … … 35 36 { 36 37 if (shadow.offset.isZero() && !shadow.blurRadius) 37 return "none"_s;38 return noneAtom(); 38 39 39 40 if (!shadow.color.isValid()) 40 return "none"_s;41 return noneAtom(); 41 42 42 43 StringBuilder builder; -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r293059 r293285 34 34 #include "CSSComputedStyleDeclaration.h" 35 35 #include "CSSStyleDeclaration.h" 36 #include "CommonAtomStrings.h" 36 37 #include "DOMWrapperWorld.h" 37 38 #include "DataTransfer.h" … … 719 720 element->cssomStyle().setPropertyInternal(CSSPropertyDisplay, "inline"_s, false); 720 721 if (element->renderer() && element->renderer()->style().isFloating()) 721 element->cssomStyle().setPropertyInternal(CSSPropertyFloat, "none"_s, false);722 element->cssomStyle().setPropertyInternal(CSSPropertyFloat, noneAtom(), false); 722 723 } 723 724 } -
trunk/Source/WebCore/editing/cocoa/DataDetection.mm
r293129 r293285 33 33 #import "ColorConversion.h" 34 34 #import "ColorSerialization.h" 35 #import "CommonAtomStrings.h" 35 36 #import "DataDetectionResultsStorage.h" 36 37 #import "Editing.h" -
trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm
r293042 r293285 35 35 #import "ColorCocoa.h" 36 36 #import "ColorMac.h" 37 #import "CommonAtomStrings.h" 37 38 #import "ComposedTreeIterator.h" 38 39 #import "Document.h" … … 598 599 case CSSPropertyDisplay: 599 600 if (element.hasTagName(headTag) || element.hasTagName(scriptTag) || element.hasTagName(appletTag) || element.hasTagName(noframesTag)) 600 return "none"_s;601 return noneAtom(); 601 602 else if (element.hasTagName(addressTag) || element.hasTagName(blockquoteTag) || element.hasTagName(bodyTag) || element.hasTagName(centerTag) 602 603 || element.hasTagName(ddTag) || element.hasTagName(dirTag) || element.hasTagName(divTag) || element.hasTagName(dlTag) … … 1018 1019 String letterSpacing = _caches->propertyValueForNode(element, CSSPropertyLetterSpacing); 1019 1020 if (fontKerning.length() || letterSpacing.length()) { 1020 if (fontKerning == "none")1021 if (fontKerning == noneAtom()) 1021 1022 [attrs setObject:@0.0 forKey:NSKernAttributeName]; 1022 1023 else { … … 1111 1112 String hyphenation = _caches->propertyValueForNode(coreBlockElement, CSSPropertyWebkitHyphens); 1112 1113 if (hyphenation.length()) { 1113 if (hyphenation == "auto")1114 if (hyphenation == autoAtom()) 1114 1115 [paragraphStyle setHyphenationFactor:1.0]; 1115 1116 else … … 1611 1612 if (element.hasTagName(headTag) && !embedded) 1612 1613 _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")) { 1614 1615 if (_caches->isBlockElement(element) && !element.hasTagName(brTag) && !(displayValue == "table-cell" && [_textTables count] == 0) 1615 1616 && !([_textLists count] > 0 && displayValue == "block" && !element.hasTagName(liTag) && !element.hasTagName(ulTag) && !element.hasTagName(olTag))) … … 1866 1867 if (is<HTMLInputElement>(element)) { 1867 1868 HTMLInputElement& inputElement = downcast<HTMLInputElement>(element); 1868 if (inputElement.type() == "text") {1869 if (inputElement.type() == textAtom()) { 1869 1870 NSString *value = inputElement.value(); 1870 1871 if (value && [value length] > 0) -
trunk/Source/WebCore/editing/markup.cpp
r293059 r293285 38 38 #include "ChildListMutationScope.h" 39 39 #include "Comment.h" 40 #include "CommonAtomStrings.h" 40 41 #include "ComposedTreeIterator.h" 41 42 #include "DocumentFragment.h" … … 1286 1287 auto fakeBody = HTMLBodyElement::create(outputDoc); 1287 1288 fragment->parseHTML(WTFMove(sourceString), fakeBody.ptr()); 1288 } else if (sourceMIMEType == "text/plain")1289 } else if (sourceMIMEType == textPlainContentTypeAtom()) 1289 1290 fragment->parserAppendChild(Text::create(outputDoc, WTFMove(sourceString))); 1290 1291 else { -
trunk/Source/WebCore/html/Autocapitalize.cpp
r262665 r293285 29 29 #if ENABLE(AUTOCAPITALIZE) 30 30 31 #include "CommonAtomStrings.h" 31 32 #include <wtf/NeverDestroyed.h> 32 33 … … 57 58 case AutocapitalizeType::Default: 58 59 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(); 63 62 case AutocapitalizeType::Sentences: { 64 63 static MainThreadNeverDestroyed<const AtomString> valueSentences("sentences", AtomString::ConstructFromLiteral); -
trunk/Source/WebCore/html/Autofill.cpp
r292963 r293285 27 27 #include "Autofill.h" 28 28 29 #include "CommonAtomStrings.h" 29 30 #include "ElementInlines.h" 30 31 #include "HTMLFormControlElement.h" … … 137 138 AutofillData AutofillData::createFromHTMLFormControlElement(const HTMLFormControlElement& element) 138 139 { 139 static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral);140 static MainThreadNeverDestroyed<const AtomString> off("off", AtomString::ConstructFromLiteral);141 142 140 // Label: Default 143 141 // 26. Let the element's IDL-exposed autofill value be the empty string, and its autofill hint set and autofill scope be empty. … … 150 148 151 149 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() }; 155 153 }; 156 154 … … 200 198 // Then, abort these steps. 201 199 if (category == AutofillCategory::Off) 202 return { off , off.get().string() };200 return { offAtom(), offAtom().string() }; 203 201 204 202 // 8. If category is Automatic, let the element's autofill field name be the string "on", … … 206 204 // "on". Then, abort these steps. 207 205 if (category == AutofillCategory::Automatic) 208 return { on , on.get().string() };206 return { onAtom(), onAtom().string() }; 209 207 210 208 // 9. Let scope tokens be an empty list. -
trunk/Source/WebCore/html/BaseCheckableInputType.cpp
r291396 r293285 33 33 #include "BaseCheckableInputType.h" 34 34 35 #include "CommonAtomStrings.h" 35 36 #include "DOMFormData.h" 36 37 #include "FormController.h" … … 47 48 { 48 49 ASSERT(element()); 49 return { element()->checked() ? "on"_s : "off"_s};50 return { element()->checked() ? onAtom() : offAtom() }; 50 51 } 51 52 … … 53 54 { 54 55 ASSERT(element()); 55 element()->setChecked(state[0] == "on");56 element()->setChecked(state[0] == onAtom()); 56 57 } 57 58 … … 100 101 String BaseCheckableInputType::fallbackValue() const 101 102 { 102 static MainThreadNeverDestroyed<const AtomString> on("on", AtomString::ConstructFromLiteral); 103 return on.get(); 103 return onAtom(); 104 104 } 105 105 -
trunk/Source/WebCore/html/EnterKeyHint.cpp
r291992 r293285 26 26 #include "config.h" 27 27 #include "EnterKeyHint.h" 28 29 #include "CommonAtomStrings.h" 28 30 29 31 namespace WebCore { … … 64 66 return "previous"_s; 65 67 case EnterKeyHint::Search: 66 return "search"_s;68 return searchAtom(); 67 69 case EnterKeyHint::Send: 68 70 return "send"_s; -
trunk/Source/WebCore/html/HTMLAudioElement.cpp
r292810 r293285 30 30 #include "HTMLAudioElement.h" 31 31 32 #include "CommonAtomStrings.h" 32 33 #include "HTMLNames.h" 33 34 #include <wtf/IsoMallocInlines.h> … … 55 56 { 56 57 auto element = create(audioTag, document, false); 57 element->setAttributeWithoutSynchronization(preloadAttr, "auto"_s);58 element->setAttributeWithoutSynchronization(preloadAttr, autoAtom()); 58 59 element->setAttributeWithoutSynchronization(srcAttr, src); 59 60 return element; -
trunk/Source/WebCore/html/HTMLButtonElement.cpp
r292960 r293285 27 27 #include "HTMLButtonElement.h" 28 28 29 #include "CommonAtomStrings.h" 29 30 #include "DOMFormData.h" 30 31 #include "ElementInlines.h" … … 83 84 { 84 85 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(); 95 92 } 96 93 -
trunk/Source/WebCore/html/HTMLElement.cpp
r293129 r293285 33 33 #include "Chrome.h" 34 34 #include "ChromeClient.h" 35 #include "CommonAtomStrings.h" 35 36 #include "DOMTokenList.h" 36 37 #include "DocumentFragment.h" … … 416 417 static MainThreadNeverDestroyed<const AtomString> ltrValue("ltr", AtomString::ConstructFromLiteral); 417 418 static MainThreadNeverDestroyed<const AtomString> rtlValue("rtl", AtomString::ConstructFromLiteral); 418 static MainThreadNeverDestroyed<const AtomString> autoValue("auto", AtomString::ConstructFromLiteral);419 419 if (equalLettersIgnoringASCIICase(value, "ltr")) 420 420 return ltrValue; … … 422 422 return rtlValue; 423 423 if (equalLettersIgnoringASCIICase(value, "auto")) 424 return auto Value;424 return autoAtom(); 425 425 return nullAtom(); 426 426 } … … 579 579 return falseAtom(); 580 580 case ContentEditableType::PlaintextOnly: 581 return "plaintext-only"_s;581 return plaintextOnlyAtom(); 582 582 } 583 583 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();590 584 } 591 585 … … 597 591 setAttributeWithoutSynchronization(contenteditableAttr, falseAtom()); 598 592 else if (equalLettersIgnoringASCIICase(enabled, "plaintext-only")) 599 setAttributeWithoutSynchronization(contenteditableAttr, plaintextOnly Name());593 setAttributeWithoutSynchronization(contenteditableAttr, plaintextOnlyAtom()); 600 594 else if (equalLettersIgnoringASCIICase(enabled, "inherit")) 601 595 removeAttribute(contenteditableAttr); … … 1065 1059 void HTMLElement::setAutocorrect(bool autocorrect) 1066 1060 { 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()); 1070 1062 } 1071 1063 -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r292960 r293285 26 26 #include "HTMLFormElement.h" 27 27 28 #include "CommonAtomStrings.h" 28 29 #include "DOMFormData.h" 29 30 #include "DOMTokenList.h" … … 1013 1014 const AtomString& HTMLFormElement::autocomplete() const 1014 1015 { 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(); 1019 1017 } 1020 1018 -
trunk/Source/WebCore/html/HTMLIFrameElement.cpp
r283851 r293285 27 27 28 28 #include "CSSPropertyNames.h" 29 #include "CommonAtomStrings.h" 29 30 #include "DOMTokenList.h" 30 31 #include "ElementInlines.h" … … 158 159 const AtomString& HTMLIFrameElement::loadingForBindings() const 159 160 { 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(); 163 162 } 164 163 -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r293042 r293285 29 29 #include "Chrome.h" 30 30 #include "ChromeClient.h" 31 #include "CommonAtomStrings.h" 31 32 #include "Editor.h" 32 33 #include "ElementIterator.h" … … 675 676 break; 676 677 } 677 return "auto"_s;678 return autoAtom(); 678 679 } 679 680 … … 897 898 const AtomString& HTMLImageElement::loadingForBindings() const 898 899 { 899 static MainThreadNeverDestroyed<const AtomString> eager("eager", AtomString::ConstructFromLiteral);900 static MainThreadNeverDestroyed<const AtomString> lazy("lazy", AtomString::ConstructFromLiteral);901 900 auto& attributeValue = attributeWithoutSynchronization(HTMLNames::loadingAttr); 902 return hasLazyLoadableAttributeValue(attributeValue) ? lazy : eager;901 return hasLazyLoadableAttributeValue(attributeValue) ? lazyAtom() : eagerAtom(); 903 902 } 904 903 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r293170 r293285 40 40 #include "Chrome.h" 41 41 #include "ChromeClient.h" 42 #include "CommonAtomStrings.h" 42 43 #include "CommonVM.h" 43 44 #include "ContentRuleListResults.h" … … 3650 3651 // "preload" - On getting: none. On setting: ignored. 3651 3652 if (m_mediaStreamSrcObject) 3652 return "none"_s;3653 return noneAtom(); 3653 3654 #endif 3654 3655 3655 3656 switch (m_preload) { 3656 3657 case MediaPlayer::Preload::None: 3657 return "none"_s;3658 return noneAtom(); 3658 3659 case MediaPlayer::Preload::MetaData: 3659 3660 return "metadata"_s; 3660 3661 case MediaPlayer::Preload::Auto: 3661 return "auto"_s;3662 return autoAtom(); 3662 3663 } 3663 3664 -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r293059 r293285 29 29 #include "CSSPrimitiveValueMappings.h" 30 30 #include "ChromeClient.h" 31 #include "CommonAtomStrings.h" 31 32 #include "DocumentInlines.h" 32 33 #include "Editing.h" … … 435 436 static const AtomString& directionString(TextFieldSelectionDirection direction) 436 437 { 437 static MainThreadNeverDestroyed<const AtomString> none("none", AtomString::ConstructFromLiteral);438 438 static MainThreadNeverDestroyed<const AtomString> forward("forward", AtomString::ConstructFromLiteral); 439 439 static MainThreadNeverDestroyed<const AtomString> backward("backward", AtomString::ConstructFromLiteral); … … 441 441 switch (direction) { 442 442 case SelectionHasNoDirection: 443 return none ;443 return noneAtom(); 444 444 case SelectionHasForwardDirection: 445 445 return forward; … … 449 449 450 450 ASSERT_NOT_REACHED(); 451 return none ;451 return noneAtom(); 452 452 } 453 453 -
trunk/Source/WebCore/html/InputMode.cpp
r261013 r293285 27 27 #include "InputMode.h" 28 28 29 #include "CommonAtomStrings.h" 29 30 #include <wtf/NeverDestroyed.h> 30 31 … … 83 84 const AtomString& none() 84 85 { 85 static MainThreadNeverDestroyed<const AtomString> mode("none", AtomString::ConstructFromLiteral); 86 return mode; 86 return noneAtom(); 87 87 } 88 88 89 89 const AtomString& text() 90 90 { 91 static MainThreadNeverDestroyed<const AtomString> mode("text", AtomString::ConstructFromLiteral); 92 return mode; 91 return textAtom(); 93 92 } 94 93 95 94 const AtomString& tel() 96 95 { 97 static MainThreadNeverDestroyed<const AtomString> mode("tel", AtomString::ConstructFromLiteral); 98 return mode; 96 return telAtom(); 99 97 } 100 98 101 99 const AtomString& url() 102 100 { 103 static MainThreadNeverDestroyed<const AtomString> mode("url", AtomString::ConstructFromLiteral); 104 return mode; 101 return urlAtom(); 105 102 } 106 103 107 104 const AtomString& email() 108 105 { 109 static MainThreadNeverDestroyed<const AtomString> mode("email", AtomString::ConstructFromLiteral); 110 return mode; 106 return emailAtom(); 111 107 } 112 108 … … 125 121 const AtomString& search() 126 122 { 127 static MainThreadNeverDestroyed<const AtomString> mode("search", AtomString::ConstructFromLiteral); 128 return mode; 123 return searchAtom(); 129 124 } 130 125 -
trunk/Source/WebCore/html/InputTypeNames.cpp
r293086 r293285 23 23 #include "InputTypeNames.h" 24 24 25 #include "CommonAtomStrings.h" 25 26 #include "HTMLNames.h" 26 27 #include <wtf/NeverDestroyed.h> … … 64 65 const AtomString& email() 65 66 { 66 static MainThreadNeverDestroyed<const AtomString> name("email", AtomString::ConstructFromLiteral); 67 return name; 67 return emailAtom(); 68 68 } 69 69 … … 118 118 const AtomString& reset() 119 119 { 120 static MainThreadNeverDestroyed<const AtomString> name("reset", AtomString::ConstructFromLiteral); 121 return name; 120 return resetAtom(); 122 121 } 123 122 124 123 const AtomString& search() 125 124 { 126 static MainThreadNeverDestroyed<const AtomString> name("search", AtomString::ConstructFromLiteral); 127 return name; 125 return searchAtom(); 128 126 } 129 127 130 128 const AtomString& submit() 131 129 { 132 static MainThreadNeverDestroyed<const AtomString> name("submit", AtomString::ConstructFromLiteral); 133 return name; 130 return submitAtom(); 134 131 } 135 132 136 133 const AtomString& telephone() 137 134 { 138 static MainThreadNeverDestroyed<const AtomString> name("tel", AtomString::ConstructFromLiteral); 139 return name; 135 return telAtom(); 140 136 } 141 137 142 138 const AtomString& text() 143 139 { 144 static MainThreadNeverDestroyed<const AtomString> name("text", AtomString::ConstructFromLiteral); 145 return name; 140 return textAtom(); 146 141 } 147 142 … … 154 149 const AtomString& url() 155 150 { 156 static MainThreadNeverDestroyed<const AtomString> name("url", AtomString::ConstructFromLiteral); 157 return name; 151 return urlAtom(); 158 152 } 159 153 -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r293129 r293285 30 30 #include "CSSPrimitiveValue.h" 31 31 #include "CSSToLengthConversionData.h" 32 #include "CommonAtomStrings.h" 32 33 #include "Document.h" 33 34 #include "EventNames.h" … … 151 152 void TextControlInnerTextElement::updateInnerTextElementEditabilityImpl(bool isEditable, bool initialization) 152 153 { 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(); 155 155 if (initialization) { 156 156 Vector<Attribute> attributes { Attribute(contenteditableAttr, value) }; -
trunk/Source/WebCore/html/track/AudioTrack.cpp
r287574 r293285 39 39 #include "AudioTrackList.h" 40 40 #include "AudioTrackPrivate.h" 41 #include "CommonAtomStrings.h" 41 42 #include <wtf/NeverDestroyed.h> 42 43 43 44 namespace WebCore { 44 45 const AtomString& AudioTrack::alternativeKeyword()46 {47 static MainThreadNeverDestroyed<const AtomString> alternative("alternative", AtomString::ConstructFromLiteral);48 return alternative;49 }50 45 51 46 const AtomString& AudioTrack::descriptionKeyword() … … 55 50 } 56 51 57 const AtomString& AudioTrack::mainKeyword()58 {59 static MainThreadNeverDestroyed<const AtomString> main("main", AtomString::ConstructFromLiteral);60 return main;61 }62 63 52 const AtomString& AudioTrack::mainDescKeyword() 64 53 { … … 71 60 static MainThreadNeverDestroyed<const AtomString> translation("translation", AtomString::ConstructFromLiteral); 72 61 return translation; 73 }74 75 const AtomString& AudioTrack::commentaryKeyword()76 {77 static MainThreadNeverDestroyed<const AtomString> commentary("commentary", AtomString::ConstructFromLiteral);78 return commentary;79 62 } 80 63 … … 124 107 bool AudioTrack::isValidKind(const AtomString& value) const 125 108 { 126 return value == alternative Keyword()127 || value == commentary Keyword()109 return value == alternativeAtom() 110 || value == commentaryAtom() 128 111 || value == descriptionKeyword() 129 || value == main Keyword()112 || value == mainAtom() 130 113 || value == mainDescKeyword() 131 114 || value == translationKeyword(); … … 209 192 switch (m_private->kind()) { 210 193 case AudioTrackPrivate::Alternative: 211 setKind( AudioTrack::alternativeKeyword());194 setKind(alternativeAtom()); 212 195 break; 213 196 case AudioTrackPrivate::Description: … … 215 198 break; 216 199 case AudioTrackPrivate::Main: 217 setKind( AudioTrack::mainKeyword());200 setKind(mainAtom()); 218 201 break; 219 202 case AudioTrackPrivate::MainDesc: … … 224 207 break; 225 208 case AudioTrackPrivate::Commentary: 226 setKind( AudioTrack::commentaryKeyword());209 setKind(commentaryAtom()); 227 210 break; 228 211 case AudioTrackPrivate::None: -
trunk/Source/WebCore/html/track/AudioTrack.h
r287574 r293285 47 47 virtual ~AudioTrack(); 48 48 49 static const AtomString& alternativeKeyword();50 49 static const AtomString& descriptionKeyword(); 51 static const AtomString& mainKeyword();52 50 static const AtomString& mainDescKeyword(); 53 51 static const AtomString& translationKeyword(); 54 static const AtomString& commentaryKeyword();55 52 56 53 bool enabled() const final { return m_enabled; } -
trunk/Source/WebCore/html/track/TextTrack.cpp
r292810 r293285 51 51 WTF_MAKE_ISO_ALLOCATED_IMPL(TextTrack); 52 52 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 65 53 static const AtomString& descriptionsKeyword() 66 54 { … … 104 92 , m_trackType(type) 105 93 { 106 if (kind == captions Keyword())94 if (kind == captionsAtom()) 107 95 m_kind = Kind::Captions; 108 96 else if (kind == chaptersKeyword()) … … 168 156 bool TextTrack::isValidKindKeyword(const AtomString& value) 169 157 { 170 if (value == subtitles Keyword())158 if (value == subtitlesAtom()) 171 159 return true; 172 if (value == captions Keyword())160 if (value == captionsAtom()) 173 161 return true; 174 162 if (value == descriptionsKeyword()) … … 188 176 switch (m_kind) { 189 177 case Kind::Captions: 190 return captions Keyword();178 return captionsAtom(); 191 179 case Kind::Chapters: 192 180 return chaptersKeyword(); … … 198 186 return metadataKeyword(); 199 187 case Kind::Subtitles: 200 return subtitles Keyword();188 return subtitlesAtom(); 201 189 } 202 190 ASSERT_NOT_REACHED(); 203 return subtitles Keyword();191 return subtitlesAtom(); 204 192 } 205 193 -
trunk/Source/WebCore/html/track/TextTrack.h
r283237 r293285 54 54 static TextTrack& captionMenuAutomaticItem(); 55 55 56 static const AtomString& subtitlesKeyword();57 56 static bool isValidKindKeyword(const AtomString&); 58 57 -
trunk/Source/WebCore/html/track/VTTCue.cpp
r293059 r293285 37 37 #include "CSSPropertyNames.h" 38 38 #include "CSSValueKeywords.h" 39 #include "CommonAtomStrings.h" 39 40 #include "DocumentFragment.h" 40 41 #include "ElementInlines.h" … … 138 139 } 139 140 140 static const String& autoKeyword()141 {142 static NeverDestroyed<const String> autoX(MAKE_STATIC_STRING_IMPL("auto"));143 return autoX;144 }145 146 141 // ---------------------------- 147 142 … … 478 473 return lineRightKeyword(); 479 474 case PositionAlignmentLignAuto: 480 return auto Keyword();475 return autoAtom(); 481 476 default: 482 477 ASSERT_NOT_REACHED(); … … 494 489 else if (value == lineRightKeyword()) 495 490 positionAlignment = PositionAlignmentLignRight; 496 else if (value == auto Keyword())491 else if (value == autoAtom()) 497 492 positionAlignment = PositionAlignmentLignAuto; 498 493 else … … 1330 1325 object.setBoolean("snapToLines"_s, snapToLines()); 1331 1326 if (m_linePosition) 1332 object.setString("line"_s, "auto"_s);1327 object.setString("line"_s, autoAtom()); 1333 1328 else 1334 1329 object.setDouble("line"_s, *m_linePosition); … … 1336 1331 object.setDouble("position"_s, *m_textPosition); 1337 1332 else 1338 object.setString("position"_s, "auto"_s);1333 object.setString("position"_s, autoAtom()); 1339 1334 object.setInteger("size"_s, m_cueSize); 1340 1335 object.setString("align"_s, align()); -
trunk/Source/WebCore/html/track/VideoTrack.cpp
r287574 r293285 35 35 #if ENABLE(VIDEO) 36 36 37 #include "CommonAtomStrings.h" 37 38 #include "VideoTrackClient.h" 38 39 #include "VideoTrackConfiguration.h" … … 47 48 namespace WebCore { 48 49 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 67 50 const AtomString& VideoTrack::signKeyword() 68 51 { 69 52 static MainThreadNeverDestroyed<const AtomString> sign("sign", AtomString::ConstructFromLiteral); 70 53 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;83 54 } 84 55 … … 119 90 bool VideoTrack::isValidKind(const AtomString& value) const 120 91 { 121 return value == alternative Keyword()122 || value == commentary Keyword()123 || value == captions Keyword()124 || value == main Keyword()92 return value == alternativeAtom() 93 || value == commentaryAtom() 94 || value == captionsAtom() 95 || value == mainAtom() 125 96 || value == signKeyword() 126 || value == subtitles Keyword();97 || value == subtitlesAtom(); 127 98 } 128 99 … … 242 213 switch (m_private->kind()) { 243 214 case VideoTrackPrivate::Alternative: 244 setKind( VideoTrack::alternativeKeyword());215 setKind(alternativeAtom()); 245 216 return; 246 217 case VideoTrackPrivate::Captions: 247 setKind( VideoTrack::captionsKeyword());218 setKind(captionsAtom()); 248 219 return; 249 220 case VideoTrackPrivate::Main: 250 setKind( VideoTrack::mainKeyword());221 setKind(mainAtom()); 251 222 return; 252 223 case VideoTrackPrivate::Sign: … … 254 225 return; 255 226 case VideoTrackPrivate::Subtitles: 256 setKind( VideoTrack::subtitlesKeyword());227 setKind(subtitlesAtom()); 257 228 return; 258 229 case VideoTrackPrivate::Commentary: 259 setKind( VideoTrack::commentaryKeyword());230 setKind(commentaryAtom()); 260 231 return; 261 232 case VideoTrackPrivate::None: -
trunk/Source/WebCore/html/track/VideoTrack.h
r287574 r293285 50 50 virtual ~VideoTrack(); 51 51 52 static const AtomString& alternativeKeyword();53 static const AtomString& captionsKeyword();54 static const AtomString& mainKeyword();55 52 static const AtomString& signKeyword(); 56 static const AtomString& subtitlesKeyword();57 static const AtomString& commentaryKeyword();58 53 59 54 bool selected() const { return m_selected; } -
trunk/Source/WebCore/html/track/WebVTTParser.cpp
r293059 r293285 36 36 #if ENABLE(VIDEO) 37 37 38 #include "CommonAtomStrings.h" 38 39 #include "Document.h" 39 40 #include "HTMLParserIdioms.h" … … 93 94 WebVTTParser::WebVTTParser(WebVTTParserClient& client, Document& document) 94 95 : m_document(document) 95 , m_decoder(TextResourceDecoder::create( "text/plain"_s, PAL::UTF8Encoding()))96 , m_decoder(TextResourceDecoder::create(textPlainContentTypeAtom(), PAL::UTF8Encoding())) 96 97 , m_client(client) 97 98 { -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
r293086 r293285 38 38 #include "CSSStyleSheet.h" 39 39 #include "CSSValueKeywords.h" 40 #include "CommonAtomStrings.h" 40 41 #include "ContainerNode.h" 41 42 #include "ContentSecurityPolicy.h" … … 783 784 784 785 auto styleElement = HTMLStyleElement::create(document); 785 styleElement->setAttributeWithoutSynchronization(HTMLNames::typeAttr, AtomString("text/css", AtomString::ConstructFromLiteral));786 styleElement->setAttributeWithoutSynchronization(HTMLNames::typeAttr, cssContentTypeAtom()); 786 787 787 788 ContainerNode* targetNode; -
trunk/Source/WebCore/loader/FormSubmission.cpp
r293056 r293285 33 33 #include "FormSubmission.h" 34 34 35 #include "CommonAtomStrings.h" 35 36 #include "ContentSecurityPolicy.h" 36 37 #include "DOMFormData.h" … … 104 105 return "multipart/form-data"_s; 105 106 if (equalLettersIgnoringASCIICase(type, "text/plain")) 106 return "text/plain"_s;107 return textPlainContentTypeAtom(); 107 108 return "application/x-www-form-urlencoded"_s; 108 109 } -
trunk/Source/WebCore/loader/NavigationScheduler.cpp
r292139 r293285 34 34 35 35 #include "BackForwardController.h" 36 #include "CommonAtomStrings.h" 36 37 #include "CommonVM.h" 37 38 #include "DOMWindow.h" … … 378 379 UserGestureIndicator gestureIndicator { userGestureToForward() }; 379 380 380 ResourceResponse replacementResponse { m_originDocument.url(), "text/plain"_s, 0, "UTF-8"_s };381 ResourceResponse replacementResponse { m_originDocument.url(), textPlainContentTypeAtom(), 0, "UTF-8"_s }; 381 382 SubstituteData replacementData { SharedBuffer::create(), m_originDocument.url(), replacementResponse, SubstituteData::SessionHistoryVisibility::Hidden }; 382 383 -
trunk/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp
r290350 r293285 34 34 #include "MHTMLParser.h" 35 35 36 #include "CommonAtomStrings.h" 36 37 #include "MHTMLArchive.h" 37 38 #include "MIMEHeader.h" … … 120 121 { 121 122 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()) { 123 124 m_resources.append(resource); 124 125 return; -
trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
r292801 r293285 29 29 #include "CachedResourceRequest.h" 30 30 #include "CachedStyleSheetClient.h" 31 #include "CommonAtomStrings.h" 31 32 #include "HTTPHeaderNames.h" 32 33 #include "HTTPParsers.h" … … 41 42 CachedCSSStyleSheet::CachedCSSStyleSheet(CachedResourceRequest&& request, PAL::SessionID sessionID, const CookieJar* cookieJar) 42 43 : 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())) 44 45 { 45 46 } -
trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp
r293129 r293285 31 31 #if ENABLE(MATHML) 32 32 33 #include "CommonAtomStrings.h" 33 34 #include "ElementIterator.h" 34 35 #include "HTMLHtmlElement.h" -
trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
r292945 r293285 31 31 #include "AudioTrackList.h" 32 32 #include "ColorSerialization.h" 33 #include "CommonAtomStrings.h" 33 34 #include "FloatConversion.h" 34 35 #include "HTMLMediaElement.h" … … 731 732 return addAudioTrackKindDescriptionsSuffix(text); 732 733 733 if (track.kind() == AudioTrack::commentaryKeyword() && !text.contains(audioTrackKindCommentaryDisplayName()))734 if (track.kind() == commentaryAtom() && !text.contains(audioTrackKindCommentaryDisplayName())) 734 735 return addAudioTrackKindCommentarySuffix(text); 735 736 -
trunk/Source/WebCore/page/Page.cpp
r292939 r293285 38 38 #include "Chrome.h" 39 39 #include "ChromeClient.h" 40 #include "CommonAtomStrings.h" 40 41 #include "ConstantPropertyMap.h" 41 42 #include "ContextMenuClient.h" … … 2067 2068 return m_userStyleSheet; 2068 2069 2069 m_userStyleSheet = TextResourceDecoder::create( "text/css"_s)->decodeAndFlush(data->data(), data->size());2070 m_userStyleSheet = TextResourceDecoder::create(cssContentTypeAtom())->decodeAndFlush(data->data(), data->size()); 2070 2071 2071 2072 return m_userStyleSheet; -
trunk/Source/WebCore/page/PageSerializer.cpp
r290394 r293285 37 37 #include "CSSStyleRule.h" 38 38 #include "CachedImage.h" 39 #include "CommonAtomStrings.h" 39 40 #include "DocumentInlines.h" 40 41 #include "ElementInlines.h" … … 261 262 PAL::TextEncoding textEncoding(styleSheet->contents().charset()); 262 263 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)) }); 264 265 m_resourceURLs.add(url); 265 266 } -
trunk/Source/WebCore/page/PrintContext.cpp
r288245 r293285 22 22 #include "PrintContext.h" 23 23 24 #include "CommonAtomStrings.h" 24 25 #include "ElementTraversal.h" 25 26 #include "GraphicsContext.h" … … 363 364 if (!strcmp(propertyName, "margin-left")) { 364 365 if (style->marginLeft().isAuto()) 365 return "auto"_s;366 return autoAtom(); 366 367 return String::number(style->marginLeft().value()); 367 368 } -
trunk/Source/WebCore/page/ProcessWarming.cpp
r290901 r293285 27 27 #include "ProcessWarming.h" 28 28 29 #include "CommonAtomStrings.h" 29 30 #include "CommonVM.h" 30 31 #include "Font.h" … … 51 52 void ProcessWarming::initializeNames() 52 53 { 53 AtomString::init();54 initializeCommonAtomStrings(); 54 55 HTMLNames::init(); 55 56 QualifiedName::init(); -
trunk/Source/WebCore/platform/CommonAtomStrings.cpp
r293279 r293285 1 1 /* 2 * Copyright (C) 202 1Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include "FontShadow.h" 28 29 #include "ColorSerialization.h" 30 #include <wtf/text/StringBuilder.h> 27 #include "CommonAtomStrings.h" 31 28 32 29 namespace WebCore { 33 30 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 36 WEBCORE_COMMON_ATOM_STRINGS_FOR_EACH_KEYWORD(DEFINE_COMMON_ATOM) 37 38 void initializeCommonAtomStrings() 35 39 { 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()); 38 42 39 if (!shadow.color.isValid()) 40 return "none"_s; 43 static std::once_flag initializeKey; 44 std::call_once(initializeKey, [] { 45 AtomString::init(); 41 46 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 }); 49 49 } 50 50 51 #undef DEFINE_COMMON_ATOM 52 #undef INITIALIZE_COMMON_ATOM 53 51 54 } // namespace WebCore -
trunk/Source/WebCore/platform/CommonAtomStrings.h
r293279 r293285 1 1 /* 2 * Copyright (C) 202 1Apple Inc. All rights reserved.2 * Copyright (C) 2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "FontShadow.h" 26 #pragma once 28 27 29 #include "ColorSerialization.h"30 #include <wtf/text/ StringBuilder.h>28 #include <wtf/NeverDestroyed.h> 29 #include <wtf/text/AtomString.h> 31 30 32 31 namespace WebCore { 33 32 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") 38 57 39 if (!shadow.color.isValid())40 return "none"_s;41 58 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 63 WEBCORE_COMMON_ATOM_STRINGS_FOR_EACH_KEYWORD(DECLARE_COMMON_ATOM) 64 65 #undef DECLARE_COMMON_ATOM 66 67 WEBCORE_EXPORT void initializeCommonAtomStrings(); 50 68 51 69 } // namespace WebCore -
trunk/Source/WebCore/platform/Pasteboard.cpp
r287021 r293285 27 27 #include "Pasteboard.h" 28 28 29 #include "CommonAtomStrings.h" 29 30 #include "PasteboardStrategy.h" 30 31 #include "PlatformStrategies.h" … … 45 46 bool Pasteboard::isSafeTypeForDOMToReadAndWrite(const String& type) 46 47 { 47 return type == "text/plain"|| type == "text/html" || type == "text/uri-list";48 return type == textPlainContentTypeAtom() || type == "text/html" || type == "text/uri-list"; 48 49 } 49 50 -
trunk/Source/WebCore/platform/StaticPasteboard.cpp
r287021 r293285 27 27 #include "StaticPasteboard.h" 28 28 29 #include "CommonAtomStrings.h" 29 30 #include "SharedBuffer.h" 30 31 … … 111 112 void StaticPasteboard::writePlainText(const String& text, SmartReplaceOption) 112 113 { 113 m_customData.writeString( "text/plain"_s, text);114 m_customData.writeString(textPlainContentTypeAtom(), text); 114 115 } 115 116 -
trunk/Source/WebCore/platform/animation/Animation.cpp
r288433 r293285 23 23 #include "Animation.h" 24 24 25 #include "CommonAtomStrings.h" 25 26 #include <wtf/NeverDestroyed.h> 26 27 #include <wtf/text/TextStream.h> … … 130 131 auto Animation::initialName() -> const Name& 131 132 { 132 static NeverDestroyed<Name> initialValue { Name { MAKE_STATIC_STRING_IMPL("none"), true } };133 static NeverDestroyed<Name> initialValue { Name { noneAtom(), true } }; 133 134 return initialValue; 134 135 } -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r293008 r293285 29 29 #if ENABLE(VIDEO) 30 30 31 #include "CommonAtomStrings.h" 31 32 #include "ContentType.h" 32 33 #include "DeprecatedGlobalSettings.h" … … 332 333 } 333 334 334 static const AtomString& textPlain()335 {336 static MainThreadNeverDestroyed<const AtomString> textPlain("text/plain", AtomString::ConstructFromLiteral);337 return textPlain;338 }339 340 335 const MediaPlayerPrivateInterface* MediaPlayer::playerPrivate() const 341 336 { … … 486 481 // If the MIME type is missing or is not meaningful, try to figure it out from the URL. 487 482 AtomString containerType = m_contentType.containerType(); 488 if (containerType.isEmpty() || containerType == applicationOctetStream() || containerType == textPlain ()) {483 if (containerType.isEmpty() || containerType == applicationOctetStream() || containerType == textPlainContentTypeAtom()) { 489 484 if (m_url.protocolIsData()) 490 485 m_contentType = ContentType(mimeTypeFromDataURL(m_url.string())); -
trunk/Source/WebCore/platform/ios/wak/WebCoreThread.mm
r287848 r293285 29 29 #if PLATFORM(IOS_FAMILY) 30 30 31 #import "CommonAtomStrings.h" 31 32 #import "CommonVM.h" 32 33 #import "FloatingPointEnvironment.h" … … 692 693 693 694 // Initialize AtomString on the main thread. 694 W TF::AtomString::init();695 WebCore::initializeCommonAtomStrings(); 695 696 696 697 // Initialize ThreadGlobalData on the main UI thread so that the WebCore thread -
trunk/Source/WebCore/platform/network/HTTPParsers.cpp
r293129 r293285 34 34 #include "HTTPParsers.h" 35 35 36 #include "CommonAtomStrings.h" 36 37 #include "HTTPHeaderField.h" 37 38 #include "HTTPHeaderNames.h" -
trunk/Source/WebCore/style/Styleable.cpp
r292561 r293285 34 34 #include "CSSPropertyAnimation.h" 35 35 #include "CSSTransition.h" 36 #include "CommonAtomStrings.h" 36 37 #include "DeclarativeAnimation.h" 37 38 #include "Document.h" … … 258 259 for (auto& animation : animations) { 259 260 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)) 261 262 return true; 262 263 } … … 303 304 304 305 auto& animationName = currentAnimation->name().string; 305 if (animationName == "none"|| animationName.isEmpty())306 if (animationName == noneAtom() || animationName.isEmpty()) 306 307 continue; 307 308 -
trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp
r291788 r293285 24 24 25 25 #include "AffineTransform.h" 26 #include "CommonAtomStrings.h" 26 27 #include "ElementIterator.h" 27 28 #include "PathTraversalState.h" … … 111 112 SVGAnimateMotionElement::RotateMode SVGAnimateMotionElement::rotateMode() const 112 113 { 113 static MainThreadNeverDestroyed<const AtomString> autoVal("auto", AtomString::ConstructFromLiteral);114 114 static MainThreadNeverDestroyed<const AtomString> autoReverse("auto-reverse", AtomString::ConstructFromLiteral); 115 const AtomString& rotate = getAttribute(SVGNames::rotateAttr);116 if (rotate == auto Val)115 auto& rotate = getAttribute(SVGNames::rotateAttr); 116 if (rotate == autoAtom()) 117 117 return RotateAuto; 118 118 if (rotate == autoReverse) -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r292951 r293285 320 320 } 321 321 322 static const AtomString& sumAtom() 323 { 324 static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral); 325 return sum; 326 } 327 322 328 bool SVGAnimationElement::isAdditive() const 323 329 { 324 static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);325 330 const AtomString& value = attributeWithoutSynchronization(SVGNames::additiveAttr); 326 return value == sum || animationMode() == AnimationMode::By;331 return value == sumAtom() || animationMode() == AnimationMode::By; 327 332 } 328 333 329 334 bool SVGAnimationElement::isAccumulated() const 330 335 { 331 static MainThreadNeverDestroyed<const AtomString> sum("sum", AtomString::ConstructFromLiteral);332 336 const AtomString& value = attributeWithoutSynchronization(SVGNames::accumulateAttr); 333 return value == sum && animationMode() != AnimationMode::To;337 return value == sumAtom() && animationMode() != AnimationMode::To; 334 338 } 335 339 -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp
r293129 r293285 22 22 #include "SVGFEConvolveMatrixElement.h" 23 23 24 #include "CommonAtomStrings.h" 24 25 #include "FEConvolveMatrix.h" 25 26 #include "SVGNames.h" -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h
r292512 r293285 21 21 #pragma once 22 22 23 #include "CommonAtomStrings.h" 23 24 #include "FEConvolveMatrix.h" 24 25 #include "SVGFilterPrimitiveStandardAttributes.h" … … 41 42 return "wrap"_s; 42 43 case EdgeModeType::None: 43 return "none"_s;44 return noneAtom(); 44 45 } 45 46 … … 54 55 if (value == "wrap") 55 56 return EdgeModeType::Wrap; 56 if (value == "none")57 if (value == noneAtom()) 57 58 return EdgeModeType::None; 58 59 return EdgeModeType::Unknown; -
trunk/Source/WebCore/svg/SVGMarkerTypes.h
r252444 r293285 26 26 #pragma once 27 27 28 #include "CommonAtomStrings.h" 28 29 #include "SVGAngleValue.h" 29 30 #include "SVGPropertyTraits.h" … … 76 77 template<> 77 78 struct SVGPropertyTraits<SVGMarkerOrientType> { 78 static const String autoString()79 {80 static const NeverDestroyed<String> autoString = MAKE_STATIC_STRING_IMPL("auto");81 return autoString;82 }83 79 static const String autoStartReverseString() 84 80 { … … 89 85 static SVGMarkerOrientType fromString(const String& string) 90 86 { 91 if (string == auto String())87 if (string == autoAtom()) 92 88 return SVGMarkerOrientAuto; 93 89 if (string == autoStartReverseString()) … … 98 94 { 99 95 if (type == SVGMarkerOrientAuto) 100 return auto String();96 return autoAtom(); 101 97 if (type == SVGMarkerOrientAutoStartReverse) 102 98 return autoStartReverseString(); -
trunk/Source/WebCore/svg/SVGStyleElement.cpp
r285186 r293285 25 25 26 26 #include "CSSStyleSheet.h" 27 #include "CommonAtomStrings.h" 27 28 #include "Document.h" 28 29 #include "SVGElementInlines.h" … … 66 67 const AtomString& SVGStyleElement::type() const 67 68 { 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; 71 71 } 72 72 -
trunk/Source/WebCore/svg/SVGTextPathElement.h
r260415 r293285 21 21 #pragma once 22 22 23 #include "CommonAtomStrings.h" 23 24 #include "SVGNames.h" 24 25 #include "SVGTextContentElement.h" … … 78 79 return emptyString(); 79 80 case SVGTextPathSpacingAuto: 80 return "auto"_s;81 return autoAtom(); 81 82 case SVGTextPathSpacingExact: 82 83 return "exact"_s; … … 89 90 static SVGTextPathSpacingType fromString(const String& value) 90 91 { 91 if (value == "auto")92 if (value == autoAtom()) 92 93 return SVGTextPathSpacingAuto; 93 94 if (value == "exact") -
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
r292857 r293285 69 69 } 70 70 71 static const AtomString& indefiniteAtom() 72 { 73 static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral); 74 return indefiniteValue; 75 } 76 71 77 // This is used for duration type time values that can't be negative. 72 78 static const double invalidCachedTime = -1.; … … 339 345 340 346 auto parse = data.stripWhiteSpace(); 341 342 static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral); 343 if (parse == indefiniteValue.get()) 347 if (parse == indefiniteAtom()) 344 348 return SMILTime::indefinite(); 345 349 … … 699 703 return SMILTime::unresolved(); 700 704 701 static MainThreadNeverDestroyed<const AtomString> indefiniteValue("indefinite", AtomString::ConstructFromLiteral); 702 if (value == indefiniteValue) 705 if (value == indefiniteAtom()) 703 706 return SMILTime::indefinite(); 704 707 bool ok; -
trunk/Source/WebCore/svg/properties/SVGPropertyTraits.h
r293129 r293285 25 25 #include "Color.h" 26 26 #include "ColorSerialization.h" 27 #include "CommonAtomStrings.h" 27 28 #include "FloatPoint.h" 28 29 #include "FloatRect.h" -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
r292861 r293285 30 30 31 31 #include "CacheStorageProvider.h" 32 #include "CommonAtomStrings.h" 32 33 #include "ContentSecurityPolicyResponseHeaders.h" 33 34 #include "EventLoop.h" … … 114 115 { 115 116 ASSERT(isMainThread()); 116 AtomString::init();117 initializeCommonAtomStrings(); 117 118 } 118 119 -
trunk/Source/WebCore/xml/XPathValue.cpp
r293129 r293285 28 28 #include "XPathValue.h" 29 29 30 #include "CommonAtomStrings.h" 30 31 #include "XPathExpressionNode.h" 31 32 #include "XPathUtil.h" -
trunk/Source/WebKit/ChangeLog
r293231 r293285 1 2022-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 1 19 2022-04-22 Aditya Keerthi <akeerthi@apple.com> 2 20 -
trunk/Source/WebKit/GPUProcess/GPUProcess.cpp
r292611 r293285 44 44 #include "WebPageProxyMessages.h" 45 45 #include "WebProcessPoolMessages.h" 46 #include <WebCore/CommonAtomStrings.h> 46 47 #include <WebCore/DeprecatedGlobalSettings.h> 47 48 #include <WebCore/LogInitialization.h> … … 227 228 RELEASE_LOG(Process, "%p - GPUProcess::initializeGPUProcess:", this); 228 229 WTF::Thread::setCurrentThreadIsUserInitiated(); 229 AtomString::init();230 WebCore::initializeCommonAtomStrings(); 230 231 231 232 auto& memoryPressureHandler = MemoryPressureHandler::singleton(); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r293202 r293285 66 66 #include "WebsiteDataType.h" 67 67 #include <WebCore/ClientOrigin.h> 68 #include <WebCore/CommonAtomStrings.h> 68 69 #include <WebCore/CookieJar.h> 69 70 #include <WebCore/DNS.h> … … 318 319 319 320 WTF::Thread::setCurrentThreadIsUserInitiated(); 320 AtomString::init();321 WebCore::initializeCommonAtomStrings(); 321 322 322 323 m_suppressMemoryPressureHandler = parameters.shouldSuppressMemoryPressureHandler; -
trunk/Source/WebKit/Shared/Cocoa/WebKit2InitializeCocoa.mm
r292870 r293285 28 28 29 29 #import <JavaScriptCore/InitializeThreading.h> 30 #import <WebCore/CommonAtomStrings.h> 30 31 #import <WebCore/WebCoreJITOperations.h> 31 32 #import <mutex> … … 50 51 RELEASE_ASSERT_WITH_MESSAGE([NSThread isMainThread], "InitializeWebKit2 should be called on the main thread"); 51 52 52 AtomString::init();53 WebCore::initializeCommonAtomStrings(); 53 54 #if PLATFORM(IOS_FAMILY) 54 55 InitWebCoreThreadSystemInterface(); -
trunk/Source/WebKit/Shared/WebKit2Initialize.cpp
r292870 r293285 29 29 #include "LogInitialization.h" 30 30 #include <JavaScriptCore/InitializeThreading.h> 31 #include <WebCore/CommonAtomStrings.h> 31 32 #include <WebCore/LogInitialization.h> 32 33 #include <WebCore/WebCoreJITOperations.h> … … 45 46 JSC::initialize(); 46 47 WTF::initializeMainThread(); 47 AtomString::init();48 WebCore::initializeCommonAtomStrings(); 48 49 49 50 WTF::RefCountedBase::enableThreadingChecksGlobally(); -
trunk/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp
r292197 r293285 34 34 #include "SharedMemory.h" 35 35 #include "WebCompiledContentRuleList.h" 36 #include <WebCore/CommonAtomStrings.h> 36 37 #include <WebCore/ContentExtensionCompiler.h> 37 38 #include <WebCore/ContentExtensionError.h> … … 546 547 { 547 548 ASSERT(RunLoop::isMain()); 548 AtomString::init();549 WebCore::initializeCommonAtomStrings(); 549 550 WebCore::QualifiedName::init(); 550 551 -
trunk/Source/WebKitLegacy/win/ChangeLog
r293205 r293285 1 2022-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 1 11 2022-04-21 Brent Fulgham <bfulgham@apple.com> 2 12 -
trunk/Source/WebKitLegacy/win/WebKitGraphics.cpp
r246490 r293285 31 31 #include "WebPreferences.h" 32 32 33 #include <WebCore/CommonAtomStrings.h> 33 34 #include <WebCore/FontCascade.h> 34 35 #include <WebCore/FontDescription.h> … … 47 48 static FontCascade makeFont(const WebFontDescription& description) 48 49 { 49 AtomString::init();50 WebCore::initializeCommonAtomStrings(); 50 51 51 52 String fontFamilyString(description.family, description.familyLength); -
trunk/Tools/ChangeLog
r293231 r293285 1 2022-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 1 11 2022-04-22 Aditya Keerthi <akeerthi@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp
r292879 r293285 31 31 #include <JavaScriptCore/InitializeThreading.h> 32 32 #include <WebCore/CombinedURLFilters.h> 33 #include <WebCore/CommonAtomStrings.h> 33 34 #include <WebCore/ContentExtensionActions.h> 34 35 #include <WebCore/ContentExtensionCompiler.h> … … 213 214 ContentExtensions::ContentExtensionsBackend makeBackend(String&& json) 214 215 { 215 AtomString::init();216 WebCore::initializeCommonAtomStrings(); 216 217 auto extension = InMemoryCompiledContentExtension::create(WTFMove(json)); 217 218 ContentExtensions::ContentExtensionsBackend backend; -
trunk/Tools/TestWebKitAPI/Tests/WebCore/FontShadowTests.cpp
r286630 r293285 27 27 28 28 #include "Test.h" 29 #include <WebCore/CommonAtomStrings.h> 29 30 #include <WebCore/FontShadow.h> 31 #include <wtf/text/AtomString.h> 30 32 31 33 using namespace WebCore; … … 33 35 namespace TestWebKitAPI { 34 36 35 TEST(FontShadow, InvalidColor) 37 class FontShadowTest : public testing::Test { 38 public: 39 void SetUp() override 40 { 41 WebCore::initializeCommonAtomStrings(); 42 } 43 }; 44 45 TEST_F(FontShadowTest, InvalidColor) 36 46 { 37 47 FontShadow fontShadow; … … 43 53 } 44 54 45 TEST (FontShadow, NoOffsetOrBlurRadius)55 TEST_F(FontShadowTest, NoOffsetOrBlurRadius) 46 56 { 47 57 FontShadow fontShadow; … … 54 64 } 55 65 56 TEST (FontShadow, NoOffset)66 TEST_F(FontShadowTest, NoOffset) 57 67 { 58 68 FontShadow fontShadow; … … 64 74 } 65 75 66 TEST (FontShadow, NegativeOffset)76 TEST_F(FontShadowTest, NegativeOffset) 67 77 { 68 78 FontShadow fontShadow; … … 73 83 } 74 84 75 TEST (FontShadow, NoBlurRadius)85 TEST_F(FontShadowTest, NoBlurRadius) 76 86 { 77 87 FontShadow fontShadow; … … 83 93 } 84 94 85 TEST (FontShadow, NegativeBlurRadius)95 TEST_F(FontShadowTest, NegativeBlurRadius) 86 96 { 87 97 FontShadow fontShadow; … … 92 102 } 93 103 94 TEST (FontShadow, AllNegative)104 TEST_F(FontShadowTest, AllNegative) 95 105 { 96 106 FontShadow fontShadow;
Note:
See TracChangeset
for help on using the changeset viewer.