OLD | NEW |
---|---|
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 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 } else if (name == onbeforeunloadAttr) { | 157 } else if (name == onbeforeunloadAttr) { |
158 // FIXME: should <frame> elements have beforeunload handlers? | 158 // FIXME: should <frame> elements have beforeunload handlers? |
159 SetAttributeEventListener( | 159 SetAttributeEventListener( |
160 EventTypeNames::beforeunload, | 160 EventTypeNames::beforeunload, |
161 CreateAttributeEventListener(this, name, value, EventParameterName())); | 161 CreateAttributeEventListener(this, name, value, EventParameterName())); |
162 } else { | 162 } else { |
163 HTMLFrameOwnerElement::ParseAttribute(params); | 163 HTMLFrameOwnerElement::ParseAttribute(params); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 const RefPtr<SecurityOrigin> HTMLFrameElementBase::GetOriginForFeaturePolicy() | |
168 const { | |
169 KURL url = GetDocument().CompleteURL(url_); | |
dcheng
2017/04/18 16:26:37
Nit: move this down to line 173
iclelland
2017/04/18 19:19:44
Done.
| |
170 // Sandboxed frames have a unique origin. | |
171 if (GetSandboxFlags() & kSandboxOrigin) | |
172 return SecurityOrigin::CreateUnique(); | |
173 | |
174 // If the frame will inherit its origin from the owner, then use the owner's | |
175 // origin when constructing the container policy. | |
176 if (Document::ShouldInheritSecurityOriginFromOwner(url)) | |
177 return GetDocument().GetSecurityOrigin(); | |
178 | |
179 // Other frames should use the origin defined by the absolute URL (this will | |
180 // be a unique origin for data: URLs) | |
181 return SecurityOrigin::Create(url); | |
182 } | |
183 | |
167 void HTMLFrameElementBase::SetNameAndOpenURL() { | 184 void HTMLFrameElementBase::SetNameAndOpenURL() { |
168 frame_name_ = GetNameAttribute(); | 185 frame_name_ = GetNameAttribute(); |
169 OpenURL(); | 186 OpenURL(); |
170 } | 187 } |
171 | 188 |
172 Node::InsertionNotificationRequest HTMLFrameElementBase::InsertedInto( | 189 Node::InsertionNotificationRequest HTMLFrameElementBase::InsertedInto( |
173 ContainerNode* insertion_point) { | 190 ContainerNode* insertion_point) { |
174 HTMLFrameOwnerElement::InsertedInto(insertion_point); | 191 HTMLFrameOwnerElement::InsertedInto(insertion_point); |
175 return kInsertionShouldCallDidNotifySubtreeInsertions; | 192 return kInsertionShouldCallDidNotifySubtreeInsertions; |
176 } | 193 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 | 289 |
273 if (contentDocument()) { | 290 if (contentDocument()) { |
274 contentDocument()->WillChangeFrameOwnerProperties( | 291 contentDocument()->WillChangeFrameOwnerProperties( |
275 margin_width_, margin_height, scrolling_mode_, IsDisplayNone()); | 292 margin_width_, margin_height, scrolling_mode_, IsDisplayNone()); |
276 } | 293 } |
277 margin_height_ = margin_height; | 294 margin_height_ = margin_height; |
278 FrameOwnerPropertiesChanged(); | 295 FrameOwnerPropertiesChanged(); |
279 } | 296 } |
280 | 297 |
281 } // namespace blink | 298 } // namespace blink |
OLD | NEW |