[CSS Blending] Parse and implement the -webkit-isolation CSS property.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Feb 2014 13:15:25 +0000 (13:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Feb 2014 13:15:25 +0000 (13:15 +0000)
commitee22c26f1fc5d31d3e8a649a852ee66372e01b18
tree73ad6a297188117d24ad318f7976c54b2ac36c2f
parentdc3a3fd94c362b8a3703d4495a5b664bffe5be41
[CSS Blending] Parse and implement the -webkit-isolation CSS property.

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

Patch by Mihai Tica <mitica@adobe.com> on 2014-02-27
Reviewed by Dirk Schulze.

Source/WebCore:

Parse and implement -webkit-isolation, part of the CSS Blending and Compositing spec.
This patch adds functionality for HTML and SVG.
-webkit-isolation: isolate restricts any child elements from blending with any of the content outside the isolated parent element.

Tests: css3/compositing/isolation-isolate-blended-child.html
       css3/compositing/isolation-parsing.html
       css3/compositing/svg-isolation-default.html
       css3/compositing/svg-isolation-isolated-group.html
       css3/compositing/svg-isolation-simple.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Isolation):
* css/CSSPropertyNames.in: Add -webkit-isolation.
* css/CSSValueKeywords.in: Add the isolate value.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle): Explicitly set isolation:isolate to create a stacking context.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint): Changing isolation should trigger a repaint.
* rendering/style/RenderStyle.h: Setters and getters for isolation.
* rendering/style/RenderStyleConstants.h: Add Isolation enum.
* rendering/style/StyleRareNonInheritedData.cpp: Add m_isolation.
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent): If isolated, paint in a transparency layer.

LayoutTests:

Test parsing of -webkit-isolation. Test if setting -webkit-isolation: isolate creats a stacking context.
Test for SVG and HTML that blending is restricted to the contents of an isolated parent element.

* css3/compositing/isolation-isolate-blended-child-expected.html: Added.
* css3/compositing/isolation-isolate-blended-child.html: Added.
* css3/compositing/isolation-isolate-simple-expected.txt: Added.
* css3/compositing/isolation-parsing-expected.txt: Added.
* css3/compositing/isolation-parsing.html: Added.
* css3/compositing/svg-isolation-default-expected.html: Added.
* css3/compositing/svg-isolation-default.html: Added.
* css3/compositing/svg-isolation-isolated-group-expected.html: Added.
* css3/compositing/svg-isolation-isolated-group.html: Added.
* css3/compositing/svg-isolation-simple-expected.html: Added.
* css3/compositing/svg-isolation-simple.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/compositing/isolation-isolate-blended-child-expected.html [new file with mode: 0644]
LayoutTests/css3/compositing/isolation-isolate-blended-child.html [new file with mode: 0644]
LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt [new file with mode: 0644]
LayoutTests/css3/compositing/isolation-parsing-expected.txt [new file with mode: 0644]
LayoutTests/css3/compositing/isolation-parsing.html [new file with mode: 0644]
LayoutTests/css3/compositing/svg-isolation-default-expected.html [new file with mode: 0644]
LayoutTests/css3/compositing/svg-isolation-default.html [new file with mode: 0644]
LayoutTests/css3/compositing/svg-isolation-isolated-group-expected.html [new file with mode: 0644]
LayoutTests/css3/compositing/svg-isolation-isolated-group.html [new file with mode: 0644]
LayoutTests/css3/compositing/svg-isolation-simple-expected.html [new file with mode: 0644]
LayoutTests/css3/compositing/svg-isolation-simple.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebCore/rendering/svg/SVGRenderingContext.cpp