| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void HTMLLIElement::attachLayoutTree(const AttachContext& context) | 94 void HTMLLIElement::attachLayoutTree(const AttachContext& context) |
| 95 { | 95 { |
| 96 HTMLElement::attachLayoutTree(context); | 96 HTMLElement::attachLayoutTree(context); |
| 97 | 97 |
| 98 if (layoutObject() && layoutObject()->isListItem()) { | 98 if (layoutObject() && layoutObject()->isListItem()) { |
| 99 LayoutLIItem liLayoutItem = LayoutLIItem(toLayoutListItem(layoutObject()
)); | 99 LayoutLIItem liLayoutItem = LayoutLIItem(toLayoutListItem(layoutObject()
)); |
| 100 | 100 |
| 101 ASSERT(!document().childNeedsDistributionRecalc()); | 101 DCHECK(!document().childNeedsDistributionRecalc()); |
| 102 | 102 |
| 103 // Find the enclosing list node. | 103 // Find the enclosing list node. |
| 104 Element* listNode = 0; | 104 Element* listNode = 0; |
| 105 Element* current = this; | 105 Element* current = this; |
| 106 while (!listNode) { | 106 while (!listNode) { |
| 107 current = LayoutTreeBuilderTraversal::parentElement(*current); | 107 current = LayoutTreeBuilderTraversal::parentElement(*current); |
| 108 if (!current) | 108 if (!current) |
| 109 break; | 109 break; |
| 110 if (isHTMLUListElement(*current) || isHTMLOListElement(*current)) | 110 if (isHTMLUListElement(*current) || isHTMLOListElement(*current)) |
| 111 listNode = current; | 111 listNode = current; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // If we are not in a list, tell the layoutObject so it can position us
inside. | 114 // If we are not in a list, tell the layoutObject so it can position us
inside. |
| 115 // We don't want to change our style to say "inside" since that would af
fect nested nodes. | 115 // We don't want to change our style to say "inside" since that would af
fect nested nodes. |
| 116 if (!listNode) | 116 if (!listNode) |
| 117 liLayoutItem.setNotInList(true); | 117 liLayoutItem.setNotInList(true); |
| 118 | 118 |
| 119 parseValue(fastGetAttribute(valueAttr)); | 119 parseValue(fastGetAttribute(valueAttr)); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 inline void HTMLLIElement::parseValue(const AtomicString& value) | 123 inline void HTMLLIElement::parseValue(const AtomicString& value) |
| 124 { | 124 { |
| 125 ASSERT(layoutObject() && layoutObject()->isListItem()); | 125 DCHECK(layoutObject()); |
| 126 DCHECK(layoutObject()->isListItem()); |
| 126 | 127 |
| 127 bool valueOK; | 128 bool valueOK; |
| 128 int requestedValue = value.toInt(&valueOK); | 129 int requestedValue = value.toInt(&valueOK); |
| 129 if (valueOK) | 130 if (valueOK) |
| 130 toLayoutListItem(layoutObject())->setExplicitValue(requestedValue); | 131 toLayoutListItem(layoutObject())->setExplicitValue(requestedValue); |
| 131 else | 132 else |
| 132 toLayoutListItem(layoutObject())->clearExplicitValue(); | 133 toLayoutListItem(layoutObject())->clearExplicitValue(); |
| 133 } | 134 } |
| 134 | 135 |
| 135 } // namespace blink | 136 } // namespace blink |
| OLD | NEW |