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

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

Issue 2370783002: Adding CSP attribute on HTMLIFrameElement (Closed)
Patch Set: Adding formatting to the test file 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 m_csp = value;
Mike West 2016/09/26 14:55:02 I think you need to notify the client that this va
122 } else { 125 } else {
123 if (name == srcAttr) 126 if (name == srcAttr)
124 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", srcAttr, ol dValue, value); 127 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", srcAttr, ol dValue, value);
125 HTMLFrameElementBase::parseAttribute(name, oldValue, value); 128 HTMLFrameElementBase::parseAttribute(name, oldValue, value);
126 } 129 }
127 } 130 }
128 131
129 bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style) 132 bool HTMLIFrameElement::layoutObjectIsNeeded(const ComputedStyle& style)
130 { 133 {
131 return isURLAllowed() && HTMLElement::layoutObjectIsNeeded(style); 134 return isURLAllowed() && HTMLElement::layoutObjectIsNeeded(style);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 { 191 {
189 if (!RuntimeEnabledFeatures::permissionDelegationEnabled()) 192 if (!RuntimeEnabledFeatures::permissionDelegationEnabled())
190 return false; 193 return false;
191 194
192 if (!m_permissions) 195 if (!m_permissions)
193 m_permissions = HTMLIFrameElementPermissions::create(this); 196 m_permissions = HTMLIFrameElementPermissions::create(this);
194 return true; 197 return true;
195 } 198 }
196 199
197 } // namespace blink 200 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698