Commit 9bbb45c6 authored by dgrogan's avatar dgrogan Committed by Commit bot

[Line Layout API] Convert some SVG code to line layout API or shim

Classes outside of core/layout/ that need a reference to an InlineBox's
layoutObject must currently use the API-busting shim we've set up to
get a reference to a LineLayoutItem's underlying layoutObject.

Some references can simply be changed to lineLayoutItem() directly, where
the line layout API already provides access to the methods used.

There are no functional changes.

BUG=499321

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

Cr-Commit-Position: refs/heads/master@{#371740}
parent 18e6557c
......@@ -259,11 +259,11 @@ void SVGTextLayoutEngine::layoutCharactersInTextBoxes(InlineFlowBox* start)
for (InlineBox* child = start->firstChild(); child; child = child->nextOnLine()) {
if (child->isSVGInlineTextBox()) {
ASSERT(child->layoutObject().isSVGInlineText());
ASSERT(child->lineLayoutItem().isSVGInlineText());
layoutInlineTextBox(toSVGInlineTextBox(child));
} else {
// Skip generated content.
Node* node = child->layoutObject().node();
Node* node = child->lineLayoutItem().node();
if (!node)
continue;
......
......@@ -24,7 +24,7 @@ void SVGRootInlineBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin
bool hasSelection = !paintInfo.isPrinting() && m_svgRootInlineBox.selectionState() != SelectionNone;
PaintInfo paintInfoBeforeFiltering(paintInfo);
if (hasSelection && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfoBeforeFiltering.context, m_svgRootInlineBox.layoutObject(),
if (hasSelection && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfoBeforeFiltering.context, *LineLayoutAPIShim::constLayoutObjectFrom(m_svgRootInlineBox.lineLayoutItem()),
paintInfoBeforeFiltering.phase, paintOffset)) {
LayoutObjectDrawingRecorder recorder(paintInfoBeforeFiltering.context, *LineLayoutAPIShim::constLayoutObjectFrom(m_svgRootInlineBox.lineLayoutItem()), paintInfoBeforeFiltering.phase,
paintInfoBeforeFiltering.cullRect().m_rect, paintOffset);
......@@ -36,7 +36,7 @@ void SVGRootInlineBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin
}
}
SVGPaintContext paintContext(m_svgRootInlineBox.layoutObject(), paintInfoBeforeFiltering);
SVGPaintContext paintContext(*LineLayoutAPIShim::constLayoutObjectFrom(m_svgRootInlineBox.lineLayoutItem()), paintInfoBeforeFiltering);
if (paintContext.applyClipMaskAndFilterIfNecessary()) {
for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine())
child->paint(paintContext.paintInfo(), paintOffset, 0, 0);
......
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