Posts

Showing posts with the label Shadow DOM HTML5 Web Developer

Shadow Master: Shadow DOM

I have had many sleepless nights trying to deal with CSS bleeds and clashing element id attributes. You have to expect this when you are working on a code base that is accessible to a lot of developers especially in an enterprise setting. Good thing that I am not the only one encountering this problem and the new w3c specification hopefully would address this problem. ( http://www.w3.org/TR/shadow-dom/#dfn-functional-encapsulation ) The SHADOW DOM As defined in the specification this addresses the functional encapsulation of element in the DOM tree. What does this mean? Well first you can now have chunks of html elements with styling that will not affect the rest of the DOM tree. Why would you want to have chunks of html elements? Of course to create widgets. This is the reason why the Shadow DOM is an important part of building web components. Once you created a chunk of html (like a widget) you can now re-use this widget all over the place without the fear of having