Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp

Issue 2837823004: Set active document url to <template> content URL. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp b/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp
index d91e600906652e4841cea896870ab8790a0f90fe..a710b41f5db6302fa9a406e5dae2e38bd8a4b7c9 100644
--- a/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp
@@ -46,10 +46,12 @@ DEFINE_NODE_FACTORY(HTMLTemplateElement)
HTMLTemplateElement::~HTMLTemplateElement() {}
DocumentFragment* HTMLTemplateElement::content() const {
- if (!content_)
+ if (!content_) {
content_ = TemplateContentDocumentFragment::Create(
GetDocument().EnsureTemplateDocument(),
const_cast<HTMLTemplateElement*>(this));
+ content_->GetDocument().SetURL(GetDocument().Url());
fs 2017/04/25 09:13:45 Shouldn't this rather be handled when creating the
foolip 2017/04/25 09:23:44 The relevant bit of spec: https://html.spec.whatwg
fs 2017/04/25 10:20:47 Right, https://dom.spec.whatwg.org/#interface-docu
foolip 2017/04/25 14:23:28 Do you mean "The Document() constructor, when invo
fs 2017/04/25 14:39:26 That may very well be the case. But shouldn't the
fs 2017/04/25 14:51:08 Found what I was looking for: 'Unless stated othe
+ }
return content_.Get();
}

Powered by Google App Engine
This is Rietveld 408576698