Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 if (current->isSVGResourceContainer()) { | 309 if (current->isSVGResourceContainer()) { |
| 310 // This will process the rest of the ancestors. | 310 // This will process the rest of the ancestors. |
| 311 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | 311 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
| 312 break; | 312 break; |
| 313 } | 313 } |
| 314 | 314 |
| 315 current = current->parent(); | 315 current = current->parent(); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 void LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation( | |
|
fs
2017/02/06 10:17:35
The way this is written it doesn't need to duplica
| |
| 320 LayoutObject* object, | |
| 321 StyleDifference diff) { | |
| 322 DCHECK(object); | |
| 323 DCHECK(object->node()); | |
| 324 | |
| 325 bool needsLayout = false; | |
| 326 | |
| 327 LayoutObject* current = object; | |
| 328 while (current) { | |
| 329 if (current->isSVGResourceContainer()) { | |
| 330 needsLayout = diff.needsPaintInvalidation(); | |
| 331 break; | |
| 332 } | |
| 333 current = current->parent(); | |
| 334 } | |
| 335 | |
| 336 if (needsLayout && !object->documentBeingDestroyed()) { | |
| 337 object->setNeedsLayoutAndFullPaintInvalidation( | |
| 338 LayoutInvalidationReason::SvgResourceInvalidated); | |
| 339 } | |
| 340 | |
| 341 removeFromCacheAndInvalidateDependencies(object, needsLayout); | |
| 342 | |
| 343 // Invalidate resources in ancestor chain, if needed. | |
| 344 current = object->parent(); | |
| 345 while (current) { | |
| 346 removeFromCacheAndInvalidateDependencies(current, needsLayout); | |
| 347 | |
| 348 if (current->isSVGResourceContainer()) { | |
| 349 // This will process the rest of the ancestors. | |
| 350 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | |
| 351 break; | |
| 352 } | |
| 353 | |
| 354 current = current->parent(); | |
| 355 } | |
| 356 } | |
| 357 | |
| 319 } // namespace blink | 358 } // namespace blink |
| OLD | NEW |