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 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1837 style->inheritFrom(*pseudoStyle); | 1837 style->inheritFrom(*pseudoStyle); |
| 1838 setStyle(style.release()); | 1838 setStyle(style.release()); |
| 1839 return; | 1839 return; |
| 1840 } | 1840 } |
| 1841 | 1841 |
| 1842 setStyle(pseudoStyle); | 1842 setStyle(pseudoStyle); |
| 1843 } | 1843 } |
| 1844 | 1844 |
| 1845 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const ComputedStyle& newStyle) | 1845 void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle, const ComputedStyle& newStyle) |
| 1846 { | 1846 { |
| 1847 StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle); | 1847 StyleDifference diff = adjustStyleDifference(oldStyle.visualInvalidationDiff (newStyle)); |
|
chrishtr
2015/11/24 23:21:56
Is the change in this file strictly necessary?
Xianzhu
2015/11/24 23:26:58
I think yes.
The above line ensures that StyleDif
| |
| 1848 if (diff.hasDifference()) { | 1848 |
| 1849 // TODO(rune@opera.com): We should use the diff to determine whether a r epaint vs. layout | 1849 if (diff.needsPaintInvalidation()) { |
| 1850 // is needed, but for now just assume a layout will be required. The dif f code | 1850 setShouldDoFullPaintInvalidation(); |
| 1851 // in LayoutObject::setStyle would need to be factored out so that it co uld be reused. | 1851 if (isLayoutBlockFlow()) |
| 1852 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::StyleChange); | 1852 toLayoutBlockFlow(this)->invalidateDisplayItemClientsOfFirstLine(); |
| 1853 } | 1853 } |
| 1854 if (diff.needsLayout()) | |
| 1855 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange) ; | |
| 1854 } | 1856 } |
| 1855 | 1857 |
| 1856 void LayoutObject::markContainingBlocksForOverflowRecalc() | 1858 void LayoutObject::markContainingBlocksForOverflowRecalc() |
| 1857 { | 1859 { |
| 1858 for (LayoutBlock* container = containingBlock(); container && !container->ch ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock ()) | 1860 for (LayoutBlock* container = containingBlock(); container && !container->ch ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock ()) |
| 1859 container->setChildNeedsOverflowRecalcAfterStyleChange(); | 1861 container->setChildNeedsOverflowRecalcAfterStyleChange(); |
| 1860 } | 1862 } |
| 1861 | 1863 |
| 1862 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() | 1864 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() |
| 1863 { | 1865 { |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3504 const blink::LayoutObject* root = object1; | 3506 const blink::LayoutObject* root = object1; |
| 3505 while (root->parent()) | 3507 while (root->parent()) |
| 3506 root = root->parent(); | 3508 root = root->parent(); |
| 3507 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3509 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3508 } else { | 3510 } else { |
| 3509 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3511 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3510 } | 3512 } |
| 3511 } | 3513 } |
| 3512 | 3514 |
| 3513 #endif | 3515 #endif |
| OLD | NEW |