OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 26 matching lines...) Expand all Loading... |
37 void attachQuote(); | 37 void attachQuote(); |
38 void detachQuote(); | 38 void detachQuote(); |
39 | 39 |
40 private: | 40 private: |
41 virtual void willBeDestroyed() OVERRIDE; | 41 virtual void willBeDestroyed() OVERRIDE; |
42 virtual const char* renderName() const OVERRIDE { return "RenderQuote"; }; | 42 virtual const char* renderName() const OVERRIDE { return "RenderQuote"; }; |
43 virtual bool isQuote() const OVERRIDE { return true; }; | 43 virtual bool isQuote() const OVERRIDE { return true; }; |
44 virtual PassRefPtr<StringImpl> originalText() const OVERRIDE; | 44 virtual PassRefPtr<StringImpl> originalText() const OVERRIDE; |
45 virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE; | 45 virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE; |
46 | 46 |
| 47 // We don't override insertedIntoTree to call attachQuote() as it would be a
ttached |
| 48 // too early and get the wrong depth since generated content is inserted int
o anonymous |
| 49 // renderers before going into the main render tree. Once we can ensure that
insertIntoTree, |
| 50 // is called on an attached tree, we should override it here. |
| 51 |
47 const QuotesData* quotesData() const; | 52 const QuotesData* quotesData() const; |
48 void updateDepth(); | 53 void updateDepth(); |
49 bool isAttached() { return m_attached; } | 54 bool isAttached() { return m_attached; } |
50 | 55 |
51 QuoteType m_type; | 56 QuoteType m_type; |
52 int m_depth; | 57 int m_depth; |
53 RenderQuote* m_next; | 58 RenderQuote* m_next; |
54 RenderQuote* m_previous; | 59 RenderQuote* m_previous; |
55 bool m_attached; | 60 bool m_attached; |
56 }; | 61 }; |
57 | 62 |
58 inline RenderQuote* toRenderQuote(RenderObject* object) | 63 inline RenderQuote* toRenderQuote(RenderObject* object) |
59 { | 64 { |
60 ASSERT(!object || object->isQuote()); | 65 ASSERT(!object || object->isQuote()); |
61 return static_cast<RenderQuote*>(object); | 66 return static_cast<RenderQuote*>(object); |
62 } | 67 } |
63 | 68 |
64 // This will catch anyone doing an unnecessary cast. | 69 // This will catch anyone doing an unnecessary cast. |
65 void toRenderQuote(const RenderQuote*); | 70 void toRenderQuote(const RenderQuote*); |
66 | 71 |
67 } // namespace WebCore | 72 } // namespace WebCore |
68 | 73 |
69 #endif // RenderQuote_h | 74 #endif // RenderQuote_h |
OLD | NEW |