Changeset 139770 in webkit
- Timestamp:
- Jan 15, 2013 12:02:20 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139768 r139770 1 2013-01-13 Dirk Schulze <dschulze@adobe.com> 2 3 [CSS Filters] brightness() function doesn't work as specified 4 https://bugs.webkit.org/show_bug.cgi?id=106674 5 6 Negative brightness values are possible but are meaningless. Modify the tests 7 to mainly use positive amounts for brightness tests. 8 9 Reviewed by Dean Jackson. 10 11 * css3/filters/effect-brightness-clamping-hw.html: 12 * css3/filters/effect-brightness-hw.html: 13 * css3/filters/effect-combined-hw.html: 14 * css3/filters/effect-combined.html: 15 * css3/filters/multiple-filters-invalidation.html: 16 * css3/filters/null-effect-check.html: 17 * css3/filters/script-tests/filter-property-parsing-invalid.js: 18 * css3/filters/script-tests/filter-property-parsing.js: 19 1 20 2013-01-15 Zan Dobersek <zandobersek@gmail.com> 2 21 -
trunk/LayoutTests/css3/filters/effect-brightness-clamping-hw.html
r123790 r139770 4 4 } 5 5 </style> 6 <img style="-webkit-filter: brightness( -1) brightness(1)" src="resources/reference.png">7 <img style="-webkit-filter: brightness( -0.8) brightness(0.8)" src="resources/reference.png">8 <img style="-webkit-filter: brightness( -0.5) brightness(0.5)" src="resources/reference.png">9 <img style="-webkit-filter: brightness( -0.2) brightness(0.2)" src="resources/reference.png">10 <img style="-webkit-filter: brightness( 0.2) brightness(-0.2)" src="resources/reference.png">11 <img style="-webkit-filter: brightness( 0.5) brightness(-0.5)" src="resources/reference.png">12 <img style="-webkit-filter: brightness( 0.8) brightness(-0.8)" src="resources/reference.png">13 <img style="-webkit-filter: brightness(1) brightness( -1)" src="resources/reference.png">6 <img style="-webkit-filter: brightness(1) brightness(2)" src="resources/reference.png"> 7 <img style="-webkit-filter: brightness(0.2) brightness(1.8)" src="resources/reference.png"> 8 <img style="-webkit-filter: brightness(0.5) brightness(1.5)" src="resources/reference.png"> 9 <img style="-webkit-filter: brightness(0.8) brightness(1.2)" src="resources/reference.png"> 10 <img style="-webkit-filter: brightness(1.2) brightness(0.8)" src="resources/reference.png"> 11 <img style="-webkit-filter: brightness(1.5) brightness(0.5)" src="resources/reference.png"> 12 <img style="-webkit-filter: brightness(1.8) brightness(0.2)" src="resources/reference.png"> 13 <img style="-webkit-filter: brightness(1) brightness(1)" src="resources/reference.png"> 14 14 <img style="-webkit-filter: brightness(0.8) grayscale(1)" src="resources/reference.png"> 15 15 <img style="-webkit-filter: brightness(0.5) blur(3px)" src="resources/reference.png"> -
trunk/LayoutTests/css3/filters/effect-brightness-hw.html
r105576 r139770 4 4 } 5 5 </style> 6 <img style="-webkit-filter: brightness( -1)" src="resources/reference.png">7 <img style="-webkit-filter: brightness( -0.6)" src="resources/reference.png">8 <img style="-webkit-filter: brightness( -0.3)" src="resources/reference.png">6 <img style="-webkit-filter: brightness(0)" src="resources/reference.png"> 7 <img style="-webkit-filter: brightness(0.4)" src="resources/reference.png"> 8 <img style="-webkit-filter: brightness(0.7)" src="resources/reference.png"> 9 9 <img style="-webkit-filter: brightness()" src="resources/reference.png"> 10 <img style="-webkit-filter: brightness( 0.3)" src="resources/reference.png">11 <img style="-webkit-filter: brightness( 0.6)" src="resources/reference.png">12 <img style="-webkit-filter: brightness( 1)" src="resources/reference.png">10 <img style="-webkit-filter: brightness(1.3)" src="resources/reference.png"> 11 <img style="-webkit-filter: brightness(1.6)" src="resources/reference.png"> 12 <img style="-webkit-filter: brightness(2)" src="resources/reference.png"> -
trunk/LayoutTests/css3/filters/effect-combined-hw.html
r105576 r139770 10 10 <img style="-webkit-filter: blur(3px) hue-rotate(-90deg) sepia()" src="resources/reference.png"> 11 11 <img style="-webkit-filter: blur(3px) opacity(0.5) hue-rotate(-90deg) sepia()" src="resources/reference.png"> 12 <img style="-webkit-filter: blur(3px) brightness( 0.2) contrast(2)" src="resources/reference.png">12 <img style="-webkit-filter: blur(3px) brightness(1.2) contrast(2)" src="resources/reference.png"> -
trunk/LayoutTests/css3/filters/effect-combined.html
r119990 r139770 15 15 <img style="-webkit-filter: blur(3px) hue-rotate(-90deg) sepia()" src="resources/reference.png"> 16 16 <img style="-webkit-filter: blur(3px) opacity(0.5) hue-rotate(-90deg) sepia()" src="resources/reference.png"> 17 <img style="-webkit-filter: blur(3px) brightness( 0.2) contrast(2)" src="resources/reference.png">17 <img style="-webkit-filter: blur(3px) brightness(1.2) contrast(2)" src="resources/reference.png"> -
trunk/LayoutTests/css3/filters/filter-property-parsing-expected.txt
r105576 r139770 637 637 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE 638 638 PASS subRule.cssText is 'grayscale(0.25)' 639 640 Parameter less than -100% : brightness(-1.1) 641 PASS cssRule.type is 1 642 PASS declaration.length is 1 643 PASS declaration.getPropertyValue('-webkit-filter') is 'brightness(-1.1)' 644 PASS jsWrapperClass(filterRule) is 'CSSValueList' 645 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 646 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 647 PASS filterRule.length is 1 648 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS 649 PASS subRule.cssText is 'brightness(-1.1)' 650 651 Parameter more than 100% : brightness(101%) 652 PASS cssRule.type is 1 653 PASS declaration.length is 1 654 PASS declaration.getPropertyValue('-webkit-filter') is 'brightness(101%)' 655 PASS jsWrapperClass(filterRule) is 'CSSValueList' 656 PASS jsWrapperClass(filterRule.__proto__) is 'CSSValueListPrototype' 657 PASS jsWrapperClass(filterRule.constructor) is 'CSSValueListConstructor' 658 PASS filterRule.length is 1 659 PASS subRule.operationType is WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS 660 PASS subRule.cssText is 'brightness(101%)' 639 661 640 662 Rule combinations : grayscale(0.25) brightness(0.5) -
trunk/LayoutTests/css3/filters/filter-property-parsing-invalid-expected.txt
r105576 r139770 215 215 PASS declaration.getPropertyValue('-webkit-filter') is null 216 216 217 Parameter out of bounds (negative) : brightness(-1.1)218 PASS cssRule.type is 1219 PASS declaration.length is 0220 PASS declaration.getPropertyValue('-webkit-filter') is null221 222 Parameter out of bounds (positive) : brightness(101%)223 PASS cssRule.type is 1224 PASS declaration.length is 0225 PASS declaration.getPropertyValue('-webkit-filter') is null226 227 217 Length instead of number : contrast(10px) 228 218 PASS cssRule.type is 1 -
trunk/LayoutTests/css3/filters/multiple-filters-invalidation.html
r119990 r139770 3 3 <style> 4 4 html { 5 -webkit-filter: brightness( 0.1) contrast(120%);5 -webkit-filter: brightness(1.1) contrast(120%); 6 6 } 7 7 #rect { -
trunk/LayoutTests/css3/filters/null-effect-check.html
r127097 r139770 24 24 --> 25 25 <div style="-webkit-filter: blur(0)"></div> 26 <div style="-webkit-filter: brightness( 0)"></div>26 <div style="-webkit-filter: brightness(1)"></div> 27 27 <div style="-webkit-filter: invert(0)"></div> 28 28 <div style="-webkit-filter: contrast(1)"></div> -
trunk/LayoutTests/css3/filters/script-tests/filter-property-parsing-invalid.js
r115265 r139770 71 71 testInvalidFilterRule("Too many parameters and commas", "brightness(0.5, 0.5)"); 72 72 testInvalidFilterRule("Trailing comma", "brightness(0.5,)"); 73 testInvalidFilterRule("Parameter out of bounds (negative)", "brightness(-1.1)");74 testInvalidFilterRule("Parameter out of bounds (positive)", "brightness(101%)");75 73 76 74 testInvalidFilterRule("Length instead of number", "contrast(10px)"); -
trunk/LayoutTests/css3/filters/script-tests/filter-property-parsing.js
r115265 r139770 328 328 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS", "WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE"], 329 329 ["brightness(0.5)", "grayscale(0.25)"]); 330 331 testFilterRule("Parameter less than -100%", 332 "brightness(-1.1)", 1, "brightness(-1.1)", 333 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS"], 334 ["brightness(-1.1)"]); 335 336 testFilterRule("Parameter more than 100%", 337 "brightness(101%)", 1, "brightness(101%)", 338 ["WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS"], 339 ["brightness(101%)"]); 330 340 331 341 testFilterRule("Rule combinations", -
trunk/LayoutTests/platform/chromium/TestExpectations
r139753 r139770 4267 4267 crbug.com/169550 [ Debug ] platform/chromium/virtual/deferred/fast/images/icon-decoding.html [ Crash ] 4268 4268 4269 # Brightnes filter update needs rebaseline. 4270 webkit.org/b/106746 css3/filters/effect-brightness-hw.html [ ImageOnlyFailure ] 4271 webkit.org/b/106746 css3/filters/effect-combined.html [ ImageOnlyFailure ] 4272 webkit.org/b/106746 css3/filters/effect-brightness-clamping.html [ ImageOnlyFailure ] 4273 webkit.org/b/106746 css3/filters/multiple-filters-invalidation.html [ ImageOnlyFailure ] 4274 webkit.org/b/106746 css3/filters/effect-combined-hw.html [ ImageOnlyFailure ] 4275 webkit.org/b/106746 css3/filters/effect-brightness.html [ ImageOnlyFailure ] 4276 webkit.org/b/106746 css3/filters/effect-brightness-clamping-hw.html [ ImageOnlyFailure ] 4277 webkit.org/b/106746 css3/filters/filter-property-parsing.html [ Failure ] 4278 4269 4279 # Transient. Needs rebaseline. 4270 4280 webkit.org/b/103955 fast/repaint/caret-outside-block.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r139768 r139770 1 2013-01-13 Dirk Schulze <dschulze@adobe.com> 2 3 [CSS Filters] brightness() function doesn't work as specified 4 https://bugs.webkit.org/show_bug.cgi?id=106674 5 6 Reviewed by Dean Jackson. 7 8 The brightness filter implementation modified the intercept instead of the slope on 9 the feComponentTransfer function. The passed amount acts as multiplier for each 10 color chanel now. 11 12 Existing tests cover the changes and were updated. 13 14 * css/CSSParser.cpp: 15 (WebCore::CSSParser::parseBuiltinFilterArguments): 16 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 17 (PlatformCALayer::setFilters): 18 * rendering/FilterEffectRenderer.cpp: 19 (WebCore::FilterEffectRenderer::build): 20 1 21 2013-01-15 Zan Dobersek <zandobersek@gmail.com> 2 22 -
trunk/Source/WebCore/css/CSSParser.cpp
r139316 r139770 8271 8271 } 8272 8272 case WebKitCSSFilterValue::BrightnessFilterOperation: { 8273 // One optional argument, -1 to +1 or -100% to +100%, if missing use 0,8273 // One optional argument, if missing use 100%. 8274 8274 if (args->size() > 1) 8275 8275 return 0; … … 8279 8279 if (!validUnit(value, FNumber | FPercent, CSSStrictMode)) 8280 8280 return 0; 8281 8282 double amount = value->fValue; 8283 double minAllowed = value->unit == CSSPrimitiveValue::CSS_PERCENTAGE ? -100.0 : -1.0; 8284 double maxAllowed = value->unit == CSSPrimitiveValue::CSS_PERCENTAGE ? 100.0 : 1.0; 8285 if (amount < minAllowed || amount > maxAllowed) 8286 return 0; 8287 8288 filterValue->append(cssValuePool().createValue(amount, static_cast<CSSPrimitiveValue::UnitTypes>(value->unit))); 8281 8282 filterValue->append(cssValuePool().createValue(value->fValue, static_cast<CSSPrimitiveValue::UnitTypes>(value->unit))); 8289 8283 } 8290 8284 break; -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r137533 r139770 860 860 861 861 CAColorMatrix brightnessMatrix = { 862 1, 0, 0, 0, static_cast<float>(op->amount()),863 0, 1, 0, 0, static_cast<float>(op->amount()),864 0, 0, 1, 0, static_cast<float>(op->amount()),862 static_cast<float>(op->amount()), 0, 0, 0, 0, 863 0, static_cast<float>(op->amount()), 0, 0, 0, 864 0, 0, static_cast<float>(op->amount()), 0, 0, 865 865 0, 0, 0, 1, 0 866 866 }; -
trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp
r138823 r139770 314 314 ComponentTransferFunction transferFunction; 315 315 transferFunction.type = FECOMPONENTTRANSFER_TYPE_LINEAR; 316 transferFunction.slope = 1;317 transferFunction.intercept = narrowPrecisionToFloat(componentTransferOperation->amount());316 transferFunction.slope = narrowPrecisionToFloat(componentTransferOperation->amount()); 317 transferFunction.intercept = 0; 318 318 319 319 ComponentTransferFunction nullFunction; -
trunk/Source/WebCore/svg/SVGStylable.h
r74782 r139770 35 35 virtual ~SVGStylable() { } 36 36 37 virtual CSSStyleDeclaration* style() = 0;38 virtual PassRefPtr<CSSValue> getPresentationAttribute(const String&) = 0;37 virtual CSSStyleDeclaration* style() { return 0; }; 38 virtual PassRefPtr<CSSValue> getPresentationAttribute(const String&) { return 0; }; 39 39 }; 40 40
Note: See TracChangeset
for help on using the changeset viewer.