OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2006, 2007, 2010 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (renderer() && renderer()->isListItem()) { | 85 if (renderer() && renderer()->isListItem()) { |
86 RenderListItem* listItemRenderer = toRenderListItem(renderer()); | 86 RenderListItem* listItemRenderer = toRenderListItem(renderer()); |
87 | 87 |
88 // Find the enclosing list node. | 88 // Find the enclosing list node. |
89 Element* listNode = 0; | 89 Element* listNode = 0; |
90 Element* current = this; | 90 Element* current = this; |
91 while (!listNode) { | 91 while (!listNode) { |
92 current = current->parentElement(); | 92 current = current->parentElement(); |
93 if (!current) | 93 if (!current) |
94 break; | 94 break; |
95 if (current->hasTagName(ulTag) || current->hasTagName(olTag)) | 95 if (isHTMLUListElement(*current) || isHTMLOListElement(*current)) |
96 listNode = current; | 96 listNode = current; |
97 } | 97 } |
98 | 98 |
99 // If we are not in a list, tell the renderer so it can position us insi
de. | 99 // If we are not in a list, tell the renderer so it can position us insi
de. |
100 // We don't want to change our style to say "inside" since that would af
fect nested nodes. | 100 // We don't want to change our style to say "inside" since that would af
fect nested nodes. |
101 if (!listNode) { | 101 if (!listNode) { |
102 listItemRenderer->setNotInList(true); | 102 listItemRenderer->setNotInList(true); |
103 listItemRenderer->updateMarkerLocation(); | 103 listItemRenderer->updateMarkerLocation(); |
104 } | 104 } |
105 | 105 |
106 parseValue(fastGetAttribute(valueAttr)); | 106 parseValue(fastGetAttribute(valueAttr)); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 inline void HTMLLIElement::parseValue(const AtomicString& value) | 110 inline void HTMLLIElement::parseValue(const AtomicString& value) |
111 { | 111 { |
112 ASSERT(renderer() && renderer()->isListItem()); | 112 ASSERT(renderer() && renderer()->isListItem()); |
113 | 113 |
114 bool valueOK; | 114 bool valueOK; |
115 int requestedValue = value.toInt(&valueOK); | 115 int requestedValue = value.toInt(&valueOK); |
116 if (valueOK) | 116 if (valueOK) |
117 toRenderListItem(renderer())->setExplicitValue(requestedValue); | 117 toRenderListItem(renderer())->setExplicitValue(requestedValue); |
118 else | 118 else |
119 toRenderListItem(renderer())->clearExplicitValue(); | 119 toRenderListItem(renderer())->clearExplicitValue(); |
120 } | 120 } |
121 | 121 |
122 } | 122 } |
OLD | NEW |