| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 4455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4754 StyleImage* borderImage = style()->borderImage().image(); | 4754 StyleImage* borderImage = style()->borderImage().image(); |
| 4755 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); | 4755 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); |
| 4756 } | 4756 } |
| 4757 | 4757 |
| 4758 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const | 4758 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const |
| 4759 { | 4759 { |
| 4760 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
: nullptr; | 4760 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
: nullptr; |
| 4761 } | 4761 } |
| 4762 | 4762 |
| 4763 } // namespace blink | 4763 } // namespace blink |
| OLD | NEW |