| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 #endif | 114 #endif |
| 115 } | 115 } |
| 116 | 116 |
| 117 #if ENABLE(ASSERT) | 117 #if ENABLE(ASSERT) |
| 118 void RenderView::checkLayoutState() | 118 void RenderView::checkLayoutState() |
| 119 { | 119 { |
| 120 ASSERT(!m_layoutState->next()); | 120 ASSERT(!m_layoutState->next()); |
| 121 } | 121 } |
| 122 #endif | 122 #endif |
| 123 | 123 |
| 124 bool RenderView::shouldDoFullPaintInvalidationForNextLayout() const | |
| 125 { | |
| 126 // It's hard to predict here which of full paint invalidation or per-descend
ant paint invalidation costs less. | |
| 127 // For vertical writing mode or width change it's more likely that per-desce
ndant paint invalidation | |
| 128 // eventually turns out to be full paint invalidation but with the cost to h
andle more layout states | |
| 129 // and discrete paint invalidation rects, so marking full paint invalidation
here is more likely to cost less. | |
| 130 // Otherwise, per-descendant paint invalidation is more likely to avoid unne
cessary full paint invalidation. | |
| 131 | |
| 132 if (width() != viewWidth()) | |
| 133 return true; | |
| 134 | |
| 135 if (height() != viewHeight()) { | |
| 136 if (RenderObject* backgroundRenderer = this->backgroundRenderer()) { | |
| 137 // When background-attachment is 'fixed', we treat the viewport (ins
tead of the 'root' | |
| 138 // i.e. html or body) as the background positioning area, and we sho
uld full paint invalidation | |
| 139 // viewport resize if the background image is not composited and nee
ds full paint invalidation on | |
| 140 // background positioning area resize. | |
| 141 if (backgroundRenderer->style()->hasFixedBackgroundImage() | |
| 142 && mustInvalidateFillLayersPaintOnHeightChange(backgroundRendere
r->style()->backgroundLayers())) | |
| 143 return true; | |
| 144 } | |
| 145 } | |
| 146 | |
| 147 return false; | |
| 148 } | |
| 149 | |
| 150 void RenderView::layout() | 124 void RenderView::layout() |
| 151 { | 125 { |
| 152 SubtreeLayoutScope layoutScope(*this); | 126 SubtreeLayoutScope layoutScope(*this); |
| 153 | 127 |
| 154 bool relayoutChildren = (!m_frameView || width() != viewWidth() || height()
!= viewHeight()); | 128 bool relayoutChildren = (!m_frameView || width() != viewWidth() || height()
!= viewHeight()); |
| 155 if (relayoutChildren) { | 129 if (relayoutChildren) { |
| 156 layoutScope.setChildNeedsLayout(this); | 130 layoutScope.setChildNeedsLayout(this); |
| 157 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) { | 131 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) { |
| 158 if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight(
)) | 132 if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight(
)) |
| 159 || child->style()->logicalHeight().isPercent() | 133 || child->style()->logicalHeight().isPercent() |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 m_iframes.remove(iframe); | 524 m_iframes.remove(iframe); |
| 551 } | 525 } |
| 552 | 526 |
| 553 void RenderView::updateIFramesAfterLayout() | 527 void RenderView::updateIFramesAfterLayout() |
| 554 { | 528 { |
| 555 for (auto& iframe: m_iframes) | 529 for (auto& iframe: m_iframes) |
| 556 iframe->updateWidgetBounds(); | 530 iframe->updateWidgetBounds(); |
| 557 } | 531 } |
| 558 | 532 |
| 559 } // namespace blink | 533 } // namespace blink |
| OLD | NEW |