Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1473363003: Invalidate first line display item clients when first line style changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Recurse into first block child Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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));
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();
rune 2015/11/27 09:27:11 How about FIRST_LINE_INHERITED. firstLineStyleDidC
Xianzhu 2015/11/30 18:15:53 For FIRST_LINE_INHERITED, we'll use the normal pai
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698