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 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 * viewport, and all scrollable boxes should be assumed to be scrolled to th
eir | 2117 * viewport, and all scrollable boxes should be assumed to be scrolled to th
eir |
2118 * origin. | 2118 * origin. |
2119 \*--------------------------------------------------------------------------
-*/ | 2119 \*--------------------------------------------------------------------------
-*/ |
2120 | 2120 |
2121 // see FIXME 2 | 2121 // see FIXME 2 |
2122 // Calculate the static distance if needed. | 2122 // Calculate the static distance if needed. |
2123 if (left.isAuto() && right.isAuto()) { | 2123 if (left.isAuto() && right.isAuto()) { |
2124 if (containerDirection == LTR) { | 2124 if (containerDirection == LTR) { |
2125 // 'staticX' should already have been set through layout of the pare
nt. | 2125 // 'staticX' should already have been set through layout of the pare
nt. |
2126 int staticPosition = layer()->staticX() - containerBlock->borderLeft
(); | 2126 int staticPosition = layer()->staticX() - containerBlock->borderLeft
(); |
2127 for (RenderObject* po = parent(); po && po != containerBlock; po = p
o->parent()) { | 2127 for (RenderObject* curr = parent(); curr && curr != containerBlock;
curr = curr->parent()) { |
2128 if (po->isBox()) | 2128 if (curr->isBox()) |
2129 staticPosition += toRenderBox(po)->x(); | 2129 staticPosition += toRenderBox(curr)->x(); |
2130 } | 2130 } |
2131 left.setValue(Fixed, staticPosition); | 2131 left.setValue(Fixed, staticPosition); |
2132 } else { | 2132 } else { |
2133 RenderObject* po = parent(); | 2133 RenderBox* enclosingBox = parent()->enclosingBox(); |
2134 // 'staticX' should already have been set through layout of the pare
nt. | 2134 // 'staticX' should already have been set through layout of the pare
nt. |
2135 int staticPosition = layer()->staticX() + containerWidth + container
Block->borderRight(); | 2135 int staticPosition = layer()->staticX() + containerWidth + container
Block->borderRight(); |
2136 if (po->isBox()) | 2136 staticPosition -= enclosingBox->width(); |
2137 staticPosition -= toRenderBox(po)->width(); | 2137 for (RenderObject* curr = enclosingBox; curr && curr != containerBlo
ck; curr = curr->parent()) { |
2138 for (; po && po != containerBlock; po = po->parent()) { | 2138 if (curr->isBox()) |
2139 if (po->isBox()) | 2139 staticPosition -= toRenderBox(curr)->x(); |
2140 staticPosition -= toRenderBox(po)->x(); | |
2141 } | 2140 } |
2142 right.setValue(Fixed, staticPosition); | 2141 right.setValue(Fixed, staticPosition); |
2143 } | 2142 } |
2144 } | 2143 } |
2145 | 2144 |
2146 // Calculate constraint equation values for 'width' case. | 2145 // Calculate constraint equation values for 'width' case. |
2147 int widthResult; | 2146 int widthResult; |
2148 int xResult; | 2147 int xResult; |
2149 computePositionedLogicalWidthUsing(style()->width(), containerBlock, contain
erDirection, | 2148 computePositionedLogicalWidthUsing(style()->width(), containerBlock, contain
erDirection, |
2150 containerWidth, bordersPlusPadding, | 2149 containerWidth, bordersPlusPadding, |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3265 { | 3264 { |
3266 if (!parent() || !parent()->isBox()) | 3265 if (!parent() || !parent()->isBox()) |
3267 return locationOffset(); | 3266 return locationOffset(); |
3268 | 3267 |
3269 IntRect rect(frameRect()); | 3268 IntRect rect(frameRect()); |
3270 parentBox()->flipForWritingMode(rect); | 3269 parentBox()->flipForWritingMode(rect); |
3271 return IntSize(rect.x(), rect.y()); | 3270 return IntSize(rect.x(), rect.y()); |
3272 } | 3271 } |
3273 | 3272 |
3274 } // namespace WebCore | 3273 } // namespace WebCore |
OLD | NEW |