Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1111)

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1307013004: Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from Daniel Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 56619e311285df3bc84cb4858f117d5a55c5e954..b03b0a1f66c12e576b4d0799a149fc2538d0bb92 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -201,6 +201,7 @@
#include "public/web/WebFindOptions.h"
#include "public/web/WebFormElement.h"
#include "public/web/WebFrameClient.h"
+#include "public/web/WebFrameOwnerProperties.h"
#include "public/web/WebHistoryItem.h"
#include "public/web/WebIconURL.h"
#include "public/web/WebInputElement.h"
@@ -1755,7 +1756,8 @@ PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
WebTreeScopeType scope = frame()->document() == ownerElement->treeScope()
? WebTreeScopeType::Document
: WebTreeScopeType::Shadow;
- WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChildFrame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags())));
+ WebFrameOwnerProperties ownerProperties(ownerElement->scrollingMode(), ownerElement->marginWidth(), ownerElement->marginHeight());
+ WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChildFrame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags()), ownerProperties));
if (!webframeChild)
return nullptr;
@@ -1995,18 +1997,24 @@ static void ensureFrameLoaderHasCommitted(FrameLoader& frameLoader)
frameLoader.stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedMultipleRealLoads);
}
-void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFrame, const WebString& name, WebSandboxFlags flags)
+void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFrame, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties& frameOwnerProperties)
{
Frame* oldFrame = toCoreFrame(oldWebFrame);
// Note: this *always* temporarily sets a frame owner, even for main frames!
// When a core Frame is created with no owner, it attempts to set itself as
// the main frame of the Page. However, this is a provisional frame, and may
// disappear, so Page::m_mainFrame can't be updated just yet.
- OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nullptr, SandboxNone);
+ OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nullptr, SandboxNone, WebFrameOwnerProperties());
RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClientImpl.get(), oldFrame->host(), tempOwner.get());
frame->setOwner(oldFrame->owner());
- if (frame->owner() && !frame->owner()->isLocal())
- toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxFlags>(flags));
+ if (frame->owner() && !frame->owner()->isLocal()) {
+ RemoteBridgeFrameOwner* remoteOwner = toRemoteBridgeFrameOwner(frame->owner());
dcheng 2015/10/14 07:20:43 Maybe this should just call WebFrame::setReplicate
dcheng 2015/10/14 07:57:08 Also, can we add a comment as to why this is neces
lazyboy 2015/10/14 20:05:29 Yes. in A-embed B-embed C scenario, if we navigate
lazyboy 2015/10/14 20:05:29 WebFrame::setFrameOwnerProperties needs core Frame
dcheng 2015/10/15 06:06:53 We prepare a local frame when we have a provisiona
lazyboy 2015/10/15 16:56:38 OK. If I understand correctly, if these properties
alexmos 2015/10/16 17:17:01 I think this should be ok. This needs to happens
+ remoteOwner->setSandboxFlags(static_cast<SandboxFlags>(flags));
+ remoteOwner->setScrollingMode(frameOwnerProperties.scrollingMode);
+ remoteOwner->setMarginWidth(frameOwnerProperties.marginWidth);
+ remoteOwner->setMarginHeight(frameOwnerProperties.marginHeight);
+ }
+
frame->tree().setName(name);
setParent(oldWebFrame->parent());
setOpener(oldWebFrame->opener());

Powered by Google App Engine
This is Rietveld 408576698