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

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

Issue 14383002: Apply FINAL to the RenderObject hierarchy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, add OVERRIDEs. Created 7 years, 8 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
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | Source/core/rendering/RenderTextControl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void extractTextBox(InlineTextBox*); 48 void extractTextBox(InlineTextBox*);
49 void attachTextBox(InlineTextBox*); 49 void attachTextBox(InlineTextBox*);
50 void removeTextBox(InlineTextBox*); 50 void removeTextBox(InlineTextBox*);
51 51
52 StringImpl* text() const { return m_text.impl(); } 52 StringImpl* text() const { return m_text.impl(); }
53 String textWithoutTranscoding() const; 53 String textWithoutTranscoding() const;
54 54
55 InlineTextBox* createInlineTextBox(); 55 InlineTextBox* createInlineTextBox();
56 void dirtyLineBoxes(bool fullLayout); 56 void dirtyLineBoxes(bool fullLayout);
57 57
58 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO ffset) const; 58 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO ffset) const OVERRIDE FINAL;
59 void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsig ned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0); 59 void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsig ned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);
60 60
61 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const; 61 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRID E FINAL;
62 void absoluteQuadsForRange(Vector<FloatQuad>&, unsigned startOffset = 0, uns igned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0) ; 62 void absoluteQuadsForRange(Vector<FloatQuad>&, unsigned startOffset = 0, uns igned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0) ;
63 63
64 enum ClippingOption { NoClipping, ClipToEllipsis }; 64 enum ClippingOption { NoClipping, ClipToEllipsis };
65 void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed = 0, ClippingOption = NoClipping) const; 65 void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed = 0, ClippingOption = NoClipping) const;
66 66
67 virtual VisiblePosition positionForPoint(const LayoutPoint&); 67 virtual VisiblePosition positionForPoint(const LayoutPoint&);
68 68
69 bool is8Bit() const { return m_text.is8Bit(); } 69 bool is8Bit() const { return m_text.is8Bit(); }
70 const LChar* characters8() const { return m_text.impl()->characters8(); } 70 const LChar* characters8() const { return m_text.impl()->characters8(); }
71 const UChar* characters16() const { return m_text.impl()->characters16(); } 71 const UChar* characters16() const { return m_text.impl()->characters16(); }
(...skipping 22 matching lines...) Expand all
94 FloatPoint firstRunOrigin() const; 94 FloatPoint firstRunOrigin() const;
95 float firstRunX() const; 95 float firstRunX() const;
96 float firstRunY() const; 96 float firstRunY() const;
97 97
98 virtual void setText(PassRefPtr<StringImpl>, bool force = false); 98 virtual void setText(PassRefPtr<StringImpl>, bool force = false);
99 void setTextWithOffset(PassRefPtr<StringImpl>, unsigned offset, unsigned len , bool force = false); 99 void setTextWithOffset(PassRefPtr<StringImpl>, unsigned offset, unsigned len , bool force = false);
100 100
101 virtual void transformText(); 101 virtual void transformText();
102 102
103 virtual bool canBeSelectionLeaf() const { return true; } 103 virtual bool canBeSelectionLeaf() const { return true; }
104 virtual void setSelectionState(SelectionState s); 104 virtual void setSelectionState(SelectionState s) OVERRIDE FINAL;
105 virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* rep aintContainer, bool clipToVisibleContent = true) OVERRIDE; 105 virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* rep aintContainer, bool clipToVisibleContent = true) OVERRIDE;
106 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0); 106 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0);
107 107
108 virtual LayoutUnit marginLeft() const { return minimumValueForLength(style() ->marginLeft(), 0, view()); } 108 LayoutUnit marginLeft() const { return minimumValueForLength(style()->margin Left(), 0, view()); }
109 virtual LayoutUnit marginRight() const { return minimumValueForLength(style( )->marginRight(), 0, view()); } 109 LayoutUnit marginRight() const { return minimumValueForLength(style()->margi nRight(), 0, view()); }
110 110
111 virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObjec t* repaintContainer) const OVERRIDE; 111 virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObjec t* repaintContainer) const OVERRIDE FINAL;
112 112
113 InlineTextBox* firstTextBox() const { return m_firstTextBox; } 113 InlineTextBox* firstTextBox() const { return m_firstTextBox; }
114 InlineTextBox* lastTextBox() const { return m_lastTextBox; } 114 InlineTextBox* lastTextBox() const { return m_lastTextBox; }
115 115
116 virtual int caretMinOffset() const; 116 virtual int caretMinOffset() const;
117 virtual int caretMaxOffset() const; 117 virtual int caretMaxOffset() const;
118 virtual unsigned renderedTextLength() const; 118 unsigned renderedTextLength() const;
119 119
120 virtual int previousOffset(int current) const; 120 virtual int previousOffset(int current) const OVERRIDE FINAL;
121 virtual int previousOffsetForBackwardDeletion(int current) const; 121 virtual int previousOffsetForBackwardDeletion(int current) const OVERRIDE FI NAL;
122 virtual int nextOffset(int current) const; 122 virtual int nextOffset(int current) const OVERRIDE FINAL;
123 123
124 bool containsReversedText() const { return m_containsReversedText; } 124 bool containsReversedText() const { return m_containsReversedText; }
125 125
126 bool isSecure() const { return style()->textSecurity() != TSNONE; } 126 bool isSecure() const { return style()->textSecurity() != TSNONE; }
127 void momentarilyRevealLastTypedCharacter(unsigned lastTypedCharacterOffset); 127 void momentarilyRevealLastTypedCharacter(unsigned lastTypedCharacterOffset);
128 128
129 InlineTextBox* findNextInlineTextBox(int offset, int& pos) const; 129 InlineTextBox* findNextInlineTextBox(int offset, int& pos) const;
130 130
131 void checkConsistency() const; 131 void checkConsistency() const;
132 132
133 bool isAllCollapsibleWhitespace(); 133 bool isAllCollapsibleWhitespace();
134 134
135 bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; } 135 bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; }
136 bool knownToHaveNoOverflowAndNoFallbackFonts() const { return m_knownToHaveN oOverflowAndNoFallbackFonts; } 136 bool knownToHaveNoOverflowAndNoFallbackFonts() const { return m_knownToHaveN oOverflowAndNoFallbackFonts; }
137 137
138 void removeAndDestroyTextBoxes(); 138 void removeAndDestroyTextBoxes();
139 139
140 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; 140 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL;
141 141
142 protected: 142 protected:
143 virtual void computePreferredLogicalWidths(float leadWidth); 143 virtual void computePreferredLogicalWidths(float leadWidth);
144 virtual void willBeDestroyed(); 144 virtual void willBeDestroyed();
145 145
146 virtual void styleWillChange(StyleDifference, const RenderStyle*) { } 146 virtual void styleWillChange(StyleDifference, const RenderStyle*) OVERRIDE F INAL { }
147 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 147 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
148 148
149 virtual void setTextInternal(PassRefPtr<StringImpl>); 149 virtual void setTextInternal(PassRefPtr<StringImpl>);
150 virtual UChar previousCharacter() const; 150 virtual UChar previousCharacter() const;
151 151
152 virtual InlineTextBox* createTextBox(); // Subclassed by SVG. 152 virtual InlineTextBox* createTextBox(); // Subclassed by SVG.
153 153
154 private: 154 private:
155 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFont Data*>& fallbackFonts, GlyphOverflow&); 155 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFont Data*>& fallbackFonts, GlyphOverflow&);
156 156
157 bool computeCanUseSimpleFontCodePath() const; 157 bool computeCanUseSimpleFontCodePath() const;
158 158
159 // Make length() private so that callers that have a RenderText* 159 // Make length() private so that callers that have a RenderText*
160 // will use the more efficient textLength() instead, while 160 // will use the more efficient textLength() instead, while
161 // callers with a RenderObject* can continue to use length(). 161 // callers with a RenderObject* can continue to use length().
162 virtual unsigned length() const { return textLength(); } 162 virtual unsigned length() const OVERRIDE FINAL { return textLength(); }
163 163
164 virtual void paint(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHED(); } 164 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { ASSERT_N OT_REACHED(); }
165 virtual void layout() { ASSERT_NOT_REACHED(); } 165 virtual void layout() OVERRIDE FINAL { ASSERT_NOT_REACHED(); }
166 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation&, const LayoutPoint&, HitTestAction) OVERRIDE { ASSERT_NOT_REACHED(); return false; } 166 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation&, const LayoutPoint&, HitTestAction) OVERRIDE FINAL { ASSERT_NOT_REACH ED(); return false; }
167 167
168 void deleteTextBoxes(); 168 void deleteTextBoxes();
169 bool containsOnlyWhitespace(unsigned from, unsigned len) const; 169 bool containsOnlyWhitespace(unsigned from, unsigned len) const;
170 float widthFromCache(const Font&, int start, int len, float xPos, HashSet<co nst SimpleFontData*>* fallbackFonts, GlyphOverflow*) const; 170 float widthFromCache(const Font&, int start, int len, float xPos, HashSet<co nst SimpleFontData*>* fallbackFonts, GlyphOverflow*) const;
171 bool isAllASCII() const { return m_isAllASCII; } 171 bool isAllASCII() const { return m_isAllASCII; }
172 void updateNeedsTranscoding(); 172 void updateNeedsTranscoding();
173 173
174 void secureText(UChar mask); 174 void secureText(UChar mask);
175 175
176 // We put the bitfield first to minimize padding on 64-bit. 176 // We put the bitfield first to minimize padding on 64-bit.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 inline void RenderText::checkConsistency() const 219 inline void RenderText::checkConsistency() const
220 { 220 {
221 } 221 }
222 #endif 222 #endif
223 223
224 void applyTextTransform(const RenderStyle*, String&, UChar); 224 void applyTextTransform(const RenderStyle*, String&, UChar);
225 225
226 } // namespace WebCore 226 } // namespace WebCore
227 227
228 #endif // RenderText_h 228 #endif // RenderText_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | Source/core/rendering/RenderTextControl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698