Chromium Code Reviews| 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef LayoutQuote_h | 22 #ifndef LayoutQuote_h |
| 23 #define LayoutQuote_h | 23 #define LayoutQuote_h |
| 24 | 24 |
| 25 #include "core/layout/LayoutInline.h" | 25 #include "core/layout/LayoutInline.h" |
| 26 #include "core/style/QuotesData.h" | 26 #include "core/style/QuotesData.h" |
| 27 | 27 |
| 28 namespace blink { | 28 namespace blink { |
| 29 | 29 |
| 30 class Document; | |
| 31 class LayoutTextFragment; | 30 class LayoutTextFragment; |
| 31 class PseudoElement; | |
| 32 | 32 |
| 33 // LayoutQuote is the layout object associated with generated quotes | 33 // LayoutQuote is the layout object associated with generated quotes |
| 34 // ("content: open-quote | close-quote | no-open-quote | no-close-quote"). | 34 // ("content: open-quote | close-quote | no-open-quote | no-close-quote"). |
| 35 // http://www.w3.org/TR/CSS2/generate.html#quotes-insert | 35 // http://www.w3.org/TR/CSS2/generate.html#quotes-insert |
| 36 // | 36 // |
| 37 // This object is generated thus always anonymous. | 37 // This object is generated thus always anonymous. |
| 38 // | 38 // |
| 39 // For performance reasons, LayoutQuotes form a doubly-linked list. See |m_next| | 39 // For performance reasons, LayoutQuotes form a doubly-linked list. See |m_next| |
| 40 // and |m_previous| below. | 40 // and |m_previous| below. |
| 41 class LayoutQuote final : public LayoutInline { | 41 class LayoutQuote final : public LayoutInline { |
| 42 public: | 42 public: |
| 43 LayoutQuote(Document*, const QuoteType); | 43 LayoutQuote(PseudoElement&, const QuoteType); |
| 44 ~LayoutQuote() override; | 44 ~LayoutQuote() override; |
| 45 void attachQuote(); | 45 void attachQuote(); |
| 46 | 46 |
| 47 const char* name() const override { return "LayoutQuote"; } | 47 const char* name() const override { return "LayoutQuote"; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 void detachQuote(); | 50 void detachQuote(); |
| 51 | 51 |
| 52 void willBeDestroyed() override; | 52 void willBeDestroyed() override; |
| 53 bool isOfType(LayoutObjectType type) const override { | 53 bool isOfType(LayoutObjectType type) const override { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 81 LayoutQuote* m_next; | 81 LayoutQuote* m_next; |
| 82 LayoutQuote* m_previous; | 82 LayoutQuote* m_previous; |
| 83 | 83 |
| 84 // This tracks whether this LayoutQuote was inserted into the layout tree | 84 // This tracks whether this LayoutQuote was inserted into the layout tree |
| 85 // and its position in the linked list is correct (m_next and m_previous). | 85 // and its position in the linked list is correct (m_next and m_previous). |
| 86 // It's used for both performance (avoid unneeded tree walks to find the | 86 // It's used for both performance (avoid unneeded tree walks to find the |
| 87 // previous and next quotes) and conformance (|m_depth| relies on an | 87 // previous and next quotes) and conformance (|m_depth| relies on an |
| 88 // up-to-date linked list positions). | 88 // up-to-date linked list positions). |
| 89 bool m_attached; | 89 bool m_attached; |
| 90 | 90 |
| 91 // The pseudo-element that owns us. | |
| 92 // | |
| 93 // TODO(ecobos@igalia.com): This is also in m_node, should we make that | |
| 94 // protected instead of private? Seems easy to misuse. | |
| 95 // | |
| 96 // Livedness is the same as m_node, so this is safe. | |
|
rune
2017/03/13 10:36:00
"Lifetime is the same as for LayoutObject::m_node"
| |
| 97 UntracedMember<PseudoElement> m_owningPseudo; | |
| 98 | |
| 91 // Cached text for this quote. | 99 // Cached text for this quote. |
| 92 String m_text; | 100 String m_text; |
| 93 }; | 101 }; |
| 94 | 102 |
| 95 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutQuote, isQuote()); | 103 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutQuote, isQuote()); |
| 96 | 104 |
| 97 } // namespace blink | 105 } // namespace blink |
| 98 | 106 |
| 99 #endif // LayoutQuote_h | 107 #endif // LayoutQuote_h |
| OLD | NEW |