/* * (C) 1999 Lars Knoll ([email protected]) * (C) 2000 Dirk Mueller ([email protected]) * Copyright (C) 2004-2009, 2013 Apple 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 THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_TEXT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_TEXT_H_ #include <iterator> #include "base/check_op.h" #include "base/dcheck_is_on.h" #include "base/memory/scoped_refptr.h" #include "base/notreached.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/text.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_span.h" #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/platform/geometry/length_functions.h" #include "third_party/blink/renderer/platform/graphics/dom_node_id.h" #include "third_party/blink/renderer/platform/wtf/forward.h" namespace blink { class AbstractInlineTextBox; class ContentCaptureManager; class OffsetMapping; struct InlineItemsData; struct InlineItemSpan; struct TextDiffRange; struct VariableLengthTransformResult; // LayoutText is the root class for anything that represents // a text node (see core/dom/text.h). // // This is a common node in the tree so to the limit memory overhead, // this class inherits directly from LayoutObject. // Also this class is used by both CSS and SVG layouts so LayoutObject // was a natural choice. // // The actual layout of text is handled by the containing inline // (LayoutInline) or block (LayoutBlockFlow). They will invoke the Unicode // Bidirectional Algorithm to break the text into actual lines. // The result of layout is the line box tree, which represents lines // on the screen. It is stored into m_firstTextBox and m_lastTextBox. // To understand how lines are broken by the bidi algorithm, read e.g. // LayoutBlockFlow::LayoutInlineChildren. // // The previous comment applies also for painting. See e.g. // BlockFlowPainter::paintContents in particular the use of LineBoxListPainter. class CORE_EXPORT LayoutText : public LayoutObject { … }; inline wtf_size_t LayoutText::FirstInlineFragmentItemIndex() const { … } inline void LayoutText::DetachAbstractInlineTextBoxesIfNeeded() { … } template <> struct DowncastTraits<LayoutText> { … }; inline LayoutText* Text::GetLayoutObject() const { … } } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_TEXT_H_