[Conic Gradients] Add support for parsing conic gradients
[WebKit-https.git] / Source / WebCore / ChangeLog
index b1d5068..db69e41 100644 (file)
@@ -1,3 +1,105 @@
+2017-10-29  Sam Weinig  <sam@webkit.org>
+
+        [Conic Gradients] Add support for parsing conic gradients
+        https://bugs.webkit.org/show_bug.cgi?id=178987
+
+        Reviewed by Dean Jackson.
+
+        Adds initial support, disabled by default, for parsing conic gradients as per
+        CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.
+
+        Test: fast/gradients/conic-gradient-parsing.html
+
+        * css/CSSGradientValue.cpp:
+        (WebCore::clone):
+        (WebCore::CSSGradientValue::isCacheable const):
+        (WebCore::CSSConicGradientValue::customCSSText const):
+        (WebCore::CSSConicGradientValue::createGradient):
+        (WebCore::CSSConicGradientValue::equals const):
+        * css/CSSGradientValue.h:
+        
+            Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
+            customCSSText() and equals(). Stub out createGradient() as painting is not
+            yet implemented.
+        
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::image):
+        (WebCore::CSSImageGeneratorValue::isFixedSize const):
+        (WebCore::CSSImageGeneratorValue::fixedSize):
+        (WebCore::CSSImageGeneratorValue::isPending const):
+        (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
+        (WebCore::CSSImageGeneratorValue::loadSubimages):
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::equals const):
+        (WebCore::CSSValue::cssText const):
+        (WebCore::CSSValue::destroy):
+        
+            Dispatch to CSSConicGradientValue as needed.
+        
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isImageGeneratorValue const):
+        (WebCore::CSSValue::isGradientValue const):
+        (WebCore::CSSValue::isConicGradientValue const):
+        
+            Add conic gradient predicate support and update isImageGeneratorValue and 
+            isGradientValue to include conic gradient.
+        
+        * css/CSSValueKeywords.in:
+        
+            Add conic-gradient and repeating-conic-gradient.
+        
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+        (WebCore::operator==):
+        * css/parser/CSSParserMode.h:
+        (WebCore::CSSParserContextHash::hash):
+        
+            Add runtime flags to enable conic gradients.
+        
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
+        
+            Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
+            Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
+        
+        (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
+        
+            Convert to take CSSGradientValue by reference.
+        
+        (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
+        
+            Helper, similar to consumeGradientColorStops, but for angular color stops
+            used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
+            but does not yet support double position syntax.
+        
+        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
+        (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
+        (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
+        
+            Pass CSSGradientValue by reference.
+        
+        (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
+        
+            Parse conic gradient.
+        
+        (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
+        
+            Dispatch to consumeConicGradient for repeating and non-repeating
+            conic gradients.
+        
+        (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
+        
+            Put each value on its own line to make it more readable and add CSSValueConicGradient
+            and CSSValueRepeatingConicGradient.
+        
+        * page/Settings.yaml:
+        
+            Add a setting to enable conic gradients. Disabled by default.
+
+        * features.json:
+        
+            Move conic gradients to "In Development".
+
 2017-10-29  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Expose the currentTime property on Animation