Chromium Code Reviews| Index: Source/core/layout/LayoutBox.cpp |
| diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp |
| index 5329151be66562410cefd001d6464fd74a8cc854..5a8a5f7a7851e0a0377d93b65d0b768857c38615 100644 |
| --- a/Source/core/layout/LayoutBox.cpp |
| +++ b/Source/core/layout/LayoutBox.cpp |
| @@ -245,6 +245,31 @@ void LayoutBox::styleDidChange(StyleDifference diff, const ComputedStyle* oldSty |
| if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlaceholder()) |
| placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle); |
| + |
| + updateSlowRepaintStatusAfterStyleChange(); |
| +} |
| + |
| + |
|
Ian Vollick
2015/07/14 02:27:11
nit: extra ws.
trchen
2015/07/14 03:36:37
Done.
|
| +void LayoutBox::updateSlowRepaintStatusAfterStyleChange() |
| +{ |
| + if (!frameView()) |
| + return; |
| + |
| + // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays |
| + // when scrolling a page with a fixed background image. As an optimization, assuming there are |
| + // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we |
| + // ignore the CSS property "background-attachment: fixed". |
| + bool ignoreFixedBackgroundAttachment = RuntimeEnabledFeatures::fastMobileScrollingEnabled(); |
| + if (ignoreFixedBackgroundAttachment) |
| + return; |
| + |
| + bool isSlowRepaintObject = !isDocumentElement() && !backgroundStolenForBeingBody() && styleRef().hasFixedBackgroundImage(); |
|
Ian Vollick
2015/07/14 02:27:11
Sorry for the dumb question, but if the document e
trchen
2015/07/14 03:36:37
Ah, sorry I forgot to tell you the context. I made
|
| + if (isLayoutView() && view()->compositor()->supportsFixedRootBackgroundCompositing()) { |
| + if (styleRef().hasEntirelyFixedBackground()) |
| + isSlowRepaintObject = false; |
| + } |
| + |
| + setIsSlowRepaintObject(isSlowRepaintObject); |
| } |
| void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& style, const ComputedStyle* oldStyle) |