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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 } | 353 } |
354 return style.transform().dependsOnBoxSize() | 354 return style.transform().dependsOnBoxSize() |
355 || (style.transformOriginX() != Length(50, Percent) && style.transformOr
iginX().hasPercent()) | 355 || (style.transformOriginX() != Length(50, Percent) && style.transformOr
iginX().hasPercent()) |
356 || (style.transformOriginY() != Length(50, Percent) && style.transformOr
iginY().hasPercent()); | 356 || (style.transformOriginY() != Length(50, Percent) && style.transformOr
iginY().hasPercent()); |
357 } | 357 } |
358 | 358 |
359 void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState&
paintInvalidationState) | 359 void LayoutBoxModelObject::invalidateTreeIfNeeded(const PaintInvalidationState&
paintInvalidationState) |
360 { | 360 { |
361 ASSERT(!needsLayout()); | 361 ASSERT(!needsLayout()); |
362 | 362 |
363 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 363 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); |
| 364 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) |
364 return; | 365 return; |
365 | 366 |
366 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe
ct(); | 367 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe
ct(); |
367 | 368 |
368 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); | |
369 // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationC
ontainer mismatch issues. crbug.com/360286 | 369 // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationC
ontainer mismatch issues. crbug.com/360286 |
370 // ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &contai
nerForPaintInvalidation()); | 370 // ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &contai
nerForPaintInvalidation()); |
371 | 371 |
372 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); | 372 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); |
373 clearPaintInvalidationFlags(newPaintInvalidationState); | 373 clearPaintInvalidationFlags(newPaintInvalidationState); |
374 | 374 |
375 if (reason == PaintInvalidationDelayedFull) | 375 if (reason == PaintInvalidationDelayedFull) |
376 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 376 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
377 | 377 |
378 if (reason == PaintInvalidationLocationChange) | 378 if (reason == PaintInvalidationLocationChange) |
379 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 379 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
380 | 380 |
| 381 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre
eIfNeeded() when removing the following workarounds. |
| 382 |
381 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
when we enable paint offset caching. | 383 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
when we enable paint offset caching. |
382 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) | 384 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) |
383 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 385 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
384 | 386 |
385 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha
ve enough saved information to do accurate check | 387 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha
ve enough saved information to do accurate check |
386 // of clipping change. Will remove when we remove rect-based paint invalidat
ion. | 388 // of clipping change. Will remove when we remove rect-based paint invalidat
ion. |
387 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() | 389 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
388 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) | 390 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) |
389 && !usesCompositedScrolling() | 391 && !usesCompositedScrolling() |
390 && hasOverflowClip()) | 392 && hasOverflowClip()) |
391 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); | 393 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); |
392 | 394 |
393 newPaintInvalidationState.updatePaintOffsetAndClipForChildren(); | 395 newPaintInvalidationState.updateForChildren(); |
394 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 396 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
395 } | 397 } |
396 | 398 |
397 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason) const | 399 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason) const |
398 { | 400 { |
399 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. | 401 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. |
400 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 402 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
401 | 403 |
402 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 404 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
403 // so assert but check that the layer is composited. | 405 // so assert but check that the layer is composited. |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 if (rootElementStyle->hasBackground()) | 967 if (rootElementStyle->hasBackground()) |
966 return false; | 968 return false; |
967 | 969 |
968 if (node() != document().firstBodyElement()) | 970 if (node() != document().firstBodyElement()) |
969 return false; | 971 return false; |
970 | 972 |
971 return true; | 973 return true; |
972 } | 974 } |
973 | 975 |
974 } // namespace blink | 976 } // namespace blink |
OLD | NEW |