Title: [164795] trunk
Revision
164795
Author
[email protected]
Date
2014-02-27 05:15:25 -0800 (Thu, 27 Feb 2014)

Log Message

[CSS Blending] Parse and implement the -webkit-isolation CSS property.

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

Patch by Mihai Tica <[email protected]> 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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (164794 => 164795)


--- trunk/LayoutTests/ChangeLog	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/LayoutTests/ChangeLog	2014-02-27 13:15:25 UTC (rev 164795)
@@ -1,3 +1,26 @@
+2014-02-27  Mihai Tica  <[email protected]>
+
+        [CSS Blending] Parse and implement the -webkit-isolation CSS property.
+
+        https://bugs.webkit.org/show_bug.cgi?id=128958
+
+        Reviewed by Dirk Schulze.
+
+        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.
+
 2014-02-27  Krzysztof Czech  <[email protected]>
 
         [ATK] Utilize AtkTableCell to expose directly AccessibilityTableCell to AT

Added: trunk/LayoutTests/css3/compositing/isolation-isolate-blended-child-expected.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/isolation-isolate-blended-child-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/isolation-isolate-blended-child-expected.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<style>
+    div {
+        margin: 20px;
+        width: 130px;
+        height: 130px;
+    }
+
+    .parent {
+        background: rgb(55, 55, 55);
+        position: fixed;
+        width: 300px;
+        height: 300px;
+    }
+
+    .isolator {
+        position: fixed;
+        z-index: 0;
+        background: violet;
+    }
+
+    .child {
+        margin-top: 0px;
+        -webkit-mix-blend-mode: multiply;
+        background: olive;
+    }
+
+</style>
+<div class="parent"><div class="isolator"><div class="child"></div></div></div>

Added: trunk/LayoutTests/css3/compositing/isolation-isolate-blended-child.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/isolation-isolate-blended-child.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/isolation-isolate-blended-child.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<!-- Test to ensure that "-webkit-isolation:isolate" creates a stacking context, thus preventing blending with the parent element. -->
+<style>
+    div {
+        margin: 20px;
+        width: 130px;
+        height: 130px;
+    }
+
+    .parent {
+        background: rgb(55, 55, 55);
+        position: fixed;
+        width: 300px;
+        height: 300px;
+    }
+
+    .isolator {
+        -webkit-isolation: isolate;
+        background: violet;
+    }
+
+    .child {
+        -webkit-mix-blend-mode: multiply;
+        background: olive;
+    }
+
+</style>
+<div class="parent"><div class="isolator"><div class="child"></div></div></div>

Added: trunk/LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt (0 => 164795)


--- trunk/LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,6 @@
+PASS 0 is 0
+PASS 0 is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/css3/compositing/isolation-parsing-expected.txt (0 => 164795)


--- trunk/LayoutTests/css3/compositing/isolation-parsing-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/isolation-parsing-expected.txt	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,8 @@
+PASS setProperty("auto") is "auto"
+PASS setProperty("isolate") is "isolate"
+PASS setProperty("") is "auto"
+PASS setProperty("rubbish") is "auto"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/css3/compositing/isolation-parsing.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/isolation-parsing.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/isolation-parsing.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<body>
+    <script src=""
+    <script>
+        function setProperty(value) {
+            var div = document.createElement('div');
+            document.body.appendChild(div);
+            div.style.setProperty("-webkit-isolation", value);
+
+            var computedValue = getComputedStyle(div).getPropertyValue("-webkit-isolation");
+            document.body.removeChild(div);
+
+            return computedValue;
+        }
+
+        function test(value, expected) {
+            shouldBeEqualToString('setProperty("' + value + '")', expected);
+        }
+
+        test("auto", "auto");
+        test("isolate", "isolate");
+        test("", "auto");
+        test("rubbish", "auto");
+    </script>
+</body>
+</html>

Added: trunk/LayoutTests/css3/compositing/svg-isolation-default-expected.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/svg-isolation-default-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/svg-isolation-default-expected.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" style="background: green">
+    <rect x="100" y="100" width="200" height="200" style="fill: blue; -webkit-mix-blend-mode: multiply"/>
+</svg>

Added: trunk/LayoutTests/css3/compositing/svg-isolation-default.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/svg-isolation-default.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/svg-isolation-default.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<!-- Test the default behaviour of isolation with two simple elements. The test passes if the small square is drawn with black (blending is performed since the element is not isolated). -->
+<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" style="background: green">
+    <g style="-webkit-isolation: auto">
+        <rect x="100" y="100" width="200" height="200" style="fill: blue; -webkit-mix-blend-mode: multiply"/>
+    </g>
+</svg>

Added: trunk/LayoutTests/css3/compositing/svg-isolation-isolated-group-expected.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/svg-isolation-isolated-group-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/svg-isolation-isolated-group-expected.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="400px" style="background: green">
+    <g>
+        <rect x="50" y="50" width="200" height="200" style="fill: orange;"/>
+        <rect x="100" y="100" width="250" height="250" style="fill: blue;"/>
+        <rect x="100" y="100" width="150" height="150" style="fill: orange; -webkit-mix-blend-mode: difference;"/>
+    </g>
+</svg>

Added: trunk/LayoutTests/css3/compositing/svg-isolation-isolated-group.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/svg-isolation-isolated-group.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/svg-isolation-isolated-group.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<!-- Test behaviour of isolation for overlapping elements within groups. The test passes if there are no rects drawn with red.
+This implies that the isolation is performed accordingly, meaning the orange rect doesn't blend with the background color. -->
+<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" style="background: green">
+    <g style="-webkit-isolation: isolate;">
+        <rect x="100" y="100" width="250" height="250" style="fill: blue;"/>
+        <rect x="50" y="50" width="200" height="200" style="fill: orange; -webkit-mix-blend-mode: difference;"/>
+    </g>
+</svg>

Added: trunk/LayoutTests/css3/compositing/svg-isolation-simple-expected.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/svg-isolation-simple-expected.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/svg-isolation-simple-expected.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" style="background: green">
+    <g>
+        <rect x="100" y="100" width="200" height="200" style="fill: blue;"/>
+    </g>
+</svg>

Added: trunk/LayoutTests/css3/compositing/svg-isolation-simple.html (0 => 164795)


--- trunk/LayoutTests/css3/compositing/svg-isolation-simple.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/svg-isolation-simple.html	2014-02-27 13:15:25 UTC (rev 164795)
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<!-- Test isolation with two simple elements. The test passes if the small square is drawn with blue (no blending is performed since the element is isolated). -->
+<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" style="background: green">
+    <g style="-webkit-isolation: isolate">
+        <rect x="100" y="100" width="200" height="200" style="fill: blue; -webkit-mix-blend-mode: multiply"/>
+    </g>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (164794 => 164795)


--- trunk/Source/WebCore/ChangeLog	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/ChangeLog	2014-02-27 13:15:25 UTC (rev 164795)
@@ -1,3 +1,47 @@
+2014-02-27  Mihai Tica  <[email protected]>
+
+        [CSS Blending] Parse and implement the -webkit-isolation CSS property.
+
+        https://bugs.webkit.org/show_bug.cgi?id=128958
+
+        Reviewed by Dirk Schulze.
+
+        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.
+
 2014-02-27  Krzysztof Czech  <[email protected]>
 
         [ATK] Utilize AtkTableCell to expose directly AccessibilityTableCell to AT

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (164794 => 164795)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -228,6 +228,7 @@
     CSSPropertyWebkitBackgroundSize,
 #if ENABLE(CSS_COMPOSITING)
     CSSPropertyWebkitMixBlendMode,
+    CSSPropertyWebkitIsolation,
 #endif
     CSSPropertyWebkitBorderFit,
     CSSPropertyWebkitBorderHorizontalSpacing,
@@ -2849,6 +2850,8 @@
 #if ENABLE(CSS_COMPOSITING)
         case CSSPropertyWebkitMixBlendMode:
             return cssValuePool().createValue(style->blendMode());
+        case CSSPropertyWebkitIsolation:
+            return cssValuePool().createValue(style->isolation());
 #endif
         case CSSPropertyBackgroundBlendMode: {
             const FillLayer* layers = style->backgroundLayers();

Modified: trunk/Source/WebCore/css/CSSParser.cpp (164794 => 164795)


--- trunk/Source/WebCore/css/CSSParser.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -818,6 +818,10 @@
             || valueID == CSSValueLuminosity))
             return true;
         break;
