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

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

Issue 20681004: Make first-letter style to work with editing Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-08-01T17:57:42 Created 7 years, 4 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 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 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 25 matching lines...) Expand all
36 RenderTextFragment(Node*, StringImpl*, int startOffset, int length); 36 RenderTextFragment(Node*, StringImpl*, int startOffset, int length);
37 RenderTextFragment(Node*, StringImpl*); 37 RenderTextFragment(Node*, StringImpl*);
38 virtual ~RenderTextFragment(); 38 virtual ~RenderTextFragment();
39 39
40 virtual bool isTextFragment() const { return true; } 40 virtual bool isTextFragment() const { return true; }
41 41
42 virtual bool canBeSelectionLeaf() const OVERRIDE { return node() && node()-> rendererIsEditable(); } 42 virtual bool canBeSelectionLeaf() const OVERRIDE { return node() && node()-> rendererIsEditable(); }
43 43
44 unsigned start() const { return m_start; } 44 unsigned start() const { return m_start; }
45 unsigned end() const { return m_end; } 45 unsigned end() const { return m_end; }
46 virtual unsigned textStartOffset() const OVERRIDE { return start(); }
46 47
47 RenderObject* firstLetter() const { return m_firstLetter; } 48 RenderObject* firstLetter() const { return m_firstLetter; }
48 void setFirstLetter(RenderObject* firstLetter) { m_firstLetter = firstLetter ; } 49 void setFirstLetter(RenderObject* firstLetter) { m_firstLetter = firstLetter ; }
50 RenderText* firstRenderTextInFirstLetter() const;
49 51
50 StringImpl* contentString() const { return m_contentString.get(); } 52 StringImpl* contentString() const { return m_contentString.get(); }
51 virtual PassRefPtr<StringImpl> originalText() const; 53 virtual PassRefPtr<StringImpl> originalText() const;
52 54
53 virtual void setText(PassRefPtr<StringImpl>, bool force = false) OVERRIDE; 55 virtual void setText(PassRefPtr<StringImpl>, bool force = false) OVERRIDE;
54 56
55 virtual void transformText() OVERRIDE; 57 virtual void transformText() OVERRIDE;
56 58
57 protected: 59 protected:
58 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 60 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
59 61
60 private: 62 private:
61 virtual void willBeDestroyed(); 63 virtual void willBeDestroyed();
62 64
63 virtual UChar previousCharacter() const; 65 virtual UChar previousCharacter() const;
64 RenderBlock* blockForAccompanyingFirstLetter() const; 66 RenderBlock* blockForAccompanyingFirstLetter() const;
67 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&);
tkent 2013/08/02 02:22:19 nit: OVERRIDE
yosin_UTC9 2013/08/02 05:01:55 Done.
65 68
66 unsigned m_start; 69 unsigned m_start;
67 unsigned m_end; 70 unsigned m_end;
68 RefPtr<StringImpl> m_contentString; 71 RefPtr<StringImpl> m_contentString;
69 RenderObject* m_firstLetter; 72 RenderObject* m_firstLetter;
70 }; 73 };
71 74
72 inline RenderTextFragment* toRenderTextFragment(RenderObject* object) 75 inline RenderTextFragment* toRenderTextFragment(RenderObject* object)
73 { 76 {
74 ASSERT_WITH_SECURITY_IMPLICATION(!object || toRenderText(object)->isTextFrag ment()); 77 ASSERT_WITH_SECURITY_IMPLICATION(!object || toRenderText(object)->isTextFrag ment());
75 return static_cast<RenderTextFragment*>(object); 78 return static_cast<RenderTextFragment*>(object);
76 } 79 }
77 80
78 inline const RenderTextFragment* toRenderTextFragment(const RenderObject* object ) 81 inline const RenderTextFragment* toRenderTextFragment(const RenderObject* object )
79 { 82 {
80 ASSERT_WITH_SECURITY_IMPLICATION(!object || toRenderText(object)->isTextFrag ment()); 83 ASSERT_WITH_SECURITY_IMPLICATION(!object || toRenderText(object)->isTextFrag ment());
81 return static_cast<const RenderTextFragment*>(object); 84 return static_cast<const RenderTextFragment*>(object);
82 } 85 }
83 86
84 // This will catch anyone doing an unnecessary cast. 87 // This will catch anyone doing an unnecessary cast.
85 void toRenderTextFragment(const RenderTextFragment*); 88 void toRenderTextFragment(const RenderTextFragment*);
86 89
87 } // namespace WebCore 90 } // namespace WebCore
88 91
89 #endif // RenderTextFragment_h 92 #endif // RenderTextFragment_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698