Commit d091f908 authored by jbroman@chromium.org's avatar jbroman@chromium.org

Move RenderTextInfo and WordMeasurement into their own headers.

They don't really belong in their current headers, and it's confusing.
For example, RenderInfo is defined in LineBreaker.h and its constructor
and destructor are defined in RenderBlockLineLayout.cpp.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176057 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6cc5b6a3
......@@ -35,6 +35,8 @@
#include "core/rendering/line/BreakingContextInlineHeaders.h"
#include "core/rendering/line/LineLayoutState.h"
#include "core/rendering/line/LineWidth.h"
#include "core/rendering/line/RenderTextInfo.h"
#include "core/rendering/line/WordMeasurement.h"
#include "core/rendering/svg/SVGRootInlineBox.h"
#include "platform/fonts/Character.h"
#include "platform/text/BidiResolver.h"
......@@ -918,16 +920,6 @@ void RenderBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState)
repaintDirtyFloats(layoutState.floats());
}
RenderTextInfo::RenderTextInfo()
: m_text(0)
, m_font(0)
{
}
RenderTextInfo::~RenderTextInfo()
{
}
// Before restarting the layout loop with a new logicalHeight, remove all floats that were added and reset the resolver.
inline const InlineIterator& RenderBlockFlow::restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogicalHeight, LayoutUnit newLogicalHeight, FloatingObject* lastFloatFromPreviousLine, InlineBidiResolver& resolver, const InlineIterator& oldEnd)
{
......
......@@ -35,7 +35,9 @@
#include "core/rendering/line/LineBreaker.h"
#include "core/rendering/line/LineInfo.h"
#include "core/rendering/line/LineWidth.h"
#include "core/rendering/line/RenderTextInfo.h"
#include "core/rendering/line/TrailingObjects.h"
#include "core/rendering/line/WordMeasurement.h"
#include "core/rendering/svg/RenderSVGInlineText.h"
namespace WebCore {
......@@ -43,23 +45,6 @@ namespace WebCore {
// We don't let our line box tree for a single line get any deeper than this.
const unsigned cMaxLineDepth = 200;
class WordMeasurement {
public:
WordMeasurement()
: renderer(0)
, width(0)
, startOffset(0)
, endOffset(0)
{
}
RenderText* renderer;
float width;
int startOffset;
int endOffset;
HashSet<const SimpleFontData*> fallbackFonts;
};
class BreakingContext {
public:
BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidth& lineWidth, RenderTextInfo& inRenderTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, RenderBlockFlow* block)
......
......@@ -25,23 +25,13 @@
#include "core/rendering/InlineIterator.h"
#include "core/rendering/line/LineInfo.h"
#include "platform/text/TextBreakIterator.h"
#include "wtf/Vector.h"
namespace WebCore {
enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
class RenderText;
struct RenderTextInfo {
RenderTextInfo();
~RenderTextInfo();
RenderText* m_text;
LazyLineBreakIterator m_lineBreakIterator;
const Font* m_font;
};
struct RenderTextInfo;
class LineBreaker {
public:
......
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef RenderTextInfo_h
#define RenderTextInfo_h
#include "platform/text/TextBreakIterator.h"
namespace WebCore {
class Font;
class RenderText;
struct RenderTextInfo {
RenderTextInfo()
: m_text(0)
, m_font(0)
{
}
RenderText* m_text;
LazyLineBreakIterator m_lineBreakIterator;
const Font* m_font;
};
} // namespace WebCore
#endif // RenderTextInfo_h
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2013 Adobe Systems Incorporated.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef WordMeasurement_h
#define WordMeasurement_h
#include "platform/fonts/SimpleFontData.h"
#include "wtf/HashSet.h"
namespace WebCore {
class RenderText;
class WordMeasurement {
public:
WordMeasurement()
: renderer(0)
, width(0)
, startOffset(0)
, endOffset(0)
{
}
RenderText* renderer;
float width;
int startOffset;
int endOffset;
HashSet<const SimpleFontData*> fallbackFonts;
};
} // namespace WebCore
#endif // WordMeasurement_h
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