RESOLVED FIXED 128958
Add support for the isolation property
https://bugs.webkit.org/show_bug.cgi?id=128958
Summary Add support for the isolation property
Mihai Tica
Reported 2014-02-17 23:41:28 PST
The isolation property is part of the CSS Blending specification: http://dev.w3.org/fxtf/compositing-1/#isolation Parse and implement a prefixed version of the property. The allowed values for -webkit-isolation are isolate and auto(default).
Attachments
Patch V1 (17.91 KB, patch)
2014-02-18 00:16 PST, Mihai Tica
no flags
Patch V2 (17.87 KB, patch)
2014-02-18 00:34 PST, Mihai Tica
no flags
Patch V3 (18.27 KB, patch)
2014-02-19 01:19 PST, Mihai Tica
no flags
Patch V4 (25.77 KB, patch)
2014-02-24 05:44 PST, Mihai Tica
no flags
Patch V4. Addressed Dirk's comments (25.80 KB, patch)
2014-02-24 08:24 PST, Mihai Tica
no flags
Mihai Tica
Comment 1 2014-02-18 00:16:33 PST
Created attachment 224476 [details] Patch V1
Mihai Tica
Comment 2 2014-02-18 00:34:54 PST
Created attachment 224479 [details] Patch V2
Andreas Kling
Comment 3 2014-02-18 10:25:44 PST
Comment on attachment 224479 [details] Patch V2 View in context: https://bugs.webkit.org/attachment.cgi?id=224479&action=review > Source/WebCore/css/CSSPrimitiveValueMappings.h:4158 > +template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Isolation i) Short variable names like "i" are not consistent with WebKit style. We tend to prefer e.g like "isolation". > Source/WebCore/css/CSSPrimitiveValueMappings.h:4169 > + switch (i) { > + case IsolationAuto: > + m_value.valueID = CSSValueAuto; > + break; > + case IsolationIsolate: > + m_value.valueID = CSSValueIsolate; > + break; > + } We should have a default case here with ASSERT_NOT_REACHED(), just like we do when converting in the other direction. > Source/WebCore/rendering/style/RenderStyle.h:974 > + void setIsolation(Isolation v) { rareNonInheritedData.access()->m_isolation = v; } Using rareNonInheritedData.access() like this will force the RenderStyle to create its own unique copy of the StyleRareNonInheritedData. If you look at other setters in this file, they use a macro (SET_VAR) that first checks if the value being written is identical to the existing one, and avoids a copy in that case.
Mihai Tica
Comment 4 2014-02-19 01:19:01 PST
Created attachment 224608 [details] Patch V3 Addressed issues highlighted by Andreas Kling.
Simon Fraser (smfr)
Comment 5 2014-02-19 10:44:28 PST
Comment on attachment 224608 [details] Patch V3 View in context: https://bugs.webkit.org/attachment.cgi?id=224608&action=review > Source/WebCore/rendering/style/RenderStyle.h:975 > + bool hasIsolation() const { return rareNonInheritedData->m_isolation != IsolationAuto; } Won't this crash if rareNonInheritedData hasn't been allocated?
Mihai Tica
Comment 6 2014-02-20 01:13:13 PST
(In reply to comment #5) > (From update of attachment 224608 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=224608&action=review > > > Source/WebCore/rendering/style/RenderStyle.h:975 > > + bool hasIsolation() const { return rareNonInheritedData->m_isolation != IsolationAuto; } > > Won't this crash if rareNonInheritedData hasn't been allocated? All of RenderStyle's constructors initialise a valid rareNonInheritedData member, so I don't think this will crash.
Mihai Tica
Comment 7 2014-02-24 05:44:16 PST
Created attachment 225055 [details] Patch V4 Add SVG implementation. Add additional tests for HTML and SVG. Please have another look.
Dirk Schulze
Comment 8 2014-02-24 07:22:05 PST
Comment on attachment 225055 [details] Patch V4 View in context: https://bugs.webkit.org/attachment.cgi?id=225055&action=review The patch looks good to me. Just two snippets. I give the other reviewers some time to review the patch as well before giving my r+. Maybe Simon has more comments. > Source/WebCore/rendering/style/RenderStyle.h:974 > + void setBlendMode(BlendMode v) { SET_VAR(rareNonInheritedData, 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) { SET_VAR(rareNonInheritedData, m_isolation, v); } should still have longer names like blendMode and isolation instead of v. Regardless of the use elsewhere.
Mihai Tica
Comment 9 2014-02-24 08:24:43 PST
Created attachment 225068 [details] Patch V4. Addressed Dirk's comments
Dirk Schulze
Comment 10 2014-02-27 04:37:24 PST
Comment on attachment 225068 [details] Patch V4. Addressed Dirk's comments LGTM. Since no further review comments came from Simon and kling: r=me
WebKit Commit Bot
Comment 11 2014-02-27 05:09:55 PST
Comment on attachment 225068 [details] Patch V4. Addressed Dirk's comments Clearing flags on attachment: 225068 Committed r164795: <http://trac.webkit.org/changeset/164795>
WebKit Commit Bot
Comment 12 2014-02-27 05:09:59 PST
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 13 2014-02-27 21:03:09 PST
css3/compositing/isolation-isolate-blended-child.html test added in this patch fails every time on one of the bots. Filed bug 129468.
Note You need to log in before you can comment on or make changes to this bug.