for (unsigned i = 1; i <= m_entries.size(); ++i) {
const Entry& entry = m_entries[m_entries.size() - i];
if (entry.isMarker())
- return 0;
+ return nullptr;
if (entry.stackItem()->matchesHTMLTag(targetName))
- return entry.element();
+ return &entry.element();
}
- return 0;
+ return nullptr;
}
bool HTMLFormattingElementList::contains(Element* element)
void HTMLFormattingElementList::swapTo(Element* oldElement, PassRefPtr<HTMLStackItem> newItem, const Bookmark& bookmark)
{
ASSERT(contains(oldElement));
- ASSERT(!contains(newItem->element()));
+ ASSERT(!contains(&newItem->element()));
if (!bookmark.hasBeenMoved()) {
- ASSERT(bookmark.mark()->element() == oldElement);
+ ASSERT(&bookmark.mark()->element() == oldElement);
bookmark.mark()->replaceElement(newItem);
return;
}
break;
// Quickly reject obviously non-matching candidates.
- HTMLStackItem* candidate = entry.stackItem().get();
+ HTMLStackItem* candidate = entry.stackItem();
if (newItem->localName() != candidate->localName() || newItem->namespaceURI() != candidate->namespaceURI())
continue;
if (candidate->attributes().size() != newItemAttributeCount)
ASSERT(newItem->attributes().size() == candidate->attributes().size());
ASSERT(newItem->localName() == candidate->localName() && newItem->namespaceURI() == candidate->namespaceURI());
- Attribute* candidateAttribute = candidate->getAttributeItem(attribute.name());
+ const Attribute* candidateAttribute = candidate->findAttribute(attribute.name());
if (candidateAttribute && candidateAttribute->value() == attribute.value())
remainingCandidates.append(candidate);
}
// however, that we wil spin the loop more than once because of how the
// formatting element list gets permuted.
for (size_t i = kNoahsArkCapacity - 1; i < candidates.size(); ++i)
- remove(candidates[i]->element());
+ remove(&candidates[i]->element());
}
#ifndef NDEBUG
if (entry.isMarker())
fprintf(stderr, "marker\n");
else
- entry.element()->showNode();
+ entry.element().showNode();
}
}