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

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

Issue 1756763004: Merge image sizing algorithms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unused variable 'styleImage' in release Created 4 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 LayoutSize LayoutListMarker::imageBulletSize() const 67 LayoutSize LayoutListMarker::imageBulletSize() const
68 { 68 {
69 ASSERT(isImage()); 69 ASSERT(isImage());
70 70
71 // FIXME: This is a somewhat arbitrary default width. Generated images for m arkers really won't 71 // FIXME: This is a somewhat arbitrary default width. Generated images for m arkers really won't
72 // become particularly useful until we support the CSS3 marker pseudoclass t o allow control over 72 // become particularly useful until we support the CSS3 marker pseudoclass t o allow control over
73 // the width and height of the marker box. 73 // the width and height of the marker box.
74 LayoutUnit bulletWidth = style()->fontMetrics().ascent() / LayoutUnit(2); 74 LayoutUnit bulletWidth = style()->fontMetrics().ascent() / LayoutUnit(2);
75 LayoutSize defaultBulletSize(bulletWidth, bulletWidth); 75 return m_image->imageSize(this, style()->effectiveZoom(), LayoutSize(bulletW idth, bulletWidth));
76 return calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, D oNotScaleByEffectiveZoom);
77 } 76 }
78 77
79 void LayoutListMarker::styleWillChange(StyleDifference diff, const ComputedStyle & newStyle) 78 void LayoutListMarker::styleWillChange(StyleDifference diff, const ComputedStyle & newStyle)
80 { 79 {
81 if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType())) 80 if (style() && (newStyle.listStylePosition() != style()->listStylePosition() || newStyle.listStyleType() != style()->listStyleType()))
82 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::StyleChange); 81 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::StyleChange);
83 82
84 LayoutBox::styleWillChange(diff, newStyle); 83 LayoutBox::styleWillChange(diff, newStyle);
85 } 84 }
86 85
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 if (style()) { 464 if (style()) {
466 // Reuse the current margins. Otherwise resetting the margins to initial values 465 // Reuse the current margins. Otherwise resetting the margins to initial values
467 // would trigger unnecessary layout. 466 // would trigger unnecessary layout.
468 newStyle->setMarginStart(style()->marginStart()); 467 newStyle->setMarginStart(style()->marginStart());
469 newStyle->setMarginEnd(style()->marginRight()); 468 newStyle->setMarginEnd(style()->marginRight());
470 } 469 }
471 setStyle(newStyle.release()); 470 setStyle(newStyle.release());
472 } 471 }
473 472
474 } // namespace blink 473 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698