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

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: Created 5 years, 9 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
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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 { 1071 {
1072 Document& document = item->document(); 1072 Document& document = item->document();
1073 LayoutListMarker* renderer = new LayoutListMarker(item); 1073 LayoutListMarker* renderer = new LayoutListMarker(item);
1074 renderer->setDocumentForAnonymous(&document); 1074 renderer->setDocumentForAnonymous(&document);
1075 return renderer; 1075 return renderer;
1076 } 1076 }
1077 1077
1078 void LayoutListMarker::styleWillChange(StyleDifference diff, const LayoutStyle& newStyle) 1078 void LayoutListMarker::styleWillChange(StyleDifference diff, const LayoutStyle& newStyle)
1079 { 1079 {
1080 if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType())) 1080 if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType()))
1081 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 1081 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::StyleChange);
1082 1082
1083 LayoutBox::styleWillChange(diff, newStyle); 1083 LayoutBox::styleWillChange(diff, newStyle);
1084 } 1084 }
1085 1085
1086 void LayoutListMarker::styleDidChange(StyleDifference diff, const LayoutStyle* o ldStyle) 1086 void LayoutListMarker::styleDidChange(StyleDifference diff, const LayoutStyle* o ldStyle)
1087 { 1087 {
1088 LayoutBox::styleDidChange(diff, oldStyle); 1088 LayoutBox::styleDidChange(diff, oldStyle);
1089 1089
1090 if (m_image != style()->listStyleImage()) { 1090 if (m_image != style()->listStyleImage()) {
1091 if (m_image) 1091 if (m_image)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 clearNeedsLayout(); 1151 clearNeedsLayout();
1152 } 1152 }
1153 1153
1154 void LayoutListMarker::imageChanged(WrappedImagePtr o, const IntRect*) 1154 void LayoutListMarker::imageChanged(WrappedImagePtr o, const IntRect*)
1155 { 1155 {
1156 // A list marker can't have a background or border image, so no need to call the base class method. 1156 // A list marker can't have a background or border image, so no need to call the base class method.
1157 if (o != m_image->data()) 1157 if (o != m_image->data())
1158 return; 1158 return;
1159 1159
1160 if (size() != m_image->imageSize(this, style()->effectiveZoom()) || m_image- >errorOccurred()) 1160 if (size() != m_image->imageSize(this, style()->effectiveZoom()) || m_image- >errorOccurred())
1161 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 1161 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::ImageChanged);
1162 else 1162 else
1163 setShouldDoFullPaintInvalidation(); 1163 setShouldDoFullPaintInvalidation();
1164 } 1164 }
1165 1165
1166 void LayoutListMarker::updateMarginsAndContent() 1166 void LayoutListMarker::updateMarginsAndContent()
1167 { 1167 {
1168 updateContent(); 1168 updateContent();
1169 updateMargins(); 1169 updateMargins();
1170 } 1170 }
1171 1171
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 if (style()) { 1641 if (style()) {
1642 // Reuse the current margins. Otherwise resetting the margins to initial values 1642 // Reuse the current margins. Otherwise resetting the margins to initial values
1643 // would trigger unnecessary layout. 1643 // would trigger unnecessary layout.
1644 newStyle->setMarginStart(style()->marginStart()); 1644 newStyle->setMarginStart(style()->marginStart());
1645 newStyle->setMarginEnd(style()->marginRight()); 1645 newStyle->setMarginEnd(style()->marginRight());
1646 } 1646 }
1647 setStyle(newStyle.release()); 1647 setStyle(newStyle.release());
1648 } 1648 }
1649 1649
1650 } // namespace blink 1650 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698