Add support for the CSS 'unset' keyword.
[WebKit-https.git] / Source / WebCore / ChangeLog
index 2dd7da2..625bf69 100644 (file)
@@ -1,3 +1,87 @@
+2015-10-15  David Hyatt  <hyatt@apple.com>
+
+        Add support for the CSS 'unset' keyword.
+        https://bugs.webkit.org/show_bug.cgi?id=148614
+
+        Reviewed by Dean Jackson.
+
+        Added new test in fast/css, and existing variables tests also use unset in several tests.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add CSSUnsetValue.cpp to the project.
+
+        * bindings/objc/DOMCSS.mm:
+        (kitClass):
+        Make sure UNSET is handled in the switch.
+
+        * css/CSSParser.cpp:
+        (WebCore::parseKeywordValue):
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseCustomPropertyDeclaration):
+        Add cases to create a CSSUnsetValue properly.
+
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::styleImage):
+        (WebCore::CSSToStyleMap::mapFillAttachment):
+        (WebCore::CSSToStyleMap::mapFillClip):
+        (WebCore::CSSToStyleMap::mapFillComposite):
+        (WebCore::CSSToStyleMap::mapFillBlendMode):
+        (WebCore::CSSToStyleMap::mapFillOrigin):
+        (WebCore::CSSToStyleMap::mapFillImage):
+        (WebCore::CSSToStyleMap::mapFillRepeatX):
+        (WebCore::CSSToStyleMap::mapFillRepeatY):
+        (WebCore::convertToLengthSize):
+        (WebCore::CSSToStyleMap::mapFillSize):
+        (WebCore::CSSToStyleMap::mapFillXPosition):
+        (WebCore::CSSToStyleMap::mapFillYPosition):
+        (WebCore::CSSToStyleMap::mapFillMaskSourceType):
+        (WebCore::CSSToStyleMap::mapAnimationDelay):
+        (WebCore::CSSToStyleMap::mapAnimationDirection):
+        (WebCore::CSSToStyleMap::mapAnimationDuration):
+        (WebCore::CSSToStyleMap::mapAnimationFillMode):
+        (WebCore::CSSToStyleMap::mapAnimationIterationCount):
+        (WebCore::CSSToStyleMap::mapAnimationName):
+        (WebCore::CSSToStyleMap::mapAnimationPlayState):
+        (WebCore::CSSToStyleMap::mapAnimationProperty):
+        (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
+        (WebCore::CSSToStyleMap::mapAnimationTrigger):
+        The background and animation functions need to check for unset and be able to map it properly to initial. This is done
+        with a new treatAsInitial method on CSSValue that can take the property ID and check for both initial
+        or unset on a non-inherited property.
+
+        * css/CSSUnsetValue.cpp: Added.
+        (WebCore::CSSUnsetValue::customCSSText):
+        * css/CSSUnsetValue.h: Added.
+        (WebCore::CSSUnsetValue::create):
+        (WebCore::CSSUnsetValue::equals):
+        (WebCore::CSSUnsetValue::CSSUnsetValue):
+        This new value looks exactly like CSSInheritedValue and CSSInitialValue.
+
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::cssValueType):
+        (WebCore::CSSValue::cssText):
+        (WebCore::CSSValue::destroy):
+        (WebCore::CSSValue::isInvalidCustomPropertyValue):
+        (WebCore::CSSValue::treatAsInheritedValue):
+        (WebCore::CSSValue::treatAsInitialValue):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isUnsetValue):
+        Add isUnsetValue and the UnsetClass. Add support for treatAsInheritedValue and treatAsInitialValue to have
+        a way to query for initial/inherit or the matching unset type.
+
+        * css/CSSValueKeywords.in:
+        Add the unset keyword.
+
+        * css/CSSValuePool.cpp:
+        (WebCore::CSSValuePool::CSSValuePool):
+        * css/CSSValuePool.h:
+        (WebCore::CSSValuePool::createUnsetValue):
+        Have a singleton model for unset just like we do for inherit/initial.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+        Handle unset correctly. It maps to inherit for inherited properties and initial for non-inherited ones.
+
 2015-10-15  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI