Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1394193003: Invalidate background-attachment:fixed on scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename all SlowRepaint to BackgroundAttachmentFixed. rebaseline test. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 scrollableArea->verticalScrollbar()->styleChanged(); 247 scrollableArea->verticalScrollbar()->styleChanged();
248 } 248 }
249 } 249 }
250 } 250 }
251 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle); 251 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
252 updateGridPositionAfterStyleChange(oldStyle); 252 updateGridPositionAfterStyleChange(oldStyle);
253 253
254 if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlacehol der()) 254 if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlacehol der())
255 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle); 255 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle);
256 256
257 updateSlowRepaintStatusAfterStyleChange(); 257 updateBackgroundAttachmentFixedStatusAfterStyleChange();
258 258
259 if (oldStyle) { 259 if (oldStyle) {
260 LayoutFlowThread* flowThread = flowThreadContainingBlock(); 260 LayoutFlowThread* flowThread = flowThreadContainingBlock();
261 if (flowThread && flowThread != this) 261 if (flowThread && flowThread != this)
262 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle ); 262 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle );
263 } 263 }
264 } 264 }
265 265
266 void LayoutBox::updateSlowRepaintStatusAfterStyleChange() 266 void LayoutBox::updateBackgroundAttachmentFixedStatusAfterStyleChange()
267 { 267 {
268 if (!frameView()) 268 if (!frameView())
269 return; 269 return;
270 270
271 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays 271 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
272 // when scrolling a page with a fixed background image. As an optimization, assuming there are 272 // when scrolling a page with a fixed background image. As an optimization, assuming there are
273 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we 273 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
274 // ignore the CSS property "background-attachment: fixed". 274 // ignore the CSS property "background-attachment: fixed".
275 bool ignoreFixedBackgroundAttachment = RuntimeEnabledFeatures::fastMobileScr ollingEnabled(); 275 bool ignoreFixedBackgroundAttachment = RuntimeEnabledFeatures::fastMobileScr ollingEnabled();
276 if (ignoreFixedBackgroundAttachment) 276 if (ignoreFixedBackgroundAttachment)
277 return; 277 return;
278 278
279 // An object needs to be repainted on frame scroll when it has background-at tachment:fixed. 279 // An object needs to be repainted on frame scroll when it has background-at tachment:fixed.
280 // LayoutObject is responsible for painting root background, thus the root e lement (and the 280 // LayoutView is responsible for painting root background, thus the root ele ment (and the
281 // body element if html element has no background) skips painting background s. 281 // body element if html element has no background) skips painting background s.
282 bool isSlowRepaintObject = !isDocumentElement() && !backgroundStolenForBeing Body() && styleRef().hasFixedBackgroundImage(); 282 bool isBackgroundAttachmentFixedObject = !isDocumentElement() && !background StolenForBeingBody() && styleRef().hasFixedBackgroundImage();
283 if (isLayoutView() && view()->compositor()->supportsFixedRootBackgroundCompo siting()) { 283 if (isLayoutView() && view()->compositor()->supportsFixedRootBackgroundCompo siting()) {
284 if (styleRef().hasEntirelyFixedBackground()) 284 if (styleRef().hasEntirelyFixedBackground())
285 isSlowRepaintObject = false; 285 isBackgroundAttachmentFixedObject = false;
286 } 286 }
287 287
288 setIsSlowRepaintObject(isSlowRepaintObject); 288 setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixedObject);
289 } 289 }
290 290
291 void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& styl e, const ComputedStyle* oldStyle) 291 void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& styl e, const ComputedStyle* oldStyle)
292 { 292 {
293 const ShapeValue* shapeOutside = style.shapeOutside(); 293 const ShapeValue* shapeOutside = style.shapeOutside();
294 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Co mputedStyle::initialShapeOutside(); 294 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Co mputedStyle::initialShapeOutside();
295 295
296 Length shapeMargin = style.shapeMargin(); 296 Length shapeMargin = style.shapeMargin();
297 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : ComputedStyle:: initialShapeMargin(); 297 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : ComputedStyle:: initialShapeMargin();
298 298
(...skipping 4535 matching lines...) Expand 10 before | Expand all | Expand 10 after
4834 StyleImage* borderImage = style()->borderImage().image(); 4834 StyleImage* borderImage = style()->borderImage().image();
4835 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4835 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4836 } 4836 }
4837 4837
4838 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const 4838 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const
4839 { 4839 {
4840 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; 4840 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr;
4841 } 4841 }
4842 4842
4843 } // namespace blink 4843 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698