| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 * (C) 1997 Torben Weis (weis@kde.org) | 3 * (C) 1997 Torben Weis (weis@kde.org) |
| 4 * (C) 1998 Waldo Bastian (bastian@kde.org) | 4 * (C) 1998 Waldo Bastian (bastian@kde.org) |
| 5 * (C) 1999 Lars Knoll (knoll@kde.org) | 5 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. |
| 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 LayoutUnit availableLogicalWidth = containingBlockLogicalWidthForContent(); | 225 LayoutUnit availableLogicalWidth = containingBlockLogicalWidthForContent(); |
| 226 bool hasPerpendicularContainingBlock = cb->style()->isHorizontalWritingMode(
) != style()->isHorizontalWritingMode(); | 226 bool hasPerpendicularContainingBlock = cb->style()->isHorizontalWritingMode(
) != style()->isHorizontalWritingMode(); |
| 227 LayoutUnit containerWidthInInlineDirection = hasPerpendicularContainingBlock
? perpendicularContainingBlockLogicalHeight() : availableLogicalWidth; | 227 LayoutUnit containerWidthInInlineDirection = hasPerpendicularContainingBlock
? perpendicularContainingBlockLogicalHeight() : availableLogicalWidth; |
| 228 | 228 |
| 229 LengthType logicalWidthType = style()->logicalWidth().type(); | 229 LengthType logicalWidthType = style()->logicalWidth().type(); |
| 230 if (logicalWidthType > Relative && style()->logicalWidth().isPositive()) { | 230 if (logicalWidthType > Relative && style()->logicalWidth().isPositive()) { |
| 231 // Percent or fixed table | 231 // Percent or fixed table |
| 232 // HTML tables size as though CSS width includes border/padding, CSS tab
les do not. | 232 // HTML tables size as though CSS width includes border/padding, CSS tab
les do not. |
| 233 LayoutUnit borders = 0; | 233 LayoutUnit borders = 0; |
| 234 if (logicalWidthType != Percent && (!node() || !node()->hasTagName(table
Tag))) { | 234 if (logicalWidthType != Percent && (!node() || !node()->hasTagName(table
Tag))) { |
| 235 bool collapsing = collapseBorders(); | 235 recalcBordersInRowDirection(); |
| 236 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? 0
: paddingBefore()); | 236 borders = borderStart() + borderEnd() + (collapseBorders() ? 0 : pad
dingStart() + paddingEnd()); |
| 237 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? 0 :
paddingAfter()); | 237 } |
| 238 borders = borderAndPaddingBefore + borderAndPaddingAfter; | |
| 239 } | |
| 240 setLogicalWidth(style()->logicalWidth().calcMinValue(containerWidthInInl
ineDirection) + borders); | 238 setLogicalWidth(style()->logicalWidth().calcMinValue(containerWidthInInl
ineDirection) + borders); |
| 241 setLogicalWidth(max(minPreferredLogicalWidth(), logicalWidth())); | 239 setLogicalWidth(max(minPreferredLogicalWidth(), logicalWidth())); |
| 242 } else { | 240 } else { |
| 243 // Subtract out any fixed margins from our available width for auto widt
h tables. | 241 // Subtract out any fixed margins from our available width for auto widt
h tables. |
| 244 LayoutUnit marginTotal = 0; | 242 LayoutUnit marginTotal = 0; |
| 245 if (!style()->marginStart().isAuto()) | 243 if (!style()->marginStart().isAuto()) |
| 246 marginTotal += style()->marginStart().calcValue(availableLogicalWidt
h); | 244 marginTotal += style()->marginStart().calcValue(availableLogicalWidt
h); |
| 247 if (!style()->marginEnd().isAuto()) | 245 if (!style()->marginEnd().isAuto()) |
| 248 marginTotal += style()->marginEnd().calcValue(availableLogicalWidth)
; | 246 marginTotal += style()->marginEnd().calcValue(availableLogicalWidth)
; |
| 249 | 247 |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 if (visibleToHitTesting() && (action == HitTestBlockBackground || action ==
HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointI
nContainer))) { | 1224 if (visibleToHitTesting() && (action == HitTestBlockBackground || action ==
HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointI
nContainer))) { |
| 1227 updateHitTestResult(result, flipForWritingMode(pointInContainer - toLayo
utSize(adjustedLocation))); | 1225 updateHitTestResult(result, flipForWritingMode(pointInContainer - toLayo
utSize(adjustedLocation))); |
| 1228 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, bound
sRect)) | 1226 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, bound
sRect)) |
| 1229 return true; | 1227 return true; |
| 1230 } | 1228 } |
| 1231 | 1229 |
| 1232 return false; | 1230 return false; |
| 1233 } | 1231 } |
| 1234 | 1232 |
| 1235 } | 1233 } |
| OLD | NEW |