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 4177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4188 return; | 4188 return; |
4189 | 4189 |
4190 if (!hasVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { | 4190 if (!hasVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { |
4191 clearAllOverflows(); | 4191 clearAllOverflows(); |
4192 return; | 4192 return; |
4193 } | 4193 } |
4194 | 4194 |
4195 m_overflow->setLayoutOverflow(noOverflowRect()); | 4195 m_overflow->setLayoutOverflow(noOverflowRect()); |
4196 } | 4196 } |
4197 | 4197 |
4198 bool LayoutBox::logicalWidthIsResolvableFromBlock(const RenderBlock* containingB
lock) | 4198 bool LayoutBox::logicalWidthIsResolvableFromBlock(const LayoutBox* box) |
4199 { | 4199 { |
4200 const RenderBlock* cb = containingBlock; | 4200 while (!box->isRenderView() && !box->isOutOfFlowPositioned() |
4201 while (!cb->isRenderView() && !cb->isOutOfFlowPositioned() && (cb->style()->
logicalWidth().isAuto() || cb->isAnonymousBlock())) | 4201 && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock()) |
4202 cb = cb->containingBlock(); | 4202 && !box->hasOverrideContainingBlockLogicalWidth()) |
| 4203 box = box->containingBlock(); |
4203 | 4204 |
4204 if (cb->style()->logicalWidth().isFixed()) | 4205 if (box->style()->logicalWidth().isFixed()) |
4205 return true; | 4206 return true; |
4206 if (cb->isRenderView()) | 4207 if (box->isRenderView()) |
4207 return true; | 4208 return true; |
4208 if (cb->isOutOfFlowPositioned()) | 4209 // The size of the containing block of an absolutely positioned element is a
lways definite with respect to that |
| 4210 // element (http://dev.w3.org/csswg/css-sizing-3/#definite). |
| 4211 if (box->isOutOfFlowPositioned()) |
4209 return true; | 4212 return true; |
4210 if (cb->style()->logicalWidth().isPercent()) | 4213 if (box->hasOverrideContainingBlockLogicalWidth()) |
4211 return logicalWidthIsResolvableFromBlock(cb->containingBlock()); | 4214 return box->overrideContainingBlockContentLogicalWidth() != -1; |
| 4215 if (box->style()->logicalWidth().isPercent()) |
| 4216 return logicalWidthIsResolvableFromBlock(box->containingBlock()); |
4212 | 4217 |
4213 return false; | 4218 return false; |
4214 } | 4219 } |
4215 | 4220 |
4216 bool LayoutBox::hasDefiniteLogicalWidth() const | 4221 bool LayoutBox::hasDefiniteLogicalWidth() const |
4217 { | 4222 { |
4218 const Length& logicalWidth = style()->logicalWidth(); | 4223 return LayoutBox::logicalWidthIsResolvableFromBlock(this); |
4219 if (logicalWidth.isIntrinsic() || logicalWidth.isLegacyIntrinsic()) | |
4220 return false; | |
4221 if (logicalWidth.isFixed()) | |
4222 return true; | |
4223 // The size of the containing block of an absolutely positioned element is a
lways definite with respect to that | |
4224 // element (http://dev.w3.org/csswg/css-sizing-3/#definite). | |
4225 if (isOutOfFlowPositioned()) | |
4226 return true; | |
4227 | |
4228 return LayoutBox::logicalWidthIsResolvableFromBlock(containingBlock()); | |
4229 } | 4224 } |
4230 | 4225 |
4231 inline static bool percentageLogicalHeightIsResolvable(const LayoutBox* box) | 4226 inline static bool percentageLogicalHeightIsResolvable(const LayoutBox* box) |
4232 { | 4227 { |
4233 return LayoutBox::percentageLogicalHeightIsResolvableFromBlock(box->containi
ngBlock(), box->isOutOfFlowPositioned()); | 4228 return LayoutBox::percentageLogicalHeightIsResolvableFromBlock(box->containi
ngBlock(), box->isOutOfFlowPositioned()); |
4234 } | 4229 } |
4235 | 4230 |
4236 bool LayoutBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock*
containingBlock, bool isOutOfFlowPositioned) | 4231 bool LayoutBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock*
containingBlock, bool isOutOfFlowPositioned) |
4237 { | 4232 { |
4238 // In quirks mode, blocks with auto height are skipped, and we keep looking
for an enclosing | 4233 // In quirks mode, blocks with auto height are skipped, and we keep looking
for an enclosing |
4239 // block that may have a specified height and then use it. In strict mode, t
his violates the | 4234 // block that may have a specified height and then use it. In strict mode, t
his violates the |
4240 // specification, which states that percentage heights just revert to auto i
f the containing | 4235 // specification, which states that percentage heights just revert to auto i
f the containing |
4241 // block has an auto height. We still skip anonymous containing blocks in bo
th modes, though, and look | 4236 // block has an auto height. We still skip anonymous containing blocks in bo
th modes, though, and look |
4242 // only at explicit containers. | 4237 // only at explicit containers. |
4243 const RenderBlock* cb = containingBlock; | 4238 const RenderBlock* cb = containingBlock; |
4244 bool inQuirksMode = cb->document().inQuirksMode(); | 4239 bool inQuirksMode = cb->document().inQuirksMode(); |
4245 while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->is
OutOfFlowPositioned() && cb->style()->logicalHeight().isAuto()) { | 4240 while (!cb->isRenderView() && !cb->isBody() && !cb->isTableCell() && !cb->is
OutOfFlowPositioned() && cb->style()->logicalHeight().isAuto()) { |
4246 if (!inQuirksMode && !cb->isAnonymousBlock()) | 4241 if (!inQuirksMode && !cb->isAnonymousBlock()) |
4247 break; | 4242 break; |
| 4243 if (cb->hasOverrideContainingBlockLogicalHeight()) |
| 4244 return cb->overrideContainingBlockContentLogicalHeight() != -1; |
| 4245 |
4248 cb = cb->containingBlock(); | 4246 cb = cb->containingBlock(); |
4249 } | 4247 } |
4250 | 4248 |
4251 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height | 4249 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height |
4252 // explicitly specified that can be used for any percentage computations. | 4250 // explicitly specified that can be used for any percentage computations. |
4253 // FIXME: We can't just check top/bottom here. | 4251 // FIXME: We can't just check top/bottom here. |
4254 // https://bugs.webkit.org/show_bug.cgi?id=46500 | 4252 // https://bugs.webkit.org/show_bug.cgi?id=46500 |
4255 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cb->style()->logicalHeight().isAuto() || (!cb->style()->top().isAuto() && !
cb->style()->bottom().isAuto())); | 4253 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cb->style()->logicalHeight().isAuto() || (!cb->style()->top().isAuto() && !
cb->style()->bottom().isAuto())); |
4256 | 4254 |
4257 // Table cells violate what the CSS spec says to do with heights. Basically
we | 4255 // Table cells violate what the CSS spec says to do with heights. Basically
we |
(...skipping 23 matching lines...) Expand all Loading... |
4281 { | 4279 { |
4282 const Length& logicalHeight = style()->logicalHeight(); | 4280 const Length& logicalHeight = style()->logicalHeight(); |
4283 if (logicalHeight.isIntrinsicOrAuto()) | 4281 if (logicalHeight.isIntrinsicOrAuto()) |
4284 return false; | 4282 return false; |
4285 if (logicalHeight.isFixed()) | 4283 if (logicalHeight.isFixed()) |
4286 return true; | 4284 return true; |
4287 // The size of the containing block of an absolutely positioned element is a
lways definite with respect to that | 4285 // The size of the containing block of an absolutely positioned element is a
lways definite with respect to that |
4288 // element (http://dev.w3.org/csswg/css-sizing-3/#definite). | 4286 // element (http://dev.w3.org/csswg/css-sizing-3/#definite). |
4289 if (isOutOfFlowPositioned()) | 4287 if (isOutOfFlowPositioned()) |
4290 return true; | 4288 return true; |
| 4289 if (hasOverrideContainingBlockLogicalHeight()) |
| 4290 return overrideContainingBlockContentLogicalHeight() != -1; |
4291 | 4291 |
4292 return percentageLogicalHeightIsResolvable(this); | 4292 return percentageLogicalHeightIsResolvable(this); |
4293 } | 4293 } |
4294 | 4294 |
4295 bool LayoutBox::hasUnsplittableScrollingOverflow() const | 4295 bool LayoutBox::hasUnsplittableScrollingOverflow() const |
4296 { | 4296 { |
4297 // We will paginate as long as we don't scroll overflow in the pagination di
rection. | 4297 // We will paginate as long as we don't scroll overflow in the pagination di
rection. |
4298 bool isHorizontal = isHorizontalWritingMode(); | 4298 bool isHorizontal = isHorizontalWritingMode(); |
4299 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf
lowX())) | 4299 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf
lowX())) |
4300 return false; | 4300 return false; |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4627 } | 4627 } |
4628 | 4628 |
4629 void LayoutBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c
onst | 4629 void LayoutBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c
onst |
4630 { | 4630 { |
4631 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); | 4631 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); |
4632 if (LayerScrollableArea* area = scrollableArea()) | 4632 if (LayerScrollableArea* area = scrollableArea()) |
4633 displayItemList->invalidate(area->displayItemClient()); | 4633 displayItemList->invalidate(area->displayItemClient()); |
4634 } | 4634 } |
4635 | 4635 |
4636 } // namespace blink | 4636 } // namespace blink |
OLD | NEW |