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

Unified Diff: Source/core/layout/line/GlyphOverflow.h

Issue 1328803003: Remove GlyphOverflow.computeBounds as it's no longer used for -webkit-line-box-contain. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/GlyphOverflow.h
diff --git a/Source/core/layout/line/GlyphOverflow.h b/Source/core/layout/line/GlyphOverflow.h
index 28c8005eada518c1e821143a88f3c6b32e6cb308..f13382f1327e7e476c88e6c15ee4440be7134370 100644
--- a/Source/core/layout/line/GlyphOverflow.h
+++ b/Source/core/layout/line/GlyphOverflow.h
@@ -27,7 +27,7 @@
#include "platform/geometry/FloatRect.h"
#include "wtf/Allocator.h"
-#include <math.h>
+#include <algorithm>
namespace blink {
@@ -38,7 +38,6 @@ struct GlyphOverflow {
, right(0)
, top(0)
, bottom(0)
- , computeBounds(false)
{
}
@@ -49,21 +48,19 @@ struct GlyphOverflow {
void setFromBounds(const FloatRect& bounds, float ascent, float descent, float textWidth)
{
- top = ceilf(computeBounds ? -bounds.y() : std::max(0.0f, -bounds.y() - ascent));
- bottom = ceilf(computeBounds ? bounds.maxY() : std::max(0.0f, bounds.maxY() - descent));
+ top = ceilf(std::max(0.0f, -bounds.y() - ascent));
+ bottom = ceilf(std::max(0.0f, bounds.maxY() - descent));
left = ceilf(std::max(0.0f, -bounds.x()));
right = ceilf(std::max(0.0f, bounds.maxX() - textWidth));
}
- // If computeBounds, top and bottom are the maximum heights of the glyphs above and below the baseline, respectively.
- // Otherwise they are the amounts of glyph overflows exceeding the font metrics' ascent and descent, respectively.
+ // Top and bottom are the amounts of glyph overflows exceeding the font metrics' ascent and descent, respectively.
// Left and right are the amounts of glyph overflows exceeding the left and right edge of normal layout boundary, respectively.
// All fields are in absolute number of pixels rounded up to the nearest integer.
int left;
int right;
int top;
int bottom;
- bool computeBounds;
};
} // namespace blink
« no previous file with comments | « Source/core/layout/LayoutText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698