OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 #include "public/platform/WebSuspendableTask.h" | 193 #include "public/platform/WebSuspendableTask.h" |
194 #include "public/platform/WebURLError.h" | 194 #include "public/platform/WebURLError.h" |
195 #include "public/platform/WebVector.h" | 195 #include "public/platform/WebVector.h" |
196 #include "public/web/WebAutofillClient.h" | 196 #include "public/web/WebAutofillClient.h" |
197 #include "public/web/WebConsoleMessage.h" | 197 #include "public/web/WebConsoleMessage.h" |
198 #include "public/web/WebDOMEvent.h" | 198 #include "public/web/WebDOMEvent.h" |
199 #include "public/web/WebDocument.h" | 199 #include "public/web/WebDocument.h" |
200 #include "public/web/WebFindOptions.h" | 200 #include "public/web/WebFindOptions.h" |
201 #include "public/web/WebFormElement.h" | 201 #include "public/web/WebFormElement.h" |
202 #include "public/web/WebFrameClient.h" | 202 #include "public/web/WebFrameClient.h" |
203 #include "public/web/WebFrameOwnerProperties.h" | |
203 #include "public/web/WebHistoryItem.h" | 204 #include "public/web/WebHistoryItem.h" |
204 #include "public/web/WebIconURL.h" | 205 #include "public/web/WebIconURL.h" |
205 #include "public/web/WebInputElement.h" | 206 #include "public/web/WebInputElement.h" |
206 #include "public/web/WebKit.h" | 207 #include "public/web/WebKit.h" |
207 #include "public/web/WebNode.h" | 208 #include "public/web/WebNode.h" |
208 #include "public/web/WebPerformance.h" | 209 #include "public/web/WebPerformance.h" |
209 #include "public/web/WebPlugin.h" | 210 #include "public/web/WebPlugin.h" |
210 #include "public/web/WebPrintParams.h" | 211 #include "public/web/WebPrintParams.h" |
211 #include "public/web/WebPrintPresetOptions.h" | 212 #include "public/web/WebPrintPresetOptions.h" |
212 #include "public/web/WebRange.h" | 213 #include "public/web/WebRange.h" |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1747 return frame; | 1748 return frame; |
1748 } | 1749 } |
1749 | 1750 |
1750 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra meLoadRequest& request, | 1751 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra meLoadRequest& request, |
1751 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) | 1752 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) |
1752 { | 1753 { |
1753 ASSERT(m_client); | 1754 ASSERT(m_client); |
1754 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope() | 1755 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope() |
1755 ? WebTreeScopeType::Document | 1756 ? WebTreeScopeType::Document |
1756 : WebTreeScopeType::Shadow; | 1757 : WebTreeScopeType::Shadow; |
1757 WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChild Frame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags ()))); | 1758 int marginWidth = -1; |
1759 int marginHeight = -1; | |
1760 if (isHTMLFrameElementBase(ownerElement)) { | |
1761 marginWidth = toHTMLFrameElementBase(ownerElement)->marginWidth(); | |
alexmos
2015/09/02 21:37:06
Is the cast necessary here? marginWidth() and mar
lazyboy
2015/09/15 01:40:33
Removed cast.
Also see my earlier question about w
alexmos
2015/09/16 00:36:47
I think you're right, we shouldn't get here for pl
alexmos
2015/09/21 16:58:07
Latest PS still has isHTMLFrameElementBase check -
lazyboy
2015/09/21 18:04:51
Removed.
| |
1762 marginHeight = toHTMLFrameElementBase(ownerElement)->marginHeight(); | |
1763 } | |
1764 | |
1765 WebFrameOwnerProperties ownerProperties(static_cast<WebFrameOwnerProperties: :ScrollingMode>(ownerElement->scrollingMode()), marginWidth, marginHeight); | |
1766 WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChild Frame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags ()), ownerProperties)); | |
1758 if (!webframeChild) | 1767 if (!webframeChild) |
1759 return nullptr; | 1768 return nullptr; |
1760 | 1769 |
1761 // FIXME: Using subResourceAttributeName as fallback is not a perfect | 1770 // FIXME: Using subResourceAttributeName as fallback is not a perfect |
1762 // solution. subResourceAttributeName returns just one attribute name. The | 1771 // solution. subResourceAttributeName returns just one attribute name. The |
1763 // element might not have the attribute, and there might be other attributes | 1772 // element might not have the attribute, and there might be other attributes |
1764 // which can identify the element. | 1773 // which can identify the element. |
1765 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR esourceAttributeName())); | 1774 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR esourceAttributeName())); |
1766 // Initializing the core frame may cause the new child to be detached, since | 1775 // Initializing the core frame may cause the new child to be detached, since |
1767 // it may dispatch a load event in the parent. | 1776 // it may dispatch a load event in the parent. |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2196 } | 2205 } |
2197 | 2206 |
2198 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2207 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
2199 { | 2208 { |
2200 if (!frame()) | 2209 if (!frame()) |
2201 return WebSandboxFlags::None; | 2210 return WebSandboxFlags::None; |
2202 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); | 2211 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); |
2203 } | 2212 } |
2204 | 2213 |
2205 } // namespace blink | 2214 } // namespace blink |
OLD | NEW |