void WebFrame::insertAfter(WebFrame* newChild, WebFrame* previousSibling) { newChild->m_parent = this; WebFrame* next; if (!previousSibling) { // Insert at the beginning if no previous sibling is specified. next = m_firstChild; m_firstChild = newChild; } else { DCHECK_EQ(previousSibling->m_parent, this); next = previousSibling->m_nextSibling; previousSibling->m_nextSibling = newChild; newChild->m_previousSibling = previousSibling; } if (next) { newChild->m_nextSibling = next; next->m_previousSibling = newChild; } else { m_lastChild = newChild; } toImplBase()->frame()->tree().invalidateScopedChildCount(); toImplBase()->frame()->host()->incrementSubframeCount(); }
void WebFrame::setFrameOwnerSandboxFlags(WebSandboxFlags flags) { // At the moment, this is only used to replicate sandbox flags // for frames with a remote owner. FrameOwner* owner = toImplBase()->frame()->owner(); DCHECK(owner); toRemoteFrameOwner(owner)->setSandboxFlags(static_cast<SandboxFlags>(flags)); }
void WebFrame::removeChild(WebFrame* child) { child->m_parent = 0; if (m_firstChild == child) m_firstChild = child->m_nextSibling; else child->m_previousSibling->m_nextSibling = child->m_nextSibling; if (m_lastChild == child) m_lastChild = child->m_previousSibling; else child->m_nextSibling->m_previousSibling = child->m_previousSibling; child->m_previousSibling = child->m_nextSibling = 0; toImplBase()->frame()->tree().invalidateScopedChildCount(); toImplBase()->frame()->host()->decrementSubframeCount(); }
WebFrame* WebFrame::findChildByName(const WebString& name) const { Frame* frame = toImplBase()->frame(); if (!frame) return 0; // FIXME: It's not clear this should ever be called to find a remote frame. // Perhaps just disallow that completely? return fromFrame(frame->tree().child(name)); }
void WebFrame::setFrameOwnerProperties( const WebFrameOwnerProperties& properties) { // At the moment, this is only used to replicate frame owner properties // for frames with a remote owner. RemoteFrameOwner* owner = toRemoteFrameOwner(toImplBase()->frame()->owner()); DCHECK(owner); Frame* frame = toImplBase()->frame(); DCHECK(frame); if (frame->isLocalFrame()) { toLocalFrame(frame)->document()->willChangeFrameOwnerProperties( properties.marginWidth, properties.marginHeight, static_cast<ScrollbarMode>(properties.scrollingMode)); } owner->setScrollingMode(properties.scrollingMode); owner->setMarginWidth(properties.marginWidth); owner->setMarginHeight(properties.marginHeight); owner->setAllowFullscreen(properties.allowFullscreen); owner->setCsp(properties.requiredCsp); owner->setDelegatedpermissions(properties.delegatedPermissions); }
bool WebFrame::isLoading() const { if (Frame* frame = toImplBase()->frame()) return frame->isLoading(); return false; }
WebFrame* WebFrame::traverseNext() const { if (Frame* frame = toImplBase()->frame()) return fromFrame(frame->tree().traverseNext()); return nullptr; }
WebInsecureRequestPolicy WebFrame::getInsecureRequestPolicy() const { return toImplBase()->frame()->securityContext()->getInsecureRequestPolicy(); }
WebSecurityOrigin WebFrame::getSecurityOrigin() const { return WebSecurityOrigin( toImplBase()->frame()->securityContext()->getSecurityOrigin()); }
WebFrame* WebFrame::traverseNext(bool wrap) const { if (Frame* frame = toImplBase()->frame()) return fromFrame(frame->tree().traverseNextWithWrap(wrap)); return 0; }
bool WebFrame::shouldEnforceStrictMixedContentChecking() const { return toImplBase()->frame()->securityContext()->shouldEnforceStrictMixedContentChecking(); }