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 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1894 // physical coordinate space of the paintInvalidationContainer. | 1894 // physical coordinate space of the paintInvalidationContainer. |
| 1895 const ComputedStyle& styleToUse = styleRef(); | 1895 const ComputedStyle& styleToUse = styleRef(); |
| 1896 | 1896 |
| 1897 EPosition position = styleToUse.position(); | 1897 EPosition position = styleToUse.position(); |
| 1898 | 1898 |
| 1899 // We need to inflate the paint invalidation rect before we use paintInvalid ationState, | 1899 // We need to inflate the paint invalidation rect before we use paintInvalid ationState, |
| 1900 // else we would forget to inflate it for the current layoutObject. FIXME: I f these were | 1900 // else we would forget to inflate it for the current layoutObject. FIXME: I f these were |
| 1901 // included into the visual overflow for repaint, we wouldn't have this issu e. | 1901 // included into the visual overflow for repaint, we wouldn't have this issu e. |
| 1902 inflatePaintInvalidationRectForReflectionAndFilter(rect); | 1902 inflatePaintInvalidationRectForReflectionAndFilter(rect); |
| 1903 | 1903 |
| 1904 // This condition should be put before the paintInvalidationState logic beca use the latter | |
| 1905 // can't handle the case. We also can't let PaintInvalidationState handle th e case, because | |
| 1906 // this code is also needed when there is no PaintInvalidationState. | |
|
chrishtr
2016/03/11 22:11:44
TODO(wangxianzhu): refactor to fix this code struc
Xianzhu
2016/03/11 22:30:51
Done.
| |
| 1907 if (ancestor == this) { | |
| 1908 if (ancestor->style()->isFlippedBlocksWritingMode()) | |
| 1909 flipForWritingMode(rect); | |
| 1910 return; | |
| 1911 } | |
| 1912 | |
| 1904 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance stor) && position != FixedPosition) { | 1913 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance stor) && position != FixedPosition) { |
| 1905 if (layer() && layer()->transform()) | 1914 if (layer() && layer()->transform()) |
| 1906 rect = LayoutRect(layer()->transform()->mapRect(pixelSnappedIntRect( rect))); | 1915 rect = LayoutRect(layer()->transform()->mapRect(pixelSnappedIntRect( rect))); |
| 1907 | 1916 |
| 1908 // We can't trust the bits on LayoutObject, because this might be called while re-resolving style. | 1917 // We can't trust the bits on LayoutObject, because this might be called while re-resolving style. |
| 1909 if (styleToUse.hasInFlowPosition() && layer()) | 1918 if (styleToUse.hasInFlowPosition() && layer()) |
| 1910 rect.move(layer()->offsetForInFlowPosition()); | 1919 rect.move(layer()->offsetForInFlowPosition()); |
| 1911 | 1920 |
| 1912 rect.moveBy(location()); | 1921 rect.moveBy(location()); |
| 1913 rect.move(paintInvalidationState->paintOffset()); | 1922 rect.move(paintInvalidationState->paintOffset()); |
| 1914 if (paintInvalidationState->isClipped()) | 1923 if (paintInvalidationState->isClipped()) |
| 1915 rect.intersect(paintInvalidationState->clipRect()); | 1924 rect.intersect(paintInvalidationState->clipRect()); |
| 1916 return; | 1925 return; |
| 1917 } | 1926 } |
| 1918 | 1927 |
| 1919 if (ancestor == this) { | |
| 1920 if (ancestor->style()->isFlippedBlocksWritingMode()) | |
| 1921 flipForWritingMode(rect); | |
| 1922 return; | |
| 1923 } | |
| 1924 | |
| 1925 bool containerSkipped; | 1928 bool containerSkipped; |
| 1926 LayoutObject* container = this->container(ancestor, &containerSkipped); | 1929 LayoutObject* container = this->container(ancestor, &containerSkipped); |
| 1927 if (!container) | 1930 if (!container) |
| 1928 return; | 1931 return; |
| 1929 | 1932 |
| 1930 if (isWritingModeRoot()) | 1933 if (isWritingModeRoot()) |
| 1931 flipForWritingMode(rect); | 1934 flipForWritingMode(rect); |
| 1932 | 1935 |
| 1933 LayoutPoint topLeft = rect.location(); | 1936 LayoutPoint topLeft = rect.location(); |
| 1934 topLeft.move(locationOffset()); | 1937 topLeft.move(locationOffset()); |
| (...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4678 } | 4681 } |
| 4679 | 4682 |
| 4680 void LayoutBox::IntrinsicSizingInfo::transpose() | 4683 void LayoutBox::IntrinsicSizingInfo::transpose() |
| 4681 { | 4684 { |
| 4682 size = size.transposedSize(); | 4685 size = size.transposedSize(); |
| 4683 aspectRatio = aspectRatio.transposedSize(); | 4686 aspectRatio = aspectRatio.transposedSize(); |
| 4684 std::swap(hasWidth, hasHeight); | 4687 std::swap(hasWidth, hasHeight); |
| 4685 } | 4688 } |
| 4686 | 4689 |
| 4687 } // namespace blink | 4690 } // namespace blink |
| OLD | NEW |