Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: Source/core/rendering/RenderText.h

Issue 104813005: Explicitly set text direction for TextRuns (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use BidiResolver in RenderText Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 *
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const LChar* characters8() const { return m_text.impl()->characters8(); } 76 const LChar* characters8() const { return m_text.impl()->characters8(); }
77 const UChar* characters16() const { return m_text.impl()->characters16(); } 77 const UChar* characters16() const { return m_text.impl()->characters16(); }
78 bool hasEmptyText() const { return m_text.isEmpty(); } 78 bool hasEmptyText() const { return m_text.isEmpty(); }
79 String substring(unsigned position, unsigned length) const { return m_text.s ubstring(position, length); } 79 String substring(unsigned position, unsigned length) const { return m_text.s ubstring(position, length); }
80 UChar characterAt(unsigned) const; 80 UChar characterAt(unsigned) const;
81 UChar uncheckedCharacterAt(unsigned) const; 81 UChar uncheckedCharacterAt(unsigned) const;
82 UChar operator[](unsigned i) const { return uncheckedCharacterAt(i); } 82 UChar operator[](unsigned i) const { return uncheckedCharacterAt(i); }
83 unsigned textLength() const { return m_text.length(); } // non virtual imple mentation of length() 83 unsigned textLength() const { return m_text.length(); } // non virtual imple mentation of length()
84 void positionLineBox(InlineBox*); 84 void positionLineBox(InlineBox*);
85 85
86 virtual float width(unsigned from, unsigned len, const Font&, float xPos, Ha shSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 86 virtual float width(unsigned from, unsigned len, const Font&, float xPos, Te xtDirection, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
87 virtual float width(unsigned from, unsigned len, float xPos, bool firstLine = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 87 virtual float width(unsigned from, unsigned len, float xPos, TextDirection, bool firstLine = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, Glyph Overflow* = 0) const;
88 88
89 float minLogicalWidth() const; 89 float minLogicalWidth() const;
90 float maxLogicalWidth() const; 90 float maxLogicalWidth() const;
91 91
92 void trimmedPrefWidths(float leadWidth, 92 void trimmedPrefWidths(float leadWidth,
93 float& firstLineMinWidth, bool& hasBreakableStart, 93 float& firstLineMinWidth, bool& hasBreakableStart,
94 float& lastLineMinWidth, bool& hasBreakableEnd, 94 float& lastLineMinWidth, bool& hasBreakableEnd,
95 bool& hasBreakableChar, bool& hasBreak, 95 bool& hasBreakableChar, bool& hasBreak,
96 float& firstLineMaxWidth, float& lastLineMaxWidth, 96 float& firstLineMaxWidth, float& lastLineMaxWidth,
97 float& minWidth, float& maxWidth, bool& stripFrontSpaces); 97 float& minWidth, float& maxWidth, bool& stripFrontSpaces);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // will use the more efficient textLength() instead, while 170 // will use the more efficient textLength() instead, while
171 // callers with a RenderObject* can continue to use length(). 171 // callers with a RenderObject* can continue to use length().
172 virtual unsigned length() const OVERRIDE FINAL { return textLength(); } 172 virtual unsigned length() const OVERRIDE FINAL { return textLength(); }
173 173
174 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { ASSERT_N OT_REACHED(); } 174 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { ASSERT_N OT_REACHED(); }
175 virtual void layout() OVERRIDE FINAL { ASSERT_NOT_REACHED(); } 175 virtual void layout() OVERRIDE FINAL { ASSERT_NOT_REACHED(); }
176 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation&, const LayoutPoint&, HitTestAction) OVERRIDE FINAL { ASSERT_NOT_REACH ED(); return false; } 176 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation&, const LayoutPoint&, HitTestAction) OVERRIDE FINAL { ASSERT_NOT_REACH ED(); return false; }
177 177
178 void deleteTextBoxes(); 178 void deleteTextBoxes();
179 bool containsOnlyWhitespace(unsigned from, unsigned len) const; 179 bool containsOnlyWhitespace(unsigned from, unsigned len) const;
180 float widthFromCache(const Font&, int start, int len, float xPos, HashSet<co nst SimpleFontData*>* fallbackFonts, GlyphOverflow*) const; 180 float widthFromCache(const Font&, int start, int len, float xPos, TextDirect ion, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*) const;
181 bool isAllASCII() const { return m_isAllASCII; } 181 bool isAllASCII() const { return m_isAllASCII; }
182 182
183 void secureText(UChar mask); 183 void secureText(UChar mask);
184 184
185 // We put the bitfield first to minimize padding on 64-bit. 185 // We put the bitfield first to minimize padding on 64-bit.
186 bool m_hasBreakableChar : 1; // Whether or not we can be broken into multipl e lines. 186 bool m_hasBreakableChar : 1; // Whether or not we can be broken into multipl e lines.
187 bool m_hasBreak : 1; // Whether or not we have a hard break (e.g., <pre> wit h '\n'). 187 bool m_hasBreak : 1; // Whether or not we have a hard break (e.g., <pre> wit h '\n').
188 bool m_hasTab : 1; // Whether or not we have a variable width tab character (e.g., <pre> with '\t'). 188 bool m_hasTab : 1; // Whether or not we have a variable width tab character (e.g., <pre> with '\t').
189 bool m_hasBreakableStart : 1; 189 bool m_hasBreakableStart : 1;
190 bool m_hasBreakableEnd : 1; 190 bool m_hasBreakableEnd : 1;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 inline void RenderText::checkConsistency() const 229 inline void RenderText::checkConsistency() const
230 { 230 {
231 } 231 }
232 #endif 232 #endif
233 233
234 void applyTextTransform(const RenderStyle*, String&, UChar); 234 void applyTextTransform(const RenderStyle*, String&, UChar);
235 235
236 } // namespace WebCore 236 } // namespace WebCore
237 237
238 #endif // RenderText_h 238 #endif // RenderText_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698