Commit 335772d5 authored by dino@apple.com's avatar dino@apple.com

Add -webkit-filter to CSSPropertyNames

https://bugs.webkit.org/show_bug.cgi?id=68675

Reviewed by Simon Fraser.

Add property and rudimentary parsing for -webkit-filter. The
property value isn't preserved anywhere yet. Add
stub definition for computed style.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFilter):
* css/CSSParser.h:
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):

New test for rudimentary parsing of -webkit-filter.
Since currently only the Apple port enables the
feature, add this new test to the platform skip lists
for GTK, QT and Chromium.

* css3/filters/filter-property-expected.txt: Added.
* css3/filters/filter-property.html: Added.
* css3/filters/script-tests/TEMPLATE.html: Added.
* css3/filters/script-tests/filter-property.js: Added.
* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eaaa4081
2011-09-23 Dean Jackson <dino@apple.com>
Add -webkit-filter to CSSPropertyNames
https://bugs.webkit.org/show_bug.cgi?id=68675
Reviewed by Simon Fraser.
New test for rudimentary parsing of -webkit-filter.
Since currently only the Apple port enables the
feature, add this new test to the platform skip lists
for GTK, QT and Chromium.
* css3/filters/filter-property-expected.txt: Added.
* css3/filters/filter-property.html: Added.
* css3/filters/script-tests/TEMPLATE.html: Added.
* css3/filters/script-tests/filter-property.js: Added.
* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/qt/Skipped:
2011-09-23 Jay Soffian <jaysoffian@gmail.com>
chrome.dll!WebCore::ApplyStyleCommand::applyBlockStyle ReadAV@NULL (64db547804532a84be2e53721e499e9e)
Test the parsing of the -webkit-filter property.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS cssRule.type is 1
PASS declaration.length is 1
PASS declaration.getPropertyValue('-webkit-filter') is 'url(#a) url(#b)'
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="script-tests/filter-property.js"></script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="YOUR_JS_FILE_HERE"></script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
description("Test the parsing of the -webkit-filter property.");
// add a -webkit-filter property to the start of the stylesheet
document.styleSheets.item(0).addRule("body", "-webkit-filter: url(#a) url(#b)", 0);
var cssRule = document.styleSheets.item(0).cssRules.item(0);
shouldBe("cssRule.type", "1");
var declaration = cssRule.style;
shouldBe("declaration.length", "1");
shouldBe("declaration.getPropertyValue('-webkit-filter')", "'url(#a) url(#b)'");
successfullyParsed = true;
......@@ -3338,6 +3338,9 @@ BUGWK57312 SKIP : fast/regions = PASS
// CSS Exclusions support not yet enabled.
BUGWK57311 SKIP : fast/exclusions = PASS
// CSS Filters support not yet enabled
BUGWK68469 SKIP : css3/filters = PASS
BUGWK68087 WIN MAC GPU GPU-CG : compositing/flat-with-transformed-child.html = IMAGE
BUGWK68087 WIN MAC GPU GPU-CG : platform/chromium/compositing/3d-corners.html = IMAGE
BUGWK68087 WIN MAC GPU GPU-CG : platform/chromium/compositing/backface-visibility-transformed.html = IMAGE
......
......@@ -449,6 +449,9 @@ fast/exclusions
# For now, Web Audio API is disabled
webaudio
# CSS Filters is disabled
css3/filters
###############################################################################
# TESTS FAILING
###############################################################################
......
......@@ -210,6 +210,9 @@ http/tests/media/media-source/
# Font feature settings is not implemented.
css3/font-feature-settings-rendering.html
# CSS Filters is disabled
css3/filters
# =========================================================================== #
# Drag and Drop Support in DRT. #
# =========================================================================== #
......
2011-09-23 Dean Jackson <dino@apple.com>
Add -webkit-filter to CSSPropertyNames
https://bugs.webkit.org/show_bug.cgi?id=68675
Reviewed by Simon Fraser.
Add property and rudimentary parsing for -webkit-filter. The
property value isn't preserved anywhere yet. Add
stub definition for computed style.
Test: css3/filters/filter-property.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFilter):
* css/CSSParser.h:
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
2011-09-23 Antoine Labour <piman@chromium.org>
Remove preserves3D() from CCLayerDelegate, replacing it by setting the
......@@ -1986,6 +1986,9 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitBorderRadius:
case CSSPropertyWebkitColumns:
case CSSPropertyWebkitColumnRule:
#if ENABLE(CSS_FILTERS)
case CSSPropertyWebkitFilter:
#endif
case CSSPropertyWebkitMarginCollapse:
case CSSPropertyWebkitMarquee:
case CSSPropertyWebkitMarqueeSpeed:
......
......@@ -1572,6 +1572,20 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyWebkitColorCorrection:
validPrimitive = id == CSSValueSrgb || id == CSSValueDefault;
break;
#if ENABLE(CSS_FILTERS)
case CSSPropertyWebkitFilter:
if (id == CSSValueNone)
validPrimitive = true;
else {
RefPtr<CSSValue> val = parseFilter();
if (val) {
addProperty(propId, val, important);
return true;
}
return false;
}
break;
#endif
#if ENABLE(CSS3_FLEXBOX)
case CSSPropertyWebkitFlexOrder:
if (validUnit(value, FInteger, true)) {
......@@ -6334,6 +6348,21 @@ private:
CSSParser::Units m_unit;
};
#if ENABLE(CSS_FILTERS)
PassRefPtr<CSSValueList> CSSParser::parseFilter()
{
if (!m_valueList)
return 0;
// The filter is a list of functional primitives that specify individual operations.
// Eventually, we will collect a list of WebKitCSSFilterValues, where each value specifies
// a single operation. For now, just use the generic CSSValueList constructor to
// parse the input.
RefPtr<CSSValueList> list = CSSValueList::createFromParserValueList(m_valueList);
return list.release();
}
#endif
PassRefPtr<CSSValueList> CSSParser::parseTransform()
{
if (!m_valueList)
......
......@@ -185,6 +185,10 @@ public:
bool parseRadialGradient(RefPtr<CSSValue>&, CSSGradientRepeat repeating);
bool parseGradientColorStops(CSSParserValueList*, CSSGradientValue*, bool expectComma);
#if ENABLE(CSS_FILTERS)
PassRefPtr<CSSValueList> parseFilter();
#endif
PassRefPtr<CSSValueList> parseTransform();
bool parseTransformOrigin(int propId, int& propId1, int& propId2, int& propId3, RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
bool parsePerspectiveOrigin(int propId, int& propId1, int& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
......
......@@ -248,6 +248,9 @@ z-index
-webkit-column-span
-webkit-column-width
-webkit-columns
#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
-webkit-filter
#endif
#if defined(ENABLE_CSS3_FLEXBOX) && ENABLE_CSS3_FLEXBOX
-webkit-flex-align
-webkit-flex-flow
......
......@@ -3733,6 +3733,11 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return;
}
#if ENABLE(CSS_FILTERS)
case CSSPropertyWebkitFilter:
return;
#endif
// These properties are implemented in the CSSStyleApplyProperty lookup table.
case CSSPropertyColor:
case CSSPropertyDirection:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment