WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch V2
bug-128958-20140218103500.patch (text/plain), 17.87 KB, created by
Mihai Tica
on 2014-02-18 00:34:54 PST
(
hide
)
Description:
Patch V2
Filename:
MIME Type:
Creator:
Mihai Tica
Created:
2014-02-18 00:34:54 PST
Size:
17.87 KB
patch
obsolete
>Subversion Revision: 164221 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 487e15782c228afa4629a1cfb37d3ab296f785ad..50c3ffdff948315993eb9279999d46a8825aed7e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,42 @@ >+2014-02-17 Mihai Tica <mitica@adobe.com> >+ >+ [CSS Blending] Parse and implement the -webkit-isolation CSS property. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=128958 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Parse the isolation property, part of the CSS Blending and compositing spec. >+ The implementation consists of adding creating a stacking context for each >+ element having isolation: isolate. The default isolation: auto has no effect. >+ >+ Tests: css3/compositing/isolation-isolate-simple.html >+ css3/compositing/isolation-parsing.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: >+ > 2014-02-17 Manuel Rego Casasnovas <rego@igalia.com> > > [CSS Grid Layout] Fix missing layout in flexible and content sized columns >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index 51a79bf2526fc592d46cda00f640cfba268104b8..dd90608e04641ebffe748559612d277e78475b00 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -228,6 +228,7 @@ static const CSSPropertyID computedProperties[] = { > CSSPropertyWebkitBackgroundSize, > #if ENABLE(CSS_COMPOSITING) > CSSPropertyWebkitBlendMode, >+ CSSPropertyWebkitIsolation, > #endif > CSSPropertyWebkitBorderFit, > CSSPropertyWebkitBorderHorizontalSpacing, >@@ -2846,6 +2847,8 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert > #if ENABLE(CSS_COMPOSITING) > case CSSPropertyWebkitBlendMode: > return cssValuePool().createValue(style->blendMode()); >+ case CSSPropertyWebkitIsolation: >+ return cssValuePool().createValue(style->isolation()); > #endif > case CSSPropertyBackgroundBlendMode: { > const FillLayer* layers = style->backgroundLayers(); >diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp >index 66e0e21cb50bf86b9caac07bdc96b97339dcffdc..d11ac5343afeceba196341e6b2df4faf33ca0485 100644 >--- a/Source/WebCore/css/CSSParser.cpp >+++ b/Source/WebCore/css/CSSParser.cpp >@@ -810,6 +810,10 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int > || 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) >@@ -1079,6 +1083,7 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId) > case CSSPropertyWebkitAppearance: > #if ENABLE(CSS_COMPOSITING) > case CSSPropertyWebkitBlendMode: >+ case CSSPropertyWebkitIsolation: > #endif > case CSSPropertyWebkitBackfaceVisibility: > case CSSPropertyWebkitBorderAfterStyle: >@@ -2415,6 +2420,10 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) > if (cssCompositingEnabled()) > validPrimitive = true; > break; >+ case CSSPropertyWebkitIsolation: >+ if (cssCompositingEnabled()) >+ validPrimitive = true; >+ break; > #endif > case CSSPropertyWebkitFlex: { > ShorthandScope scope(this, propId); >diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h >index 83671b46c287ab7fbc88e784ae99c12870a7ffea..2614ed938a9bd1e304e9f6d3b5be3e15a9ef5d48 100644 >--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h >+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h >@@ -4155,6 +4155,36 @@ template<> inline CSSPrimitiveValue::operator BlendMode() const > return BlendModeNormal; > } > >+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Isolation i) >+ : CSSValue(PrimitiveClass) >+{ >+ m_primitiveUnitType = CSS_VALUE_ID; >+ switch (i) { >+ case IsolationAuto: >+ m_value.valueID = CSSValueAuto; >+ break; >+ case IsolationIsolate: >+ m_value.valueID = CSSValueIsolate; >+ break; >+ } >+} >+ >+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) > { >diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in >index 3ef0524415f9bcf4aef37ac45df0873e9f56372a..10770f6abc42853e4cb6869239298b2d79379e1e 100644 >--- a/Source/WebCore/css/CSSPropertyNames.in >+++ b/Source/WebCore/css/CSSPropertyNames.in >@@ -283,6 +283,7 @@ z-index > #endif > #if defined(ENABLE_CSS_COMPOSITING) && ENABLE_CSS_COMPOSITING > -webkit-blend-mode >+-webkit-isolation > #endif > #if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS > -webkit-filter >diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in >index 38ad1767ec7d7f1e65ef0b389bfd20aa0234d2f2..e1400a7c5c0b69c4389c35dbd7749282bb61f660 100644 >--- a/Source/WebCore/css/CSSValueKeywords.in >+++ b/Source/WebCore/css/CSSValueKeywords.in >@@ -1024,6 +1024,10 @@ saturation > color > luminosity > >+// isolation >+// auto >+isolate >+ > // object-fit > // fill > // contain >diff --git a/Source/WebCore/css/DeprecatedStyleBuilder.cpp b/Source/WebCore/css/DeprecatedStyleBuilder.cpp >index 583a5db78e4a50c28897d9e1cad45ae93dd28c3e..907be0ac5b33dcb428f34f4fe996e889453fe701 100644 >--- a/Source/WebCore/css/DeprecatedStyleBuilder.cpp >+++ b/Source/WebCore/css/DeprecatedStyleBuilder.cpp >@@ -2488,6 +2488,7 @@ DeprecatedStyleBuilder::DeprecatedStyleBuilder() > setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize); > #if ENABLE(CSS_COMPOSITING) > setPropertyHandler(CSSPropertyWebkitBlendMode, 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()); >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index d82bc74d612553f42e929e9562f39719d0df3087..1d257653cb2b3c06d160df56fa875c28b113d1f2 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -1238,6 +1238,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& par > || 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() >diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp >index 133ab490ede2496fb93b82e0e17e8a8d668ef91f..ba829f6b524df6c172e49be9311dbc8b9f5c3993 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.cpp >+++ b/Source/WebCore/rendering/style/RenderStyle.cpp >@@ -679,6 +679,9 @@ bool RenderStyle::changeRequiresLayerRepaint(const RenderStyle* other, unsigned& > #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) { >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index f6c43e63f98e4e0d3a2d96a7b432ddfd9e177478..a352ede644e10fd76fba5c5fab6fdb8f4079463d 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -969,7 +969,13 @@ public: > BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); } > void setBlendMode(BlendMode v) { rareNonInheritedData.access()->m_effectiveBlendMode = v; } > bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) != BlendModeNormal; } >+ >+ Isolation isolation() const { return static_cast<Isolation>(rareNonInheritedData->m_isolation); } >+ void setIsolation(Isolation v) { rareNonInheritedData.access()->m_isolation = v; } >+ bool hasIsolation() const { return rareNonInheritedData->m_isolation != IsolationAuto; } > #else >+ Isolation isolation() const { return IsolationAuto; } >+ bool hasIsolation() const { return false; } > bool hasBlendMode() const { return false; } > #endif > >@@ -1816,6 +1822,7 @@ public: > #endif > #if ENABLE(CSS_COMPOSITING) > static BlendMode initialBlendMode() { return BlendModeNormal; } >+ static Isolation initialIsolation() { return IsolationAuto; } > #endif > > private: >diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h >index 704ade06a305a8f80b9ef688b0b837a1ccf4ab3e..0c64ddb5cd986405cfb1c4cdf64be9aeec0da492 100644 >--- a/Source/WebCore/rendering/style/RenderStyleConstants.h >+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h >@@ -550,6 +550,8 @@ enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine }; > 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 }; > >diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp >index 8bec162956a82f5f5bf4124914350c0ddbc07643..62c1c94a0d7ff46b4370489e7e120a6141a68a40 100644 >--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp >+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp >@@ -92,6 +92,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData() > , m_aspectRatioType(RenderStyle::initialAspectRatioType()) > #if ENABLE(CSS_COMPOSITING) > , m_effectiveBlendMode(RenderStyle::initialBlendMode()) >+ , m_isolation(RenderStyle::initialIsolation()) > #endif > , m_objectFit(RenderStyle::initialObjectFit()) > { >@@ -172,6 +173,7 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn > , 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) > { >@@ -262,6 +264,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c > && !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; >diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h >index c3ba52615f8fe536592eda9fbfefbb5e07e8bd6f..929b3a1689704dd8ff685c7e7e8859ddab3dcec5 100644 >--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h >+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h >@@ -194,6 +194,7 @@ public: > > #if ENABLE(CSS_COMPOSITING) > unsigned m_effectiveBlendMode: 5; // EBlendMode >+ unsigned m_isolation : 1; // Isolation > #endif > > unsigned m_objectFit : 3; // ObjectFit >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8df3175bbbb071ccbfc98ca0147fc0fe6c8f32e9..8bdd589f72fd08ddf3133de18a495beca14ca26c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2014-02-17 Mihai Tica <mitica@adobe.com> >+ >+ [CSS Blending] Parse and implement the -webkit-isolation CSS property. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=128958 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * css3/compositing/isolation-isolate-simple-expected.txt: Added. >+ * css3/compositing/isolation-isolate-simple.html: Check both the composited and non-composited path >+ for the creation of a stacking context when setting -webkit-isolation: isolate. >+ * css3/compositing/isolation-parsing-expected.txt: Added. >+ * css3/compositing/isolation-parsing.html: Test if -webkit-isolation is properly parsed. >+ > 2014-02-17 MichaÅ PakuÅa vel Rutka <m.pakula@samsung.com> > > Unreviewed EFL gardening >diff --git a/LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt b/LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f89cfd8353f6a42454777565705d9772d7b70c50 >--- /dev/null >+++ b/LayoutTests/css3/compositing/isolation-isolate-simple-expected.txt >@@ -0,0 +1,6 @@ >+PASS 0 is 0 >+PASS 0 is 0 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/css3/compositing/isolation-isolate-simple.html b/LayoutTests/css3/compositing/isolation-isolate-simple.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ef24c0d8e8f353a07a682dfeb3c62e1c90591b12 >--- /dev/null >+++ b/LayoutTests/css3/compositing/isolation-isolate-simple.html >@@ -0,0 +1,28 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<style> >+ div { >+ width: 10px; >+ height: 10px; >+ background: green; >+ -webkit-isolation:isolate; >+ } >+</style> >+<!-- Isolation should create a stacking context. Test if "isolation:isolate" sets the zIndex to 0, instead of the default "auto" value. --> >+<body> >+ <div id="isolator"></div> >+ <div id="isolator_composited" style="-webkit-transform: translateZ(0);"></div> >+ >+ <script src="../../resources/js-test.js"></script> >+ <script> >+ // Non composited path. >+ var zIndex = getComputedStyle(document.getElementById("isolator")).zIndex; >+ shouldBeZero(zIndex); >+ >+ // Composited path. >+ zIndex = getComputedStyle(document.getElementById("isolator_composited")).zIndex; >+ shouldBeZero(zIndex); >+ </script> >+</body> >+</html> >diff --git a/LayoutTests/css3/compositing/isolation-parsing-expected.txt b/LayoutTests/css3/compositing/isolation-parsing-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0995ec48a967039209fef9b0370692c5c696fd55 >--- /dev/null >+++ b/LayoutTests/css3/compositing/isolation-parsing-expected.txt >@@ -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 >+ >diff --git a/LayoutTests/css3/compositing/isolation-parsing.html b/LayoutTests/css3/compositing/isolation-parsing.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8529dea5e9d06024ddbfdaf97fd953afdbb620db >--- /dev/null >+++ b/LayoutTests/css3/compositing/isolation-parsing.html >@@ -0,0 +1,27 @@ >+<!DOCTYPE html> >+<html> >+<body> >+ <script src="../../resources/js-test.js"></script> >+ <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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 128958
:
224476
|
224479
|
224608
|
225055
|
225068