| 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 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 if (hasLayer() && diff.cssClipChanged()) | 235 if (hasLayer() && diff.cssClipChanged()) |
| 236 layer()->clipper().clearClipRectsIncludingDescendants(); | 236 layer()->clipper().clearClipRectsIncludingDescendants(); |
| 237 | 237 |
| 238 LayoutObject::styleWillChange(diff, newStyle); | 238 LayoutObject::styleWillChange(diff, newStyle); |
| 239 } | 239 } |
| 240 | 240 |
| 241 DISABLE_CFI_PERF | 241 DISABLE_CFI_PERF |
| 242 void LayoutBoxModelObject::styleDidChange(StyleDifference diff, | 242 void LayoutBoxModelObject::styleDidChange(StyleDifference diff, |
| 243 const ComputedStyle* oldStyle) { | 243 const ComputedStyle* oldStyle) { |
| 244 bool hadTransform = hasTransformRelatedProperty(); | 244 bool hadTransformRelatedProperty = hasTransformRelatedProperty(); |
| 245 bool hadLayer = hasLayer(); | 245 bool hadLayer = hasLayer(); |
| 246 bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer(); | 246 bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer(); |
| 247 bool wasFloatingBeforeStyleChanged = | 247 bool wasFloatingBeforeStyleChanged = |
| 248 FloatStateForStyleChange::wasFloating(this); | 248 FloatStateForStyleChange::wasFloating(this); |
| 249 bool wasHorizontalWritingMode = isHorizontalWritingMode(); | 249 bool wasHorizontalWritingMode = isHorizontalWritingMode(); |
| 250 | 250 |
| 251 LayoutObject::styleDidChange(diff, oldStyle); | 251 LayoutObject::styleDidChange(diff, oldStyle); |
| 252 updateFromStyle(); | 252 updateFromStyle(); |
| 253 | 253 |
| 254 // When an out-of-flow-positioned element changes its display between block | 254 // When an out-of-flow-positioned element changes its display between block |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // Either a transform wasn't specified or the object doesn't support | 288 // Either a transform wasn't specified or the object doesn't support |
| 289 // transforms, so just null out the bit. | 289 // transforms, so just null out the bit. |
| 290 setHasTransformRelatedProperty(false); | 290 setHasTransformRelatedProperty(false); |
| 291 setHasReflection(false); | 291 setHasReflection(false); |
| 292 layer()->updateFilters(oldStyle, styleRef()); | 292 layer()->updateFilters(oldStyle, styleRef()); |
| 293 layer()->updateClipPath(oldStyle, styleRef()); | 293 layer()->updateClipPath(oldStyle, styleRef()); |
| 294 // Calls destroyLayer() which clears m_layer. | 294 // Calls destroyLayer() which clears m_layer. |
| 295 layer()->removeOnlyThisLayerAfterStyleChange(); | 295 layer()->removeOnlyThisLayerAfterStyleChange(); |
| 296 if (wasFloatingBeforeStyleChanged && isFloating()) | 296 if (wasFloatingBeforeStyleChanged && isFloating()) |
| 297 setChildNeedsLayout(); | 297 setChildNeedsLayout(); |
| 298 if (hadTransform) | 298 if (hadTransformRelatedProperty) { |
| 299 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( | 299 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation( |
| 300 LayoutInvalidationReason::StyleChange); | 300 LayoutInvalidationReason::StyleChange); |
| 301 } |
| 301 if (!needsLayout()) { | 302 if (!needsLayout()) { |
| 302 // FIXME: We should call a specialized version of this function. | 303 // FIXME: We should call a specialized version of this function. |
| 303 parentLayer->updateLayerPositionsAfterLayout(); | 304 parentLayer->updateLayerPositionsAfterLayout(); |
| 304 } | 305 } |
| 305 } | 306 } |
| 306 | 307 |
| 307 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 308 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 308 // hasLayer status will affect whether to create localBorderBoxProperties. | 309 // hasLayer status will affect whether to create localBorderBoxProperties. |
| 309 if (hadLayer != hasLayer()) { | 310 // hasTransformRelatedProperty will affect whether to create transform node. |
| 311 if (hadLayer != hasLayer() || |
| 312 hadTransformRelatedProperty != hasTransformRelatedProperty()) { |
| 310 setNeedsPaintPropertyUpdate(); | 313 setNeedsPaintPropertyUpdate(); |
| 311 } else if (oldStyle && oldStyle->position() != styleRef().position() && | 314 } else if (oldStyle && oldStyle->position() != styleRef().position() && |
| 312 (oldStyle->position() == FixedPosition || | 315 (oldStyle->position() == FixedPosition || |
| 313 styleRef().position() == FixedPosition)) { | 316 styleRef().position() == FixedPosition)) { |
| 314 // Fixed-position status affects whether to create paintOffsetTranslation. | 317 // Fixed-position status affects whether to create paintOffsetTranslation. |
| 315 // TODO(chrishtr): Update the condition here when changing the condition | 318 // TODO(chrishtr): Update the condition here when changing the condition |
| 316 // in PaintPropertyTreeBuilder::updatePaintOffsetTranslation(). | 319 // in PaintPropertyTreeBuilder::updatePaintOffsetTranslation(). |
| 317 setNeedsPaintPropertyUpdate(); | 320 setNeedsPaintPropertyUpdate(); |
| 318 } | 321 } |
| 319 } | 322 } |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 if (rootElementStyle->hasBackground()) | 1339 if (rootElementStyle->hasBackground()) |
| 1337 return false; | 1340 return false; |
| 1338 | 1341 |
| 1339 if (node() != document().firstBodyElement()) | 1342 if (node() != document().firstBodyElement()) |
| 1340 return false; | 1343 return false; |
| 1341 | 1344 |
| 1342 return true; | 1345 return true; |
| 1343 } | 1346 } |
| 1344 | 1347 |
| 1345 } // namespace blink | 1348 } // namespace blink |
| OLD | NEW |