MHTML: shadow dom is not rendered into MHTML DOM dump |
|||
Issue descriptionWhile creating an MHTML snapshot of the page (WebContents::GenerateMHTML) we need to go into the shadow links in order to capture the state of the custom elements. Repro: 1. Go to elements.polymer-project.org. If it asks to redirect to webcomponents.org, don't agree - that page has service worker which makes it a different case. 2. select some collection of elements, then go to Demo of one of them, paper-cards for example. 3. Download the Demo page, open as offline page - observe the elements to be incorrectly laid out. Use DevTools to observe that shadow subtrees are not present. This currently breaks Polymer-based pages. Also, we need to remove <link rel=import> from the snapshot. Essentially, we treat those as iframes wrt MHTML generation, by replacing with the actual DOM that renders current state of the element. Likely part of MHTML sanitization.
,
Apr 12 2017
,
May 31 2017
Here is the design doc: https://docs.google.com/document/d/1GrP-c7dOYv6JFyy6eOxF_xY39pRJvT4sRuc-xAhaDRM
,
Jun 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/05d415724da48cbeba542558a3ce5689ec0fee93 commit 05d415724da48cbeba542558a3ce5689ec0fee93 Author: jianli <jianli@chromium.org> Date: Thu Jun 15 00:11:17 2017 Support serializing shadow DOM to MHTML The content of shadow DOM tree will be serialized and put within a template element that appends to the children of the shadow host element. The template element contains a special attribute to denote the mode of the shadow dom tree. When MHTML page is being loaded, the shadow DOM tree will be recreated by the injected script to convert the templates to the shadow DOM trees. Please see the bug for the link to the design doc. BUG= 695738 TEST=new tests added Review-Url: https://codereview.chromium.org/2912213002 Cr-Commit-Position: refs/heads/master@{#479550} [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.h [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/core/frame/FrameSerializer.cpp [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/core/frame/FrameSerializer.h [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/WebFrameSerializer.cpp [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/tests/MHTMLTest.cpp [modify] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/tests/WebFrameSerializerSanitizationTest.cpp [add] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/tests/data/frameserialization/shadow_dom.html [add] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/tests/data/mhtml/.gitattributes [add] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/tests/data/mhtml/page_with_javascript.mht [add] https://crrev.com/05d415724da48cbeba542558a3ce5689ec0fee93/third_party/WebKit/Source/web/tests/data/mhtml/shadow.mht
,
Jun 16 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by jianli@chromium.org
, Mar 1 2017