New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 764611 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

Shadow DOM serialization strategy is inconsistent with overall serialization philosophy

Project Member Reported by dcheng@chromium.org, Sep 13 2017

Issue description

Design doc for the shadow DOM serialization: https://docs.google.com/document/d/1GrP-c7dOYv6JFyy6eOxF_xY39pRJvT4sRuc-xAhaDRM

https://codereview.chromium.org/2912213002/ implemented support for serializing shadow DOM. However, the option we implemented is not consistent with how we generally implement serialization support. We currently require runtime fixups, which means the serialized page won't work correctly when loaded in other browsers, such as Safari.

For everything else we serialize, we do extra work at serialization time to guarantee that the markup can interoperate reasonably well:
- when serializing just <td></td> elements, we do extra work to make sure we include <table> and <tr> as well.
- when serializing elements that inherit styles via classes, we inline the styles.

Implementing the analogous approach for shadow DOM would mean implementing option 2 (Convert Shadow DOM CSS Pseudo-class Selectors), which would be more complex. However, I think this is the right long-term approach.
 

Comment 1 by jianli@chromium.org, Sep 14 2017

We've tried option 2 and found out that it was almost impossible to get everything right, esp for Polymer. Upon talking with several Shadow DOM and  WebKit experts, we decided to go with option 3 and did a thorough security review on this approach.

Note that Safari does not natively support MHTML. IE (not Edge) supports MHTML but Shadow DOM is not supported in IE. Since latest version of Opera is based on Blink, it should not have any issue.

Comment 2 by hayato@chromium.org, Sep 25 2017

Components: -Blink>DOM>ShadowDOM
Declarative Shadow DOM is under the discussion : https://github.com/whatwg/dom/issues/510

I talked with hayato and it seems like there is currently no good solution for this. It's unfortunate, because it means we're stuck with a bit of code (that affects all loading paths) just to make shadow DOM work in MHTML.

... this makes me tempted to try to figure out how to execute JS in MHTML...
If you are interested, we'd appreciate if you could input the MHTML use case at https://github.com/whatwg/dom/issues/510.

That might be helpful for people to understand the need of Declarative Shadow DOM.
Added to https://github.com/whatwg/dom/issues/510. Thanks for driving this.

Comment 6 by foolip@chromium.org, Nov 21 2017

Cc: -foolip@chromium.org

Comment 7 by yosin@chromium.org, Dec 6 2017

Labels: Pri-3
Lower to Pri-3 since we don't have time to work this.

Sign in to add a comment