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

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

Issue 2370783002: Adding CSP attribute on HTMLIFrameElement (Closed)
Patch Set: Addressing Comments: changing TreatAsNull, adding frameOwnerPropertyChanged Created 4 years, 2 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
(...skipping 12 matching lines...) Expand all
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/frame/UseCounter.h" 29 #include "core/frame/UseCounter.h"
30 #include "core/html/HTMLDocument.h" 30 #include "core/html/HTMLDocument.h"
31 #include "core/inspector/ConsoleMessage.h" 31 #include "core/inspector/ConsoleMessage.h"
32 #include "core/layout/LayoutIFrame.h" 32 #include "core/layout/LayoutIFrame.h"
33 #include "platform/RuntimeEnabledFeatures.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 using namespace HTMLNames; 37 using namespace HTMLNames;
37 38
38 inline HTMLIFrameElement::HTMLIFrameElement(Document& document) 39 inline HTMLIFrameElement::HTMLIFrameElement(Document& document)
39 : HTMLFrameElementBase(iframeTag, document) 40 : HTMLFrameElementBase(iframeTag, document)
40 , m_didLoadNonEmptyDocument(false) 41 , m_didLoadNonEmptyDocument(false)
41 , m_sandbox(HTMLIFrameElementSandbox::create(this)) 42 , m_sandbox(HTMLIFrameElementSandbox::create(this))
42 , m_referrerPolicy(ReferrerPolicyDefault) 43 , m_referrerPolicy(ReferrerPolicyDefault)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (!value.isNull()) 113 if (!value.isNull())
113 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(value, &m _referrerPolicy); 114 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(value, &m _referrerPolicy);
114 } else if (name == allowfullscreenAttr) { 115 } else if (name == allowfullscreenAttr) {
115 bool oldAllowFullscreen = m_allowFullscreen; 116 bool oldAllowFullscreen = m_allowFullscreen;
116 m_allowFullscreen = !value.isNull(); 117 m_allowFullscreen = !value.isNull();
117 if (m_allowFullscreen != oldAllowFullscreen) 118 if (m_allowFullscreen != oldAllowFullscreen)
118 frameOwnerPropertiesChanged(); 119 frameOwnerPropertiesChanged();
119 } else if (name == permissionsAttr) { 120 } else if (name == permissionsAttr) {
120 if (initializePermissionsAttribute()) 121 if (initializePermissionsAttribute())
121 m_permissions->setValue(value); 122 m_permissions->setValue(value);
123 } else if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() && name = = cspAttr) {
124 AtomicString oldCSP = m_csp;
125 m_csp = value;
126 if (m_csp != oldCSP)
127 frameOwnerPropertiesChanged();
122 } else { 128 } else {
123 if (name == srcAttr) 129 if (name == srcAttr)
124 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", srcAttr, ol dValue, value); 130 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", srcAttr, ol dValue, value);
125 HTMLFrameElementBase::parseAttribute(name, oldValue, value); 131 HTMLFrameElementBase::parseAttribute(name, oldValue, value);
126 } 132 }
127 } 133 }
128 134
129 bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style) 135 bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style)
130 { 136 {
131 return isURLAllowed() && HTMLElement::layoutObjectIsNeeded(style); 137 return isURLAllowed() && HTMLElement::layoutObjectIsNeeded(style);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 { 194 {
189 if (!RuntimeEnabledFeatures::permissionDelegationEnabled()) 195 if (!RuntimeEnabledFeatures::permissionDelegationEnabled())
190 return false; 196 return false;
191 197
192 if (!m_permissions) 198 if (!m_permissions)
193 m_permissions = HTMLIFrameElementPermissions::create(this); 199 m_permissions = HTMLIFrameElementPermissions::create(this);
194 return true; 200 return true;
195 } 201 }
196 202
197 } // namespace blink 203 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698