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(); |
| 1762 marginHeight = toHTMLFrameElementBase(ownerElement)->marginHeight(); |
| 1763 } |
| 1764 |
| 1765 WebFrameOwnerProperties::ScrollingMode scrollingMode = WebFrameOwnerProperti
es::ScrollingModeAuto; |
| 1766 switch (ownerElement->scrollingMode()) { |
| 1767 case ScrollbarAuto: |
| 1768 scrollingMode = WebFrameOwnerProperties::ScrollingModeAuto; |
| 1769 break; |
| 1770 case ScrollbarAlwaysOff: |
| 1771 scrollingMode = WebFrameOwnerProperties::ScrollingModeAlwaysOff; |
| 1772 break; |
| 1773 case ScrollbarAlwaysOn: |
| 1774 scrollingMode = WebFrameOwnerProperties::ScrollingModeAlwaysOn; |
| 1775 break; |
| 1776 } |
| 1777 |
| 1778 WebFrameOwnerProperties ownerProperties(scrollingMode, marginWidth, marginHe
ight); |
| 1779 WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChild
Frame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags
()), ownerProperties)); |
1758 if (!webframeChild) | 1780 if (!webframeChild) |
1759 return nullptr; | 1781 return nullptr; |
1760 | 1782 |
1761 // FIXME: Using subResourceAttributeName as fallback is not a perfect | 1783 // FIXME: Using subResourceAttributeName as fallback is not a perfect |
1762 // solution. subResourceAttributeName returns just one attribute name. The | 1784 // solution. subResourceAttributeName returns just one attribute name. The |
1763 // element might not have the attribute, and there might be other attributes | 1785 // element might not have the attribute, and there might be other attributes |
1764 // which can identify the element. | 1786 // which can identify the element. |
1765 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr
ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR
esourceAttributeName())); | 1787 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 | 1788 // Initializing the core frame may cause the new child to be detached, since |
1767 // it may dispatch a load event in the parent. | 1789 // it may dispatch a load event in the parent. |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2196 } | 2218 } |
2197 | 2219 |
2198 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2220 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
2199 { | 2221 { |
2200 if (!frame()) | 2222 if (!frame()) |
2201 return WebSandboxFlags::None; | 2223 return WebSandboxFlags::None; |
2202 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2224 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2203 } | 2225 } |
2204 | 2226 |
2205 } // namespace blink | 2227 } // namespace blink |
OLD | NEW |