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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutListMarker.cpp

Issue 1704493002: Use Image::updateConcreteSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-image-updateconcretesize
Patch Set: Move test here from dependency CL. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
index b77747df22d204d5f8634561d4712ad834c622bf..bf1f43cf7d1f620bf81e97214cb500cb96e789f3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
@@ -67,13 +67,7 @@ LayoutListMarker* LayoutListMarker::createAnonymous(LayoutListItem* item)
LayoutSize LayoutListMarker::imageBulletSize() const
{
ASSERT(isImage());
-
- // FIXME: This is a somewhat arbitrary default width. Generated images for markers really won't
- // become particularly useful until we support the CSS3 marker pseudoclass to allow control over
- // the width and height of the marker box.
- LayoutUnit bulletWidth = style()->fontMetrics().ascent() / LayoutUnit(2);
- LayoutSize defaultBulletSize(bulletWidth, bulletWidth);
- return calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom);
+ return m_image->imageSize(this, style()->effectiveZoom());
}
void LayoutListMarker::styleWillChange(StyleDifference diff, const ComputedStyle& newStyle)
@@ -136,6 +130,14 @@ void LayoutListMarker::layout()
if (isImage()) {
updateMarginsAndContent();
+ // FIXME: This is a somewhat arbitrary default width. Generated images for markers really won't
+ // become particularly useful until we support the CSS3 marker pseudoclass to allow control over
+ // the width and height of the marker box.
+ LayoutUnit bulletWidth = style()->fontMetrics().ascent() / LayoutUnit(2);
+ LayoutSize defaultObjectSize(bulletWidth, bulletWidth);
+ defaultObjectSize.scale(1 / style()->effectiveZoom());
+ m_image->updateConcreteObjectSize(defaultObjectSize);
+
LayoutSize imageSize(imageBulletSize());
setWidth(imageSize.width());
setHeight(imageSize.height());

Powered by Google App Engine
This is Rietveld 408576698