OLD | NEW |
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 4056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4067 } | 4067 } |
4068 | 4068 |
4069 void RenderBox::addLayoutOverflow(const LayoutRect& rect) | 4069 void RenderBox::addLayoutOverflow(const LayoutRect& rect) |
4070 { | 4070 { |
4071 LayoutRect clientBox = noOverflowRect(); | 4071 LayoutRect clientBox = noOverflowRect(); |
4072 if (clientBox.contains(rect) || rect.isEmpty()) | 4072 if (clientBox.contains(rect) || rect.isEmpty()) |
4073 return; | 4073 return; |
4074 | 4074 |
4075 // For overflow clip objects, we don't want to propagate overflow into unrea
chable areas. | 4075 // For overflow clip objects, we don't want to propagate overflow into unrea
chable areas. |
4076 LayoutRect overflowRect(rect); | 4076 LayoutRect overflowRect(rect); |
4077 if (hasOverflowClip() || isRenderView()) { | |
4078 // Overflow is in the block's coordinate space and thus is flipped for h
orizontal-bt and vertical-rl | |
4079 // writing modes. At this stage that is actually a simplification, sinc
e we can treat horizontal-tb/bt as the same | |
4080 // and vertical-lr/rl as the same. | |
4081 bool hasTopOverflow = !style()->isLeftToRightDirection() && !isHorizonta
lWritingMode(); | |
4082 bool hasLeftOverflow = !style()->isLeftToRightDirection() && isHorizonta
lWritingMode(); | |
4083 if (isFlexibleBox() && style()->isReverseFlexDirection()) { | |
4084 RenderFlexibleBox* flexibleBox = toRenderFlexibleBox(this); | |
4085 if (flexibleBox->isHorizontalFlow()) | |
4086 hasLeftOverflow = true; | |
4087 else | |
4088 hasTopOverflow = true; | |
4089 } | |
4090 | |
4091 if (!hasTopOverflow) | |
4092 overflowRect.shiftYEdgeTo(std::max(overflowRect.y(), clientBox.y()))
; | |
4093 else | |
4094 overflowRect.shiftMaxYEdgeTo(std::min(overflowRect.maxY(), clientBox
.maxY())); | |
4095 if (!hasLeftOverflow) | |
4096 overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x()))
; | |
4097 else | |
4098 overflowRect.shiftMaxXEdgeTo(std::min(overflowRect.maxX(), clientBox
.maxX())); | |
4099 | |
4100 // Now re-test with the adjusted rectangle and see if it has become unre
achable or fully | |
4101 // contained. | |
4102 if (clientBox.contains(overflowRect) || overflowRect.isEmpty()) | |
4103 return; | |
4104 } | |
4105 | 4077 |
4106 if (!m_overflow) | 4078 if (!m_overflow) |
4107 m_overflow = adoptPtr(new RenderOverflow(clientBox, borderBoxRect())); | 4079 m_overflow = adoptPtr(new RenderOverflow(clientBox, borderBoxRect())); |
4108 | 4080 |
4109 m_overflow->addLayoutOverflow(overflowRect); | 4081 m_overflow->addLayoutOverflow(overflowRect); |
4110 } | 4082 } |
4111 | 4083 |
4112 void RenderBox::addVisualOverflow(const LayoutRect& rect) | 4084 void RenderBox::addVisualOverflow(const LayoutRect& rect) |
4113 { | 4085 { |
4114 LayoutRect borderBox = borderBoxRect(); | 4086 LayoutRect borderBox = borderBoxRect(); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4521 computedValues.m_margins.m_end = marginEnd(); | 4493 computedValues.m_margins.m_end = marginEnd(); |
4522 | 4494 |
4523 setLogicalTop(oldLogicalTop); | 4495 setLogicalTop(oldLogicalTop); |
4524 setLogicalWidth(oldLogicalWidth); | 4496 setLogicalWidth(oldLogicalWidth); |
4525 setLogicalLeft(oldLogicalLeft); | 4497 setLogicalLeft(oldLogicalLeft); |
4526 setMarginLeft(oldMarginLeft); | 4498 setMarginLeft(oldMarginLeft); |
4527 setMarginRight(oldMarginRight); | 4499 setMarginRight(oldMarginRight); |
4528 } | 4500 } |
4529 | 4501 |
4530 } // namespace blink | 4502 } // namespace blink |
OLD | NEW |