| 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 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2036 bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances
tor, LayoutRect& rect, VisualRectFlags visualRectFlags) const | 2036 bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances
tor, LayoutRect& rect, VisualRectFlags visualRectFlags) const |
| 2037 { | 2037 { |
| 2038 inflateVisualRectForReflectionAndFilter(rect); | 2038 inflateVisualRectForReflectionAndFilter(rect); |
| 2039 | 2039 |
| 2040 if (ancestor == this) | 2040 if (ancestor == this) |
| 2041 return true; | 2041 return true; |
| 2042 | 2042 |
| 2043 bool ancestorSkipped; | 2043 bool ancestorSkipped; |
| 2044 bool filterOrReflectionSkipped; | 2044 bool filterOrReflectionSkipped; |
| 2045 LayoutObject* container = this->container(ancestor, &ancestorSkipped, &filte
rOrReflectionSkipped); | 2045 LayoutObject* container = this->container(ancestor, &ancestorSkipped, &filte
rOrReflectionSkipped); |
| 2046 LayoutBox* localContainingBlock = containingBlock(); | |
| 2047 // Skip table row because cells and rows are in the same coordinate space, e
xcept when we're already at the ancestor. | 2046 // Skip table row because cells and rows are in the same coordinate space, e
xcept when we're already at the ancestor. |
| 2048 if (container->isTableRow() && container != ancestor) { | 2047 if (container->isTableRow() && container != ancestor) { |
| 2049 DCHECK(isTableCell()); | 2048 DCHECK(isTableCell()); |
| 2050 localContainingBlock = toLayoutBox(container->parent()); | |
| 2051 container = container->parent(); | 2049 container = container->parent(); |
| 2052 } | 2050 } |
| 2053 if (!container) | 2051 if (!container) |
| 2054 return true; | 2052 return true; |
| 2055 | 2053 |
| 2056 if (filterOrReflectionSkipped) | 2054 if (filterOrReflectionSkipped) |
| 2057 inflateVisualRectForReflectionAndFilterUnderContainer(rect, *container,
ancestor); | 2055 inflateVisualRectForReflectionAndFilterUnderContainer(rect, *container,
ancestor); |
| 2058 | 2056 |
| 2059 // We are now in our parent container's coordinate space. Apply our transfo
rm to obtain a bounding box | 2057 // We are now in our parent container's coordinate space. Apply our transfo
rm to obtain a bounding box |
| 2060 // in the parent's coordinate space that encloses us. | 2058 // in the parent's coordinate space that encloses us. |
| 2061 if (hasLayer() && layer()->transform()) { | 2059 if (hasLayer() && layer()->transform()) { |
| 2062 // Use enclosingIntRect because we cannot properly compute pixel snappin
g for painted elements within | 2060 // Use enclosingIntRect because we cannot properly compute pixel snappin
g for painted elements within |
| 2063 // the transform since we don't know the desired subpixel accumulation a
t this point, and the transform may | 2061 // the transform since we don't know the desired subpixel accumulation a
t this point, and the transform may |
| 2064 // include a scale. | 2062 // include a scale. |
| 2065 rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect)))
; | 2063 rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect)))
; |
| 2066 } | 2064 } |
| 2067 LayoutPoint topLeft = rect.location(); | 2065 LayoutPoint topLeft = rect.location(); |
| 2068 // TODO(wkorman): Look into and document why this conditional is needed. | 2066 // TODO(wkorman): Look into and document why this conditional is needed. |
| 2069 // Currently present following logic in PaintLayer::updateLayerPosition. | 2067 // Currently present following logic in PaintLayer::updateLayerPosition. |
| 2070 if (!(isInline() && isLayoutInline())) | 2068 if (container->isBox()) |
| 2071 topLeft.moveBy(topLeftLocation(localContainingBlock)); | 2069 topLeft.moveBy(topLeftLocation(toLayoutBox(container))); |
| 2070 else |
| 2071 topLeft.move(locationOffset()); |
| 2072 | 2072 |
| 2073 const ComputedStyle& styleToUse = styleRef(); | 2073 const ComputedStyle& styleToUse = styleRef(); |
| 2074 EPosition position = styleToUse.position(); | 2074 EPosition position = styleToUse.position(); |
| 2075 if (position == AbsolutePosition && container->isInFlowPositioned() && conta
iner->isLayoutInline()) { | 2075 if (position == AbsolutePosition && container->isInFlowPositioned() && conta
iner->isLayoutInline()) { |
| 2076 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t
his); | 2076 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t
his); |
| 2077 } else if (styleToUse.hasInFlowPosition() && layer()) { | 2077 } else if (styleToUse.hasInFlowPosition() && layer()) { |
| 2078 // Apply the relative position offset when invalidating a rectangle. Th
e layer | 2078 // Apply the relative position offset when invalidating a rectangle. Th
e layer |
| 2079 // is translated, but the layout box isn't, so we need to do this to get
the | 2079 // is translated, but the layout box isn't, so we need to do this to get
the |
| 2080 // right dirty rect. Since this is called from LayoutObject::setStyle,
the relative position | 2080 // right dirty rect. Since this is called from LayoutObject::setStyle,
the relative position |
| 2081 // flag on the LayoutObject has been cleared, so use the one on the styl
e(). | 2081 // flag on the LayoutObject has been cleared, so use the one on the styl
e(). |
| (...skipping 2844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4926 m_rareData->m_snapAreas->remove(&snapArea); | 4926 m_rareData->m_snapAreas->remove(&snapArea); |
| 4927 } | 4927 } |
| 4928 } | 4928 } |
| 4929 | 4929 |
| 4930 SnapAreaSet* LayoutBox::snapAreas() const | 4930 SnapAreaSet* LayoutBox::snapAreas() const |
| 4931 { | 4931 { |
| 4932 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4932 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
| 4933 } | 4933 } |
| 4934 | 4934 |
| 4935 } // namespace blink | 4935 } // namespace blink |
| OLD | NEW |