| 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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 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 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 { | 2028 { |
| 2029 if (childrenInline()) | 2029 if (childrenInline()) |
| 2030 return toLayoutBlockFlow(const_cast<LayoutBlock*>(this)); | 2030 return toLayoutBlockFlow(const_cast<LayoutBlock*>(this)); |
| 2031 for (LayoutObject* child = firstChild(); child && !child->isFloatingOrOutOfF
lowPositioned() && child->isLayoutBlockFlow(); child = toLayoutBlock(child)->fir
stChild()) { | 2031 for (LayoutObject* child = firstChild(); child && !child->isFloatingOrOutOfF
lowPositioned() && child->isLayoutBlockFlow(); child = toLayoutBlock(child)->fir
stChild()) { |
| 2032 if (child->childrenInline()) | 2032 if (child->childrenInline()) |
| 2033 return toLayoutBlockFlow(child); | 2033 return toLayoutBlockFlow(child); |
| 2034 } | 2034 } |
| 2035 return nullptr; | 2035 return nullptr; |
| 2036 } | 2036 } |
| 2037 | 2037 |
| 2038 void LayoutBlock::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accum
ulatedOffset) const | |
| 2039 { | |
| 2040 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the | |
| 2041 // inline boxes above and below us (thus getting merged with them to form a
single irregular | |
| 2042 // shape). | |
| 2043 if (isAnonymousBlockContinuation()) { | |
| 2044 // FIXME: This is wrong for vertical writing-modes. | |
| 2045 // https://bugs.webkit.org/show_bug.cgi?id=46781 | |
| 2046 LayoutRect rect(accumulatedOffset, size()); | |
| 2047 rect.expand(collapsedMarginBoxLogicalOutsets()); | |
| 2048 rects.append(pixelSnappedIntRect(rect)); | |
| 2049 continuation()->absoluteRects(rects, accumulatedOffset - toLayoutSize(lo
cation() + | |
| 2050 inlineElementContinuation()->containingBlock()->location())); | |
| 2051 } else { | |
| 2052 rects.append(pixelSnappedIntRect(accumulatedOffset, size())); | |
| 2053 } | |
| 2054 } | |
| 2055 | |
| 2056 void LayoutBlock::absoluteQuads(Vector<FloatQuad>& quads) const | |
| 2057 { | |
| 2058 // For blocks inside inlines, we go ahead and include margins so that we run
right up to the | |
| 2059 // inline boxes above and below us (thus getting merged with them to form a
single irregular | |
| 2060 // shape). | |
| 2061 if (isAnonymousBlockContinuation()) { | |
| 2062 // FIXME: This is wrong for vertical writing-modes. | |
| 2063 // https://bugs.webkit.org/show_bug.cgi?id=46781 | |
| 2064 LayoutRect localRect(LayoutPoint(), size()); | |
| 2065 localRect.expand(collapsedMarginBoxLogicalOutsets()); | |
| 2066 quads.append(localToAbsoluteQuad(FloatRect(localRect))); | |
| 2067 continuation()->absoluteQuads(quads); | |
| 2068 } else { | |
| 2069 quads.append(LayoutBox::localToAbsoluteQuad(FloatRect(0, 0, size().width
().toFloat(), size().height().toFloat()))); | |
| 2070 } | |
| 2071 } | |
| 2072 | |
| 2073 LayoutObject* LayoutBlock::hoverAncestor() const | 2038 LayoutObject* LayoutBlock::hoverAncestor() const |
| 2074 { | 2039 { |
| 2075 return isAnonymousBlockContinuation() ? continuation() : LayoutBox::hoverAnc
estor(); | 2040 return isAnonymousBlockContinuation() ? continuation() : LayoutBox::hoverAnc
estor(); |
| 2076 } | 2041 } |
| 2077 | 2042 |
| 2078 void LayoutBlock::updateDragState(bool dragOn) | 2043 void LayoutBlock::updateDragState(bool dragOn) |
| 2079 { | 2044 { |
| 2080 LayoutBox::updateDragState(dragOn); | 2045 LayoutBox::updateDragState(dragOn); |
| 2081 if (LayoutBoxModelObject* continuation = this->continuation()) | 2046 if (LayoutBoxModelObject* continuation = this->continuation()) |
| 2082 continuation->updateDragState(dragOn); | 2047 continuation->updateDragState(dragOn); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2379 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda
ntSet->begin(); it != end; ++it) { | 2344 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda
ntSet->begin(); it != end; ++it) { |
| 2380 LayoutBox* currBox = *it; | 2345 LayoutBox* currBox = *it; |
| 2381 ASSERT(!currBox->needsLayout()); | 2346 ASSERT(!currBox->needsLayout()); |
| 2382 } | 2347 } |
| 2383 } | 2348 } |
| 2384 } | 2349 } |
| 2385 | 2350 |
| 2386 #endif | 2351 #endif |
| 2387 | 2352 |
| 2388 } // namespace blink | 2353 } // namespace blink |
| OLD | NEW |