Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLLIElement.cpp

Issue 2258033002: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698