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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2336013002: ScrollRectToVisible should bubble up through its layout container. (Closed)
Patch Set: Bubbling up through the layout container. Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/fast/scrolling/absolute-position-overflow-clip.html ('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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 LayoutRect rectToScroll = rect; 568 LayoutRect rectToScroll = rect;
569 if (rectToScroll.width() <= 0) 569 if (rectToScroll.width() <= 0)
570 rectToScroll.setWidth(LayoutUnit(1)); 570 rectToScroll.setWidth(LayoutUnit(1));
571 if (rectToScroll.height() <= 0) 571 if (rectToScroll.height() <= 0)
572 rectToScroll.setHeight(LayoutUnit(1)); 572 rectToScroll.setHeight(LayoutUnit(1));
573 573
574 LayoutBox* parentBox = nullptr; 574 LayoutBox* parentBox = nullptr;
575 LayoutRect newRect = rectToScroll; 575 LayoutRect newRect = rectToScroll;
576 576
577 bool restrictedByLineClamp = false; 577 bool restrictedByLineClamp = false;
578 if (parent()) { 578 if (container()) {
579 parentBox = parent()->enclosingBox(); 579 parentBox = container()->enclosingBox();
bokan 2016/09/15 20:54:41 I think we could use containingBlock rather than c
580 restrictedByLineClamp = !parent()->style()->lineClamp().isNone(); 580 restrictedByLineClamp = !container()->style()->lineClamp().isNone();
581 } 581 }
582 582
583 if (hasOverflowClip() && !restrictedByLineClamp) { 583 if (hasOverflowClip() && !restrictedByLineClamp) {
584 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property. 584 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property.
585 // This will prevent us from revealing text hidden by the slider in Safa ri RSS. 585 // This will prevent us from revealing text hidden by the slider in Safa ri RSS.
586 newRect = getScrollableArea()->scrollIntoView(rectToScroll, alignX, alig nY, scrollType); 586 newRect = getScrollableArea()->scrollIntoView(rectToScroll, alignX, alig nY, scrollType);
587 if (newRect.isEmpty()) 587 if (newRect.isEmpty())
588 return; 588 return;
589 } else if (!parentBox && canBeProgramaticallyScrolled()) { 589 } else if (!parentBox && canBeProgramaticallyScrolled()) {
590 if (FrameView* frameView = this->frameView()) { 590 if (FrameView* frameView = this->frameView()) {
(...skipping 4265 matching lines...) Expand 10 before | Expand all | Expand 10 after
4856 m_rareData->m_snapAreas->remove(&snapArea); 4856 m_rareData->m_snapAreas->remove(&snapArea);
4857 } 4857 }
4858 } 4858 }
4859 4859
4860 SnapAreaSet* LayoutBox::snapAreas() const 4860 SnapAreaSet* LayoutBox::snapAreas() const
4861 { 4861 {
4862 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4862 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4863 } 4863 }
4864 4864
4865 } // namespace blink 4865 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/scrolling/absolute-position-overflow-clip.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698