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

Side by Side Diff: Source/core/layout/LayoutListMarker.cpp

Issue 1025213002: Begin tracking why layout is invalidated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/layout/LayoutMenuList.cpp » ('j') | 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com)
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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 { 1072 {
1073 Document& document = item->document(); 1073 Document& document = item->document();
1074 LayoutListMarker* renderer = new LayoutListMarker(item); 1074 LayoutListMarker* renderer = new LayoutListMarker(item);
1075 renderer->setDocumentForAnonymous(&document); 1075 renderer->setDocumentForAnonymous(&document);
1076 return renderer; 1076 return renderer;
1077 } 1077 }
1078 1078
1079 void LayoutListMarker::styleWillChange(StyleDifference diff, const ComputedStyle & newStyle) 1079 void LayoutListMarker::styleWillChange(StyleDifference diff, const ComputedStyle & newStyle)
1080 { 1080 {
1081 if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType())) 1081 if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType()))
1082 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 1082 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::StyleChange);
1083 1083
1084 LayoutBox::styleWillChange(diff, newStyle); 1084 LayoutBox::styleWillChange(diff, newStyle);
1085 } 1085 }
1086 1086
1087 void LayoutListMarker::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle) 1087 void LayoutListMarker::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
1088 { 1088 {
1089 LayoutBox::styleDidChange(diff, oldStyle); 1089 LayoutBox::styleDidChange(diff, oldStyle);
1090 1090
1091 if (m_image != style()->listStyleImage()) { 1091 if (m_image != style()->listStyleImage()) {
1092 if (m_image) 1092 if (m_image)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 clearNeedsLayout(); 1153 clearNeedsLayout();
1154 } 1154 }
1155 1155
1156 void LayoutListMarker::imageChanged(WrappedImagePtr o, const IntRect*) 1156 void LayoutListMarker::imageChanged(WrappedImagePtr o, const IntRect*)
1157 { 1157 {
1158 // A list marker can't have a background or border image, so no need to call the base class method. 1158 // A list marker can't have a background or border image, so no need to call the base class method.
1159 if (o != m_image->data()) 1159 if (o != m_image->data())
1160 return; 1160 return;
1161 1161
1162 if (size() != m_image->imageSize(this, style()->effectiveZoom()) || m_image- >errorOccurred()) 1162 if (size() != m_image->imageSize(this, style()->effectiveZoom()) || m_image- >errorOccurred())
1163 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 1163 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::ImageChanged);
1164 else 1164 else
1165 setShouldDoFullPaintInvalidation(); 1165 setShouldDoFullPaintInvalidation();
1166 } 1166 }
1167 1167
1168 void LayoutListMarker::updateMarginsAndContent() 1168 void LayoutListMarker::updateMarginsAndContent()
1169 { 1169 {
1170 updateContent(); 1170 updateContent();
1171 updateMargins(); 1171 updateMargins();
1172 } 1172 }
1173 1173
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 if (style()) { 1643 if (style()) {
1644 // Reuse the current margins. Otherwise resetting the margins to initial values 1644 // Reuse the current margins. Otherwise resetting the margins to initial values
1645 // would trigger unnecessary layout. 1645 // would trigger unnecessary layout.
1646 newStyle->setMarginStart(style()->marginStart()); 1646 newStyle->setMarginStart(style()->marginStart());
1647 newStyle->setMarginEnd(style()->marginRight()); 1647 newStyle->setMarginEnd(style()->marginRight());
1648 } 1648 }
1649 setStyle(newStyle.release()); 1649 setStyle(newStyle.release());
1650 } 1650 }
1651 1651
1652 } // namespace blink 1652 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutListItem.cpp ('k') | Source/core/layout/LayoutMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698