| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 ASSERT(!view.layoutState()); | 41 ASSERT(!view.layoutState()); |
| 42 view.pushLayoutState(*this); | 42 view.pushLayoutState(*this); |
| 43 } | 43 } |
| 44 | 44 |
| 45 LayoutState::LayoutState(RenderBox& renderer, const LayoutSize& offset, bool con
tainingBlockLogicalWidthChanged) | 45 LayoutState::LayoutState(RenderBox& renderer, const LayoutSize& offset, bool con
tainingBlockLogicalWidthChanged) |
| 46 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged) | 46 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged) |
| 47 , m_next(renderer.view()->layoutState()) | 47 , m_next(renderer.view()->layoutState()) |
| 48 , m_renderer(renderer) | 48 , m_renderer(renderer) |
| 49 { | 49 { |
| 50 renderer.view()->pushLayoutState(*this); | 50 renderer.view()->pushLayoutState(*this); |
| 51 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position(
) == FixedPosition; | 51 m_layoutOffset = m_next->m_layoutOffset + offset; |
| 52 if (fixed) { | |
| 53 // FIXME: This doesn't work correctly with transforms. | |
| 54 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(),
IsFixed); | |
| 55 m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset; | |
| 56 } else { | |
| 57 m_layoutOffset = m_next->m_layoutOffset + offset; | |
| 58 } | |
| 59 | 52 |
| 60 if (renderer.isOutOfFlowPositioned() && !fixed) { | 53 if (renderer.isOutOfFlowPositioned()) { |
| 61 if (RenderObject* container = renderer.container()) { | 54 if (RenderObject* container = renderer.container()) { |
| 62 if (container->style()->hasInFlowPosition() && container->isRenderIn
line()) | 55 if (container->style()->hasInFlowPosition() && container->isRenderIn
line()) |
| 63 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi
tionedInline(renderer); | 56 m_layoutOffset += toRenderInline(container)->offsetForInFlowPosi
tionedInline(renderer); |
| 64 } | 57 } |
| 65 } | 58 } |
| 66 | 59 |
| 67 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. | 60 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. |
| 68 } | 61 } |
| 69 | 62 |
| 70 LayoutState::LayoutState(RenderObject& root) | 63 LayoutState::LayoutState(RenderObject& root) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 86 | 79 |
| 87 LayoutState::~LayoutState() | 80 LayoutState::~LayoutState() |
| 88 { | 81 { |
| 89 if (m_renderer.view()->layoutState()) { | 82 if (m_renderer.view()->layoutState()) { |
| 90 ASSERT(m_renderer.view()->layoutState() == this); | 83 ASSERT(m_renderer.view()->layoutState() == this); |
| 91 m_renderer.view()->popLayoutState(); | 84 m_renderer.view()->popLayoutState(); |
| 92 } | 85 } |
| 93 } | 86 } |
| 94 | 87 |
| 95 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |