Changeset 265129 in webkit


Ignore:
Timestamp:
Jul 30, 2020 8:44:09 PM (4 years ago)
Author:
weinig@apple.com
Message:

It would be nice if the predicate taking functions in ParsingUtilities.h didn't require specifying the character type
https://bugs.webkit.org/show_bug.cgi?id=215002

Reviewed by Darin Adler.

Remove the need for specifying the character type by providing overloads for LChar and UChar
explicitly.

  • html/parser/HTMLSrcsetParser.cpp:

(WebCore::parseImageCandidatesFromSrcsetAttribute):

  • html/parser/ParsingUtilities.h:

(WebCore::characterPredicate):

  • html/track/VTTScanner.h:

(WebCore::characterPredicate):

  • loader/LinkHeader.cpp:

(WebCore::findURLBoundaries):
(WebCore::invalidParameterDelimiter):
(WebCore::parseParameterDelimiter):
(WebCore::parseParameterName):
(WebCore::skipQuotesIfNeeded):
(WebCore::parseParameterValue):
(WebCore::findNextHeader):

  • loader/ResourceCryptographicDigest.cpp:

(WebCore::parseCryptographicDigestImpl):
(WebCore::parseEncodedCryptographicDigestImpl):

  • loader/SubresourceIntegrity.cpp:

(WebCore::splitOnSpaces):

  • loader/appcache/ApplicationCacheManifestParser.cpp:

(WebCore::parseApplicationCacheManifest):

  • page/csp/ContentSecurityPolicyDirectiveList.cpp:

(WebCore::ContentSecurityPolicyDirectiveList::parseDirective):
(WebCore::ContentSecurityPolicyDirectiveList::parseReportURI):

  • page/csp/ContentSecurityPolicyMediaListDirective.cpp:

(WebCore::ContentSecurityPolicyMediaListDirective::parse):

  • page/csp/ContentSecurityPolicySourceList.cpp:

(WebCore::isSourceListNone):
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parseScheme):
(WebCore::ContentSecurityPolicySourceList::parseHost):
(WebCore::ContentSecurityPolicySourceList::parsePath):
(WebCore::ContentSecurityPolicySourceList::parsePort):
(WebCore::ContentSecurityPolicySourceList::parseNonceSource):

  • platform/DateComponents.cpp:

(WebCore::countDigits):

  • svg/SVGLengthList.cpp:

(WebCore::SVGLengthList::parse):

  • svg/SVGParserUtilities.cpp:

(WebCore::genericParseNumber):

  • svg/SVGParserUtilities.h:

(WebCore::skipOptionalSVGSpaces):

