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

Unified Diff: third_party/WebKit/Source/core/dom/CompositorProxy.cpp

Issue 2292133002: [compositor-worker] root scrolling layer is associated with document scrolling element
Patch Set: Use document instead of documentElement() Created 3 years, 10 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/core/dom/CompositorProxy.cpp
diff --git a/third_party/WebKit/Source/core/dom/CompositorProxy.cpp b/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
index e715638b804f420fddba14fb52c421ec4cc444a1..e0a2b215676afa2c9f745012fd47d53923af40e7 100644
--- a/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
+++ b/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
@@ -115,26 +115,41 @@ CompositorProxy* CompositorProxy::create(ExecutionContext* context,
return nullptr;
}
- return new CompositorProxy(*element, attributeArray);
+ Document* document = toDocument(context);
+ Node* scrollingNode = element;
+ // The scrolling layer for the root scrolling element is attached to the
+ // document. So use document as scrolling node when creating a proxy to ensure
+ // we mutate the correct scroll layer.
+ // TODO(majidvp): Consider checking against
+ // |RootScrollerController::effectiveRootScroller| instead of
+ // |Document::scrollingElement|.
+ if (element->isSameNode(document->scrollingElement()))
+ scrollingNode = document;
flackr 2017/03/01 16:31:26 It seems like the proper fix would be for cc to se
+ return new CompositorProxy(*element, *scrollingNode, attributeArray);
}
CompositorProxy* CompositorProxy::create(ExecutionContext* context,
uint64_t elementId,
+ uint64_t scrollingNodeId,
uint32_t compositorMutableProperties) {
if (context->isCompositorWorkerGlobalScope()) {
WorkerClients* clients = toWorkerGlobalScope(context)->clients();
DCHECK(clients);
CompositorWorkerProxyClient* client =
CompositorWorkerProxyClient::from(clients);
- return new CompositorProxy(elementId, compositorMutableProperties, client);
+ return new CompositorProxy(elementId, scrollingNodeId,
+ compositorMutableProperties, client);
}
- return new CompositorProxy(elementId, compositorMutableProperties);
+ return new CompositorProxy(elementId, scrollingNodeId,
+ compositorMutableProperties);
}
CompositorProxy::CompositorProxy(uint64_t elementId,
+ uint64_t scrollingNodeId,
uint32_t compositorMutableProperties)
: m_elementId(elementId),
+ m_scrollingNodeId(scrollingNodeId),
m_compositorMutableProperties(compositorMutableProperties),
m_client(nullptr) {
DCHECK(m_compositorMutableProperties);
@@ -154,16 +169,19 @@ CompositorProxy::CompositorProxy(uint64_t elementId,
}
CompositorProxy::CompositorProxy(Element& element,
+ Node& scrollingNode,
const Vector<String>& attributeArray)
: CompositorProxy(DOMNodeIds::idForNode(&element),
+ DOMNodeIds::idForNode(&scrollingNode),
compositorMutablePropertiesFromNames(attributeArray)) {
DCHECK(isMainThread());
}
CompositorProxy::CompositorProxy(uint64_t elementId,
+ uint64_t scrollingNodeId,
uint32_t compositorMutableProperties,
CompositorProxyClient* client)
- : CompositorProxy(elementId, compositorMutableProperties) {
+ : CompositorProxy(elementId, scrollingNodeId, compositorMutableProperties) {
m_client = client;
DCHECK(m_client);
DCHECK(isControlThread());

Powered by Google App Engine
This is Rietveld 408576698