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

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: Invalidate the whole first line 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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 LayoutBlockFlow* block = nullptr;
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 block = toLayoutBlockFlow(this);
1853 } else {
1854 ASSERT(isLayoutInline());
1855 if (toLayoutInline(this)->firstLineBoxIncludingCulling()->isFirstLin eStyle())
1856 block = toLayoutBlockFlow(containingBlock());
1857 }
1858 if (block) {
1859 block->invalidateDisplayItemClientsOfFirstLine();
1860 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
1861 block->setShouldDoFullPaintInvalidation();
Xianzhu 2015/12/01 20:06:25 This is needed for rect-based invalidation. Curren
1862 }
1853 } 1863 }
1864 if (diff.needsLayout())
1865 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange) ;
1854 } 1866 }
1855 1867
1856 void LayoutObject::markContainingBlocksForOverflowRecalc() 1868 void LayoutObject::markContainingBlocksForOverflowRecalc()
1857 { 1869 {
1858 for (LayoutBlock* container = containingBlock(); container && !container->ch ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock ()) 1870 for (LayoutBlock* container = containingBlock(); container && !container->ch ildNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock ())
1859 container->setChildNeedsOverflowRecalcAfterStyleChange(); 1871 container->setChildNeedsOverflowRecalcAfterStyleChange();
1860 } 1872 }
1861 1873
1862 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange() 1874 void LayoutObject::setNeedsOverflowRecalcAfterStyleChange()
1863 { 1875 {
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
3507 const blink::LayoutObject* root = object1; 3519 const blink::LayoutObject* root = object1;
3508 while (root->parent()) 3520 while (root->parent())
3509 root = root->parent(); 3521 root = root->parent();
3510 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3522 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3511 } else { 3523 } else {
3512 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3524 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3513 } 3525 }
3514 } 3526 }
3515 3527
3516 #endif 3528 #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