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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp

Issue 2657263002: Experiment with blocking script inside fragment-parser-inserted `<iframe srcdoc>`.
Patch Set: Bitwise logic is hard. Created 3 years, 10 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
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) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2009 Ericsson AB. All rights reserved. 7 * Copyright (C) 2009 Ericsson AB. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either 11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version. 12 * version 2 of the License, or (at your option) any later version.
13 * 13 *
14 * This library is distributed in the hope that it will be useful, 14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details. 17 * Library General Public License for more details.
18 * 18 *
19 * You should have received a copy of the GNU Library General Public License 19 * You should have received a copy of the GNU Library General Public License
20 * along with this library; see the file COPYING.LIB. If not, write to 20 * along with this library; see the file COPYING.LIB. If not, write to
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA. 22 * Boston, MA 02110-1301, USA.
23 */ 23 */
24 24
25 #include "core/html/HTMLIFrameElement.h" 25 #include "core/html/HTMLIFrameElement.h"
26 26
27 #include "core/CSSPropertyNames.h" 27 #include "core/CSSPropertyNames.h"
28 #include "core/HTMLNames.h" 28 #include "core/HTMLNames.h"
29 #include "core/dom/ScriptableDocumentParser.h"
29 #include "core/frame/UseCounter.h" 30 #include "core/frame/UseCounter.h"
30 #include "core/html/HTMLDocument.h" 31 #include "core/html/HTMLDocument.h"
32 #include "core/html/parser/HTMLDocumentParser.h"
31 #include "core/inspector/ConsoleMessage.h" 33 #include "core/inspector/ConsoleMessage.h"
32 #include "core/layout/LayoutIFrame.h" 34 #include "core/layout/LayoutIFrame.h"
33 #include "platform/RuntimeEnabledFeatures.h" 35 #include "platform/RuntimeEnabledFeatures.h"
34 36
35 namespace blink { 37 namespace blink {
36 38
37 using namespace HTMLNames; 39 using namespace HTMLNames;
38 40
39 inline HTMLIFrameElement::HTMLIFrameElement(Document& document) 41 // static.
42 HTMLIFrameElement* HTMLIFrameElement::create(Document& document,
43 bool createdByFragmentParser) {
44 return new HTMLIFrameElement(document, createdByFragmentParser);
45 }
46
47 inline HTMLIFrameElement::HTMLIFrameElement(Document& document,
48 bool createdByFragmentParser)
40 : HTMLFrameElementBase(iframeTag, document), 49 : HTMLFrameElementBase(iframeTag, document),
41 m_didLoadNonEmptyDocument(false), 50 m_didLoadNonEmptyDocument(false),
51 m_createdByFragmentParser(createdByFragmentParser),
42 m_sandbox(HTMLIFrameElementSandbox::create(this)), 52 m_sandbox(HTMLIFrameElementSandbox::create(this)),
43 m_referrerPolicy(ReferrerPolicyDefault) {} 53 m_referrerPolicy(ReferrerPolicyDefault) {}
44 54
45 DEFINE_NODE_FACTORY(HTMLIFrameElement)
46
47 DEFINE_TRACE(HTMLIFrameElement) { 55 DEFINE_TRACE(HTMLIFrameElement) {
48 visitor->trace(m_sandbox); 56 visitor->trace(m_sandbox);
49 visitor->trace(m_permissions); 57 visitor->trace(m_permissions);
50 HTMLFrameElementBase::trace(visitor); 58 HTMLFrameElementBase::trace(visitor);
51 Supplementable<HTMLIFrameElement>::trace(visitor); 59 Supplementable<HTMLIFrameElement>::trace(visitor);
52 } 60 }
53 61
54 HTMLIFrameElement::~HTMLIFrameElement() {} 62 HTMLIFrameElement::~HTMLIFrameElement() {}
55 63
56 DOMTokenList* HTMLIFrameElement::sandbox() const { 64 DOMTokenList* HTMLIFrameElement::sandbox() const {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool HTMLIFrameElement::initializePermissionsAttribute() { 226 bool HTMLIFrameElement::initializePermissionsAttribute() {
219 if (!RuntimeEnabledFeatures::permissionDelegationEnabled()) 227 if (!RuntimeEnabledFeatures::permissionDelegationEnabled())
220 return false; 228 return false;
221 229
222 if (!m_permissions) 230 if (!m_permissions)
223 m_permissions = HTMLIFrameElementPermissions::create(this); 231 m_permissions = HTMLIFrameElementPermissions::create(this);
224 return true; 232 return true;
225 } 233 }
226 234
227 } // namespace blink 235 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElement.h ('k') | third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698