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 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is); | 363 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is); |
| 364 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) | 364 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) |
| 365 return; | 365 return; |
| 366 | 366 |
| 367 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct(); | 367 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct(); |
| 368 | |
| 369 // TODO(wangxianzhu): Enable this assert after we fix all paintInvalidationC ontainer mismatch issues. crbug.com/360286 | |
| 370 // ASSERT(&newPaintInvalidationState.paintInvalidationContainer() == &contai nerForPaintInvalidation()); | |
|
Xianzhu
2016/03/29 23:05:24
It's enough to check this in LayoutObject::invalid
| |
| 371 | |
| 372 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState); | 368 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState); |
| 373 clearPaintInvalidationFlags(newPaintInvalidationState); | 369 clearPaintInvalidationFlags(newPaintInvalidationState); |
| 374 | 370 |
| 375 if (reason == PaintInvalidationDelayedFull) | 371 if (reason == PaintInvalidationDelayedFull) |
| 376 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 372 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
| 377 | 373 |
| 378 if (reason == PaintInvalidationLocationChange) | 374 if (reason == PaintInvalidationLocationChange) |
| 379 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 375 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
| 380 | 376 |
| 381 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre eIfNeeded() when removing the following workarounds. | 377 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre eIfNeeded() when removing the following workarounds. |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 967 if (rootElementStyle->hasBackground()) | 963 if (rootElementStyle->hasBackground()) |
| 968 return false; | 964 return false; |
| 969 | 965 |
| 970 if (node() != document().firstBodyElement()) | 966 if (node() != document().firstBodyElement()) |
| 971 return false; | 967 return false; |
| 972 | 968 |
| 973 return true; | 969 return true; |
| 974 } | 970 } |
| 975 | 971 |
| 976 } // namespace blink | 972 } // namespace blink |
| OLD | NEW |