Parse '-webkit-filter' property syntax
https://bugs.webkit.org/show_bug.cgi?id=68473
Reviewed by Nikolas Zimmermann.
Parse the new -webkit-filter property, looking for shorthand
functions then testing number, type and value of parameters.
Note that support for drop-shadow() was omitted from this
patch because parsing CSS shadow syntax was going to require some
refactoring of the box and text shadow code. The followup
bug is https://bugs.webkit.org/show_bug.cgi?id=69108.
Also, computed style will return null for filters at the moment.
That's https://bugs.webkit.org/show_bug.cgi?id=68477.
Tests: css3/filters/filter-property-parsing-invalid.html
css3/filters/filter-property-parsing.html
* CMakeLists.txt:
* CodeGenerators.pri:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Build files updated for new WebKitCSSFilterValue classes.
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJS):
* bindings/objc/DOMCSS.mm:
Test if value is WebKitCSSFilterValue.
* css/CSSParser.cpp:
(WebCore::filterInfoForName):
(WebCore::CSSParser::isValidFilterArgument):
(WebCore::CSSParser::parseFilter):
* css/CSSParser.h:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
(WebCore::filterOperationForType):
(WebCore::CSSStyleSelector::createFilterOperations):
* css/CSSStyleSelector.h:
Handle the new shorthand functions in -webkit-filter.
* css/CSSValue.h:
(WebCore::CSSValue::isWebKitCSSFilterValue):
Add virtual function that returns false here.
* css/WebKitCSSFilterValue.cpp: Added.
(WebCore::WebKitCSSFilterValue::WebKitCSSFilterValue):
(WebCore::WebKitCSSFilterValue::~WebKitCSSFilterValue):
(WebCore::WebKitCSSFilterValue::cssText):
* css/WebKitCSSFilterValue.h: Added.
(WebCore::WebKitCSSFilterValue::create):
(WebCore::WebKitCSSFilterValue::operationType):
(WebCore::WebKitCSSFilterValue::isWebKitCSSFilterValue):
* css/WebKitCSSFilterValue.idl: Added.
WebKitCSSFilterValue modelled closely on WebKitCSSTransformValue,
basically identifying the type of operation in a CSSValueList.
* page/DOMWindow.idl:
New WebKitCSSFilterValue constructor.
* platform/graphics/filters/FilterOperation.h:
(WebCore::BlurFilterOperation::create):
(WebCore::BlurFilterOperation::stdDeviationX):
(WebCore::BlurFilterOperation::stdDeviationY):
(WebCore::BlurFilterOperation::BlurFilterOperation):
(WebCore::SharpenFilterOperation::create):
(WebCore::SharpenFilterOperation::radius):
(WebCore::SharpenFilterOperation::threshold):
(WebCore::SharpenFilterOperation::SharpenFilterOperation):
Use Length rather than double for parameters that are CSS lengths.
New tests that exercise the -webkit-filter syntax, with
(nearly) all the function shorthands. Since this patch also
added a global WebKitCSSFilterValue interface, the window
tests needed update, but only on the platforms that have
ENABLE(CSS_FILTERS).
* css3/filters/filter-property-expected.txt:
* css3/filters/filter-property-parsing-expected.txt: Added.
* css3/filters/filter-property-parsing-invalid-expected.txt: Added.
* css3/filters/filter-property-parsing-invalid.html: Added.
* css3/filters/filter-property-parsing.html: Added.
* css3/filters/script-tests/filter-property-parsing-invalid.js: Added.
(testInvalidFilterRule):
* css3/filters/script-tests/filter-property-parsing.js: Added.
(jsWrapperClass):
(shouldBeType):
(testFilterRule):
* css3/filters/script-tests/filter-property.js:
Updated old test which was missing quotes, plus new tests that
exercise the shorthand feature.
* platform/mac/fast/dom/Window/window-properties-expected.txt:
* platform/mac/fast/dom/Window/window-property-descriptors-expected.txt:
* platform/mac/fast/dom/prototype-inheritance-2-expected.txt: Added.
* platform/mac/fast/js/global-constructors-expected.txt:
* platform/win/fast/dom/Window/window-properties-expected.txt: Copied from LayoutTests/platform/mac/fast/dom/Window/window-properties-expected.txt.
* platform/win/fast/dom/Window/window-property-descriptors-expected.txt:
* platform/win/fast/dom/prototype-inheritance-2-expected.txt: Added.
* platform/win/fast/js/global-constructors-expected.txt:
Updated isAppleWebkit() platform files for the new WebKitCSSFilterValue
API exposed on Window.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/DerivedSources.cpp b/Source/WebCore/DerivedSources.cpp
index 67f356d..699a9a2 100644
--- a/Source/WebCore/DerivedSources.cpp
+++ b/Source/WebCore/DerivedSources.cpp
@@ -461,6 +461,9 @@
#include "JSWebKitAnimationEvent.cpp"
#include "JSWebKitAnimationList.cpp"
#include "JSWebKitBlobBuilder.cpp"
+#if ENABLE(CSS_FILTERS)
+#include "JSWebKitCSSFilterValue.cpp"
+#endif
#include "JSWebKitCSSKeyframeRule.cpp"
#include "JSWebKitCSSKeyframesRule.cpp"
#include "JSWebKitCSSTransformValue.cpp"