[webkit-changes] [WebKit/WebKit] 7f7aad: Rename isHTMLSpace and move it to WTF

Anne van Kesteren noreply at github.com
Sun Apr 23 08:58:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7f7aade4cf4a5c2688604f64e7b0f901771a3241
      https://github.com/WebKit/WebKit/commit/7f7aade4cf4a5c2688604f64e7b0f901771a3241
  Author: Anne van Kesteren <annevk at annevk.nl>
  Date:   2023-04-23 (Sun, 23 Apr 2023)

  Changed paths:
    M Source/JavaScriptCore/bytecode/ReduceWhitespace.cpp
    M Source/JavaScriptCore/runtime/ConfigFile.cpp
    M Source/JavaScriptCore/runtime/Options.cpp
    M Source/JavaScriptCore/tools/FunctionOverrides.cpp
    M Source/WTF/wtf/ASCIICType.h
    M Source/WTF/wtf/DateMath.cpp
    M Source/WTF/wtf/text/Base64.cpp
    M Source/WTF/wtf/text/StringImpl.h
    M Source/WTF/wtf/text/StringToIntegerConversion.h
    M Source/WTF/wtf/text/StringView.cpp
    M Source/WTF/wtf/text/WTFString.cpp
    M Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AccessibilityList.cpp
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/contentextensions/Term.h
    M Source/WebCore/css/SelectorChecker.cpp
    M Source/WebCore/css/parser/CSSParserFastPaths.cpp
    M Source/WebCore/css/parser/CSSTokenizer.cpp
    M Source/WebCore/css/parser/CSSTokenizerInputStream.cpp
    M Source/WebCore/cssjit/SelectorCompiler.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Position.cpp
    M Source/WebCore/dom/SecurityContext.cpp
    M Source/WebCore/dom/ShadowRoot.cpp
    M Source/WebCore/dom/SpaceSplitString.cpp
    M Source/WebCore/editing/TextManipulationController.cpp
    M Source/WebCore/html/DOMTokenList.cpp
    M Source/WebCore/html/FeaturePolicy.cpp
    M Source/WebCore/html/HTMLElement.cpp
    M Source/WebCore/html/HTMLFontElement.cpp
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/HTMLInputElement.cpp
    M Source/WebCore/html/HTMLObjectElement.cpp
    M Source/WebCore/html/HTMLOptionElement.cpp
    M Source/WebCore/html/parser/CSSPreloadScanner.cpp
    M Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp
    M Source/WebCore/html/parser/HTMLMetaCharsetParser.cpp
    M Source/WebCore/html/parser/HTMLParserIdioms.cpp
    M Source/WebCore/html/parser/HTMLParserIdioms.h
    M Source/WebCore/html/parser/HTMLPreloadScanner.cpp
    M Source/WebCore/html/parser/HTMLSrcsetParser.cpp
    M Source/WebCore/html/parser/HTMLTreeBuilder.cpp
    M Source/WebCore/html/parser/ParsingUtilities.h
    M Source/WebCore/html/track/VTTRegion.cpp
    M Source/WebCore/html/track/WebVTTParser.cpp
    M Source/WebCore/inspector/InspectorStyleSheet.cpp
    M Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/SubresourceIntegrity.cpp
    M Source/WebCore/mathml/MathMLMencloseElement.cpp
    M Source/WebCore/mathml/MathMLPresentationElement.cpp
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/WindowFeatures.cpp
    M Source/WebCore/page/csp/ContentSecurityPolicy.cpp
    M Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp
    M Source/WebCore/page/csp/ContentSecurityPolicyMediaListDirective.cpp
    M Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp
    M Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
    M Source/WebCore/platform/ContentType.cpp
    M Source/WebCore/platform/graphics/ComplexTextController.cpp
    M Source/WebCore/rendering/LegacyLineLayout.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderText.cpp
    M Source/WebCore/rendering/TextPainter.cpp
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/svg/SVGAnimationElement.cpp
    M Source/WebGPU/WGSL/Lexer.cpp
    M Source/WebKit/Shared/linux/WebMemorySamplerLinux.cpp
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  Rename isHTMLSpace and move it to WTF
https://bugs.webkit.org/show_bug.cgi?id=255840
rdar://108419120

Reviewed by Darin Adler.

Rename isHTMLSpace to isASCIIWhitespace to align it with the Infra standard, make it a constexpr
following precedent set in c650d41f8945032a348d7ffd4e11c9ca2dd75ea7, and move it to WTF to make it
more easily usable throughout WebKit. Put it in ASCIICType.h because based on
169adaafef454897deb4507150d2708430e4de01 it seemed like a reasonable place for ASCII-related
functionality.

