Chromium Code Reviews| 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, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. |
| 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #ifndef RenderText_h | 23 #ifndef RenderText_h |
| 24 #define RenderText_h | 24 #define RenderText_h |
| 25 | 25 |
| 26 #include "core/rendering/RenderObject.h" | 26 #include "core/rendering/RenderObject.h" |
| 27 #include "platform/text/TextPath.h" | |
| 27 #include "wtf/Forward.h" | 28 #include "wtf/Forward.h" |
| 28 #include "wtf/PassRefPtr.h" | 29 #include "wtf/PassRefPtr.h" |
| 29 | 30 |
| 30 namespace WebCore { | 31 namespace WebCore { |
| 31 | 32 |
| 32 class AbstractInlineTextBox; | 33 class AbstractInlineTextBox; |
| 33 class InlineTextBox; | 34 class InlineTextBox; |
| 34 | 35 |
| 35 class RenderText : public RenderObject { | 36 class RenderText : public RenderObject { |
| 36 public: | 37 public: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 InlineTextBox* findNextInlineTextBox(int offset, int& pos) const; | 137 InlineTextBox* findNextInlineTextBox(int offset, int& pos) const; |
| 137 | 138 |
| 138 void checkConsistency() const; | 139 void checkConsistency() const; |
| 139 | 140 |
| 140 bool isAllCollapsibleWhitespace() const; | 141 bool isAllCollapsibleWhitespace() const; |
| 141 | 142 |
| 142 bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; } | 143 bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; } |
| 143 bool knownToHaveNoOverflowAndNoFallbackFonts() const { return m_knownToHaveN oOverflowAndNoFallbackFonts; } | 144 bool knownToHaveNoOverflowAndNoFallbackFonts() const { return m_knownToHaveN oOverflowAndNoFallbackFonts; } |
| 144 | 145 |
| 145 void removeAndDestroyTextBoxes(); | 146 void removeAndDestroyTextBoxes(); |
| 147 CodePath getCodePath() const { return m_textCodePath;} | |
|
eseidel
2013/12/27 04:36:45
Blink doesn't prefix simple getters with "get"
eae
2013/12/30 19:29:14
Like Eric said, this should be "CodePath codePath(
h.joshi
2013/12/31 06:07:43
Yes I have fixed this will update code soon with f
| |
| 146 | 148 |
| 147 PassRefPtr<AbstractInlineTextBox> firstAbstractInlineTextBox(); | 149 PassRefPtr<AbstractInlineTextBox> firstAbstractInlineTextBox(); |
| 148 | 150 |
| 149 protected: | 151 protected: |
| 150 virtual void computePreferredLogicalWidths(float leadWidth); | 152 virtual void computePreferredLogicalWidths(float leadWidth); |
| 151 virtual void willBeDestroyed(); | 153 virtual void willBeDestroyed(); |
| 152 | 154 |
| 153 virtual void styleWillChange(StyleDifference, const RenderStyle*) OVERRIDE F INAL { } | 155 virtual void styleWillChange(StyleDifference, const RenderStyle*) OVERRIDE F INAL { } |
| 154 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 156 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
| 155 | 157 |
| 156 virtual void setTextInternal(PassRefPtr<StringImpl>); | 158 virtual void setTextInternal(PassRefPtr<StringImpl>); |
| 157 virtual UChar previousCharacter() const; | 159 virtual UChar previousCharacter() const; |
| 158 | 160 |
| 159 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur rentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) cons t OVERRIDE; | 161 virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer* cur rentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) cons t OVERRIDE; |
| 160 | 162 |
| 161 virtual InlineTextBox* createTextBox(); // Subclassed by SVG. | 163 virtual InlineTextBox* createTextBox(); // Subclassed by SVG. |
| 162 | 164 |
| 163 private: | 165 private: |
| 164 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFont Data*>& fallbackFonts, GlyphOverflow&); | 166 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFont Data*>& fallbackFonts, GlyphOverflow&); |
| 165 | 167 |
| 166 bool computeCanUseSimpleFontCodePath() const; | 168 bool computeCanUseSimpleFontCodePath(); |
| 167 | 169 |
| 168 // Make length() private so that callers that have a RenderText* | 170 // Make length() private so that callers that have a RenderText* |
| 169 // will use the more efficient textLength() instead, while | 171 // will use the more efficient textLength() instead, while |
| 170 // callers with a RenderObject* can continue to use length(). | 172 // callers with a RenderObject* can continue to use length(). |
| 171 virtual unsigned length() const OVERRIDE FINAL { return textLength(); } | 173 virtual unsigned length() const OVERRIDE FINAL { return textLength(); } |
| 172 | 174 |
| 173 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { ASSERT_N OT_REACHED(); } | 175 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { ASSERT_N OT_REACHED(); } |
| 174 virtual void layout() OVERRIDE FINAL { ASSERT_NOT_REACHED(); } | 176 virtual void layout() OVERRIDE FINAL { ASSERT_NOT_REACHED(); } |
| 175 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation&, const LayoutPoint&, HitTestAction) OVERRIDE FINAL { ASSERT_NOT_REACH ED(); return false; } | 177 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation&, const LayoutPoint&, HitTestAction) OVERRIDE FINAL { ASSERT_NOT_REACH ED(); return false; } |
| 176 | 178 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 199 | 201 |
| 200 float m_minWidth; | 202 float m_minWidth; |
| 201 float m_maxWidth; | 203 float m_maxWidth; |
| 202 float m_firstLineMinWidth; | 204 float m_firstLineMinWidth; |
| 203 float m_lastLineLineMinWidth; | 205 float m_lastLineLineMinWidth; |
| 204 | 206 |
| 205 String m_text; | 207 String m_text; |
| 206 | 208 |
| 207 InlineTextBox* m_firstTextBox; | 209 InlineTextBox* m_firstTextBox; |
| 208 InlineTextBox* m_lastTextBox; | 210 InlineTextBox* m_lastTextBox; |
| 211 | |
| 212 CodePath m_textCodePath; | |
| 209 }; | 213 }; |
| 210 | 214 |
| 211 inline UChar RenderText::uncheckedCharacterAt(unsigned i) const | 215 inline UChar RenderText::uncheckedCharacterAt(unsigned i) const |
| 212 { | 216 { |
| 213 ASSERT_WITH_SECURITY_IMPLICATION(i < textLength()); | 217 ASSERT_WITH_SECURITY_IMPLICATION(i < textLength()); |
| 214 return is8Bit() ? characters8()[i] : characters16()[i]; | 218 return is8Bit() ? characters8()[i] : characters16()[i]; |
| 215 } | 219 } |
| 216 | 220 |
| 217 inline UChar RenderText::characterAt(unsigned i) const | 221 inline UChar RenderText::characterAt(unsigned i) const |
| 218 { | 222 { |
| 219 if (i >= textLength()) | 223 if (i >= textLength()) |
| 220 return 0; | 224 return 0; |
| 221 | 225 |
| 222 return uncheckedCharacterAt(i); | 226 return uncheckedCharacterAt(i); |
| 223 } | 227 } |
| 224 | 228 |
| 225 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderText, isText()); | 229 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderText, isText()); |
| 226 | 230 |
| 227 #ifdef NDEBUG | 231 #ifdef NDEBUG |
| 228 inline void RenderText::checkConsistency() const | 232 inline void RenderText::checkConsistency() const |
| 229 { | 233 { |
| 230 } | 234 } |
| 231 #endif | 235 #endif |
| 232 | 236 |
| 233 void applyTextTransform(const RenderStyle*, String&, UChar); | 237 void applyTextTransform(const RenderStyle*, String&, UChar); |
| 234 | 238 |
| 235 } // namespace WebCore | 239 } // namespace WebCore |
| 236 | 240 |
| 237 #endif // RenderText_h | 241 #endif // RenderText_h |
| OLD | NEW |