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 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 offset += toRenderInline(o)->offsetForInFlowPositionedInline(*this); | 1924 offset += toRenderInline(o)->offsetForInFlowPositionedInline(*this); |
1925 | 1925 |
1926 if (offsetDependsOnPoint) | 1926 if (offsetDependsOnPoint) |
1927 *offsetDependsOnPoint |= o->isRenderFlowThread(); | 1927 *offsetDependsOnPoint |= o->isRenderFlowThread(); |
1928 | 1928 |
1929 return offset; | 1929 return offset; |
1930 } | 1930 } |
1931 | 1931 |
1932 InlineBox* RenderBox::createInlineBox() | 1932 InlineBox* RenderBox::createInlineBox() |
1933 { | 1933 { |
1934 return new InlineBox(this); | 1934 return new InlineBox(*this); |
1935 } | 1935 } |
1936 | 1936 |
1937 void RenderBox::dirtyLineBoxes(bool fullLayout) | 1937 void RenderBox::dirtyLineBoxes(bool fullLayout) |
1938 { | 1938 { |
1939 if (inlineBoxWrapper()) { | 1939 if (inlineBoxWrapper()) { |
1940 if (fullLayout) { | 1940 if (fullLayout) { |
1941 inlineBoxWrapper()->destroy(); | 1941 inlineBoxWrapper()->destroy(); |
1942 ASSERT(m_rareData); | 1942 ASSERT(m_rareData); |
1943 m_rareData->m_inlineBoxWrapper = 0; | 1943 m_rareData->m_inlineBoxWrapper = 0; |
1944 } else { | 1944 } else { |
1945 inlineBoxWrapper()->dirtyLineBoxes(); | 1945 inlineBoxWrapper()->dirtyLineBoxes(); |
1946 } | 1946 } |
1947 } | 1947 } |
1948 } | 1948 } |
1949 | 1949 |
1950 void RenderBox::positionLineBox(InlineBox* box) | 1950 void RenderBox::positionLineBox(InlineBox* box) |
1951 { | 1951 { |
1952 if (isOutOfFlowPositioned()) { | 1952 if (isOutOfFlowPositioned()) { |
1953 // Cache the x position only if we were an INLINE type originally. | 1953 // Cache the x position only if we were an INLINE type originally. |
1954 bool wasInline = style()->isOriginalDisplayInlineType(); | 1954 bool wasInline = style()->isOriginalDisplayInlineType(); |
1955 if (wasInline) { | 1955 if (wasInline) { |
1956 // The value is cached in the xPos of the box. We only need this va
lue if | 1956 // The value is cached in the xPos of the box. We only need this va
lue if |
1957 // our object was inline originally, since otherwise it would have e
nded up underneath | 1957 // our object was inline originally, since otherwise it would have e
nded up underneath |
1958 // the inlines. | 1958 // the inlines. |
1959 RootInlineBox* root = box->root(); | 1959 RootInlineBox* root = box->root(); |
1960 root->block()->setStaticInlinePositionForChild(this, root->lineTopWi
thLeading(), LayoutUnit::fromFloatRound(box->logicalLeft())); | 1960 root->block().setStaticInlinePositionForChild(this, root->lineTopWit
hLeading(), LayoutUnit::fromFloatRound(box->logicalLeft())); |
1961 if (style()->hasStaticInlinePosition(box->isHorizontal())) | 1961 if (style()->hasStaticInlinePosition(box->isHorizontal())) |
1962 setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the
positioned object as needing layout, so it will update its position properly. | 1962 setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the
positioned object as needing layout, so it will update its position properly. |
1963 } else { | 1963 } else { |
1964 // Our object was a block originally, so we make our normal flow pos
ition be | 1964 // Our object was a block originally, so we make our normal flow pos
ition be |
1965 // just below the line box (as though all the inlines that came befo
re us got | 1965 // just below the line box (as though all the inlines that came befo
re us got |
1966 // wrapped in an anonymous block, which is what would have happened
had we been | 1966 // wrapped in an anonymous block, which is what would have happened
had we been |
1967 // in flow). This value was cached in the y() of the box. | 1967 // in flow). This value was cached in the y() of the box. |
1968 layer()->setStaticBlockPosition(box->logicalTop()); | 1968 layer()->setStaticBlockPosition(box->logicalTop()); |
1969 if (style()->hasStaticBlockPosition(box->isHorizontal())) | 1969 if (style()->hasStaticBlockPosition(box->isHorizontal())) |
1970 setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the
positioned object as needing layout, so it will update its position properly. | 1970 setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the
positioned object as needing layout, so it will update its position properly. |
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4692 return 0; | 4692 return 0; |
4693 | 4693 |
4694 if (!layoutState && !flowThreadContainingBlock()) | 4694 if (!layoutState && !flowThreadContainingBlock()) |
4695 return 0; | 4695 return 0; |
4696 | 4696 |
4697 RenderBlock* containerBlock = containingBlock(); | 4697 RenderBlock* containerBlock = containingBlock(); |
4698 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4698 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4699 } | 4699 } |
4700 | 4700 |
4701 } // namespace WebCore | 4701 } // namespace WebCore |
OLD | NEW |