Ignore:
Timestamp:
Nov 6, 2021, 12:20:59 PM (4 years ago)
Author:
Antti Koivisto
Message:

Remove separate classes for CSS wide keywords (initial/inherit/unset/revert)
https://bugs.webkit.org/show_bug.cgi?id=232750

Reviewed by Sam Weinig.

Remove CSSInitialValue, CSSInheritedValue, CSSRevertValue and CSSUnsetValue classes.
They can all be handled by CSSPrimitiveValue.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDeprecatedCSSOMValueCustom.cpp:

(WebCore::toJSNewlyCreated):

Avoid changing the class type visible in CSSOM.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::renderTextDecorationStyleFlagsToCSSValue):
(WebCore::renderTextDecorationSkipToCSSValue):

  • css/CSSInheritedValue.cpp: Removed.
  • css/CSSInheritedValue.h: Removed.
  • css/CSSInitialValue.cpp: Removed.
  • css/CSSInitialValue.h: Removed.
  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::isCSSWideKeyword const):

  • css/CSSPrimitiveValue.h:
  • css/CSSRevertValue.cpp: Removed.
  • css/CSSRevertValue.h: Removed.
  • css/CSSUnsetValue.cpp: Removed.
  • css/CSSUnsetValue.h: Removed.
  • css/CSSValue.cpp:

(WebCore::CSSValue::cssValueType const):
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::treatAsInheritedValue const):
(WebCore::CSSValue::treatAsInitialValue const):
(WebCore::CSSValue::isInitialValue const):
(WebCore::CSSValue::isImplicitInitialValue const):
(WebCore::CSSValue::isInheritValue const):
(WebCore::CSSValue::isUnsetValue const):
(WebCore::CSSValue::isRevertValue const):
(WebCore::CSSValue::isCSSWideKeyword const):

  • css/CSSValue.h:

(WebCore::CSSValue::CSSValue):
(WebCore::CSSValue::isInheritedValue const): Deleted.
(WebCore::CSSValue::isInitialValue const): Deleted.
(WebCore::CSSValue::isUnsetValue const): Deleted.
(WebCore::CSSValue::isRevertValue const): Deleted.
(WebCore::CSSValue::isGlobalKeyword const): Deleted.

  • css/CSSValuePool.cpp:

(WebCore::StaticCSSValuePool::StaticCSSValuePool):

  • css/CSSValuePool.h:

(WebCore::CSSValuePool::createImplicitInitialValue):
(WebCore::CSSValuePool::createInheritedValue): Deleted.
(WebCore::CSSValuePool::createExplicitInitialValue): Deleted.
(WebCore::CSSValuePool::createUnsetValue): Deleted.
(WebCore::CSSValuePool::createRevertValue): Deleted.

  • css/DeprecatedCSSOMPrimitiveValue.h:

(WebCore::DeprecatedCSSOMPrimitiveValue::isCSSWideKeyword const):

  • css/SelectorChecker.cpp:
  • css/StyleProperties.cpp:

(WebCore::StyleProperties::borderRadiusValue const):
(WebCore::StyleProperties::pageBreakPropertyValue const):

  • css/parser/CSSParserFastPaths.cpp:

(WebCore::parseKeywordValue):

  • css/parser/CSSParserIdioms.h:

(WebCore::isCSSWideKeyword):
(WebCore::isValidCustomIdentifier):

Separate the concept of valid custom identifier from that of CSS-wide keyword. The former also excludes the obsolete "default" keyword.

  • css/parser/CSSPropertyParser.cpp:

(WebCore::maybeConsumeCSSWideKeyword):

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude):
(WebCore::CSSPropertyParserHelpers::concatenateFamilyName):
(WebCore::CSSPropertyParserHelpers::isCSSWideKeyword): Deleted.

  • editing/EditingStyle.cpp:

(WebCore::fontWeightIsBold):

  • editing/cocoa/HTMLConverter.mm:

(HTMLConverterCaches::propertyValueForNode):
(HTMLConverterCaches::floatPropertyValueForNode):
(HTMLConverterCaches::colorPropertyValueForNode):

  • html/HTMLTableElement.cpp:

(WebCore::HTMLTableElement::createSharedCellStyle const):

  • style/ElementRuleCollector.cpp:

(WebCore::Style::ElementRuleCollector::addMatchedProperties):

  • style/PropertyCascade.cpp:

(WebCore::Style::PropertyCascade::addMatch):
(WebCore::Style::PropertyCascade::resolveDirectionAndWritingMode const):

  • style/StyleBuilder.cpp:

(WebCore::Style::Builder::applyProperty):
(WebCore::Style::Builder::resolveValue):

  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::parseAttribute):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r285343 r285373  
    16531653
    16541654    ASSERT_NOT_REACHED();
    1655     return CSSValuePool::singleton().createExplicitInitialValue();
     1655    return CSSValuePool::singleton().createIdentifierValue(CSSValueInitial);
    16561656}
    16571657
     
    16681668
    16691669    ASSERT_NOT_REACHED();
    1670     return CSSValuePool::singleton().createExplicitInitialValue();
     1670    return CSSValuePool::singleton().createIdentifierValue(CSSValueInitial);
    16711671}
    16721672
Note: See TracChangeset for help on using the changeset viewer.