| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 #include "core/dom/shadow/ShadowRoot.h" | 111 #include "core/dom/shadow/ShadowRoot.h" |
| 112 #include "core/editing/EditingUtilities.h" | 112 #include "core/editing/EditingUtilities.h" |
| 113 #include "core/editing/Editor.h" | 113 #include "core/editing/Editor.h" |
| 114 #include "core/editing/FrameSelection.h" | 114 #include "core/editing/FrameSelection.h" |
| 115 #include "core/editing/InputMethodController.h" | 115 #include "core/editing/InputMethodController.h" |
| 116 #include "core/editing/PlainTextRange.h" | 116 #include "core/editing/PlainTextRange.h" |
| 117 #include "core/editing/TextAffinity.h" | 117 #include "core/editing/TextAffinity.h" |
| 118 #include "core/editing/iterators/TextIterator.h" | 118 #include "core/editing/iterators/TextIterator.h" |
| 119 #include "core/editing/serializers/Serialization.h" | 119 #include "core/editing/serializers/Serialization.h" |
| 120 #include "core/editing/spellcheck/SpellChecker.h" | 120 #include "core/editing/spellcheck/SpellChecker.h" |
| 121 #include "core/frame/FrameHost.h" | |
| 122 #include "core/frame/FrameView.h" | 121 #include "core/frame/FrameView.h" |
| 123 #include "core/frame/LocalDOMWindow.h" | 122 #include "core/frame/LocalDOMWindow.h" |
| 124 #include "core/frame/PageScaleConstraintsSet.h" | 123 #include "core/frame/PageScaleConstraintsSet.h" |
| 125 #include "core/frame/RemoteFrame.h" | 124 #include "core/frame/RemoteFrame.h" |
| 126 #include "core/frame/Settings.h" | 125 #include "core/frame/Settings.h" |
| 127 #include "core/frame/SmartClip.h" | 126 #include "core/frame/SmartClip.h" |
| 128 #include "core/frame/UseCounter.h" | 127 #include "core/frame/UseCounter.h" |
| 129 #include "core/frame/VisualViewport.h" | 128 #include "core/frame/VisualViewport.h" |
| 130 #include "core/html/HTMLAnchorElement.h" | 129 #include "core/html/HTMLAnchorElement.h" |
| 131 #include "core/html/HTMLCollection.h" | 130 #include "core/html/HTMLCollection.h" |
| (...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 visitor->trace(m_printContext); | 1591 visitor->trace(m_printContext); |
| 1593 visitor->trace(m_contextMenuNode); | 1592 visitor->trace(m_contextMenuNode); |
| 1594 WebFrame::traceFrames(visitor, this); | 1593 WebFrame::traceFrames(visitor, this); |
| 1595 WebFrameImplBase::trace(visitor); | 1594 WebFrameImplBase::trace(visitor); |
| 1596 } | 1595 } |
| 1597 | 1596 |
| 1598 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { | 1597 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { |
| 1599 m_frame = frame; | 1598 m_frame = frame; |
| 1600 } | 1599 } |
| 1601 | 1600 |
| 1602 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, | 1601 void WebLocalFrameImpl::initializeCoreFrame(Page& page, |
| 1603 FrameOwner* owner, | 1602 FrameOwner* owner, |
| 1604 const AtomicString& name) { | 1603 const AtomicString& name) { |
| 1605 setCoreFrame(LocalFrame::create(m_localFrameClientImpl.get(), | 1604 setCoreFrame(LocalFrame::create(m_localFrameClientImpl.get(), &page, owner, |
| 1606 host ? &host->page() : nullptr, owner, | |
| 1607 m_interfaceProvider, m_interfaceRegistry)); | 1605 m_interfaceProvider, m_interfaceRegistry)); |
| 1608 frame()->tree().setName(name); | 1606 frame()->tree().setName(name); |
| 1609 // We must call init() after m_frame is assigned because it is referenced | 1607 // We must call init() after m_frame is assigned because it is referenced |
| 1610 // during init(). Note that this may dispatch JS events; the frame may be | 1608 // during init(). Note that this may dispatch JS events; the frame may be |
| 1611 // detached after init() returns. | 1609 // detached after init() returns. |
| 1612 frame()->init(); | 1610 frame()->init(); |
| 1613 if (frame()) { | 1611 if (frame()) { |
| 1614 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && | 1612 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && |
| 1615 !parent() && !opener() && | 1613 !parent() && !opener() && |
| 1616 frame()->settings()->getShouldReuseGlobalForUnownedMainFrame()) { | 1614 frame()->settings()->getShouldReuseGlobalForUnownedMainFrame()) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1655 // which can identify the element. | 1653 // which can identify the element. |
| 1656 WebLocalFrameImpl* webframeChild = | 1654 WebLocalFrameImpl* webframeChild = |
| 1657 toWebLocalFrameImpl(m_client->createChildFrame( | 1655 toWebLocalFrameImpl(m_client->createChildFrame( |
| 1658 this, scope, name, | 1656 this, scope, name, |
| 1659 ownerElement->getAttribute(ownerElement->subResourceAttributeName()), | 1657 ownerElement->getAttribute(ownerElement->subResourceAttributeName()), |
| 1660 static_cast<WebSandboxFlags>(ownerElement->getSandboxFlags()), | 1658 static_cast<WebSandboxFlags>(ownerElement->getSandboxFlags()), |
| 1661 ownerProperties)); | 1659 ownerProperties)); |
| 1662 if (!webframeChild) | 1660 if (!webframeChild) |
| 1663 return nullptr; | 1661 return nullptr; |
| 1664 | 1662 |
| 1665 webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name); | 1663 webframeChild->initializeCoreFrame(*frame()->page(), ownerElement, name); |
| 1666 // Initializing the core frame may cause the new child to be detached, since | 1664 // Initializing the core frame may cause the new child to be detached, since |
| 1667 // it may dispatch a load event in the parent. | 1665 // it may dispatch a load event in the parent. |
| 1668 if (!webframeChild->parent()) | 1666 if (!webframeChild->parent()) |
| 1669 return nullptr; | 1667 return nullptr; |
| 1670 | 1668 |
| 1671 // If we're moving in the back/forward list, we might want to replace the | 1669 // If we're moving in the back/forward list, we might want to replace the |
| 1672 // content of this child frame with whatever was there at that point. | 1670 // content of this child frame with whatever was there at that point. |
| 1673 HistoryItem* childItem = nullptr; | 1671 HistoryItem* childItem = nullptr; |
| 1674 if (isBackForwardLoadType(frame()->loader().documentLoader()->loadType()) && | 1672 if (isBackForwardLoadType(frame()->loader().documentLoader()->loadType()) && |
| 1675 !frame()->document()->loadEventFinished()) | 1673 !frame()->document()->loadEventFinished()) |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2505 createMarkup(startPosition, endPosition, AnnotateForInterchange, | 2503 createMarkup(startPosition, endPosition, AnnotateForInterchange, |
| 2506 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 2504 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
| 2507 } else { | 2505 } else { |
| 2508 clipHtml = | 2506 clipHtml = |
| 2509 createMarkup(endPosition, startPosition, AnnotateForInterchange, | 2507 createMarkup(endPosition, startPosition, AnnotateForInterchange, |
| 2510 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 2508 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
| 2511 } | 2509 } |
| 2512 } | 2510 } |
| 2513 | 2511 |
| 2514 } // namespace blink | 2512 } // namespace blink |
| OLD | NEW |