haikuwebkit/LayoutTests/css3/filters/effect-drop-shadow.html

17 lines
604 B
HTML
Raw Permalink Normal View History

CSS Filters: apply the filters in RenderLayerBacking::paintIntoLayer when filters cannot be composited in hardware https://bugs.webkit.org/show_bug.cgi?id=75842 Reviewed by Simon Fraser. Source/WebCore: RenderLayers have two possible states: composited or not. When composited the RenderLayerBacking::paintIntoLayer is used to render the result inside the graphics context of the GraphicsLayer. When not composited the RenderLayer::paintLayer method will draw the result in the graphics context of the parent layer. Because a recent patch forced creation of composited layers for filters, this patch makes RenderLayerBacking::paintIntoLayer aware that it might need to apply the filters when the composition engine failed to apply them in platform code. No new tests needed, I've just updated some of the old tests to force disable the accelerated composition so that we can still test software painted filters. * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::clearFilters): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setFilters): If filtersCanBeComposited() is false we need to reset the CoreAnimation layer to remove any previously applied filter. * platform/graphics/ca/mac/PlatformCALayerMac.mm: (PlatformCALayer::filtersCanBeComposited): Added grayscale, brightness and contrast in the list of not accelerated filters. Otherwise an assert if triggered. * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::updateBackingStore): Moved this method from RenderLayer::updateFilterBackingStore. It had no dependencies on RenderLayer. (WebCore::FilterEffectRendererHelper::beginFilterEffect): (WebCore::FilterEffectRendererHelper::applyFilterEffect): Consolidated the filter rendering inside this helper class that is now used in both RenderLayerBacking::paintIntoLayer and RenderLayer::paintLayer. * rendering/FilterEffectRenderer.h: (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): (WebCore::FilterEffectRendererHelper::haveFilterEffect): (WebCore::FilterEffectRendererHelper::hasStartedFilterEffect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): Filters should apply after the opacity is applied, so I moved this down to paintLayerContents. (WebCore::RenderLayer::paintLayerContents): * rendering/RenderLayer.h: (WebCore::RenderLayer::filter): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): Added software fallback rendering of the filters on composited RenderLayers. LayoutTests: Disabled the accelerated composition on some of the tests, so that we can test that software pipeline still works. Note that we also have equivalent tests ending in "-hw.html" that test the accelerated composited mode. * css3/filters/effect-blur.html: * css3/filters/effect-brightness.html: * css3/filters/effect-combined.html: * css3/filters/effect-contrast.html: * css3/filters/effect-custom-expected.png: Reverted the expected results for CSS Shader test with WebGL enabled. * css3/filters/effect-custom-expected.txt: Added some output to the test, to make it easy to understand what is tested. * css3/filters/effect-custom.html: Also forced enabled WebGL using layoutTestController.overridePreference. * css3/filters/effect-drop-shadow.html: * css3/filters/effect-grayscale.html: * css3/filters/effect-hue-rotate.html: * css3/filters/effect-invert.html: * css3/filters/effect-opacity.html: * css3/filters/effect-saturate.html: * css3/filters/effect-sepia.html: * css3/filters/filter-repaint.html: Canonical link: https://commits.webkit.org/92870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-11 12:08:59 +00:00
<script>
Use window.internals instead of overridePreference to set WebCore settings in tests https://bugs.webkit.org/show_bug.cgi?id=173714 Patch by Frederic Wang <fwang@igalia.com> on 2017-06-23 Reviewed by Simon Fraser. Source/WebKit2: This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that are no longer necessary after the changes done in LayoutTests. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences that no longer require testRunner.overridePreference calls in tests. LayoutTests: This commit is a first step to replace the use of testRunner.overridePreference with internals.settings.set* calls in tests. Such a call will fail immediately and obviously if its a function that does not exist, and these settings are restored properly between tests. Some preferences that do not have a WebCore setting or an internals.settings setter are not handled yet. The temporary failure added in r218480 for fast/frames/flattening/set-preference is removed and so is a custom expectation caret-mode-document-begin-end for Mac WK1. * accessibility/gtk/caret-browsing-select-focus.html: Use internals.settings.set* function. * accessibility/gtk/caret-browsing-text-focus.html: Ditto. * accessibility/gtk/caret-offsets-and-extraneous-white-spaces.html: Ditto. * accessibility/gtk/caret-offsets.html: Ditto. * accessibility/gtk/text-in-span-block-in-a-block.html: Ditto. * css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html: Ditto. * css3/blending/blend-mode-simple.html: Ditto. * css3/blending/effect-background-blend-mode.html: Ditto. * css3/filters/blur-filter-page-scroll-parents.html: Ditto. * css3/filters/blur-filter-page-scroll-self.html: Ditto. * css3/filters/blur-filter-page-scroll.html: Ditto. * css3/filters/effect-blur.html: Ditto. * css3/filters/effect-brightness-clamping.html: Ditto. * css3/filters/effect-brightness.html: Ditto. * css3/filters/effect-combined.html: Ditto. * css3/filters/effect-contrast.html: Ditto. * css3/filters/effect-drop-shadow.html: Ditto. * css3/filters/effect-grayscale.html: Ditto. * css3/filters/effect-hue-rotate.html: Ditto. * css3/filters/effect-invert.html: Ditto. * css3/filters/effect-opacity.html: Ditto. * css3/filters/effect-saturate.html: Ditto. * css3/filters/effect-sepia.html: Ditto. * css3/filters/filter-repaint.html: Ditto. * css3/filters/null-effect-check.html: Ditto. * editing/selection/caret-mode-document-begin-end.html: Ditto. * editing/selection/caret-mode-paragraph-keys-navigation.html: Ditto. * fast/animation/request-animation-frame-disabled.html: Ditto. * fast/canvas/canvas-blend-image.html: Ditto. * fast/canvas/canvas-blend-solid.html: Ditto. * fast/canvas/canvas-imageSmoothingQuality.html: Ditto. * fast/canvas/drawImage-with-small-values.html: Ditto. * fast/images/exif-orientation-composited.html: Ditto. * fast/images/exif-orientation-css.html: Ditto. * fast/images/exif-orientation.html: Ditto. * fast/images/image-controls-basic.html: Ditto. * fast/parser/pre-html5-parser-quirks.html: Ditto. * fast/repaint/no-caret-repaint-in-non-content-editable-element.html: Ditto. * http/tests/appcache/disabled.html: Ditto. * http/tests/contentextensions/block-cookies-in-ping.html: Ditto. * http/tests/contentextensions/block-ping.html: Ditto. * http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html: Ditto. * http/tests/contentextensions/hide-on-ping.html: Ditto. * http/tests/misc/favicon-loads-with-icon-loading-override.html: Ditto. * http/tests/navigation/ping-attribute/anchor-cookie.html: Ditto. * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: Ditto. * http/tests/navigation/ping-attribute/anchor-cross-origin.html: Ditto. * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html: Ditto. * http/tests/navigation/ping-attribute/anchor-same-origin.html: Ditto. * http/tests/navigation/ping-attribute/area-cookie.html: Ditto. * http/tests/navigation/ping-attribute/area-cross-origin-from-https.html: Ditto. * http/tests/navigation/ping-attribute/area-cross-origin.html: Ditto. * http/tests/navigation/ping-attribute/area-same-origin.html: Ditto. * http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html: Ditto. * imported/blink/fast/css/image-orientation/image-orientation-dynamic-expected.html: Ditto. * loader/meta-refresh-disabled.html: Ditto. * media/crash-closing-page-with-media-as-plugin-fallback.html: Ditto. * platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt: Removed. Mac WK1 now produces the same output as other platforms. * platform/mac/TestExpectations: Remove the failure for FrameFlattening now that the test uses internals.settings.set*. * platform/mac/fast/frames/flattening/set-preference.html: Use internals.settings.set*. * plugins/crash-restoring-plugin-page-from-page-cache.html: Ditto. * plugins/frameset-with-plugin-frame.html: Ditto. * plugins/netscape-plugin-page-cache-works.html: Ditto. Canonical link: https://commits.webkit.org/190637@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-23 18:48:01 +00:00
if (window.internals) {
CSS Filters: apply the filters in RenderLayerBacking::paintIntoLayer when filters cannot be composited in hardware https://bugs.webkit.org/show_bug.cgi?id=75842 Reviewed by Simon Fraser. Source/WebCore: RenderLayers have two possible states: composited or not. When composited the RenderLayerBacking::paintIntoLayer is used to render the result inside the graphics context of the GraphicsLayer. When not composited the RenderLayer::paintLayer method will draw the result in the graphics context of the parent layer. Because a recent patch forced creation of composited layers for filters, this patch makes RenderLayerBacking::paintIntoLayer aware that it might need to apply the filters when the composition engine failed to apply them in platform code. No new tests needed, I've just updated some of the old tests to force disable the accelerated composition so that we can still test software painted filters. * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::clearFilters): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setFilters): If filtersCanBeComposited() is false we need to reset the CoreAnimation layer to remove any previously applied filter. * platform/graphics/ca/mac/PlatformCALayerMac.mm: (PlatformCALayer::filtersCanBeComposited): Added grayscale, brightness and contrast in the list of not accelerated filters. Otherwise an assert if triggered. * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::updateBackingStore): Moved this method from RenderLayer::updateFilterBackingStore. It had no dependencies on RenderLayer. (WebCore::FilterEffectRendererHelper::beginFilterEffect): (WebCore::FilterEffectRendererHelper::applyFilterEffect): Consolidated the filter rendering inside this helper class that is now used in both RenderLayerBacking::paintIntoLayer and RenderLayer::paintLayer. * rendering/FilterEffectRenderer.h: (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): (WebCore::FilterEffectRendererHelper::haveFilterEffect): (WebCore::FilterEffectRendererHelper::hasStartedFilterEffect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): Filters should apply after the opacity is applied, so I moved this down to paintLayerContents. (WebCore::RenderLayer::paintLayerContents): * rendering/RenderLayer.h: (WebCore::RenderLayer::filter): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): Added software fallback rendering of the filters on composited RenderLayers. LayoutTests: Disabled the accelerated composition on some of the tests, so that we can test that software pipeline still works. Note that we also have equivalent tests ending in "-hw.html" that test the accelerated composited mode. * css3/filters/effect-blur.html: * css3/filters/effect-brightness.html: * css3/filters/effect-combined.html: * css3/filters/effect-contrast.html: * css3/filters/effect-custom-expected.png: Reverted the expected results for CSS Shader test with WebGL enabled. * css3/filters/effect-custom-expected.txt: Added some output to the test, to make it easy to understand what is tested. * css3/filters/effect-custom.html: Also forced enabled WebGL using layoutTestController.overridePreference. * css3/filters/effect-drop-shadow.html: * css3/filters/effect-grayscale.html: * css3/filters/effect-hue-rotate.html: * css3/filters/effect-invert.html: * css3/filters/effect-opacity.html: * css3/filters/effect-saturate.html: * css3/filters/effect-sepia.html: * css3/filters/filter-repaint.html: Canonical link: https://commits.webkit.org/92870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-11 12:08:59 +00:00
// Force software rendering mode.
Use window.internals instead of overridePreference to set WebCore settings in tests https://bugs.webkit.org/show_bug.cgi?id=173714 Patch by Frederic Wang <fwang@igalia.com> on 2017-06-23 Reviewed by Simon Fraser. Source/WebKit2: This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that are no longer necessary after the changes done in LayoutTests. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences that no longer require testRunner.overridePreference calls in tests. LayoutTests: This commit is a first step to replace the use of testRunner.overridePreference with internals.settings.set* calls in tests. Such a call will fail immediately and obviously if its a function that does not exist, and these settings are restored properly between tests. Some preferences that do not have a WebCore setting or an internals.settings setter are not handled yet. The temporary failure added in r218480 for fast/frames/flattening/set-preference is removed and so is a custom expectation caret-mode-document-begin-end for Mac WK1. * accessibility/gtk/caret-browsing-select-focus.html: Use internals.settings.set* function. * accessibility/gtk/caret-browsing-text-focus.html: Ditto. * accessibility/gtk/caret-offsets-and-extraneous-white-spaces.html: Ditto. * accessibility/gtk/caret-offsets.html: Ditto. * accessibility/gtk/text-in-span-block-in-a-block.html: Ditto. * css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html: Ditto. * css3/blending/blend-mode-simple.html: Ditto. * css3/blending/effect-background-blend-mode.html: Ditto. * css3/filters/blur-filter-page-scroll-parents.html: Ditto. * css3/filters/blur-filter-page-scroll-self.html: Ditto. * css3/filters/blur-filter-page-scroll.html: Ditto. * css3/filters/effect-blur.html: Ditto. * css3/filters/effect-brightness-clamping.html: Ditto. * css3/filters/effect-brightness.html: Ditto. * css3/filters/effect-combined.html: Ditto. * css3/filters/effect-contrast.html: Ditto. * css3/filters/effect-drop-shadow.html: Ditto. * css3/filters/effect-grayscale.html: Ditto. * css3/filters/effect-hue-rotate.html: Ditto. * css3/filters/effect-invert.html: Ditto. * css3/filters/effect-opacity.html: Ditto. * css3/filters/effect-saturate.html: Ditto. * css3/filters/effect-sepia.html: Ditto. * css3/filters/filter-repaint.html: Ditto. * css3/filters/null-effect-check.html: Ditto. * editing/selection/caret-mode-document-begin-end.html: Ditto. * editing/selection/caret-mode-paragraph-keys-navigation.html: Ditto. * fast/animation/request-animation-frame-disabled.html: Ditto. * fast/canvas/canvas-blend-image.html: Ditto. * fast/canvas/canvas-blend-solid.html: Ditto. * fast/canvas/canvas-imageSmoothingQuality.html: Ditto. * fast/canvas/drawImage-with-small-values.html: Ditto. * fast/images/exif-orientation-composited.html: Ditto. * fast/images/exif-orientation-css.html: Ditto. * fast/images/exif-orientation.html: Ditto. * fast/images/image-controls-basic.html: Ditto. * fast/parser/pre-html5-parser-quirks.html: Ditto. * fast/repaint/no-caret-repaint-in-non-content-editable-element.html: Ditto. * http/tests/appcache/disabled.html: Ditto. * http/tests/contentextensions/block-cookies-in-ping.html: Ditto. * http/tests/contentextensions/block-ping.html: Ditto. * http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html: Ditto. * http/tests/contentextensions/hide-on-ping.html: Ditto. * http/tests/misc/favicon-loads-with-icon-loading-override.html: Ditto. * http/tests/navigation/ping-attribute/anchor-cookie.html: Ditto. * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: Ditto. * http/tests/navigation/ping-attribute/anchor-cross-origin.html: Ditto. * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html: Ditto. * http/tests/navigation/ping-attribute/anchor-same-origin.html: Ditto. * http/tests/navigation/ping-attribute/area-cookie.html: Ditto. * http/tests/navigation/ping-attribute/area-cross-origin-from-https.html: Ditto. * http/tests/navigation/ping-attribute/area-cross-origin.html: Ditto. * http/tests/navigation/ping-attribute/area-same-origin.html: Ditto. * http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html: Ditto. * imported/blink/fast/css/image-orientation/image-orientation-dynamic-expected.html: Ditto. * loader/meta-refresh-disabled.html: Ditto. * media/crash-closing-page-with-media-as-plugin-fallback.html: Ditto. * platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt: Removed. Mac WK1 now produces the same output as other platforms. * platform/mac/TestExpectations: Remove the failure for FrameFlattening now that the test uses internals.settings.set*. * platform/mac/fast/frames/flattening/set-preference.html: Use internals.settings.set*. * plugins/crash-restoring-plugin-page-from-page-cache.html: Ditto. * plugins/frameset-with-plugin-frame.html: Ditto. * plugins/netscape-plugin-page-cache-works.html: Ditto. Canonical link: https://commits.webkit.org/190637@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-23 18:48:01 +00:00
window.internals.settings.setAcceleratedCompositingEnabled(false);
CSS Filters: apply the filters in RenderLayerBacking::paintIntoLayer when filters cannot be composited in hardware https://bugs.webkit.org/show_bug.cgi?id=75842 Reviewed by Simon Fraser. Source/WebCore: RenderLayers have two possible states: composited or not. When composited the RenderLayerBacking::paintIntoLayer is used to render the result inside the graphics context of the GraphicsLayer. When not composited the RenderLayer::paintLayer method will draw the result in the graphics context of the parent layer. Because a recent patch forced creation of composited layers for filters, this patch makes RenderLayerBacking::paintIntoLayer aware that it might need to apply the filters when the composition engine failed to apply them in platform code. No new tests needed, I've just updated some of the old tests to force disable the accelerated composition so that we can still test software painted filters. * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::clearFilters): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setFilters): If filtersCanBeComposited() is false we need to reset the CoreAnimation layer to remove any previously applied filter. * platform/graphics/ca/mac/PlatformCALayerMac.mm: (PlatformCALayer::filtersCanBeComposited): Added grayscale, brightness and contrast in the list of not accelerated filters. Otherwise an assert if triggered. * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::updateBackingStore): Moved this method from RenderLayer::updateFilterBackingStore. It had no dependencies on RenderLayer. (WebCore::FilterEffectRendererHelper::beginFilterEffect): (WebCore::FilterEffectRendererHelper::applyFilterEffect): Consolidated the filter rendering inside this helper class that is now used in both RenderLayerBacking::paintIntoLayer and RenderLayer::paintLayer. * rendering/FilterEffectRenderer.h: (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): (WebCore::FilterEffectRendererHelper::haveFilterEffect): (WebCore::FilterEffectRendererHelper::hasStartedFilterEffect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): Filters should apply after the opacity is applied, so I moved this down to paintLayerContents. (WebCore::RenderLayer::paintLayerContents): * rendering/RenderLayer.h: (WebCore::RenderLayer::filter): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): Added software fallback rendering of the filters on composited RenderLayers. LayoutTests: Disabled the accelerated composition on some of the tests, so that we can test that software pipeline still works. Note that we also have equivalent tests ending in "-hw.html" that test the accelerated composited mode. * css3/filters/effect-blur.html: * css3/filters/effect-brightness.html: * css3/filters/effect-combined.html: * css3/filters/effect-contrast.html: * css3/filters/effect-custom-expected.png: Reverted the expected results for CSS Shader test with WebGL enabled. * css3/filters/effect-custom-expected.txt: Added some output to the test, to make it easy to understand what is tested. * css3/filters/effect-custom.html: Also forced enabled WebGL using layoutTestController.overridePreference. * css3/filters/effect-drop-shadow.html: * css3/filters/effect-grayscale.html: * css3/filters/effect-hue-rotate.html: * css3/filters/effect-invert.html: * css3/filters/effect-opacity.html: * css3/filters/effect-saturate.html: * css3/filters/effect-sepia.html: * css3/filters/filter-repaint.html: Canonical link: https://commits.webkit.org/92870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-01-11 12:08:59 +00:00
}
</script>
Filters need to affect visual overflow https://bugs.webkit.org/show_bug.cgi?id=71930 Source/WebCore: Reviewed by Simon Fraser. Make sure filters are included in visual overflow. Add a new method to calculate the expansion of overflow region given a list of FilterOperations. This is a slight duplication of code from the rendering path, but is needed because overflow is calculated before the FilterEffect chain is built. Also, filters were always rendered into their input rectangle which was wrong for any effect that produced a different sized result - drop-shadow and blur. This required two changes. First, FilterEffect needed a flag to decide whether or not to clip output to primitive regions (as required by SVG but not what we want here). Second, the rendering operation draws into the rectangle the filter claims is its painting rectangle. Test: css3/filters/regions-expanding.html * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::determineAbsolutePaintRect): Only clipToBounds if necessary. * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): CSS filters ask for the kernel size before the Filter object is created, so add a new method to return an unscaled kernel. (WebCore::FEGaussianBlur::calculateKernelSize): (WebCore::FEGaussianBlur::determineAbsolutePaintRect): Only clipToBounds if necessary. * platform/graphics/filters/FEGaussianBlur.h: * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::determineAbsolutePaintRect): Only clipToBounds if necessary. * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::determineAbsolutePaintRect): Only clipToBounds if necessary. * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::FilterEffect): Initialize clipToBounds as false so SVG remains unchanged. (WebCore::FilterEffect::determineAbsolutePaintRect): Only clipToBounds if necessary. * platform/graphics/filters/FilterEffect.h: (WebCore::FilterEffect::clipsToBounds): (WebCore::FilterEffect::setClipsToBounds): * rendering/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::build): Make sure we set our filters here to NOT clip to bounds. * rendering/FilterEffectRenderer.h: (WebCore::FilterEffectRenderer::outputRect): Asks the filter operation for the size of the result image. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computeOverflow): * rendering/RenderBox.cpp: (WebCore::RenderBox::addVisualEffectOverflow): Change the name from addBoxShadowAndBorderOverflow(). * rendering/RenderBox.h: * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::layout): * rendering/RenderIFrame.cpp: (WebCore::RenderIFrame::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): * rendering/RenderLayerBacking.cpp: (WebCore::hasBoxDecorations): Change name from hasBorderOutlineOrShadow(). (WebCore::hasBoxDecorationsOrBackground): (WebCore::hasBoxDecorationsOrBackgroundImage): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::layout): * rendering/style/FilterOperations.cpp: (WebCore::outsetSizeForBlur): Return an IntSize that is the amount of offset. (WebCore::FilterOperations::hasOutsets): (WebCore::FilterOperations::getOutsets): * rendering/style/FilterOperations.h: * rendering/style/RenderStyle.h: (WebCore::InheritedFlags::getFilterOutsets): (WebCore::InheritedFlags::hasFilterOutsets): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::determineAbsolutePaintRect): Only clipToBounds if necessary. LayoutTests: Previously, filters that expanded their input region (drop-shadow and blur) were being squished when rendered back into the document. This is now fixed, so the expected.png images from tests including such filters needed updating. I also turned off dumpAsText() in order to enable pixel tests, and added some margin between the elements in effects which have overflow (so that blurs don't overlap, for example). There is one new test which exercises the case of expanding filters at various stages in a list of operations. Reviewed by Simon Fraser. * css3/filters/crash-filter-change-expected.png: * css3/filters/effect-blur-expected.png: * css3/filters/effect-blur-expected.txt: * css3/filters/effect-blur.html: * css3/filters/effect-combined-expected.png: * css3/filters/effect-combined-expected.txt: * css3/filters/effect-combined.html: * css3/filters/effect-drop-shadow-expected.png: * css3/filters/effect-drop-shadow-expected.txt: * css3/filters/effect-drop-shadow.html: * css3/filters/effect-gamma-expected.txt: * css3/filters/effect-gamma.html: * css3/filters/effect-grayscale-expected.txt: * css3/filters/effect-grayscale.html: * css3/filters/effect-hue-rotate-expected.txt: * css3/filters/effect-hue-rotate.html: * css3/filters/effect-invert-expected.png: * css3/filters/effect-invert-expected.txt: * css3/filters/effect-invert.html: * css3/filters/effect-opacity-expected.txt: * css3/filters/effect-opacity.html: * css3/filters/effect-saturate-expected.txt: * css3/filters/effect-saturate.html: * css3/filters/effect-sepia-expected.txt: * css3/filters/effect-sepia.html: * css3/filters/regions-expanding-expected.png: Added. * css3/filters/regions-expanding-expected.txt: Added. * css3/filters/regions-expanding.html: Added. Canonical link: https://commits.webkit.org/91440@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-12-16 18:01:09 +00:00
<style>
img {
margin: 15px;
}
</style>
Support CSS filters without webkit prefix https://bugs.webkit.org/show_bug.cgi?id=148138 <rdar://problem/22331434> Reviewed by Sam Weinig. Source/WebCore: Add support for the un-prefixed form of the CSS filter property. This was straightforward for the general case on HTML content. It was a bit more tricky on SVG content, where there already was an existing "filter" property/attribute. The parsing code is now shared between SVG and HTML, as is the computed style output. Covered by updating the existing tests, and adding one new test: css3/filters/unprefixed.html * css/CSSComputedStyleDeclaration.cpp: Rename CSSPropertyWebkitFilter to CSSPropertyFilter. (WebCore::isLayoutDependent): (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::customCSSText): Use "filter(" as the prefix. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Rename CSSPropertyWebkitFilter to CSSPropertyFilter. (WebCore::CSSParser::isGeneratedImageValue): Add support for "filter()". (WebCore::CSSParser::parseGeneratedImage): Ditto. (WebCore::CSSParser::parseBuiltinFilterArguments): * css/CSSPropertyNames.in: Add filter. Make -webkit-filter an alias. * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::svgPropertyValue): Deleted. * page/animation/CSSPropertyAnimation.cpp: Rename CSSPropertyWebkitFilter to CSSPropertyFilter. (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): * page/animation/KeyframeAnimation.cpp: Ditto. (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists): * platform/graphics/GraphicsLayer.cpp: Rename AnimatedPropertyWebkitFilter to AnimatedPropertyFilter. (WebCore::GraphicsLayer::validateFilterOperations): * platform/graphics/GraphicsLayerClient.h: Ditto. * platform/graphics/ca/GraphicsLayerCA.cpp: Ditto. (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateOrRemoveFilterClients): SVG manages its own filter resources, so we shouldn't add a layer that has an SVG root to the filter clients. * rendering/RenderLayerBacking.cpp: Renaming. (WebCore::RenderLayerBacking::startAnimation): (WebCore::RenderLayerBacking::startTransition): (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty): (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty): * rendering/RenderLayerCompositor.cpp: Ditto. (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): * rendering/style/SVGRenderStyle.h: Remove the SVG filter style. (WebCore::SVGRenderStyle::isolatesBlending): No need to check for hasFilter(). (WebCore::SVGRenderStyle::initialFilterResource): Deleted. (WebCore::SVGRenderStyle::setFilterResource): Deleted. (WebCore::SVGRenderStyle::filterResource): Deleted. (WebCore::SVGRenderStyle::hasFilter): Deleted. * rendering/style/SVGRenderStyleDefs.cpp: Remove the filter resource. (WebCore::StyleResourceData::StyleResourceData): Deleted. (WebCore::StyleResourceData::operator==): Deleted. * rendering/style/SVGRenderStyleDefs.h: * rendering/style/WillChangeData.cpp: Renaming. (WebCore::propertyCreatesStackingContext): (WebCore::propertyTriggersCompositing): * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::isolatesBlending): Since SVGRenderStyle no longer checks hasFilter() in its isolatesBlending(), we need to do it here. * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeResources): Dump from the CSS style value. * rendering/svg/SVGResources.cpp: Ditto. (WebCore::SVGResources::buildCachedResources): * rendering/svg/SVGResources.h: * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::addResourcesFromRenderer): * platform/graphics/texmap/TextureMapperLayer.cpp: Renaming. * platform/graphics/texmap/TextureMapperAnimation.cpp: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: Source/WebKit2: Rename WebkitFilter to Filter. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder<TextureMapperAnimation>::encode): (IPC::ArgumentCoder<TextureMapperAnimation>::decode): LayoutTests: Globally change -webkit-filter to filter in as many places as possible. Then add a new test that makes sure the prefixed and unprefixed value resolve to the same computed style. * animations/resources/animation-test-helpers.js: (parseCSSImage): * css3/filters/backdrop/effect-hw-expected.html: * css3/filters/effect-blur-hw.html: * css3/filters/effect-blur.html: * css3/filters/effect-brightness-clamping-hw.html: * css3/filters/effect-brightness-clamping.html: * css3/filters/effect-brightness-hw.html: * css3/filters/effect-brightness.html: * css3/filters/effect-combined-hw.html: * css3/filters/effect-combined.html: * css3/filters/effect-contrast-hw.html: * css3/filters/effect-contrast.html: * css3/filters/effect-drop-shadow-hw.html: * css3/filters/effect-drop-shadow.html: * css3/filters/effect-grayscale-hw.html: * css3/filters/effect-grayscale.html: * css3/filters/effect-hue-rotate-hw.html: * css3/filters/effect-hue-rotate.html: * css3/filters/effect-invert-hw.html: * css3/filters/effect-invert.html: * css3/filters/effect-opacity-hw.html: * css3/filters/effect-opacity.html: * css3/filters/effect-reference-composite-hw.html: * css3/filters/effect-reference-composite.html: * css3/filters/effect-reference-hw.html: * css3/filters/effect-reference-ordering-hw.html: * css3/filters/effect-reference-ordering.html: * css3/filters/effect-reference.html: * css3/filters/effect-saturate-hw.html: * css3/filters/effect-saturate.html: * css3/filters/effect-sepia-hw.html: * css3/filters/effect-sepia.html: * css3/filters/filter-property-computed-style-expected.txt: * css3/filters/filter-property-parsing-expected.txt: * css3/filters/script-tests/filter-property-computed-style.js: (testComputedFilterRule): * css3/filters/script-tests/filter-property-parsing.js: (testFilterRule): * css3/filters/script-tests/unprefixed.js: Copied from LayoutTests/css3/filters/script-tests/filter-property-computed-style.js. (testComputedFilterRule): * css3/filters/unprefixed-expected.txt: Copied from LayoutTests/css3/filters/filter-property-computed-style-expected.txt. * css3/filters/unprefixed.html: Added. * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/filter-image/clipped-filter-expected.html: * fast/filter-image/clipped-filter.html: * fast/filter-image/filter-image-animation-expected.txt: * fast/filter-image/filter-image-animation.html: * fast/filter-image/filter-image-blur.html: * fast/filter-image/filter-image-expected.html: * fast/filter-image/filter-image-svg.html: * fast/filter-image/filter-image.html: * fast/filter-image/parse-filter-image-expected.txt: * fast/filter-image/parse-filter-image.html: * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/166305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-19 20:22:50 +00:00
<img style="filter: drop-shadow(0 0 0 black)" src="resources/reference.png">
<img style="filter: drop-shadow(5px 5px 2px black)" src="resources/reference.png">
<img style="filter: drop-shadow(5px 5px 0px red)" src="resources/reference.png">
<img style="filter: drop-shadow(10px 10px 0px red)" src="resources/reference.png">
<img style="filter: drop-shadow(5px 5px 10px blue)" src="resources/reference.png">