OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004-2009, 2013 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004-2009, 2013 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 float firstRunX() const; | 107 float firstRunX() const; |
108 float firstRunY() const; | 108 float firstRunY() const; |
109 | 109 |
110 virtual void setText(PassRefPtr<StringImpl>, bool force = false); | 110 virtual void setText(PassRefPtr<StringImpl>, bool force = false); |
111 void setTextWithOffset(PassRefPtr<StringImpl>, unsigned offset, unsigned len
, bool force = false); | 111 void setTextWithOffset(PassRefPtr<StringImpl>, unsigned offset, unsigned len
, bool force = false); |
112 | 112 |
113 virtual void transformText(); | 113 virtual void transformText(); |
114 | 114 |
115 virtual bool canBeSelectionLeaf() const override { return true; } | 115 virtual bool canBeSelectionLeaf() const override { return true; } |
116 virtual void setSelectionState(SelectionState) override final; | 116 virtual void setSelectionState(SelectionState) override final; |
117 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer) const override; | 117 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutLayerModelO
bject* paintInvalidationContainer) const override; |
118 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override; | 118 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override; |
119 | 119 |
120 InlineTextBox* firstTextBox() const { return m_firstTextBox; } | 120 InlineTextBox* firstTextBox() const { return m_firstTextBox; } |
121 InlineTextBox* lastTextBox() const { return m_lastTextBox; } | 121 InlineTextBox* lastTextBox() const { return m_lastTextBox; } |
122 | 122 |
123 virtual int caretMinOffset() const override; | 123 virtual int caretMinOffset() const override; |
124 virtual int caretMaxOffset() const override; | 124 virtual int caretMaxOffset() const override; |
125 unsigned renderedTextLength() const; | 125 unsigned renderedTextLength() const; |
126 | 126 |
127 virtual int previousOffset(int current) const override final; | 127 virtual int previousOffset(int current) const override final; |
(...skipping 15 matching lines...) Expand all Loading... |
143 | 143 |
144 protected: | 144 protected: |
145 virtual void willBeDestroyed() override; | 145 virtual void willBeDestroyed() override; |
146 | 146 |
147 virtual void styleWillChange(StyleDifference, const RenderStyle&) override f
inal { } | 147 virtual void styleWillChange(StyleDifference, const RenderStyle&) override f
inal { } |
148 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; | 148 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
149 | 149 |
150 virtual void setTextInternal(PassRefPtr<StringImpl>); | 150 virtual void setTextInternal(PassRefPtr<StringImpl>); |
151 virtual UChar previousCharacter() const; | 151 virtual UChar previousCharacter() const; |
152 | 152 |
153 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur
rentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) cons
t override; | 153 virtual void addLayerHitTestRects(LayerHitTestRects&, const Layer* currentLa
yer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const over
ride; |
154 | 154 |
155 virtual InlineTextBox* createTextBox(int start, unsigned short length); // S
ubclassed by SVG. | 155 virtual InlineTextBox* createTextBox(int start, unsigned short length); // S
ubclassed by SVG. |
156 | 156 |
157 virtual void invalidateDisplayItemClients(DisplayItemList*) const override; | 157 virtual void invalidateDisplayItemClients(DisplayItemList*) const override; |
158 | 158 |
159 private: | 159 private: |
160 void computePreferredLogicalWidths(float leadWidth); | 160 void computePreferredLogicalWidths(float leadWidth); |
161 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFont
Data*>& fallbackFonts, GlyphOverflow&); | 161 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFont
Data*>& fallbackFonts, GlyphOverflow&); |
162 | 162 |
163 bool computeCanUseSimpleFontCodePath() const; | 163 bool computeCanUseSimpleFontCodePath() const; |
164 | 164 |
165 // Make length() private so that callers that have a RenderText* | 165 // Make length() private so that callers that have a RenderText* |
166 // will use the more efficient textLength() instead, while | 166 // will use the more efficient textLength() instead, while |
167 // callers with a RenderObject* can continue to use length(). | 167 // callers with a RenderObject* can continue to use length(). |
168 virtual unsigned length() const override final { return textLength(); } | 168 virtual unsigned length() const override final { return textLength(); } |
169 | 169 |
170 virtual void paint(const PaintInfo&, const LayoutPoint&) override final { AS
SERT_NOT_REACHED(); } | 170 virtual void paint(const PaintInfo&, const LayoutPoint&) override final { AS
SERT_NOT_REACHED(); } |
171 virtual void layout() override final { ASSERT_NOT_REACHED(); } | 171 virtual void layout() override final { ASSERT_NOT_REACHED(); } |
172 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation&, const LayoutPoint&, HitTestAction) override final { ASSERT_NOT_REACH
ED(); return false; } | 172 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation&, const LayoutPoint&, HitTestAction) override final { ASSERT_NOT_REACH
ED(); return false; } |
173 | 173 |
174 void deleteTextBoxes(); | 174 void deleteTextBoxes(); |
175 bool containsOnlyWhitespace(unsigned from, unsigned len) const; | 175 bool containsOnlyWhitespace(unsigned from, unsigned len) const; |
176 float widthFromCache(const Font&, int start, int len, float xPos, TextDirect
ion, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const; | 176 float widthFromCache(const Font&, int start, int len, float xPos, TextDirect
ion, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const; |
177 bool isAllASCII() const { return m_isAllASCII; } | 177 bool isAllASCII() const { return m_isAllASCII; } |
178 | 178 |
179 void secureText(UChar mask); | 179 void secureText(UChar mask); |
180 | 180 |
181 bool isText() const = delete; // This will catch anyone doing an unnecessary
check. | 181 bool isText() const = delete; // This will catch anyone doing an unnecessary
check. |
182 | 182 |
183 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t override; | 183 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutLayer
ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons
t override; |
184 | 184 |
185 void checkConsistency() const; | 185 void checkConsistency() const; |
186 | 186 |
187 // We put the bitfield first to minimize padding on 64-bit. | 187 // We put the bitfield first to minimize padding on 64-bit. |
188 bool m_hasBreakableChar : 1; // Whether or not we can be broken into multipl
e lines. | 188 bool m_hasBreakableChar : 1; // Whether or not we can be broken into multipl
e lines. |
189 bool m_hasBreak : 1; // Whether or not we have a hard break (e.g., <pre> wit
h '\n'). | 189 bool m_hasBreak : 1; // Whether or not we have a hard break (e.g., <pre> wit
h '\n'). |
190 bool m_hasTab : 1; // Whether or not we have a variable width tab character
(e.g., <pre> with '\t'). | 190 bool m_hasTab : 1; // Whether or not we have a variable width tab character
(e.g., <pre> with '\t'). |
191 bool m_hasBreakableStart : 1; | 191 bool m_hasBreakableStart : 1; |
192 bool m_hasBreakableEnd : 1; | 192 bool m_hasBreakableEnd : 1; |
193 bool m_hasEndWhiteSpace : 1; | 193 bool m_hasEndWhiteSpace : 1; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 inline RenderText* Text::renderer() const | 236 inline RenderText* Text::renderer() const |
237 { | 237 { |
238 return toRenderText(CharacterData::renderer()); | 238 return toRenderText(CharacterData::renderer()); |
239 } | 239 } |
240 | 240 |
241 void applyTextTransform(const RenderStyle*, String&, UChar); | 241 void applyTextTransform(const RenderStyle*, String&, UChar); |
242 | 242 |
243 } // namespace blink | 243 } // namespace blink |
244 | 244 |
245 #endif // RenderText_h | 245 #endif // RenderText_h |
OLD | NEW |