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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 = oldStyle.visualInvalidationDiff(newStyle); |
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() || diff.textDecorationOrColorChanged()) { |
1850 // is needed, but for now just assume a layout will be required. The dif f code | 1850 LayoutBlock* block = nullptr; |
1851 // in LayoutObject::setStyle would need to be factored out so that it co uld be reused. | 1851 if (isLayoutBlockFlow() || isLayoutButton()) { |
1852 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::StyleChange); | 1852 block = toLayoutBlock(this); |
1853 } else if (isLayoutInline()) { | |
1854 if (toLayoutInline(this)->firstLineBoxIncludingCulling()->isFirstLin eStyle()) | |
mstensho (USE GERRIT)
2015/12/02 10:09:31
Can't firstLineBoxIncludingCulling() return nullpt
Xianzhu
2015/12/02 17:41:57
Not sure though didn't encounter. Added nullptr ch
| |
1855 block = containingBlock(); | |
1856 } | |
1857 if (block) { | |
1858 block->invalidateDisplayItemClientsOfFirstLine(); | |
1859 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | |
1860 block->setShouldDoFullPaintInvalidation(); | |
1861 } | |
1853 } | 1862 } |
1863 if (diff.needsLayout()) | |
1864 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange) ; | |
1854 } | 1865 } |
1855 | 1866 |
1856 void LayoutObject::markContainingBlocksForOverflowRecalc() | 1867 void LayoutObject::markContainingBlocksForOverflowRecalc() |
1857 { | 1868 { |
1858 for (LayoutBlock* container = containingBlock(); container && !container->ch ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock ()) | 1869 for (LayoutBlock* container = containingBlock(); container && !container->ch ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock ()) |
1859 container->setChildNeedsOverflowRecalcAfterStyleChange(); | 1870 container->setChildNeedsOverflowRecalcAfterStyleChange(); |
1860 } | 1871 } |
1861 | 1872 |
1862 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() | 1873 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() |
1863 { | 1874 { |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3507 const blink::LayoutObject* root = object1; | 3518 const blink::LayoutObject* root = object1; |
3508 while (root->parent()) | 3519 while (root->parent()) |
3509 root = root->parent(); | 3520 root = root->parent(); |
3510 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3521 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3511 } else { | 3522 } else { |
3512 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3523 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3513 } | 3524 } |
3514 } | 3525 } |
3515 | 3526 |
3516 #endif | 3527 #endif |
OLD | NEW |