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

Changeset 285714 in webkit


Ignore:
Timestamp:
Nov 12, 2021, 4:48:43 AM (5 years ago)
Author:
ntim@apple.com
Message:

Re-use isCSSWideKeyword in CSSCustomPropertyValue::createWithID
https://bugs.webkit.org/show_bug.cgi?id=233035

Reviewed by Antti Koivisto.

  • css/CSSCustomPropertyValue.cpp:

(WebCore::CSSCustomPropertyValue::createWithID):

  • css/CSSCustomPropertyValue.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r285713 r285714  
     12021-11-12  Tim Nguyen  <ntim@apple.com>
     2
     3        Re-use isCSSWideKeyword in CSSCustomPropertyValue::createWithID
     4        https://bugs.webkit.org/show_bug.cgi?id=233035
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * css/CSSCustomPropertyValue.cpp:
     9        (WebCore::CSSCustomPropertyValue::createWithID):
     10        * css/CSSCustomPropertyValue.h:
     11
    1122021-11-12  Antti Koivisto  <antti@apple.com>
    213
  • trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp

    r284095 r285714  
    2727#include "CSSCustomPropertyValue.h"
    2828
     29#include "CSSParserIdioms.h"
    2930#include "CSSTokenizer.h"
    3031
     
    3435{
    3536    return adoptRef(*new CSSCustomPropertyValue(name, std::monostate { }));
     37}
     38
     39Ref<CSSCustomPropertyValue> CSSCustomPropertyValue::createWithID(const AtomString& name, CSSValueID id)
     40{
     41    ASSERT(WebCore::isCSSWideKeyword(id) || id == CSSValueInvalid);
     42    return adoptRef(*new CSSCustomPropertyValue(name, { id }));
    3643}
    3744
  • trunk/Source/WebCore/css/CSSCustomPropertyValue.h

    r284213 r285714  
    5353    }
    5454
    55     static Ref<CSSCustomPropertyValue> createWithID(const AtomString& name, CSSValueID id)
    56     {
    57         ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert || id == CSSValueInvalid);
    58         return adoptRef(*new CSSCustomPropertyValue(name, { id }));
    59     }
     55    static Ref<CSSCustomPropertyValue> createWithID(const AtomString& name, CSSValueID);
    6056
    6157    static Ref<CSSCustomPropertyValue> createSyntaxAll(const AtomString& name, Ref<CSSVariableData>&& value)
     
    6359        return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) }));
    6460    }
    65    
     61
    6662    static Ref<CSSCustomPropertyValue> createSyntaxLength(const AtomString& name, Length value)
    6763    {
Note: See TracChangeset for help on using the changeset viewer.