| Index: Source/core/rendering/RenderView.cpp
|
| diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
|
| index 5e97df55f1446c9221e299fa2c2c92ac3f13fd13..e98f74023f67cec313d3521b2bc909ad107c1e30 100644
|
| --- a/Source/core/rendering/RenderView.cpp
|
| +++ b/Source/core/rendering/RenderView.cpp
|
| @@ -200,8 +200,17 @@ void RenderView::layout()
|
| // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
|
| bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
|
| if (relayoutChildren) {
|
| - // FIXME: Should not always fully repaint on resize.
|
| - setShouldDoFullRepaintAfterLayout(true);
|
| + // It's hard to predict here which of full repaint or per-descendant repaint costs less.
|
| + // For vertical writing mode or width change it's more likely that per-descendant repaint
|
| + // eventually turns out to be full repaint but with the cost to handle more layout states
|
| + // and discrete repaint rects, so marking full repaint here is more likely to cost less.
|
| + // Otherwise, per-descendant repaint is more likely to avoid unnecessary full repaints.
|
| + if (!style()->isHorizontalWritingMode() || width() != viewWidth()) {
|
| + setShouldDoFullRepaintAfterLayout(true);
|
| + } else if (RenderObject* backgroundRenderer = this->backgroundRenderer()) {
|
| + if (backgroundRenderer->style()->backgroundImageNeedsFullRepaintOnContainerHeightChange())
|
| + setShouldDoFullRepaintAfterLayout(true);
|
| + }
|
|
|
| layoutScope.setChildNeedsLayout(this);
|
| for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
|
| @@ -792,12 +801,18 @@ IntRect RenderView::unscaledDocumentRect() const
|
|
|
| bool RenderView::rootBackgroundIsEntirelyFixed() const
|
| {
|
| - RenderObject* rootObject = document().documentElement() ? document().documentElement()->renderer() : 0;
|
| - if (!rootObject)
|
| - return false;
|
| + if (RenderObject* backgroundRenderer = this->backgroundRenderer())
|
| + return backgroundRenderer->hasEntirelyFixedBackground();
|
| + return false;
|
| +}
|
|
|
| - RenderObject* rootRenderer = rootObject->rendererForRootBackground();
|
| - return rootRenderer->hasEntirelyFixedBackground();
|
| +RenderObject* RenderView::backgroundRenderer() const
|
| +{
|
| + if (Element* documentElement = document().documentElement()) {
|
| + if (RenderObject* rootObject = documentElement->renderer())
|
| + return rootObject->rendererForRootBackground();
|
| + }
|
| + return 0;
|
| }
|
|
|
| LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const
|
|
|