Chromium Code Reviews| 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()); |