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

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

Issue 1557993002: Add scroll units in GestureEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 const double deltaX = scrollState.deltaX(); 563 const double deltaX = scrollState.deltaX();
564 const double deltaY = scrollState.deltaY(); 564 const double deltaY = scrollState.deltaY();
565 bool scrolled = false; 565 bool scrolled = false;
566 566
567 if (deltaY || deltaX) 567 if (deltaY || deltaX)
568 document().updateLayoutIgnorePendingStylesheets(); 568 document().updateLayoutIgnorePendingStylesheets();
569 569
570 // Handle the scrollingElement separately, as it scrolls the viewport. 570 // Handle the scrollingElement separately, as it scrolls the viewport.
571 if (this == document().scrollingElement()) { 571 if (this == document().scrollingElement()) {
572 FloatSize delta(deltaX, deltaY); 572 FloatSize delta(deltaX, deltaY);
573 if (document().frame()->applyScrollDelta(delta, scrollState.isBeginning( )).didScroll()) { 573 if (document().frame()->applyScrollDelta(ScrollByPrecisePixel, delta, sc rollState.isBeginning()).didScroll()) {
574 scrolled = true; 574 scrolled = true;
575 scrollState.consumeDeltaNative(scrollState.deltaX(), scrollState.del taY()); 575 scrollState.consumeDeltaNative(scrollState.deltaX(), scrollState.del taY());
576 } 576 }
577 } else { 577 } else {
578 if (!layoutObject()) 578 if (!layoutObject())
579 return; 579 return;
580 LayoutBox* curBox = layoutObject()->enclosingBox(); 580 LayoutBox* curBox = layoutObject()->enclosingBox();
581 // FIXME: Native scrollers should only consume the scroll they 581 // FIXME: Native scrollers should only consume the scroll they
582 // apply. See crbug.com/457765. 582 // apply. See crbug.com/457765.
583 if (deltaX && curBox->scroll(ScrollLeft, ScrollByPrecisePixel, deltaX).d idScroll) { 583 if (deltaX && curBox->scroll(ScrollLeft, ScrollByPrecisePixel, deltaX).d idScroll) {
(...skipping 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after
3620 { 3620 {
3621 #if ENABLE(OILPAN) 3621 #if ENABLE(OILPAN)
3622 if (hasRareData()) 3622 if (hasRareData())
3623 visitor->trace(elementRareData()); 3623 visitor->trace(elementRareData());
3624 visitor->trace(m_elementData); 3624 visitor->trace(m_elementData);
3625 #endif 3625 #endif
3626 ContainerNode::trace(visitor); 3626 ContainerNode::trace(visitor);
3627 } 3627 }
3628 3628
3629 } // namespace blink 3629 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698