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

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

Issue 1846953008: Clip visual rect with real overflow clip rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 rect.move(offset); 969 rect.move(offset);
970 } 970 }
971 971
972 bool LayoutBox::applyOverflowClip(LayoutRect& rect, VisualRectFlags visualRectFl ags) const 972 bool LayoutBox::applyOverflowClip(LayoutRect& rect, VisualRectFlags visualRectFl ags) const
973 { 973 {
974 ASSERT(hasLayer()); 974 ASSERT(hasLayer());
975 ASSERT(hasOverflowClip()); 975 ASSERT(hasOverflowClip());
976 976
977 flipForWritingMode(rect); 977 flipForWritingMode(rect);
978 978
979 // size() is inaccurate if we're in the middle of a layout of this LayoutBox , so use the 979 LayoutRect clipRect = overflowClipRect(LayoutPoint());
980 // layer's size instead. Even if the layer's size is wrong, the layer itself will issue paint invalidations 980
981 // anyway if its size does change.
982 LayoutRect clipRect(LayoutPoint(), LayoutSize(layer()->size()));
983 bool doesIntersect; 981 bool doesIntersect;
984 if (visualRectFlags & EdgeInclusive) { 982 if (visualRectFlags & EdgeInclusive) {
985 doesIntersect = rect.inclusiveIntersect(clipRect); 983 doesIntersect = rect.inclusiveIntersect(clipRect);
986 } else { 984 } else {
987 rect.intersect(clipRect); 985 rect.intersect(clipRect);
988 doesIntersect = !rect.isEmpty(); 986 doesIntersect = !rect.isEmpty();
989 } 987 }
990 if (doesIntersect) 988 if (doesIntersect)
991 flipForWritingMode(rect); 989 flipForWritingMode(rect);
992 return doesIntersect; 990 return doesIntersect;
(...skipping 3708 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 4699
4702 void LayoutBox::clearPercentHeightDescendants() 4700 void LayoutBox::clearPercentHeightDescendants()
4703 { 4701 {
4704 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4702 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4705 if (curr->isBox()) 4703 if (curr->isBox())
4706 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4704 toLayoutBox(curr)->removeFromPercentHeightContainer();
4707 } 4705 }
4708 } 4706 }
4709 4707
4710 } // namespace blink 4708 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698