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

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 for tests + merge blink/cr changes. Created 5 years, 3 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 086a79881696112c584d0d849db0724672006d89..c30380f19da408e91a6c7acb846aeef26b3f8285 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"
@@ -1748,7 +1749,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(static_cast<WebFrameOwnerProperties::ScrollingMode>(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;
@@ -1988,18 +1990,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());
+ remoteOwner->setSandboxFlags(static_cast<SandboxFlags>(flags));
+ remoteOwner->setScrollingMode(static_cast<ScrollbarMode>(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