| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // and discrete paint invalidation rects, so marking full paint invalidation
here is more likely to cost less. | 158 // and discrete paint invalidation rects, so marking full paint invalidation
here is more likely to cost less. |
| 159 // Otherwise, per-descendant paint invalidation is more likely to avoid unne
cessary full paint invalidation. | 159 // Otherwise, per-descendant paint invalidation is more likely to avoid unne
cessary full paint invalidation. |
| 160 | 160 |
| 161 if (shouldUsePrintingLayout()) | 161 if (shouldUsePrintingLayout()) |
| 162 return true; | 162 return true; |
| 163 | 163 |
| 164 if (!style()->isHorizontalWritingMode() || size().width() != viewWidth()) | 164 if (!style()->isHorizontalWritingMode() || size().width() != viewWidth()) |
| 165 return true; | 165 return true; |
| 166 | 166 |
| 167 if (size().height() != viewHeight()) { | 167 if (size().height() != viewHeight()) { |
| 168 if (LayoutObject* backgroundRenderer = this->backgroundRenderer()) { | 168 if (LayoutObject* backgroundLayoutObject = this->backgroundLayoutObject(
)) { |
| 169 // When background-attachment is 'fixed', we treat the viewport (ins
tead of the 'root' | 169 // When background-attachment is 'fixed', we treat the viewport (ins
tead of the 'root' |
| 170 // i.e. html or body) as the background positioning area, and we sho
uld full paint invalidation | 170 // i.e. html or body) as the background positioning area, and we sho
uld full paint invalidation |
| 171 // viewport resize if the background image is not composited and nee
ds full paint invalidation on | 171 // viewport resize if the background image is not composited and nee
ds full paint invalidation on |
| 172 // background positioning area resize. | 172 // background positioning area resize. |
| 173 if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(la
yer())) { | 173 if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(la
yer())) { |
| 174 if (backgroundRenderer->style()->hasFixedBackgroundImage() | 174 if (backgroundLayoutObject->style()->hasFixedBackgroundImage() |
| 175 && mustInvalidateFillLayersPaintOnHeightChange(backgroundRen
derer->style()->backgroundLayers())) | 175 && mustInvalidateFillLayersPaintOnHeightChange(backgroundLay
outObject->style()->backgroundLayers())) |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 | 183 |
| 184 void LayoutView::layout() | 184 void LayoutView::layout() |
| 185 { | 185 { |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 | 805 |
| 806 IntRect LayoutView::unscaledDocumentRect() const | 806 IntRect LayoutView::unscaledDocumentRect() const |
| 807 { | 807 { |
| 808 LayoutRect overflowRect(layoutOverflowRect()); | 808 LayoutRect overflowRect(layoutOverflowRect()); |
| 809 flipForWritingMode(overflowRect); | 809 flipForWritingMode(overflowRect); |
| 810 return pixelSnappedIntRect(overflowRect); | 810 return pixelSnappedIntRect(overflowRect); |
| 811 } | 811 } |
| 812 | 812 |
| 813 bool LayoutView::rootBackgroundIsEntirelyFixed() const | 813 bool LayoutView::rootBackgroundIsEntirelyFixed() const |
| 814 { | 814 { |
| 815 if (LayoutObject* backgroundRenderer = this->backgroundRenderer()) | 815 if (LayoutObject* backgroundLayoutObject = this->backgroundLayoutObject()) |
| 816 return backgroundRenderer->hasEntirelyFixedBackground(); | 816 return backgroundLayoutObject->hasEntirelyFixedBackground(); |
| 817 return false; | 817 return false; |
| 818 } | 818 } |
| 819 | 819 |
| 820 LayoutObject* LayoutView::backgroundRenderer() const | 820 LayoutObject* LayoutView::backgroundLayoutObject() const |
| 821 { | 821 { |
| 822 if (Element* documentElement = document().documentElement()) { | 822 if (Element* documentElement = document().documentElement()) { |
| 823 if (LayoutObject* rootObject = documentElement->layoutObject()) | 823 if (LayoutObject* rootObject = documentElement->layoutObject()) |
| 824 return rootObject->layoutObjectForRootBackground(); | 824 return rootObject->layoutObjectForRootBackground(); |
| 825 } | 825 } |
| 826 return 0; | 826 return 0; |
| 827 } | 827 } |
| 828 | 828 |
| 829 LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundRenderer) const | 829 LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundLayoutObject) const |
| 830 { | 830 { |
| 831 if (!hasColumns()) | 831 if (!hasColumns()) |
| 832 return LayoutRect(unscaledDocumentRect()); | 832 return LayoutRect(unscaledDocumentRect()); |
| 833 | 833 |
| 834 ColumnInfo* columnInfo = this->columnInfo(); | 834 ColumnInfo* columnInfo = this->columnInfo(); |
| 835 LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo
->columnHeight() * columnInfo->columnCount()); | 835 LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo
->columnHeight() * columnInfo->columnCount()); |
| 836 if (!isHorizontalWritingMode()) | 836 if (!isHorizontalWritingMode()) |
| 837 backgroundRect = backgroundRect.transposedRect(); | 837 backgroundRect = backgroundRect.transposedRect(); |
| 838 backgroundRenderer->flipForWritingMode(backgroundRect); | 838 backgroundLayoutObject->flipForWritingMode(backgroundRect); |
| 839 | 839 |
| 840 return backgroundRect; | 840 return backgroundRect; |
| 841 } | 841 } |
| 842 | 842 |
| 843 IntRect LayoutView::documentRect() const | 843 IntRect LayoutView::documentRect() const |
| 844 { | 844 { |
| 845 FloatRect overflowRect(unscaledDocumentRect()); | 845 FloatRect overflowRect(unscaledDocumentRect()); |
| 846 if (hasTransformRelatedProperty()) | 846 if (hasTransformRelatedProperty()) |
| 847 overflowRect = layer()->currentTransform().mapRect(overflowRect); | 847 overflowRect = layer()->currentTransform().mapRect(overflowRect); |
| 848 return IntRect(overflowRect); | 848 return IntRect(overflowRect); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 return viewHeight(IncludeScrollbars) / scale; | 943 return viewHeight(IncludeScrollbars) / scale; |
| 944 } | 944 } |
| 945 | 945 |
| 946 void LayoutView::willBeDestroyed() | 946 void LayoutView::willBeDestroyed() |
| 947 { | 947 { |
| 948 LayoutBlockFlow::willBeDestroyed(); | 948 LayoutBlockFlow::willBeDestroyed(); |
| 949 m_compositor.clear(); | 949 m_compositor.clear(); |
| 950 } | 950 } |
| 951 | 951 |
| 952 } // namespace blink | 952 } // namespace blink |
| OLD | NEW |