Location:
trunk/Source/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r265126 r265129  
     12020-07-30  Sam Weinig  <weinig@apple.com>
     2
     3        It would be nice if the predicate taking functions in ParsingUtilities.h didn't require specifying the character type
     4        https://bugs.webkit.org/show_bug.cgi?id=215002
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove the need for specifying the character type by providing overloads for LChar and UChar
     9        explicitly.
     10
     11        * html/parser/HTMLSrcsetParser.cpp:
     12        (WebCore::parseImageCandidatesFromSrcsetAttribute):
     13        * html/parser/ParsingUtilities.h:
     14        (WebCore::characterPredicate):
     15        * html/track/VTTScanner.h:
     16        (WebCore::characterPredicate):
     17        * loader/LinkHeader.cpp:
     18        (WebCore::findURLBoundaries):
     19        (WebCore::invalidParameterDelimiter):
     20        (WebCore::parseParameterDelimiter):
     21        (WebCore::parseParameterName):
     22        (WebCore::skipQuotesIfNeeded):
     23        (WebCore::parseParameterValue):
     24        (WebCore::findNextHeader):
     25        * loader/ResourceCryptographicDigest.cpp:
     26        (WebCore::parseCryptographicDigestImpl):
     27        (WebCore::parseEncodedCryptographicDigestImpl):
     28        * loader/SubresourceIntegrity.cpp:
     29        (WebCore::splitOnSpaces):
     30        * loader/appcache/ApplicationCacheManifestParser.cpp:
     31        (WebCore::parseApplicationCacheManifest):
     32        * page/csp/ContentSecurityPolicyDirectiveList.cpp:
     33        (WebCore::ContentSecurityPolicyDirectiveList::parseDirective):
     34        (WebCore::ContentSecurityPolicyDirectiveList::parseReportURI):
     35        * page/csp/ContentSecurityPolicyMediaListDirective.cpp:
     36        (WebCore::ContentSecurityPolicyMediaListDirective::parse):
     37        * page/csp/ContentSecurityPolicySourceList.cpp:
     38        (WebCore::isSourceListNone):
     39        (WebCore::ContentSecurityPolicySourceList::parse):
     40        (WebCore::ContentSecurityPolicySourceList::parseSource):
     41        (WebCore::ContentSecurityPolicySourceList::parseScheme):
     42        (WebCore::ContentSecurityPolicySourceList::parseHost):
     43        (WebCore::ContentSecurityPolicySourceList::parsePath):
     44        (WebCore::ContentSecurityPolicySourceList::parsePort):
     45        (WebCore::ContentSecurityPolicySourceList::parseNonceSource):
     46        * platform/DateComponents.cpp:
     47        (WebCore::countDigits):
     48        * svg/SVGLengthList.cpp:
     49        (WebCore::SVGLengthList::parse):
     50        * svg/SVGParserUtilities.cpp:
     51        (WebCore::genericParseNumber):
     52        * svg/SVGParserUtilities.h:
     53        (WebCore::skipOptionalSVGSpaces):
     54
    1552020-07-30  Sam Weinig  <weinig@apple.com>
    256
  • trunk/Source/WebCore/html/parser/HTMLSrcsetParser.cpp

    r246490 r265129  
    171171    for (const CharType* position = attributeStart; position < attributeEnd;) {
    172172        // 4. Splitting loop: Collect a sequence of characters that are space characters or U+002C COMMA characters.
    173         skipWhile<CharType, isHTMLSpaceOrComma<CharType> >(position, attributeEnd);
     173        skipWhile<isHTMLSpaceOrComma>(position, attributeEnd);
    174174        if (position == attributeEnd) {
    175175            // Contrary to spec language - descriptor parsing happens on each candidate, so when we reach the attributeEnd, we can exit.
     
    179179        // 6. Collect a sequence of characters that are not space characters, and let that be url.
    180180
    181         skipUntil<CharType, isHTMLSpace<CharType> >(position, attributeEnd);
     181        skipUntil<isHTMLSpace>(position, attributeEnd);
    182182        const CharType* imageURLEnd = position;
    183183
     
    188188            // Remove all trailing U+002C COMMA characters from url.
    189189            imageURLEnd = position - 1;
    190             reverseSkipWhile<CharType, isComma>(imageURLEnd, imageURLStart);
     190            reverseSkipWhile<isComma>(imageURLEnd, imageURLStart);
    191191            ++imageURLEnd;
    192192            // If url is empty, then jump to the step labeled splitting loop.
     
    194194                continue;
    195195        } else {
    196             skipWhile<CharType, isHTMLSpace<CharType>>(position, attributeEnd);
     196            skipWhile<isHTMLSpace>(position, attributeEnd);
    197197            Vector<StringView> descriptorTokens;
    198198            tokenizeDescriptors(position, attributeEnd, descriptorTokens);
  • trunk/Source/WebCore/html/parser/ParsingUtilities.h

    r263916 r265129  
    11/*
    22 * Copyright (C) 2013 Google Inc. All rights reserved.
     3 * Copyright (C) 2020 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3132#pragma once
    3233
    33 #include <wtf/Forward.h>
    3434#include <wtf/text/StringCommon.h>
     35#include <wtf/text/StringParsingBuffer.h>
    3536
    3637namespace WebCore {
     
    5960}
    6061
    61 template<typename CharacterType, bool characterPredicate(CharacterType)> bool skipExactly(const CharacterType*& position, const CharacterType* end)
     62template<bool characterPredicate(LChar)> bool skipExactly(const LChar*& position, const LChar* end)
    6263{
    6364    if (position < end && characterPredicate(*position)) {
     
    6869}
    6970
    70 template<typename CharacterType, bool characterPredicate(CharacterType)> bool skipExactly(StringParsingBuffer<CharacterType>& buffer)
     71template<bool characterPredicate(UChar)> bool skipExactly(const UChar*& position, const UChar* end)
     72{
     73    if (position < end && characterPredicate(*position)) {
     74        ++position;
     75        return true;
     76    }
     77    return false;
     78}
     79
     80template<bool characterPredicate(LChar)> bool skipExactly(StringParsingBuffer<LChar>& buffer)
    7181{
    7282    if (buffer.hasCharactersRemaining() && characterPredicate(*buffer)) {
     
    7787}
    7888
     89template<bool characterPredicate(UChar)> bool skipExactly(StringParsingBuffer<UChar>& buffer)
     90{
     91    if (buffer.hasCharactersRemaining() && characterPredicate(*buffer)) {
     92        ++buffer;
     93        return true;
     94    }
     95    return false;
     96}
     97
    7998template<typename CharacterType, typename DelimiterType> void skipUntil(const CharacterType*& position, const CharacterType* end, DelimiterType delimiter)
    8099{
     
    89108}
    90109
    91 template<typename CharacterType, bool characterPredicate(CharacterType)> void skipUntil(const CharacterType*& position, const CharacterType* end)
     110template<bool characterPredicate(LChar)> void skipUntil(const LChar*& position, const LChar* end)
    92111{
    93112    while (position < end && !characterPredicate(*position))
     
    95114}
    96115
    97 template<typename CharacterType, bool characterPredicate(CharacterType)> void skipUntil(StringParsingBuffer<CharacterType>& buffer)
     116template<bool characterPredicate(UChar)> void skipUntil(const UChar*& position, const UChar* end)
     117{
     118    while (position < end && !characterPredicate(*position))
     119        ++position;
     120}
     121
     122template<bool characterPredicate(LChar)> void skipUntil(StringParsingBuffer<LChar>& buffer)
    98123{
    99124    while (buffer.hasCharactersRemaining() && !characterPredicate(*buffer))
     
    101126}
    102127
    103 template<typename CharacterType, bool characterPredicate(CharacterType)> void skipWhile(const CharacterType*& position, const CharacterType* end)
     128template<bool characterPredicate(UChar)> void skipUntil(StringParsingBuffer<UChar>& buffer)
     129{
     130    while (buffer.hasCharactersRemaining() && !characterPredicate(*buffer))
     131        ++buffer;
     132}
     133
     134template<bool characterPredicate(LChar)> void skipWhile(const LChar*& position, const LChar* end)
    104135{
    105136    while (position < end && characterPredicate(*position))
     
    107138}
    108139
    109 template<typename CharacterType, bool characterPredicate(CharacterType)> void skipWhile(StringParsingBuffer<CharacterType>& buffer)
     140template<bool characterPredicate(UChar)> void skipWhile(const UChar*& position, const UChar* end)
     141{
     142    while (position < end && characterPredicate(*position))
     143        ++position;
     144}
     145
     146template<bool characterPredicate(LChar)> void skipWhile(StringParsingBuffer<LChar>& buffer)
    110147{
    111148    while (buffer.hasCharactersRemaining() && characterPredicate(*buffer))
     
    113150}
    114151
    115 template<typename CharacterType, bool characterPredicate(CharacterType)> void reverseSkipWhile(const CharacterType*& position, const CharacterType* start)
     152template<bool characterPredicate(UChar)> void skipWhile(StringParsingBuffer<UChar>& buffer)
     153{
     154    while (buffer.hasCharactersRemaining() && characterPredicate(*buffer))
     155        ++buffer;
     156}
     157
     158
     159template<bool characterPredicate(LChar)> void reverseSkipWhile(const LChar*& position, const LChar* start)
     160{
     161    while (position >= start && characterPredicate(*position))
     162        --position;
     163}
     164
     165template<bool characterPredicate(UChar)> void reverseSkipWhile(const UChar*& position, const UChar* start)
    116166{
    117167    while (position >= start && characterPredicate(*position))
  • trunk/Source/WebCore/html/track/VTTScanner.h

    r208179 r265129  
    167167{
    168168    if (m_is8Bit)
    169         WebCore::skipWhile<LChar, LCharPredicateAdapter<characterPredicate> >(m_data.characters8, m_end.characters8);
     169        WebCore::skipWhile<LCharPredicateAdapter<characterPredicate> >(m_data.characters8, m_end.characters8);
    170170    else
    171         WebCore::skipWhile<UChar, characterPredicate>(m_data.characters16, m_end.characters16);
     171        WebCore::skipWhile<characterPredicate>(m_data.characters16, m_end.characters16);
    172172}
    173173
     
    176176{
    177177    if (m_is8Bit)
    178         WebCore::skipUntil<LChar, LCharPredicateAdapter<characterPredicate> >(m_data.characters8, m_end.characters8);
     178        WebCore::skipUntil<LCharPredicateAdapter<characterPredicate> >(m_data.characters8, m_end.characters8);
    179179    else
    180         WebCore::skipUntil<UChar, characterPredicate>(m_data.characters16, m_end.characters16);
     180        WebCore::skipUntil<characterPredicate>(m_data.characters16, m_end.characters16);
    181181}
    182182
     
    186186    if (m_is8Bit) {
    187187        const LChar* current = m_data.characters8;
    188         WebCore::skipWhile<LChar, LCharPredicateAdapter<characterPredicate> >(current, m_end.characters8);
     188        WebCore::skipWhile<LCharPredicateAdapter<characterPredicate>>(current, m_end.characters8);
    189189        return Run(position(), current, m_is8Bit);
    190190    }
    191191    const UChar* current = m_data.characters16;
    192     WebCore::skipWhile<UChar, characterPredicate>(current, m_end.characters16);
     192    WebCore::skipWhile<characterPredicate>(current, m_end.characters16);
    193193    return Run(position(), reinterpret_cast<Position>(current), m_is8Bit);
    194194}
     
    199199    if (m_is8Bit) {
    200200        const LChar* current = m_data.characters8;
    201         WebCore::skipUntil<LChar, LCharPredicateAdapter<characterPredicate> >(current, m_end.characters8);
     201        WebCore::skipUntil<LCharPredicateAdapter<characterPredicate> >(current, m_end.characters8);
    202202        return Run(position(), current, m_is8Bit);
    203203    }
    204204    const UChar* current = m_data.characters16;
    205     WebCore::skipUntil<UChar, characterPredicate>(current, m_end.characters16);
     205    WebCore::skipUntil<characterPredicate>(current, m_end.characters16);
    206206    return Run(position(), reinterpret_cast<Position>(current), m_is8Bit);
    207207}
  • trunk/Source/WebCore/loader/LinkHeader.cpp

    r246045 r265129  
    9090{
    9191    ASSERT(position <= end);
    92     skipWhile<CharacterType, isSpaceOrTab>(position, end);
    93     if (!skipExactly<CharacterType>(position, end, '<'))
     92    skipWhile<isSpaceOrTab>(position, end);
     93    if (!skipExactly(position, end, '<'))
    9494        return WTF::nullopt;
    95     skipWhile<CharacterType, isSpaceOrTab>(position, end);
     95    skipWhile<isSpaceOrTab>(position, end);
    9696
    9797    CharacterType* urlStart = position;
    98     skipWhile<CharacterType, isNotURLTerminatingChar>(position, end);
     98    skipWhile<isNotURLTerminatingChar>(position, end);
    9999    CharacterType* urlEnd = position;
    100     skipUntil<CharacterType>(position, end, '>');
    101     if (!skipExactly<CharacterType>(position, end, '>'))
     100    skipUntil(position, end, '>');
     101    if (!skipExactly(position, end, '>'))
    102102        return WTF::nullopt;
    103103
     
    109109{
    110110    ASSERT(position <= end);
    111     return (!skipExactly<CharacterType>(position, end, ';') && (position < end) && (*position != ','));
     111    return (!skipExactly(position, end, ';') && (position < end) && (*position != ','));
    112112}
    113113
     
    135135    ASSERT(position <= end);
    136136    isValid = true;
    137     skipWhile<CharacterType, isSpaceOrTab>(position, end);
     137    skipWhile<isSpaceOrTab>(position, end);
    138138    if (invalidParameterDelimiter(position, end)) {
    139139        isValid = false;
    140140        return false;
    141141    }
    142     skipWhile<CharacterType, isSpaceOrTab>(position, end);
     142    skipWhile<isSpaceOrTab>(position, end);
    143143    if (validFieldEnd(position, end))
    144144        return false;
     
    189189    ASSERT(position <= end);
    190190    CharacterType* nameStart = position;
    191     skipWhile<CharacterType, isValidParameterNameChar>(position, end);
     191    skipWhile<isValidParameterNameChar>(position, end);
    192192    CharacterType* nameEnd = position;
    193     skipWhile<CharacterType, isSpaceOrTab>(position, end);
    194     bool hasEqual = skipExactly<CharacterType>(position, end, '=');
    195     skipWhile<CharacterType, isSpaceOrTab>(position, end);
     193    skipWhile<isSpaceOrTab>(position, end);
     194    bool hasEqual = skipExactly(position, end, '=');
     195    skipWhile<isSpaceOrTab>(position, end);
    196196    name = paramterNameFromString(String(nameStart, nameEnd - nameStart));
    197197    if (hasEqual)
     
    217217    ASSERT(position <= end);
    218218    unsigned char quote;
    219     if (skipExactly<CharacterType>(position, end, '\''))
     219    if (skipExactly(position, end, '\''))
    220220        quote = '\'';
    221     else if (skipExactly<CharacterType>(position, end, '"'))
     221    else if (skipExactly(position, end, '"'))
    222222        quote = '"';
    223223    else
     
    253253    bool hasQuotes = skipQuotesIfNeeded(position, end, completeQuotes);
    254254    if (!hasQuotes)
    255         skipWhile<CharacterType, isParameterValueChar>(position, end);
     255        skipWhile<isParameterValueChar>(position, end);
    256256    valueEnd = position;
    257     skipWhile<CharacterType, isSpaceOrTab>(position, end);
     257    skipWhile<isSpaceOrTab>(position, end);
    258258    if ((!completeQuotes && valueStart == valueEnd) || (position != end && !isParameterValueEnd(*position))) {
    259259        value = emptyString();
     
    311311{
    312312    ASSERT(position <= end);
    313     skipUntil<CharacterType>(position, end, ',');
    314     skipExactly<CharacterType>(position, end, ',');
     313    skipUntil(position, end, ',');
     314    skipExactly(position, end, ',');
    315315}
    316316
  • trunk/Source/WebCore/loader/ResourceCryptographicDigest.cpp

    r263581 r265129  
    6363
    6464    auto beginHashValue = buffer.position();
    65     skipWhile<CharacterType, isBase64OrBase64URLCharacter>(buffer);
     65    skipWhile<isBase64OrBase64URLCharacter>(buffer);
    6666    skipExactly(buffer, '=');
    6767    skipExactly(buffer, '=');
     
    103103
    104104    auto beginHashValue = buffer.position();
    105     skipWhile<CharacterType, isBase64OrBase64URLCharacter>(buffer);
     105    skipWhile<isBase64OrBase64URLCharacter>(buffer);
    106106    skipExactly(buffer, '=');
    107107    skipExactly(buffer, '=');
  • trunk/Source/WebCore/loader/SubresourceIntegrity.cpp

    r263581 r265129  
    6868        // them. Their syntax is a '?' follow by any number of VCHARs.
    6969        if (skipExactly(buffer, '?'))
    70             skipWhile<CharacterType, isVCHAR>(buffer);
     70            skipWhile<isVCHAR>(buffer);
    7171
    7272        // After the base64 value and options, the current character pointed to by position
     
    8888static inline void splitOnSpaces(StringParsingBuffer<CharacterType> buffer, Functor&& functor)
    8989{
    90     skipWhile<CharacterType, isHTMLSpace>(buffer);
     90    skipWhile<isHTMLSpace>(buffer);
    9191
    9292    while (buffer.hasCharactersRemaining()) {
    9393        if (!functor(buffer))
    94             skipWhile<CharacterType, isNotHTMLSpace>(buffer);
    95         skipWhile<CharacterType, isHTMLSpace>(buffer);
     94            skipWhile<isNotHTMLSpace>(buffer);
     95        skipWhile<isHTMLSpace>(buffer);
    9696    }
    9797}
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheManifestParser.cpp

    r263908 r265129  
    9797
    9898        // Skip to the end of the line.
    99         skipUntil<CharacterType, isManifestNewline>(buffer);
     99        skipUntil<isManifestNewline>(buffer);
    100100
    101101        while (1) {
    102102            // Skip whitespace
    103             skipWhile<CharacterType, isManifestWhitespaceOrNewline>(buffer);
     103            skipWhile<isManifestWhitespaceOrNewline>(buffer);
    104104           
    105105            if (buffer.atEnd())
     
    109109           
    110110            // Find the end of the line
    111             skipUntil<CharacterType, isManifestNewline>(buffer);
     111            skipUntil<isManifestNewline>(buffer);
    112112           
    113113            // Line is a comment, skip to the next line.
     
    148148            case ApplicationCacheParserMode::Explicit: {
    149149                // Look for whitespace separating the URL from subsequent ignored tokens.
    150                 skipUntil<CharacterType, isManifestWhitespace>(lineBuffer);
     150                skipUntil<isManifestWhitespace>(lineBuffer);
    151151
    152152                auto url = makeManifestURL(manifestURL, lineStart, lineBuffer.position());
     
    166166            case ApplicationCacheParserMode::OnlineAllowlist: {
    167167                // Look for whitespace separating the URL from subsequent ignored tokens.
    168                 skipUntil<CharacterType, isManifestWhitespace>(lineBuffer);
     168                skipUntil<isManifestWhitespace>(lineBuffer);
    169169
    170170                if (lineBuffer.position() - lineStart == 1 && *lineStart == '*') {
     
    187187            case ApplicationCacheParserMode::Fallback: {
    188188                // Look for whitespace separating the two URLs
    189                 skipUntil<CharacterType, isManifestWhitespace>(lineBuffer);
     189                skipUntil<isManifestWhitespace>(lineBuffer);
    190190
    191191                if (lineBuffer.atEnd()) {
     
    208208
    209209                // Skip whitespace separating fallback namespace from URL.
    210                 skipWhile<CharacterType, isManifestWhitespace>(lineBuffer);
     210                skipWhile<isManifestWhitespace>(lineBuffer);
    211211
    212212                auto fallbackStart = lineBuffer.position();
    213213
    214214                // Look for whitespace separating the URL from subsequent ignored tokens.
    215                 skipUntil<CharacterType, isManifestWhitespace>(lineBuffer);
     215                skipUntil<isManifestWhitespace>(lineBuffer);
    216216
    217217                auto fallbackURL = makeManifestURL(manifestURL, fallbackStart, lineBuffer.position());
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp

    r263581 r265129  
    372372template<typename CharacterType> auto ContentSecurityPolicyDirectiveList::parseDirective(StringParsingBuffer<CharacterType> buffer) -> Optional<ParsedDirective>
    373373{
    374     skipWhile<CharacterType, isASCIISpace>(buffer);
     374    skipWhile<isASCIISpace>(buffer);
    375375
    376376    // Empty directive (e.g. ";;;"). Exit early.
     
    379379
    380380    auto nameBegin = buffer.position();
    381     skipWhile<CharacterType, isDirectiveNameCharacter>(buffer);
     381    skipWhile<isDirectiveNameCharacter>(buffer);
    382382
    383383    // The directive-name must be non-empty.
    384384    if (nameBegin == buffer.position()) {
    385         skipWhile<CharacterType, isNotASCIISpace>(buffer);
     385        skipWhile<isNotASCIISpace>(buffer);
    386386        m_policy.reportUnsupportedDirective(String(nameBegin, buffer.position() - nameBegin));
    387387        return WTF::nullopt;
     
    393393        return ParsedDirective { WTFMove(name), { } };
    394394
    395     if (!skipExactly<CharacterType, isASCIISpace>(buffer)) {
    396         skipWhile<CharacterType, isNotASCIISpace>(buffer);
     395    if (!skipExactly<isASCIISpace>(buffer)) {
     396        skipWhile<isNotASCIISpace>(buffer);
    397397        m_policy.reportUnsupportedDirective(String(nameBegin, buffer.position() - nameBegin));
    398398        return WTF::nullopt;
    399399    }
    400400
    401     skipWhile<CharacterType, isASCIISpace>(buffer);
     401    skipWhile<isASCIISpace>(buffer);
    402402
    403403    auto valueBegin = buffer.position();
    404     skipWhile<CharacterType, isDirectiveValueCharacter>(buffer);
     404    skipWhile<isDirectiveValueCharacter>(buffer);
    405405
    406406    if (!buffer.atEnd()) {
     
    425425
    426426    readCharactersForParsing(directive.value, [&](auto buffer) {
    427         using CharacterType = typename decltype(buffer)::CharacterType;
    428 
    429427        auto begin = buffer.position();
    430428        while (buffer.hasCharactersRemaining()) {
    431             skipWhile<CharacterType, isASCIISpace>(buffer);
     429            skipWhile<isASCIISpace>(buffer);
    432430
    433431            auto urlBegin = buffer.position();
    434             skipWhile<CharacterType, isNotASCIISpace>(buffer);
     432            skipWhile<isNotASCIISpace>(buffer);
    435433
    436434            if (urlBegin < buffer.position())
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicyMediaListDirective.cpp

    r263581 r265129  
    6161
    6262    readCharactersForParsing(value, [&](auto buffer) {
    63         using CharacterType = typename decltype(buffer)::CharacterType;
    64 
    6563        while (buffer.hasCharactersRemaining()) {
    6664            // _____ OR _____mime1/mime1
    6765            // ^        ^
    68             skipWhile<CharacterType, isASCIISpace>(buffer);
     66            skipWhile<isASCIISpace>(buffer);
    6967            if (buffer.atEnd())
    7068                return;
     
    7371            // ^
    7472            auto begin = buffer.position();
    75             if (!skipExactly<CharacterType, isMediaTypeCharacter>(buffer)) {
    76                 skipWhile<CharacterType, isNotASCIISpace>(buffer);
     73            if (!skipExactly<isMediaTypeCharacter>(buffer)) {
     74                skipWhile<isNotASCIISpace>(buffer);
    7775                directiveList().policy().reportInvalidPluginTypes(String(begin, buffer.position() - begin));
    7876                continue;
    7977            }
    80             skipWhile<CharacterType, isMediaTypeCharacter>(buffer);
     78            skipWhile<isMediaTypeCharacter>(buffer);
    8179
    8280            // mime1/mime1 mime2/mime2
    8381            //      ^
    8482            if (!skipExactly(buffer, '/')) {
    85                 skipWhile<CharacterType, isNotASCIISpace>(buffer);
     83                skipWhile<isNotASCIISpace>(buffer);
    8684                directiveList().policy().reportInvalidPluginTypes(String(begin, buffer.position() - begin));
    8785                continue;
     
    9088            // mime1/mime1 mime2/mime2
    9189            //       ^
    92             if (!skipExactly<CharacterType, isMediaTypeCharacter>(buffer)) {
    93                 skipWhile<CharacterType, isNotASCIISpace>(buffer);
     90            if (!skipExactly<isMediaTypeCharacter>(buffer)) {
     91                skipWhile<isNotASCIISpace>(buffer);
    9492                directiveList().policy().reportInvalidPluginTypes(String(begin, buffer.position() - begin));
    9593                continue;
    9694            }
    97             skipWhile<CharacterType, isMediaTypeCharacter>(buffer);
     95            skipWhile<isMediaTypeCharacter>(buffer);
    9896
    9997            // mime1/mime1 mime2/mime2 OR mime1/mime1  OR mime1/mime1/error
    10098            //            ^                          ^               ^
    10199            if (buffer.hasCharactersRemaining() && isNotASCIISpace(*buffer)) {
    102                 skipWhile<CharacterType, isNotASCIISpace>(buffer);
     100                skipWhile<isNotASCIISpace>(buffer);
    103101                directiveList().policy().reportInvalidPluginTypes(String(begin, buffer.position() - begin));
    104102                continue;
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp

    r263581 r265129  
    8585template<typename CharacterType> static bool isSourceListNone(StringParsingBuffer<CharacterType> buffer)
    8686{
    87     skipWhile<CharacterType, isASCIISpace>(buffer);
     87    skipWhile<isASCIISpace>(buffer);
    8888
    8989    if (!skipExactlyIgnoringASCIICase(buffer, "'none'"))
    9090        return false;
    9191
    92     skipWhile<CharacterType, isASCIISpace>(buffer);
     92    skipWhile<isASCIISpace>(buffer);
    9393
    9494    return buffer.atEnd();
     
    160160{
    161161    while (buffer.hasCharactersRemaining()) {
    162         skipWhile<CharacterType, isASCIISpace>(buffer);
     162        skipWhile<isASCIISpace>(buffer);
    163163        if (buffer.atEnd())
    164164            return;
    165165
    166166        auto beginSource = buffer.position();
    167         skipWhile<CharacterType, isSourceCharacter>(buffer);
     167        skipWhile<isSourceCharacter>(buffer);
    168168
    169169        auto sourceBuffer = StringParsingBuffer { beginSource, buffer.position() };
     
    232232    const CharacterType* beginPort = nullptr;
    233233
    234     skipWhile<CharacterType, isNotColonOrSlash>(buffer);
     234    skipWhile<isNotColonOrSlash>(buffer);
    235235
    236236    if (buffer.atEnd()) {
     
    288288
    289289            beginHost = buffer.position();
    290             skipWhile<CharacterType, isNotColonOrSlash>(buffer);
     290            skipWhile<isNotColonOrSlash>(buffer);
    291291        }
    292292
     
    344344    auto begin = buffer.position();
    345345
    346     if (!skipExactly<CharacterType, isASCIIAlpha>(buffer))
    347         return WTF::nullopt;
    348 
    349     skipWhile<CharacterType, isSchemeContinuationCharacter>(buffer);
     346    if (!skipExactly<isASCIIAlpha>(buffer))
     347        return WTF::nullopt;
     348
     349    skipWhile<isSchemeContinuationCharacter>(buffer);
    350350
    351351    if (!buffer.atEnd())
     
    381381
    382382    while (buffer.hasCharactersRemaining()) {
    383         if (!skipExactly<CharacterType, isHostCharacter>(buffer))
    384             return WTF::nullopt;
    385 
    386         skipWhile<CharacterType, isHostCharacter>(buffer);
     383        if (!skipExactly<isHostCharacter>(buffer))
     384            return WTF::nullopt;
     385
     386        skipWhile<isHostCharacter>(buffer);
    387387
    388388        if (buffer.hasCharactersRemaining() && !skipExactly(buffer, '.'))
     
    400400   
    401401    auto begin = buffer.position();
    402     skipWhile<CharacterType, isPathComponentCharacter>(buffer);
     402    skipWhile<isPathComponentCharacter>(buffer);
    403403    // path/to/file.js?query=string || path/to/file.js#anchor
    404404    //                ^                               ^
     
    431431   
    432432    auto begin = buffer.position();
    433     skipWhile<CharacterType, isASCIIDigit>(buffer);
     433    skipWhile<isASCIIDigit>(buffer);
    434434   
    435435    if (!buffer.atEnd())
     
    462462
    463463    auto beginNonceValue = buffer.position();
    464     skipWhile<CharacterType, isNonceCharacter>(buffer);
     464    skipWhile<isNonceCharacter>(buffer);
    465465    if (buffer.atEnd() || buffer.position() == beginNonceValue || *buffer != '\'')
    466466        return false;
  • trunk/Source/WebCore/platform/DateComponents.cpp

    r265126 r265129  
    110110{
    111111    auto begin = buffer.position();
    112     skipWhile<CharacterType, isASCIIDigit>(buffer);
     112    skipWhile<isASCIIDigit>(buffer);
    113113    return buffer.position() - begin;
    114114}
  • trunk/Source/WebCore/svg/SVGLengthList.cpp

    r263617 r265129  
    3737
    3838    return readCharactersForParsing(value, [&](auto buffer) {
    39         using CharacterType = typename decltype(buffer)::CharacterType;
    40 
    4139        while (buffer.hasCharactersRemaining()) {
    4240            auto start = buffer.position();
    4341
    44             skipUntil<CharacterType, isSVGSpaceOrComma>(buffer);
     42            skipUntil<isSVGSpaceOrComma>(buffer);
    4543
    4644            if (buffer.position() == start)
  • trunk/Source/WebCore/svg/SVGParserUtilities.cpp

    r263617 r265129  
    6969   
    7070    // Advance to first non-digit.
    71     skipWhile<CharacterType, isASCIIDigit>(buffer);
     71    skipWhile<isASCIIDigit>(buffer);
    7272
    7373    if (buffer.position() != ptrStartIntPart) {
  • trunk/Source/WebCore/svg/SVGParserUtilities.h

    r264533 r265129  
    7171template<typename CharacterType> constexpr bool skipOptionalSVGSpaces(const CharacterType*& ptr, const CharacterType* end)
    7272{
    73     skipWhile<CharacterType, isSVGSpace>(ptr, end);
     73    skipWhile<isSVGSpace>(ptr, end);
    7474    return ptr < end;
    7575}
     
    7777template<typename CharacterType> constexpr bool skipOptionalSVGSpaces(StringParsingBuffer<CharacterType>& characters)
    7878{
    79     skipWhile<CharacterType, isSVGSpace>(characters);
     79    skipWhile<isSVGSpace>(characters);
    8080    return characters.hasCharactersRemaining();
    8181}
Note: See TracChangeset for help on using the changeset viewer.