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

Side by Side Diff: Source/core/dom/DocumentInit.cpp

Issue 19762002: [HTML Imports] Let script of imported document running. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made a test more robust. Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 19 matching lines...) Expand all
30 30
31 #include "RuntimeEnabledFeatures.h" 31 #include "RuntimeEnabledFeatures.h"
32 #include "core/dom/Document.h" 32 #include "core/dom/Document.h"
33 #include "core/html/HTMLImportsController.h" 33 #include "core/html/HTMLImportsController.h"
34 #include "core/page/Frame.h" 34 #include "core/page/Frame.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 bool DocumentInit::shouldSetURL() const 38 bool DocumentInit::shouldSetURL() const
39 { 39 {
40 return (m_frame && m_frame->ownerElement()) || !m_url.isEmpty(); 40 Frame* frame = frameForSecurityContext();
41 return (frame && frame->ownerElement()) || !m_url.isEmpty();
41 } 42 }
42 43
43 bool DocumentInit::shouldTreatURLAsSrcdocDocument() const 44 bool DocumentInit::shouldTreatURLAsSrcdocDocument() const
44 { 45 {
45 ASSERT(m_frame); 46 ASSERT(m_frame);
46 return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url); 47 return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url);
47 } 48 }
48 49
49 Frame* DocumentInit::frameForSecurityContext() const 50 Frame* DocumentInit::frameForSecurityContext() const
50 { 51 {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return 0; 95 return 0;
95 96
96 if (m_registrationContext) 97 if (m_registrationContext)
97 return m_registrationContext.get(); 98 return m_registrationContext.get();
98 99
99 return CustomElementRegistrationContext::create(); 100 return CustomElementRegistrationContext::create();
100 } 101 }
101 102
102 } // namespace WebCore 103 } // namespace WebCore
103 104
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/htmlimports/resources/sniff-js.cgi ('k') | Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698