Chromium Code Reviews| 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 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2070 if (container->styleRef().isFlippedBlocksWritingMode()) | 2070 if (container->styleRef().isFlippedBlocksWritingMode()) |
| 2071 rect.setX(m_frameRect.width() - rect.maxX()); | 2071 rect.setX(m_frameRect.width() - rect.maxX()); |
| 2072 } | 2072 } |
| 2073 | 2073 |
| 2074 LayoutPoint topLeft = rect.location(); | 2074 LayoutPoint topLeft = rect.location(); |
| 2075 topLeft.move(locationOffset()); | 2075 topLeft.move(locationOffset()); |
| 2076 | 2076 |
| 2077 // We are now in our parent container's coordinate space. Apply our transfo rm to obtain a bounding box | 2077 // We are now in our parent container's coordinate space. Apply our transfo rm to obtain a bounding box |
| 2078 // in the parent's coordinate space that encloses us. | 2078 // in the parent's coordinate space that encloses us. |
| 2079 if (hasLayer() && layer()->transform()) { | 2079 if (hasLayer() && layer()->transform()) { |
| 2080 rect = LayoutRect(layer()->transform()->mapRect(pixelSnappedIntRect(rect ))); | 2080 // Use enclosingIntRect because we cannot propery compute pixel snapping for painted elements within the transform since we |
|
pdr.
2016/06/24 22:47:51
Nit propery
pdr.
2016/06/24 22:49:18
Nit: line length
chrishtr
2016/06/24 22:50:14
Done.
| |
| 2081 // don't know the desired subpixel accumulation at this point, and the t ransform may include a scale. | |
| 2082 rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect))) ; | |
| 2081 topLeft = rect.location(); | 2083 topLeft = rect.location(); |
| 2082 topLeft.move(locationOffset()); | 2084 topLeft.move(locationOffset()); |
| 2083 } | 2085 } |
| 2084 | 2086 |
| 2085 const ComputedStyle& styleToUse = styleRef(); | 2087 const ComputedStyle& styleToUse = styleRef(); |
| 2086 EPosition position = styleToUse.position(); | 2088 EPosition position = styleToUse.position(); |
| 2087 if (position == AbsolutePosition && container->isInFlowPositioned() && conta iner->isLayoutInline()) { | 2089 if (position == AbsolutePosition && container->isInFlowPositioned() && conta iner->isLayoutInline()) { |
| 2088 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t his); | 2090 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t his); |
| 2089 } else if (styleToUse.hasInFlowPosition() && layer()) { | 2091 } else if (styleToUse.hasInFlowPosition() && layer()) { |
| 2090 // Apply the relative position offset when invalidating a rectangle. Th e layer | 2092 // Apply the relative position offset when invalidating a rectangle. Th e layer |
| (...skipping 2834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4925 m_rareData->m_snapAreas->remove(&snapArea); | 4927 m_rareData->m_snapAreas->remove(&snapArea); |
| 4926 } | 4928 } |
| 4927 } | 4929 } |
| 4928 | 4930 |
| 4929 SnapAreaSet* LayoutBox::snapAreas() const | 4931 SnapAreaSet* LayoutBox::snapAreas() const |
| 4930 { | 4932 { |
| 4931 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4933 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
| 4932 } | 4934 } |
| 4933 | 4935 |
| 4934 } // namespace blink | 4936 } // namespace blink |
| OLD | NEW |