Commit ec0f0687 authored by wkorman@chromium.org's avatar wkorman@chromium.org

Remove GlyphOverflow.computeBounds as it's no longer used for -webkit-line-box-contain.

BUG=522215

Review URL: https://codereview.chromium.org/1328803003

git-svn-id: svn://svn.chromium.org/blink/trunk@201742 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fb45ae39
......@@ -1111,8 +1111,6 @@ void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
m_lastLineLineMinWidth = currMaxWidth;
}
// TODO(wkorman): Look into potentially removing GlyphOverflow or at least the
// computeBounds field as we no longer use it for line-box-contain implementation.
GlyphOverflow glyphOverflow;
glyphOverflow.setFromBounds(glyphBounds, f.fontMetrics().floatAscent(), f.fontMetrics().floatDescent(), m_maxWidth);
// We shouldn't change our mind once we "know".
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment