Commit 0e4d62e4 authored by eae@chromium.org's avatar eae@chromium.org

Have BidiRunList destructor delete runs

Have the BidiRunList destructor delete all runs and change all
BidiRunList call sites, except RenderBlockLineLayout, to rely on the
destructor instead of explicit calls to deleteRuns.

In RenderBlockFlow::layoutRunsAndFloatsInRange deleteRuns is called
early, and explicitly, in two places. Removing these calls would likely
involve splitting the run list of changing the life time of it.

BUG=396963
R=dglazkov@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@179177 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent cf62ba45
......@@ -821,7 +821,10 @@ void RenderBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
renderTextInfo.m_lineBreakIterator.resetPriorContext();
if (resolver.position().atEnd()) {
// FIXME: We shouldn't be creating any runs in nextLineBreak to begin with!
// Once BidiRunList is separated from BidiResolver this will not be needed.
// Figure out why we create new runs in nextLineBreak and why we
// seem to rely on that behavior.
// Removing the addRun calls in LineBreaker::skipLeadingWhitespace
// breaks a bunch of bidi layout tests.
bidiRuns.deleteRuns();
resolver.markCurrentRunEmpty(); // FIXME: This can probably be replaced by an ASSERT (or just removed).
layoutState.setCheckForFloatsFromLastLine(true);
......
......@@ -1112,8 +1112,6 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si
lastWordBoundary++;
}
}
if (run)
bidiRuns.deleteRuns();
if (firstGlyphLeftOverflow > 0)
glyphOverflow.left = firstGlyphLeftOverflow;
......
......@@ -40,7 +40,6 @@ namespace blink {
class SVGTextMetricsCalculator {
public:
SVGTextMetricsCalculator(RenderSVGInlineText*);
~SVGTextMetricsCalculator();
SVGTextMetrics computeMetricsForCharacter(unsigned textPosition);
unsigned textLength() const { return static_cast<unsigned>(m_run.charactersLength()); }
......@@ -90,11 +89,6 @@ SVGTextMetricsCalculator::SVGTextMetricsCalculator(RenderSVGInlineText* text)
setupBidiRuns();
}
SVGTextMetricsCalculator::~SVGTextMetricsCalculator()
{
m_bidiRuns.deleteRuns();
}
void SVGTextMetricsCalculator::setupBidiRuns()
{
RenderStyle* style = m_text->style();
......
......@@ -984,8 +984,6 @@ void GraphicsContext::drawBidiText(const Font& font, const TextRunPaintInfo& run
if (bidiRun)
currPoint.move(font.width(subrun), 0);
}
bidiRuns.deleteRuns();
}
void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to)
......
......@@ -240,7 +240,6 @@ void BidiTestRunner::runTest(const std::basic_string<UChar>& input, const std::v
break;
}
}
runs.deleteRuns();
}
......
......@@ -40,8 +40,7 @@ public:
{
}
// FIXME: Once BidiResolver no longer owns the BidiRunList,
// then ~BidiRunList should call deleteRuns() automatically.
~BidiRunList() { deleteRuns(); }
Run* firstRun() const { return m_firstRun; }
Run* lastRun() const { return m_lastRun; }
......
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