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

Issue 2837823004: Set active document url to <template> content URL. (Closed)

Created:
3 years, 8 months ago by Shanmuga Pandi
Modified:
3 years, 3 months ago
Reviewers:
tkent, fs, foolip
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Set active document url to <template> content URL. Template element's content is documentFragment which naturally doesn't have an URL of its Own. So set active Document Url to it. BUG=713012

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -1 line) Patch
A third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-template.html View 1 chunk +14 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp View 1 chunk +3 lines, -1 line 6 comments Download

Messages

Total messages: 16 (7 generated)
Shanmuga Pandi
PTAL !! Thanks
3 years, 8 months ago (2017-04-25 08:32:56 UTC) #6
fs
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right): https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp#newcode53 third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp:53: content_->GetDocument().SetURL(GetDocument().Url()); Shouldn't this rather be handled when creating the ...
3 years, 8 months ago (2017-04-25 09:13:45 UTC) #7
foolip
tkent@ would probably be a better reviewer of this, but left my thoughts. https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-template.html File ...
3 years, 8 months ago (2017-04-25 09:23:44 UTC) #9
fs
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right): https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp#newcode53 third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp:53: content_->GetDocument().SetURL(GetDocument().Url()); On 2017/04/25 at 09:23:44, foolip_UTC7 wrote: > On ...
3 years, 8 months ago (2017-04-25 10:20:47 UTC) #10
foolip
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right): https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp#newcode53 third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp:53: content_->GetDocument().SetURL(GetDocument().Url()); On 2017/04/25 10:20:47, fs wrote: > On 2017/04/25 ...
3 years, 8 months ago (2017-04-25 14:23:29 UTC) #11
fs
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right): https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp#newcode53 third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp:53: content_->GetDocument().SetURL(GetDocument().Url()); On 2017/04/25 at 14:23:28, foolip_UTC7 wrote: > On ...
3 years, 8 months ago (2017-04-25 14:39:26 UTC) #12
fs
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right): https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp#newcode53 third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp:53: content_->GetDocument().SetURL(GetDocument().Url()); On 2017/04/25 at 14:39:26, fs wrote: > On ...
3 years, 8 months ago (2017-04-25 14:51:08 UTC) #13
Shanmuga Pandi
On 2017/04/25 14:51:08, fs wrote: > https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp > File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right): > > https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp#newcode53 > ...
3 years, 8 months ago (2017-04-26 05:57:51 UTC) #14
foolip
3 years, 8 months ago (2017-04-26 07:34:32 UTC) #15
On 2017/04/26 05:57:51, Shanmuga Pandi wrote:
> On 2017/04/25 14:51:08, fs wrote:
> >
>
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/c...
> > File third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp (right):
> > 
> >
>
https://codereview.chromium.org/2837823004/diff/1/third_party/WebKit/Source/c...
> > third_party/WebKit/Source/core/html/HTMLTemplateElement.cpp:53:
> > content_->GetDocument().SetURL(GetDocument().Url());
> > On 2017/04/25 at 14:39:26, fs wrote:
> > > On 2017/04/25 at 14:23:28, foolip_UTC7 wrote:
> > > > On 2017/04/25 10:20:47, fs wrote:
> > > > > On 2017/04/25 at 09:23:44, foolip_UTC7 wrote:
> > > > > > On 2017/04/25 09:13:45, fs wrote:
> > > > > > > Shouldn't this rather be handled when creating the template
> document?
> > > > > > 
> > > > > > The relevant bit of spec:
> > > > > >
> https://html.spec.whatwg.org/multipage/scripting.html#template-contents
> > > > > >
> > > > >
> >
>
https://html.spec.whatwg.org/multipage/scripting.html#appropriate-template-co...
> > > > > > 
> > > > > > AFAICT, there's nothing that sets that document's URL.
> > > > > 
> > > > > Right, https://dom.spec.whatwg.org/#interface-document only calls for
> > 'setting'
> > > > > the origin. (Maybe that should be asserted by the test as well then.)
> > > > 
> > > > Do you mean "The Document() constructor, when invoked, must return a new
> > document whose origin is the origin of current global object’s associated
> > Document"? It's a bit odd, but I'm pretty sure that is for the
script-exposed
> > constructor only, and that when HTML says "Let /new doc/ be a new Document",
> > it's using a magical internal constructor.
> > > 
> > > That may very well be the case. But shouldn't the magic internal
constructor
> > be well-defined? (Based on the discrepancies observed here, one might argue
> that
> > it isn't.)
> > 
> > Found what I was looking for:
> > 
> > 'Unless stated otherwise, a document’s encoding is the utf-8 encoding,
content
> > type is "application/xml", URL is "about:blank", origin is an opaque origin,
> > type is "xml", and its mode is "no-quirks".'
> > 
> > So, our current behavior seems right.
> 
> Thank you fs@ and @fooip.
> Shall we mark the bug as "WontFix" ?

Yes, but there is something interesting here. If you could write just a test
under
LayoutTests/external/wpt/html/semantics/scripting-1/the-template-element/template-element/
that already passes for us but fails in Firefox, that'd be great. Something like
https://jsbin.com/babalob/edit?html,output

Filing a Gecko bug pointing to that test would also increase the chances of a
fix.

Powered by Google App Engine
This is Rietveld 408576698