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

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

Issue 2780593002: Apply control clips in LayoutBox::clippingRect() (Closed)
Patch Set: none Created 3 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. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 IntSize result = 1143 IntSize result =
1144 scrollableArea->scrollOffsetInt() + originAdjustmentForScrollbars(); 1144 scrollableArea->scrollOffsetInt() + originAdjustmentForScrollbars();
1145 if (isHorizontalWritingMode() && 1145 if (isHorizontalWritingMode() &&
1146 shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1146 shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
1147 result.expand(-verticalScrollbarWidth(), 0); 1147 result.expand(-verticalScrollbarWidth(), 0);
1148 return result; 1148 return result;
1149 } 1149 }
1150 1150
1151 LayoutRect LayoutBox::clippingRect() const { 1151 LayoutRect LayoutBox::clippingRect() const {
1152 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect()); 1152 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect());
1153 if (hasOverflowClip() || style()->containsPaint()) 1153 if (shouldClipOverflow())
1154 result = overflowClipRect(LayoutPoint()); 1154 result = overflowClipRect(LayoutPoint());
1155 1155
1156 if (hasClip()) 1156 if (hasClip())
1157 result.intersect(clipRect(LayoutPoint())); 1157 result.intersect(clipRect(LayoutPoint()));
1158 1158
1159 return result; 1159 return result;
1160 } 1160 }
1161 1161
1162 bool LayoutBox::mapScrollingContentsRectToBoxSpace( 1162 bool LayoutBox::mapScrollingContentsRectToBoxSpace(
1163 TransformState& transformState, 1163 TransformState& transformState,
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2343 break; 2343 break;
2344 } 2344 }
2345 transformState.move(-offsetFromContainer); 2345 transformState.move(-offsetFromContainer);
2346 } 2346 }
2347 2347
2348 bool LayoutBox::mapToVisualRectInAncestorSpaceInternal( 2348 bool LayoutBox::mapToVisualRectInAncestorSpaceInternal(
2349 const LayoutBoxModelObject* ancestor, 2349 const LayoutBoxModelObject* ancestor,
2350 TransformState& transformState, 2350 TransformState& transformState,
2351 VisualRectFlags visualRectFlags) const { 2351 VisualRectFlags visualRectFlags) const {
2352 inflateVisualRectForFilter(transformState); 2352 inflateVisualRectForFilter(transformState);
2353
pdr. 2017/03/28 03:30:20 Nit: remove this
2354 if (ancestor == this) 2353 if (ancestor == this)
2355 return true; 2354 return true;
2356 2355
2357 AncestorSkipInfo skipInfo(ancestor, true); 2356 AncestorSkipInfo skipInfo(ancestor, true);
2358 LayoutObject* container = this->container(&skipInfo); 2357 LayoutObject* container = this->container(&skipInfo);
2359 LayoutBox* tableRowContainer = nullptr; 2358 LayoutBox* tableRowContainer = nullptr;
2360 // Skip table row because cells and rows are in the same coordinate space (see 2359 // Skip table row because cells and rows are in the same coordinate space (see
2361 // below, however for more comments about when |ancestor| is the table row). 2360 // below, however for more comments about when |ancestor| is the table row).
2362 if (isTableCell()) { 2361 if (isTableCell()) {
2363 DCHECK(container->isTableRow() && parentBox() == container); 2362 DCHECK(container->isTableRow() && parentBox() == container);
(...skipping 3389 matching lines...) Expand 10 before | Expand all | Expand 10 after
5753 5752
5754 void LayoutBox::MutableForPainting:: 5753 void LayoutBox::MutableForPainting::
5755 savePreviousContentBoxSizeAndLayoutOverflowRect() { 5754 savePreviousContentBoxSizeAndLayoutOverflowRect() {
5756 auto& rareData = layoutBox().ensureRareData(); 5755 auto& rareData = layoutBox().ensureRareData();
5757 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; 5756 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true;
5758 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); 5757 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size();
5759 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); 5758 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect();
5760 } 5759 }
5761 5760
5762 } // namespace blink 5761 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698