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

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

Issue 1456813002: Calculate Background Image Geometries using sub-pixel values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MOAR expectations 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 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 f36302249cc85002fe72aa753044fa823212404a..49ef363a0f90771b4940dde53ae4101b1d8098fc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
@@ -65,15 +65,15 @@ LayoutListMarker* LayoutListMarker::createAnonymous(LayoutListItem* item)
return layoutObject;
}
-IntSize LayoutListMarker::imageBulletSize() const
+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.
- int bulletWidth = style()->fontMetrics().ascent() / 2;
- IntSize defaultBulletSize(bulletWidth, bulletWidth);
+ LayoutUnit bulletWidth = style()->fontMetrics().ascent() / LayoutUnit(2);
+ LayoutSize defaultBulletSize(bulletWidth, bulletWidth);
return calculateImageIntrinsicDimensions(m_image.get(), defaultBulletSize, DoNotScaleByEffectiveZoom);
}
@@ -164,7 +164,7 @@ void LayoutListMarker::imageChanged(WrappedImagePtr o, const IntRect*)
if (o != m_image->data())
return;
- LayoutSize imageSize = isImage() ? LayoutSize(imageBulletSize()) : LayoutSize();
+ LayoutSize imageSize = isImage() ? imageBulletSize() : LayoutSize();
if (size() != imageSize || m_image->errorOccurred())
setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::ImageChanged);
else
@@ -402,7 +402,7 @@ bool LayoutListMarker::isInside() const
IntRect LayoutListMarker::getRelativeMarkerRect() const
{
if (isImage()) {
- IntSize imageSize = imageBulletSize();
+ IntSize imageSize = flooredIntSize(imageBulletSize());
return IntRect(0, 0, imageSize.width(), imageSize.height());
}

Powered by Google App Engine
This is Rietveld 408576698