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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.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: Pure paint invalildation change (Element.cpp reverted) 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
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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 2872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2883 } 2883 }
2884 2884
2885 setLogicalHeight(computedValues.m_extent); 2885 setLogicalHeight(computedValues.m_extent);
2886 setLogicalTop(computedValues.m_position); 2886 setLogicalTop(computedValues.m_position);
2887 setMarginBefore(computedValues.m_margins.m_before); 2887 setMarginBefore(computedValues.m_margins.m_before);
2888 setMarginAfter(computedValues.m_margins.m_after); 2888 setMarginAfter(computedValues.m_margins.m_after);
2889 2889
2890 return true; 2890 return true;
2891 } 2891 }
2892 2892
2893 static void invalidteDisplayItemClientsOfInlineBoxRecursively(InlineBox& box)
rune 2015/12/02 09:00:49 invalidte -> invalidate
Xianzhu 2015/12/02 17:41:57 Done.
2894 {
2895 box.layoutObject().invalidateDisplayItemClient(box);
2896 if (!box.isInlineFlowBox())
2897 return;
2898 for (InlineBox* child = toInlineFlowBox(box).firstChild(); child; child = ch ild->nextOnLine())
2899 invalidteDisplayItemClientsOfInlineBoxRecursively(*child);
2900 }
2901
2902 void LayoutBlock::invalidateDisplayItemClientsOfFirstLine()
mstensho (USE GERRIT) 2015/12/02 10:09:31 Lines are only interesting in block containers, i.
Xianzhu 2015/12/02 17:41:57 Done. Separated this method into LayoutBlock::firs
mstensho (USE GERRIT) 2015/12/03 12:08:10 Acknowledged.
2903 {
2904 if (childrenInline()) {
2905 // This block has the first line.
2906 if (RootInlineBox* firstRootBox = this->firstRootBox())
2907 invalidteDisplayItemClientsOfInlineBoxRecursively(*firstRootBox);
2908 return;
2909 }
2910
2911 // Let the first child flow find the first line.
2912 if (LayoutObject* child = firstChild()) {
2913 if (!child->isFloatingOrOutOfFlowPositioned() && child->isLayoutBlock())
mstensho (USE GERRIT) 2015/12/02 10:09:31 Should only allow LayoutBlockFlow here. It's okay
Xianzhu 2015/12/02 17:41:57 Done. Now this is in LayoutBlock::firstLineContain
2914 toLayoutBlock(child)->invalidateDisplayItemClientsOfFirstLine();
2915 }
2916 }
2917
2893 #if ENABLE(ASSERT) 2918 #if ENABLE(ASSERT)
2894 void LayoutBlock::checkPositionedObjectsNeedLayout() 2919 void LayoutBlock::checkPositionedObjectsNeedLayout()
2895 { 2920 {
2896 if (!gPositionedDescendantsMap) 2921 if (!gPositionedDescendantsMap)
2897 return; 2922 return;
2898 2923
2899 if (TrackedLayoutBoxListHashSet* positionedDescendantSet = positionedObjects ()) { 2924 if (TrackedLayoutBoxListHashSet* positionedDescendantSet = positionedObjects ()) {
2900 TrackedLayoutBoxListHashSet::const_iterator end = positionedDescendantSe t->end(); 2925 TrackedLayoutBoxListHashSet::const_iterator end = positionedDescendantSe t->end();
2901 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) { 2926 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) {
2902 LayoutBox* currBox = *it; 2927 LayoutBox* currBox = *it;
2903 ASSERT(!currBox->needsLayout()); 2928 ASSERT(!currBox->needsLayout());
2904 } 2929 }
2905 } 2930 }
2906 } 2931 }
2907 2932
2908 #endif 2933 #endif
2909 2934
2910 #ifndef NDEBUG 2935 #ifndef NDEBUG
2911 2936
2912 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2937 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2913 { 2938 {
2914 showLayoutObject(); 2939 showLayoutObject();
2915 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2940 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2916 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2941 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2917 } 2942 }
2918 2943
2919 #endif 2944 #endif
2920 2945
2921 } // namespace blink 2946 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698