Commit 657576bc authored by Takayoshi Kochi's avatar Takayoshi Kochi Committed by Commit Bot

Add comment about why ImageDocument uses UA shadow DOM.

Bug: 802185
Change-Id: Ibbffe82ac4dfdeb200e608deb908dbbc691459f1
Reviewed-on: https://chromium-review.googlesource.com/888459Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532311}
parent 762a427c
......@@ -242,6 +242,10 @@ void ImageDocument::CreateDocumentStructure() {
HTMLSlotElement* slot = HTMLSlotElement::CreateUserAgentDefaultSlot(*this);
div_element_->AppendChild(slot);
// Adding a UA shadow root here is because the container <div> should be
// hidden so that only the <img> element should be visible in <body>,
// according to the spec:
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#read-media
ShadowRoot& shadow_root = body->EnsureUserAgentShadowRoot();
shadow_root.AppendChild(div_element_);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment