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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 682 curr = curr->parent(); | 682 curr = curr->parent(); |
| 683 } | 683 } |
| 684 } | 684 } |
| 685 return nullptr; | 685 return nullptr; |
| 686 } | 686 } |
| 687 | 687 |
| 688 // FIXME: This could be used when changing the size of a layoutObject without ch ildren to skip some invalidations. | 688 // FIXME: This could be used when changing the size of a layoutObject without ch ildren to skip some invalidations. |
| 689 // FIXME: This is incorrect for document element. Remove this when we enable sli mming paint. | 689 // FIXME: This is incorrect for document element. Remove this when we enable sli mming paint. |
| 690 static inline bool layoutObjectHasNoBoxEffectObsolete(const LayoutObject& object ) | 690 static inline bool layoutObjectHasNoBoxEffectObsolete(const LayoutObject& object ) |
| 691 { | 691 { |
| 692 return !object.style()->hasVisualOverflowingEffect() && !object.style()->has Border() && !object.style()->hasBackground(); | 692 return !object.style()->hasVisualOverflowingEffect() && !object.style()->has BorderDecoration() && !object.style()->hasBackground(); |
| 693 } | 693 } |
| 694 | 694 |
| 695 bool LayoutObject::skipInvalidationWhenLaidOutChildren() const | 695 bool LayoutObject::skipInvalidationWhenLaidOutChildren() const |
| 696 { | 696 { |
| 697 if (!neededLayoutBecauseOfChildren()) | 697 if (!neededLayoutBecauseOfChildren()) |
| 698 return false; | 698 return false; |
| 699 | 699 |
| 700 // SVG layoutObjects need to be invalidated when their children are laid out . | 700 // SVG layoutObjects need to be invalidated when their children are laid out . |
| 701 // LayoutBlocks with line boxes are responsible to invalidate them so we can 't ignore them. | 701 // LayoutBlocks with line boxes are responsible to invalidate them so we can 't ignore them. |
| 702 if (isSVG() || (isLayoutBlockFlow() && toLayoutBlockFlow(this)->firstLineBox ())) | 702 if (isSVG() || (isLayoutBlockFlow() && toLayoutBlockFlow(this)->firstLineBox ())) |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 // If filter changed, and the layer does not paint into its own separate bac king or it paints with filters, then we need to invalidate paints. | 1663 // If filter changed, and the layer does not paint into its own separate bac king or it paints with filters, then we need to invalidate paints. |
| 1664 if (diff.filterChanged() && hasLayer()) { | 1664 if (diff.filterChanged() && hasLayer()) { |
| 1665 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(this)->layer(); | 1665 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(this)->layer(); |
| 1666 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint sWithFilters()) | 1666 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint sWithFilters()) |
| 1667 diff.setNeedsPaintInvalidationLayer(); | 1667 diff.setNeedsPaintInvalidationLayer(); |
| 1668 } | 1668 } |
| 1669 | 1669 |
| 1670 if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) { | 1670 if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) { |
| 1671 if (style()->hasBorder() || style()->hasOutline() | 1671 if (style()->hasBorderDecoration() || style()->hasOutline() |
|
pdr.
2015/06/02 03:07:56
I think this may be correct as just hasBorder beca
davve
2015/06/03 06:56:01
Ah, sounds reasonable. Thanks.
| |
| 1672 || (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace())) | 1672 || (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace())) |
| 1673 diff.setNeedsPaintInvalidationObject(); | 1673 diff.setNeedsPaintInvalidationObject(); |
| 1674 } | 1674 } |
| 1675 | 1675 |
| 1676 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch ange without the actual | 1676 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch ange without the actual |
| 1677 // style changing, since it depends on whether we decide to composite these elements. When the | 1677 // style changing, since it depends on whether we decide to composite these elements. When the |
| 1678 // layer status of one of these elements changes, we need to force a layout. | 1678 // layer status of one of these elements changes, we need to force a layout. |
| 1679 if (!diff.needsFullLayout() && style() && isLayoutBoxModelObject()) { | 1679 if (!diff.needsFullLayout() && style() && isLayoutBoxModelObject()) { |
| 1680 bool requiresLayer = toLayoutBoxModelObject(this)->layerTypeRequired() ! = NoDeprecatedPaintLayer; | 1680 bool requiresLayer = toLayoutBoxModelObject(this)->layerTypeRequired() ! = NoDeprecatedPaintLayer; |
| 1681 if (hasLayer() != requiresLayer) | 1681 if (hasLayer() != requiresLayer) |
| (...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3300 const blink::LayoutObject* root = object1; | 3300 const blink::LayoutObject* root = object1; |
| 3301 while (root->parent()) | 3301 while (root->parent()) |
| 3302 root = root->parent(); | 3302 root = root->parent(); |
| 3303 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3303 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3304 } else { | 3304 } else { |
| 3305 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3305 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3306 } | 3306 } |
| 3307 } | 3307 } |
| 3308 | 3308 |
| 3309 #endif | 3309 #endif |
| OLD | NEW |