Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 | 238 |
| 239 if (isDocumentElement() || isBody()) { | 239 if (isDocumentElement() || isBody()) { |
| 240 document().view()->recalculateScrollbarOverlayStyle(); | 240 document().view()->recalculateScrollbarOverlayStyle(); |
| 241 document().view()->recalculateCustomScrollbarStyle(); | 241 document().view()->recalculateCustomScrollbarStyle(); |
| 242 } | 242 } |
| 243 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle); | 243 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle); |
| 244 updateGridPositionAfterStyleChange(oldStyle); | 244 updateGridPositionAfterStyleChange(oldStyle); |
| 245 | 245 |
| 246 if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlacehol der()) | 246 if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlacehol der()) |
| 247 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle); | 247 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle); |
| 248 | |
| 249 updateSlowRepaintStatusAfterStyleChange(); | |
| 250 } | |
| 251 | |
| 252 | |
|
Ian Vollick
2015/07/14 02:27:11
nit: extra ws.
trchen
2015/07/14 03:36:37
Done.
| |
| 253 void LayoutBox::updateSlowRepaintStatusAfterStyleChange() | |
| 254 { | |
| 255 if (!frameView()) | |
| 256 return; | |
| 257 | |
| 258 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays | |
| 259 // when scrolling a page with a fixed background image. As an optimization, assuming there are | |
| 260 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we | |
| 261 // ignore the CSS property "background-attachment: fixed". | |
| 262 bool ignoreFixedBackgroundAttachment = RuntimeEnabledFeatures::fastMobileScr ollingEnabled(); | |
| 263 if (ignoreFixedBackgroundAttachment) | |
| 264 return; | |
| 265 | |
| 266 bool isSlowRepaintObject = !isDocumentElement() && !backgroundStolenForBeing Body() && 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
| |
| 267 if (isLayoutView() && view()->compositor()->supportsFixedRootBackgroundCompo siting()) { | |
| 268 if (styleRef().hasEntirelyFixedBackground()) | |
| 269 isSlowRepaintObject = false; | |
| 270 } | |
| 271 | |
| 272 setIsSlowRepaintObject(isSlowRepaintObject); | |
| 248 } | 273 } |
| 249 | 274 |
| 250 void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& styl e, const ComputedStyle* oldStyle) | 275 void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& styl e, const ComputedStyle* oldStyle) |
| 251 { | 276 { |
| 252 const ShapeValue* shapeOutside = style.shapeOutside(); | 277 const ShapeValue* shapeOutside = style.shapeOutside(); |
| 253 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Co mputedStyle::initialShapeOutside(); | 278 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Co mputedStyle::initialShapeOutside(); |
| 254 | 279 |
| 255 Length shapeMargin = style.shapeMargin(); | 280 Length shapeMargin = style.shapeMargin(); |
| 256 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : ComputedStyle:: initialShapeMargin(); | 281 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : ComputedStyle:: initialShapeMargin(); |
| 257 | 282 |
| (...skipping 4498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4756 StyleImage* borderImage = style()->borderImage().image(); | 4781 StyleImage* borderImage = style()->borderImage().image(); |
| 4757 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); | 4782 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); |
| 4758 } | 4783 } |
| 4759 | 4784 |
| 4760 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const | 4785 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const |
| 4761 { | 4786 { |
| 4762 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; | 4787 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; |
| 4763 } | 4788 } |
| 4764 | 4789 |
| 4765 } // namespace blink | 4790 } // namespace blink |
| OLD | NEW |