Currently updating any styles in shadow dom trees causes full style update. However, the update doesn't affect document tree. So we should update only the affected shadow dom trees.
Created attachment 174942 [details] WIP
This WIP patch contains: (1) add ShadowStyleSheetCollection and move all styles in shadow dom trees from DocumentStyleSheetCollection to ShadowStyleSheetCollection. (2) update HTMLStyleElement and StyleElement to provide treescope information for ShadowStyleSheetCollection. (3) add StyleShadowResolver and make StyleResolver to invoke the resolver. (4) use ShadowStyleSheetCollection to update RuleSets in shadow dom trees instead of all RuleSets. This WIP patch also makes document.stylesheet not to include styles in shadow dom trees.
Comment on attachment 174942 [details] WIP Attachment 174942 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/14907183
Comment on attachment 174942 [details] WIP Attachment 174942 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/14907207
Created attachment 175372 [details] WIP
Comment on attachment 175372 [details] WIP Attachment 175372 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/14894915
Created attachment 175395 [details] WIP