+    case CSSPropertyWebkitIsolation:
+        if (parserContext.isCSSCompositingEnabled && (valueID == CSSValueAuto || valueID == CSSValueIsolate))
+            return true;
+        break;
 #endif
     case CSSPropertyWebkitBorderFit:
         if (valueID == CSSValueBorder || valueID == CSSValueLines)
@@ -1089,6 +1093,7 @@
     case CSSPropertyWebkitAppearance:
 #if ENABLE(CSS_COMPOSITING)
     case CSSPropertyWebkitMixBlendMode:
+    case CSSPropertyWebkitIsolation:
 #endif
     case CSSPropertyWebkitBackfaceVisibility:
     case CSSPropertyWebkitBorderAfterStyle:
@@ -2427,6 +2432,10 @@
         if (cssCompositingEnabled())
             validPrimitive = true;
         break;
+    case CSSPropertyWebkitIsolation:
+        if (cssCompositingEnabled())
+            validPrimitive = true;
+        break;
 #endif
     case CSSPropertyWebkitFlex: {
         ShorthandScope scope(this, propId);

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (164794 => 164795)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2014-02-27 13:15:25 UTC (rev 164795)
@@ -4157,6 +4157,38 @@
     return BlendModeNormal;
 }
 
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Isolation isolation)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (isolation) {
+    case IsolationAuto:
+        m_value.valueID = CSSValueAuto;
+        break;
+    case IsolationIsolate:
+        m_value.valueID = CSSValueIsolate;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator Isolation() const
+{
+    ASSERT(isValueID());
+    switch (m_value.valueID) {
+    case CSSValueAuto:
+        return IsolationAuto;
+    case CSSValueIsolate:
+        return IsolationIsolate;
+    default:
+        break;
+    }
+
+    ASSERT_NOT_REACHED();
+    return IsolationAuto;
+}
+
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
     : CSSValue(PrimitiveClass)
 {

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (164794 => 164795)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2014-02-27 13:15:25 UTC (rev 164795)
@@ -283,6 +283,7 @@
 #endif
 #if defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING
 -webkit-mix-blend-mode
+-webkit-isolation
 #endif
 #if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
 -webkit-filter

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (164794 => 164795)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2014-02-27 13:15:25 UTC (rev 164795)
@@ -1024,6 +1024,10 @@
 color
 luminosity
 
+// isolation
+// auto
+isolate
+
 // object-fit
 // fill
 // contain

Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (164794 => 164795)


--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -2488,6 +2488,7 @@
     setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
 #if ENABLE(CSS_COMPOSITING)
     setPropertyHandler(CSSPropertyWebkitMixBlendMode, ApplyPropertyDefault<BlendMode, &RenderStyle::blendMode, BlendMode, &RenderStyle::setBlendMode, BlendMode, &RenderStyle::initialBlendMode>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitIsolation, ApplyPropertyDefault<Isolation, &RenderStyle::isolation, Isolation, &RenderStyle::setIsolation, Isolation, &RenderStyle::initialIsolation>::createHandler());
 #endif
     setPropertyHandler(CSSPropertyWebkitBorderFit, ApplyPropertyDefault<EBorderFit, &RenderStyle::borderFit, EBorderFit, &RenderStyle::setBorderFit, EBorderFit, &RenderStyle::initialBorderFit>::createHandler());
     setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (164794 => 164795)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -1245,6 +1245,7 @@
         || style.boxReflect()
         || style.hasFilter()
         || style.hasBlendMode()
+        || style.hasIsolation()
         || style.position() == StickyPosition
         || (style.position() == FixedPosition && e && e->document().page() && e->document().page()->settings().fixedPositionCreatesStackingContext())
         || style.hasFlowFrom()

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (164794 => 164795)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -681,6 +681,9 @@
 #if ENABLE(CSS_COMPOSITING)
     if (rareNonInheritedData->m_effectiveBlendMode != other->rareNonInheritedData->m_effectiveBlendMode)
         return true;
+
+    if (rareNonInheritedData->m_isolation != other->rareNonInheritedData->m_isolation)
+        return true;
 #endif
 
     if (rareNonInheritedData->opacity != other->rareNonInheritedData->opacity) {

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (164794 => 164795)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2014-02-27 13:15:25 UTC (rev 164795)
@@ -972,11 +972,18 @@
 
 #if ENABLE(CSS_COMPOSITING)
     BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); }
-    void setBlendMode(BlendMode v) { rareNonInheritedData.access()->m_effectiveBlendMode = v; }
+    void setBlendMode(BlendMode blendMode) { SET_VAR(rareNonInheritedData, m_effectiveBlendMode, blendMode); }
     bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) != BlendModeNormal; }
