Changes between Version 3 and Version 4 of ImplementingCSSProperty


Ignore:
Timestamp:
Aug 28, 2015 12:08:23 PM (7 years ago)
Author:
mmaxfield@apple.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementingCSSProperty

    v3 v4  
    3333Then, at layout or paint time, you consult with the RenderStyle to do whatever your property is supposed to do. Every element has a reference to its RenderStyle.
    3434
    35 One last piece that you have to do is to allow for getComputedStyle() to work. There is a function, ComputedStyleExtractor::propertyValue() which inspects a RenderStyle and constructs a CSSValue for a given property. Because of this, your property must be round-trippable through RenderStyle. This function switches over the property to extract, and each one has a stanza where the RenderStyle is inspected and the resulting CSSValue is built up.
     35There are a couple other follow-up pieces you will also need to do:
     36
     37One extra piece that you have to do is to allow for getComputedStyle() to work. There is a function, ComputedStyleExtractor::propertyValue() which inspects a RenderStyle and constructs a CSSValue for a given property. Because of this, your property must be round-trippable through RenderStyle. This function switches over the property to extract, and each one has a stanza where the RenderStyle is inspected and the resulting CSSValue is built up.
     38
     39Another extra piece comes into play when style changes. We have machinery which partitions all our properties into properties which require layout, properties which require repainting, properties which require recompositing, etc. When a property changes, we inspect this partitioning to decide which operations we need to perform as a result of the style change. You can add this partitioning information about your new property in RenderStyle::diff().