Likewise for isNotHTMLSpace though non-predicate instances are replaced with !isASCIIWhitespace.

At the same time rename isASCIISpace to isUnicodeCompatibleASCIIWhitespace to make it clearer this
does not match the typical web standard usage and has to be somewhat carefully considered. Auditing
of existing usage will continue in https://bugs.webkit.org/show_bug.cgi?id=255467 and dependencies.

* Source/JavaScriptCore/bytecode/ReduceWhitespace.cpp:
(JSC::reduceWhitespace):
* Source/JavaScriptCore/runtime/ConfigFile.cpp:
(JSC::ConfigFileScanner::fillBufferIfNeeded):
(JSC::ConfigFile::parse):
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::isSeparator):
* Source/JavaScriptCore/tools/FunctionOverrides.cpp:
(JSC::hasDisallowedCharacters):
* Source/WTF/wtf/ASCIICType.h:
(WTF::isASCIIWhitespace):
(WTF::isUnicodeCompatibleASCIIWhitespace):
(WTF::isNotASCIIWhitespace):
(WTF::isASCIISpace): Deleted.
* Source/WTF/wtf/DateMath.cpp:
(WTF::skipSpacesAndComments):
(WTF::parseDateFromNullTerminatedCharacters):
* Source/WTF/wtf/text/Base64.cpp:
(WTF::base64DecodeInternal):
* Source/WTF/wtf/text/StringImpl.h:
(WTF::isSpaceOrNewline):
(WTF::isUnicodeWhitespace):
* Source/WTF/wtf/text/StringToIntegerConversion.h:
(WTF::parseInteger):
* Source/WTF/wtf/text/StringView.cpp:
(WTF::StringView::stripWhiteSpace const):
* Source/WTF/wtf/text/WTFString.cpp:
(WTF::toDoubleType):
* Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp:
(WebCore::MediaRecorderProvider::isSupported):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
* Source/WebCore/accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::objectInclusionFromAltText):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
* Source/WebCore/contentextensions/Term.h:
(WebCore::ContentExtensions::Term::toString const):
* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::attributeValueMatches):
* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::parseColorIntOrPercentage):
(WebCore::parseAlphaValue):
* Source/WebCore/css/parser/CSSTokenizer.cpp:
(WebCore::CSSTokenizer::consumeURLToken):
(WebCore::CSSTokenizer::consumeSingleWhitespaceIfNext):
* Source/WebCore/css/parser/CSSTokenizerInputStream.cpp:
(WebCore::CSSTokenizerInputStream::advanceUntilNonWhitespace):
* Source/WebCore/cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::attributeValueSpaceSeparatedListContains):
* Source/WebCore/dom/Document.cpp:
(WebCore::canonicalizedTitle):
(WebCore::processColorSchemeString):
* Source/WebCore/dom/Position.cpp:
(WebCore::Position::leadingWhitespacePosition const):
(WebCore::Position::trailingWhitespacePosition const):
* Source/WebCore/dom/SecurityContext.cpp:
(WebCore::SecurityContext::parseSandboxPolicy):
* Source/WebCore/dom/ShadowRoot.cpp:
(WebCore::parsePartMapping):
* Source/WebCore/dom/SpaceSplitString.cpp:
(WebCore::tokenizeSpaceSplitString):
* Source/WebCore/editing/TextManipulationController.cpp:
(WebCore::isNotSpace):
(WebCore::TextManipulationController::parse):
* Source/WebCore/html/DOMTokenList.cpp:
(WebCore::tokenContainsHTMLSpace):
(WebCore::DOMTokenList::updateTokensFromAttributeValue):
* Source/WebCore/html/FeaturePolicy.cpp:
(WebCore::processOriginItem):
(WebCore::updateList):
(WebCore::FeaturePolicy::parse):
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::parseLegacyColorValue):
* Source/WebCore/html/HTMLFontElement.cpp:
(WebCore::parseFontSize):
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::extractMIMETypeFromTypeAttributeForLookup):
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::parseAcceptAttribute):
* Source/WebCore/html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent const):
(WebCore::preventsParentObjectFromExposure):
* Source/WebCore/html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::text const):
(WebCore::HTMLOptionElement::value const):
(WebCore::HTMLOptionElement::label const):
(WebCore::HTMLOptionElement::displayLabel const):
* Source/WebCore/html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize):
(WebCore::parseCSSStringOrURL):
(WebCore::hasValidImportConditions):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::isCharAfterTagNameOrAttribute):
(WebCore::isCharAfterUnquotedAttribute):
(WebCore::HTMLFastPathParser::scanTagName):
(WebCore::HTMLFastPathParser::scanAttributeValue):
(WebCore::HTMLFastPathParser::scanEscapedAttributeValue):
(WebCore::HTMLFastPathParser::parseAttributes):
(WebCore::HTMLFastPathParser::parseContainerElement):
* Source/WebCore/html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes):
* Source/WebCore/html/parser/HTMLParserIdioms.cpp:
(WebCore::stripLeadingAndTrailingHTMLSpaces):
(WebCore::parseHTMLIntegerInternal):
(WebCore::isHTMLSpaceOrDelimiter):
(WebCore::parseHTTPRefreshInternal):
(WebCore::parseHTMLDimensionNumber):
* Source/WebCore/html/parser/HTMLParserIdioms.h:
(WebCore::isHTMLSpaceOrComma):
(WebCore::isHTMLSpaceButNotLineBreak):
(WebCore::isHTMLSpace): Deleted.
(WebCore::isNotHTMLSpace): Deleted.
* Source/WebCore/html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processImageAndScriptAttribute):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
(WebCore::TokenPreloadScanner::StartTagScanner::setURLToLoadAllowingReplacement):
* Source/WebCore/html/parser/HTMLSrcsetParser.cpp:
(WebCore::tokenizeDescriptors):
(WebCore::parseImageCandidatesFromSrcsetAttribute):
* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::isAllWhitespace):
(WebCore::isAllWhitespaceOrReplacementCharacters):
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipLeadingWhitespace):
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeadingWhitespace):
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipLeadingNonWhitespace):
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
* Source/WebCore/html/parser/ParsingUtilities.h:
(WebCore::isNotASCIISpace):
* Source/WebCore/html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setRegionSettings):
(WebCore::VTTRegion::parseSettingValue):
* Source/WebCore/html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::hasRequiredFileIdentifier):
(WebCore::WebVTTParser::collectTimingsAndSettings):
* Source/WebCore/inspector/InspectorStyleSheet.cpp:
(WebCore::StyleSheetHandler::setRuleHeaderEnd):
(WebCore::fixUnparsedProperties):
* Source/WebCore/inspector/agents/InspectorDOMAgent.cpp:
(WebCore::containsOnlyHTMLWhitespace):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::extractContentLanguageFromHeader):
* Source/WebCore/loader/SubresourceIntegrity.cpp:
(WebCore::splitOnSpaces):
* Source/WebCore/mathml/MathMLMencloseElement.cpp:
(WebCore::MathMLMencloseElement::parseNotationAttribute):
* Source/WebCore/mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::parseMathMLLength):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::incrementVisuallyNonEmptyCharacterCount):
* Source/WebCore/page/WindowFeatures.cpp:
(WebCore::isSeparator):
* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeader):
* Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::isDirectiveValueCharacter):
(WebCore::ContentSecurityPolicyDirectiveList::parseDirective):
(WebCore::ContentSecurityPolicyDirectiveList::parseReportURI):
(WebCore::ContentSecurityPolicyDirectiveList::parseReportTo):
* Source/WebCore/page/csp/ContentSecurityPolicyMediaListDirective.cpp:
(WebCore::isMediaTypeCharacter):
(WebCore::ContentSecurityPolicyMediaListDirective::parse):
* Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::isSourceCharacter):
(WebCore::isSourceListNone):
(WebCore::ContentSecurityPolicySourceList::parse):
* Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::threadCPUUsage):
* Source/WebCore/platform/ContentType.cpp:
(WebCore::ContentType::parameter const):
(WebCore::splitParameters):
* Source/WebCore/platform/graphics/ComplexTextController.cpp:
(WebCore::shouldSynthesize):
* Source/WebCore/rendering/LegacyLineLayout.cpp:
(WebCore::endsWithHTMLSpaces):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::isVisibleRenderText):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/RenderText.cpp:
(WebCore::RenderText::trimmedPreferredWidths):
* Source/WebCore/rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks):
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::textRendererIsNeeded):
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):
* Source/WebCore/svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::attributeContainsJavaScriptURL const):
(WebCore::SVGAnimationElement::attributeChanged):
* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::skipWhitespaceAndComments):
* Source/WebKit/Shared/linux/WebMemorySamplerLinux.cpp:
(WebKit::nextToken):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPlatformEditorState const):

Canonical link: https://commits.webkit.org/263290@main




More information about the webkit-changes mailing list