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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 853103003: Fix drag-and-drop autoscrolling with --enable-pinch-virtual-viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change only RenderBox Created 5 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 // absolute coordinates in the parent. 519 // absolute coordinates in the parent.
520 newRect.setX(rect.x() - frameView->scrollX() + frameView ->x()); 520 newRect.setX(rect.x() - frameView->scrollX() + frameView ->x());
521 newRect.setY(rect.y() - frameView->scrollY() + frameView ->y()); 521 newRect.setY(rect.y() - frameView->scrollY() + frameView ->y());
522 } else { 522 } else {
523 parentBox = 0; 523 parentBox = 0;
524 } 524 }
525 } 525 }
526 } else { 526 } else {
527 if (frame()->settings()->pinchVirtualViewportEnabled()) { 527 if (frame()->settings()->pinchVirtualViewportEnabled()) {
528 PinchViewport& pinchViewport = frame()->page()->frameHost(). pinchViewport(); 528 PinchViewport& pinchViewport = frame()->page()->frameHost(). pinchViewport();
529 LayoutRect r = ScrollAlignment::getRectToExpose(LayoutRect(p inchViewport.visibleRectInDocument()), rect, alignX, alignY); 529
530 // We want to move the rect into the viewport that excludes the scrollbars so we intersect
531 // the pinch viewport with the scrollbar-excluded frameView content rect.
532 LayoutRect viewRect = intersection(
533 LayoutRect(pinchViewport.visibleRectInDocument()), frame View->visibleContentRect());
534 LayoutRect r = ScrollAlignment::getRectToExpose(viewRect, re ct, alignX, alignY);
535
536 // pinchViewport.scrollIntoView will attempt to center the g iven rect within the viewport
537 // so to prevent it from adjusting r's coordinates the rect must match the viewport's size
538 // i.e. add the subtracted scrollbars from above back in.
539 // FIXME: This is hacky and required because getRectToExpose doesn't naturally account
540 // for the two viewports. crbug.com/449340.
541 r.setSize(LayoutSize(pinchViewport.visibleRectInDocument().s ize()));
542
530 pinchViewport.scrollIntoView(r); 543 pinchViewport.scrollIntoView(r);
531 } else { 544 } else {
532 LayoutRect viewRect = frameView->visibleContentRect(); 545 LayoutRect viewRect = frameView->visibleContentRect();
533 LayoutRect r = ScrollAlignment::getRectToExpose(viewRect, re ct, alignX, alignY); 546 LayoutRect r = ScrollAlignment::getRectToExpose(viewRect, re ct, alignX, alignY);
534 frameView->setScrollPosition(DoublePoint(r.location())); 547 frameView->setScrollPosition(DoublePoint(r.location()));
535 } 548 }
536 } 549 }
537 } 550 }
538 } 551 }
539 552
(...skipping 4017 matching lines...) Expand 10 before | Expand all | Expand 10 after
4557 computedValues.m_margins.m_end = marginEnd(); 4570 computedValues.m_margins.m_end = marginEnd();
4558 4571
4559 setLogicalTop(oldLogicalTop); 4572 setLogicalTop(oldLogicalTop);
4560 setLogicalWidth(oldLogicalWidth); 4573 setLogicalWidth(oldLogicalWidth);
4561 setLogicalLeft(oldLogicalLeft); 4574 setLogicalLeft(oldLogicalLeft);
4562 setMarginLeft(oldMarginLeft); 4575 setMarginLeft(oldMarginLeft);
4563 setMarginRight(oldMarginRight); 4576 setMarginRight(oldMarginRight);
4564 } 4577 }
4565 4578
4566 } // namespace blink 4579 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698