OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // access to Entry::isMarker() and Entry::replaceElement() to do so. | 47 // access to Entry::isMarker() and Entry::replaceElement() to do so. |
48 class Entry { | 48 class Entry { |
49 public: | 49 public: |
50 // Inline because they're hot and Vector<T> uses them. | 50 // Inline because they're hot and Vector<T> uses them. |
51 explicit Entry(PassRefPtr<HTMLStackItem> item) | 51 explicit Entry(PassRefPtr<HTMLStackItem> item) |
52 : m_item(item) | 52 : m_item(item) |
53 { | 53 { |
54 } | 54 } |
55 enum MarkerEntryType { MarkerEntry }; | 55 enum MarkerEntryType { MarkerEntry }; |
56 explicit Entry(MarkerEntryType) | 56 explicit Entry(MarkerEntryType) |
57 : m_item(0) | 57 : m_item(nullptr) |
58 { | 58 { |
59 } | 59 } |
60 ~Entry() {} | 60 ~Entry() {} |
61 | 61 |
62 bool isMarker() const { return !m_item; } | 62 bool isMarker() const { return !m_item; } |
63 | 63 |
64 PassRefPtr<HTMLStackItem> stackItem() const { return m_item; } | 64 PassRefPtr<HTMLStackItem> stackItem() const { return m_item; } |
65 Element* element() const | 65 Element* element() const |
66 { | 66 { |
67 // The fact that !m_item == isMarker() is an implementation detail | 67 // The fact that !m_item == isMarker() is an implementation detail |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // These functions enforce the "Noah's Ark" condition, which removes redunda
nt mis-nested elements. | 132 // These functions enforce the "Noah's Ark" condition, which removes redunda
nt mis-nested elements. |
133 void tryToEnsureNoahsArkConditionQuickly(HTMLStackItem*, Vector<HTMLStackIte
m*>& remainingCandiates); | 133 void tryToEnsureNoahsArkConditionQuickly(HTMLStackItem*, Vector<HTMLStackIte
m*>& remainingCandiates); |
134 void ensureNoahsArkCondition(HTMLStackItem*); | 134 void ensureNoahsArkCondition(HTMLStackItem*); |
135 | 135 |
136 Vector<Entry> m_entries; | 136 Vector<Entry> m_entries; |
137 }; | 137 }; |
138 | 138 |
139 } | 139 } |
140 | 140 |
141 #endif // HTMLFormattingElementList_h | 141 #endif // HTMLFormattingElementList_h |
OLD | NEW |