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

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

Issue 1907213002: Refactor OverlayScrollbarSizeRelevancy into OverlayScrollbarClipBehavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include -> Exclude Created 4 years, 8 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) 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 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 void LayoutBox::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState) 1515 void LayoutBox::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState)
1516 { 1516 {
1517 LayoutBoxModelObject::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidati onState); 1517 LayoutBoxModelObject::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidati onState);
1518 1518
1519 if (PaintLayer* layer = this->layer()) { 1519 if (PaintLayer* layer = this->layer()) {
1520 if (PaintLayerReflectionInfo* reflectionInfo = layer->reflectionInfo()) 1520 if (PaintLayerReflectionInfo* reflectionInfo = layer->reflectionInfo())
1521 reflectionInfo->reflection()->invalidateTreeIfNeeded(childPaintInval idationState); 1521 reflectionInfo->reflection()->invalidateTreeIfNeeded(childPaintInval idationState);
1522 } 1522 }
1523 } 1523 }
1524 1524
1525 LayoutRect LayoutBox::overflowClipRect(const LayoutPoint& location, OverlayScrol lbarSizeRelevancy relevancy) const 1525 LayoutRect LayoutBox::overflowClipRect(const LayoutPoint& location, OverlayScrol lbarClipBehavior overlayScrollbarClipBehavior) const
1526 { 1526 {
1527 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the propert y 1527 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the propert y
1528 // here. 1528 // here.
1529 LayoutRect clipRect = borderBoxRect(); 1529 LayoutRect clipRect = borderBoxRect();
1530 clipRect.setLocation(location + clipRect.location() + LayoutSize(borderLeft( ), borderTop())); 1530 clipRect.setLocation(location + clipRect.location() + LayoutSize(borderLeft( ), borderTop()));
1531 clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(), borderTop() + borderBottom())); 1531 clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(), borderTop() + borderBottom()));
1532 1532
1533 if (hasOverflowClip()) 1533 if (hasOverflowClip())
1534 excludeScrollbars(clipRect, relevancy); 1534 excludeScrollbars(clipRect, overlayScrollbarClipBehavior);
1535 return clipRect; 1535 return clipRect;
1536 } 1536 }
1537 1537
1538 void LayoutBox::excludeScrollbars(LayoutRect& rect, OverlayScrollbarSizeRelevanc y relevancy) const 1538 void LayoutBox::excludeScrollbars(LayoutRect& rect, OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const
1539 { 1539 {
1540 if (PaintLayerScrollableArea* scrollableArea = this->getScrollableArea()) { 1540 if (PaintLayerScrollableArea* scrollableArea = this->getScrollableArea()) {
1541 if (shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1541 if (shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
1542 rect.move(scrollableArea->verticalScrollbarWidth(relevancy), 0); 1542 rect.move(scrollableArea->verticalScrollbarWidth(overlayScrollbarCli pBehavior), 0);
1543 rect.contract(scrollableArea->verticalScrollbarWidth(relevancy), scrolla bleArea->horizontalScrollbarHeight(relevancy)); 1543 rect.contract(scrollableArea->verticalScrollbarWidth(overlayScrollbarCli pBehavior), scrollableArea->horizontalScrollbarHeight(overlayScrollbarClipBehavi or));
1544 } 1544 }
1545 } 1545 }
1546 1546
1547 LayoutRect LayoutBox::clipRect(const LayoutPoint& location) const 1547 LayoutRect LayoutBox::clipRect(const LayoutPoint& location) const
1548 { 1548 {
1549 LayoutRect borderBoxRect = this->borderBoxRect(); 1549 LayoutRect borderBoxRect = this->borderBoxRect();
1550 LayoutRect clipRect = LayoutRect(borderBoxRect.location() + location, border BoxRect.size()); 1550 LayoutRect clipRect = LayoutRect(borderBoxRect.location() + location, border BoxRect.size());
1551 1551
1552 if (!style()->clipLeft().isAuto()) { 1552 if (!style()->clipLeft().isAuto()) {
1553 LayoutUnit c = valueForLength(style()->clipLeft(), borderBoxRect.width() ); 1553 LayoutUnit c = valueForLength(style()->clipLeft(), borderBoxRect.width() );
(...skipping 3176 matching lines...) Expand 10 before | Expand all | Expand 10 after
4730 4730
4731 void LayoutBox::clearPercentHeightDescendants() 4731 void LayoutBox::clearPercentHeightDescendants()
4732 { 4732 {
4733 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4733 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4734 if (curr->isBox()) 4734 if (curr->isBox())
4735 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4735 toLayoutBox(curr)->removeFromPercentHeightContainer();
4736 } 4736 }
4737 } 4737 }
4738 4738
4739 } // namespace blink 4739 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698