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 void LayoutBox::updateSlowRepaintStatusAfterStyleChange() | |
253 { | |
254 if (!frameView()) | |
255 return; | |
256 | |
257 // On low-powered/mobile devices, preventing blitting on a scroll can cause
noticeable delays | |
258 // when scrolling a page with a fixed background image. As an optimization,
assuming there are | |
259 // no fixed positoned elements on the page, we can acclerate scrolling (via
blitting) if we | |
260 // ignore the CSS property "background-attachment: fixed". | |
261 bool ignoreFixedBackgroundAttachment = RuntimeEnabledFeatures::fastMobileScr
ollingEnabled(); | |
262 if (ignoreFixedBackgroundAttachment) | |
263 return; | |
264 | |
265 // An object needs to be repainted on frame scroll when it has background-at
tachment:fixed. | |
266 // LayoutObject is responsible for painting root background, thus the root e
lement (and the | |
267 // body element if html element has no background) skips painting background
s. | |
268 bool isSlowRepaintObject = !isDocumentElement() && !backgroundStolenForBeing
Body() && styleRef().hasFixedBackgroundImage(); | |
269 if (isLayoutView() && view()->compositor()->supportsFixedRootBackgroundCompo
siting()) { | |
270 if (styleRef().hasEntirelyFixedBackground()) | |
271 isSlowRepaintObject = false; | |
272 } | |
273 | |
274 setIsSlowRepaintObject(isSlowRepaintObject); | |
275 } | 248 } |
276 | 249 |
277 void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& styl
e, const ComputedStyle* oldStyle) | 250 void LayoutBox::updateShapeOutsideInfoAfterStyleChange(const ComputedStyle& styl
e, const ComputedStyle* oldStyle) |
278 { | 251 { |
279 const ShapeValue* shapeOutside = style.shapeOutside(); | 252 const ShapeValue* shapeOutside = style.shapeOutside(); |
280 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Co
mputedStyle::initialShapeOutside(); | 253 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Co
mputedStyle::initialShapeOutside(); |
281 | 254 |
282 Length shapeMargin = style.shapeMargin(); | 255 Length shapeMargin = style.shapeMargin(); |
283 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : ComputedStyle::
initialShapeMargin(); | 256 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : ComputedStyle::
initialShapeMargin(); |
284 | 257 |
(...skipping 4498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4783 StyleImage* borderImage = style()->borderImage().image(); | 4756 StyleImage* borderImage = style()->borderImage().image(); |
4784 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); | 4757 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); |
4785 } | 4758 } |
4786 | 4759 |
4787 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const | 4760 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const |
4788 { | 4761 { |
4789 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
: nullptr; | 4762 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
: nullptr; |
4790 } | 4763 } |
4791 | 4764 |
4792 } // namespace blink | 4765 } // namespace blink |
OLD | NEW |