Changes between Initial Version and Version 1 of ShadowDOMForReplacedElements

Jul 20, 2012 12:01:26 AM (11 years ago)



  • ShadowDOMForReplacedElements

    v1 v1  
     1= Shadow DOM for Replaced Elements =
     3This page explains Shadow DOM for Replaced Elements.
     5= Background =
     7Per HTML specification, some HTML elements are designed to either not render their contents or have special requirements in regard to contents rendering.
     8According to the spec [], all the HTML elements are considered having an equivalent of a shadow DOM subtree that is created and populated at the time of element instantiation.
     10= Implementation =
     12To implement Shadow DOM for these elements, we use either of these options.
     13  1. Some HTML elements have a UserAgentShadowRoot at the time of element instantiation
     14  2. Other HTML elements does not have a UserAgentShadowRoot at the time of element instantiation, but just before we add AuthorShadowDOM to these elements, we instantiate UserAgentShadowDOM for these elements. (Lazily instantiated UserAgentShadowDOM)
     16The lazily instantiated UserAgentShadowDOM basically has an inner element, which is almost the same to the host. It will create the same renderer as the host's. The host's renderer will become just a RenderBlock or RenderInlineBlock or something defined in CSS.
     18= Styling =
     20To style the inner element of UserAgentShadowDOM for replaced elements, pseudo id is used. These are the implemented pseudo ids. This will grow as we implement Shadow DOM for other replaced elements.
     22|| element name || pseudo id ||
     23|| img || -webkit-image-inner-element ||