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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1755773002: Pass the physical scroll delta through the scroll customization path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removeOneDimensionalScrolls
Patch Set: Updated LayoutTest Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if (document().frame()->applyScrollDelta(ScrollByPrecisePixel, delta, sc rollState.isBeginning()).didScroll()) { 562 if (document().frame()->applyScrollDelta(ScrollByPrecisePixel, delta, sc rollState.isBeginning()).didScroll()) {
563 scrolled = true; 563 scrolled = true;
564 scrollState.consumeDeltaNative(scrollState.deltaX(), scrollState.del taY()); 564 scrollState.consumeDeltaNative(scrollState.deltaX(), scrollState.del taY());
565 } 565 }
566 } else { 566 } else {
567 if (!layoutObject()) 567 if (!layoutObject())
568 return; 568 return;
569 LayoutBoxItem curBox = LayoutBoxItem(toLayoutBox(layoutObject())).enclos ingBox(); 569 LayoutBoxItem curBox = LayoutBoxItem(toLayoutBox(layoutObject())).enclos ingBox();
570 // FIXME: Native scrollers should only consume the scroll they 570 // FIXME: Native scrollers should only consume the scroll they
571 // apply. See crbug.com/457765. 571 // apply. See crbug.com/457765.
572 // TODO(bokan): The deltas here are the screen-space touchpoint deltas 572 if (deltaX && curBox.scroll(ScrollByPrecisePixel, FloatSize(deltaX, 0)). didScrollX) {
573 // which are inverted relative to scrolling deltas.
574 if (deltaX && curBox.scroll(ScrollByPrecisePixel, FloatSize(-deltaX, 0)) .didScrollX) {
575 scrollState.consumeDeltaNative(scrollState.deltaX(), 0); 573 scrollState.consumeDeltaNative(scrollState.deltaX(), 0);
576 scrolled = true; 574 scrolled = true;
577 } 575 }
578 576
579 if (deltaY && curBox.scroll(ScrollByPrecisePixel, FloatSize(0, -deltaY)) .didScrollY) { 577 if (deltaY && curBox.scroll(ScrollByPrecisePixel, FloatSize(0, deltaY)). didScrollY) {
580 scrollState.consumeDeltaNative(0, scrollState.deltaY()); 578 scrollState.consumeDeltaNative(0, scrollState.deltaY());
581 scrolled = true; 579 scrolled = true;
582 } 580 }
583 } 581 }
584 582
585 if (!scrolled) 583 if (!scrolled)
586 return; 584 return;
587 585
588 // We need to setCurrentNativeScrollingElement in both the 586 // We need to setCurrentNativeScrollingElement in both the
589 // distributeScroll and applyScroll default implementations so 587 // distributeScroll and applyScroll default implementations so
(...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 { 3640 {
3643 #if ENABLE(OILPAN) 3641 #if ENABLE(OILPAN)
3644 if (hasRareData()) 3642 if (hasRareData())
3645 visitor->trace(elementRareData()); 3643 visitor->trace(elementRareData());
3646 visitor->trace(m_elementData); 3644 visitor->trace(m_elementData);
3647 #endif 3645 #endif
3648 ContainerNode::trace(visitor); 3646 ContainerNode::trace(visitor);
3649 } 3647 }
3650 3648
3651 } // namespace blink 3649 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698