+
+    Isolation isolation() const { return static_cast<Isolation>(rareNonInheritedData->m_isolation); }
+    void setIsolation(Isolation isolation) { SET_VAR(rareNonInheritedData, m_isolation, isolation); }
+    bool hasIsolation() const { return rareNonInheritedData->m_isolation != IsolationAuto; }
 #else
     BlendMode blendMode() const { return BlendModeNormal; }
     bool hasBlendMode() const { return false; }
+
+    Isolation isolation() const { return IsolationAuto; }
+    bool hasIsolation() const { return false; }
 #endif
  
 #if USE(RTL_SCROLLBAR)
@@ -1825,6 +1832,7 @@
 #endif
 #if ENABLE(CSS_COMPOSITING)
     static BlendMode initialBlendMode() { return BlendModeNormal; }
+    static Isolation initialIsolation() { return IsolationAuto; }
 #endif
 
 private:

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (164794 => 164795)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2014-02-27 13:15:25 UTC (rev 164795)
@@ -554,6 +554,8 @@
 enum TextIndentType { TextIndentNormal, TextIndentHanging };
 #endif
 
+enum Isolation { IsolationAuto, IsolationIsolate };
+
 // Fill, Stroke, ViewBox are just used for SVG.
 enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox };
 

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (164794 => 164795)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -94,6 +94,7 @@
     , m_aspectRatioType(RenderStyle::initialAspectRatioType())
 #if ENABLE(CSS_COMPOSITING)
     , m_effectiveBlendMode(RenderStyle::initialBlendMode())
+    , m_isolation(RenderStyle::initialIsolation())
 #endif
     , m_objectFit(RenderStyle::initialObjectFit())
 {
@@ -176,6 +177,7 @@
     , m_aspectRatioType(o.m_aspectRatioType)
 #if ENABLE(CSS_COMPOSITING)
     , m_effectiveBlendMode(o.m_effectiveBlendMode)
+    , m_isolation(o.m_isolation)
 #endif
     , m_objectFit(o.m_objectFit)
 {
@@ -268,6 +270,7 @@
         && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation
 #if ENABLE(CSS_COMPOSITING)
         && m_effectiveBlendMode == o.m_effectiveBlendMode
+        && m_isolation == o.m_isolation
 #endif
         && m_aspectRatioType == o.m_aspectRatioType
         && m_objectFit == o.m_objectFit;

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (164794 => 164795)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2014-02-27 13:15:25 UTC (rev 164795)
@@ -198,6 +198,7 @@
 
 #if ENABLE(CSS_COMPOSITING)
     unsigned m_effectiveBlendMode: 5; // EBlendMode
+    unsigned m_isolation : 1; // Isolation
 #endif
 
     unsigned m_objectFit : 3; // ObjectFit

Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (164794 => 164795)


--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp	2014-02-27 12:27:52 UTC (rev 164794)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp	2014-02-27 13:15:25 UTC (rev 164795)
@@ -104,6 +104,7 @@
     float opacity = isRenderingMask ? 1 : style.opacity();
     const ShadowData* shadow = svgStyle.shadow();
     bool hasBlendMode = style.hasBlendMode();
+    bool hasIsolation = style.hasIsolation();
     bool isolateMaskForBlending = false;
 
 #if ENABLE(CSS_COMPOSITING)
@@ -113,11 +114,11 @@
     }
 #endif
 
-    if (opacity < 1 || shadow || hasBlendMode || isolateMaskForBlending) {
+    if (opacity < 1 || shadow || hasBlendMode || isolateMaskForBlending || hasIsolation) {
         FloatRect repaintRect = m_renderer->repaintRectInLocalCoordinates();
         m_paintInfo->context->clip(repaintRect);
 
-        if (opacity < 1 || hasBlendMode || isolateMaskForBlending) {
+        if (opacity < 1 || hasBlendMode || isolateMaskForBlending || hasIsolation) {
 
             if (hasBlendMode)
                 m_paintInfo->context->setCompositeOperation(m_paintInfo->context->compositeOperation(), style.blendMode());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to