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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1683 if (diff.transformChanged()) { | 1683 if (diff.transformChanged()) { |
1684 // Text nodes share style with their parents but transforms don't apply to them, | 1684 // Text nodes share style with their parents but transforms don't apply to them, |
1685 // hence the !isText() check. | 1685 // hence the !isText() check. |
1686 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()- >hasStyleDeterminedDirectCompositingReasons())) | 1686 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()- >hasStyleDeterminedDirectCompositingReasons())) |
1687 diff.setNeedsPaintInvalidationLayer(); | 1687 diff.setNeedsPaintInvalidationLayer(); |
1688 } | 1688 } |
1689 | 1689 |
1690 // If opacity or zIndex changed, and the layer does not paint into its own s eparate backing, then we need to invalidate paints (also | 1690 // If opacity or zIndex changed, and the layer does not paint into its own s eparate backing, then we need to invalidate paints (also |
1691 // ignoring text nodes) | 1691 // ignoring text nodes) |
1692 if (diff.opacityChanged() || diff.zIndexChanged()) { | 1692 if (diff.opacityChanged() || diff.zIndexChanged()) { |
1693 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()- >hasStyleDeterminedDirectCompositingReasons())) | 1693 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()- >hasStyleDeterminedDirectCompositingReasons())) { |
Timothy Loh
2015/08/28 04:48:44
Don't add unrelated changes like these, it just ma
nainar1
2015/08/28 05:02:40
Done
| |
1694 diff.setNeedsPaintInvalidationLayer(); | 1694 diff.setNeedsPaintInvalidationLayer(); |
1695 } | |
1695 } | 1696 } |
1696 | 1697 |
1697 // 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. | 1698 // 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. |
1698 if (diff.filterChanged() && hasLayer()) { | 1699 if (diff.filterChanged() && hasLayer()) { |
1699 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(this)->layer(); | 1700 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(this)->layer(); |
1700 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint sWithFilters()) | 1701 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint sWithFilters()) |
1701 diff.setNeedsPaintInvalidationLayer(); | 1702 diff.setNeedsPaintInvalidationLayer(); |
1702 } | 1703 } |
1703 | 1704 |
1704 if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) { | 1705 if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) { |
1705 if (style()->hasBorder() || style()->hasOutline() | 1706 if (style()->hasBorder() || style()->hasOutline() |
1706 || (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace())) | 1707 || style()->isBackgroundColorCurrentColor() |
1708 || (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace())) { | |
1707 diff.setNeedsPaintInvalidationObject(); | 1709 diff.setNeedsPaintInvalidationObject(); |
1710 } | |
1708 } | 1711 } |
1709 | 1712 |
1710 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch ange without the actual | 1713 // The answer to layerTypeRequired() for plugins, iframes, and canvas can ch ange without the actual |
1711 // style changing, since it depends on whether we decide to composite these elements. When the | 1714 // style changing, since it depends on whether we decide to composite these elements. When the |
1712 // layer status of one of these elements changes, we need to force a layout. | 1715 // layer status of one of these elements changes, we need to force a layout. |
1713 if (!diff.needsFullLayout() && style() && isBoxModelObject()) { | 1716 if (!diff.needsFullLayout() && style() && isBoxModelObject()) { |
1714 bool requiresLayer = toLayoutBoxModelObject(this)->layerTypeRequired() ! = NoDeprecatedPaintLayer; | 1717 bool requiresLayer = toLayoutBoxModelObject(this)->layerTypeRequired() ! = NoDeprecatedPaintLayer; |
1715 if (hasLayer() != requiresLayer) | 1718 if (hasLayer() != requiresLayer) |
1716 diff.setNeedsFullLayout(); | 1719 diff.setNeedsFullLayout(); |
1717 } | 1720 } |
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3384 const blink::LayoutObject* root = object1; | 3387 const blink::LayoutObject* root = object1; |
3385 while (root->parent()) | 3388 while (root->parent()) |
3386 root = root->parent(); | 3389 root = root->parent(); |
3387 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3390 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3388 } else { | 3391 } else { |
3389 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3392 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3390 } | 3393 } |
3391 } | 3394 } |
3392 | 3395 |
3393 #endif | 3396 #endif |
OLD | NEW |