+2007-03-26 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Kevin McCulough.
+
+ Global replace of "assert(" with "ASSERT(" to assist debugging. Removed
+ one instance of commented-out code containing "assert(" instead of replacing it.
+
2007-03-25 Antti Koivisto <antti@apple.com>
Reviewed by Adam.
case ParentRule:
return toJS(exec, m_impl->parentRule());
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
case Length:
return jsNumber(m_impl->length());
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
case Length:
return jsNumber(m_impl->length());
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
case Rules:
return toJS(exec, static_cast<CSSStyleSheet*>(impl())->cssRules(true));
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
return jsStringOrNull(static_cast<CSSCharsetRule*>(m_impl.get())->encoding());
default:
- assert(0);
+ ASSERT(0);
}
return jsUndefined();
}
case CssValueType:
return jsNumber(cssValue.cssValueType());
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
void DOMNode::mark()
{
- assert(!marked());
+ ASSERT(!marked());
Node* node = m_impl.get();
root->m_inSubtreeMark = false;
// Double check that we actually ended up marked. This assert caught problems in the past.
- assert(marked());
+ ASSERT(marked());
}
bool DOMNode::toBoolean(ExecState* ) const
JSValue* DOMNodeList::getValueProperty(ExecState* exec, int token) const
{
- assert(token == Length);
+ ASSERT(token == Length);
return jsNumber(m_impl->length());
}
{
switch (token) {
case DropEffect:
- assert(clipboard->isForDragging() || clipboard->dropEffect().isNull());
+ ASSERT(clipboard->isForDragging() || clipboard->dropEffect().isNull());
return jsStringOrUndefined(clipboard->dropEffect());
case EffectAllowed:
- assert(clipboard->isForDragging() || clipboard->effectAllowed().isNull());
+ ASSERT(clipboard->isForDragging() || clipboard->effectAllowed().isNull());
return jsStringOrUndefined(clipboard->effectAllowed());
case Types:
{
case DesignMode:
return jsString(doc.inDesignMode() ? "on" : "off");
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
JSValue *Plugins::getValueProperty(ExecState *exec, int token) const
{
- assert(token == Length);
+ ASSERT(token == Length);
return jsNumber(plugins->size());
}
JSValue *MimeTypes::getValueProperty(ExecState *exec, int token) const
{
- assert(token == Length);
+ ASSERT(token == Length);
return jsNumber(mimes->size());
}
case Length:
return jsNumber(m_info->mimes.size());
default:
- assert(0);
+ ASSERT(0);
return jsUndefined();
}
}
ScriptInterpreter* KJSProxy::interpreter()
{
initScriptIfNeeded();
- assert(m_script);
+ ASSERT(m_script);
return m_script.get();
}
i++;
valueEnd = i;
- assert(i <= length);
+ ASSERT(i <= length);
String keyString(buffer.substring(keyBegin, keyEnd - keyBegin));
String valueString(buffer.substring(valueBegin, valueEnd - valueBegin));
- (void)dealloc
{
- assert(false);
+ ASSERT(false);
return;
[super dealloc]; // make -Wdealloc-check happy
}
else if (!m_bottom)
m_bottom = val;
else {
- assert(!m_left);
+ ASSERT(!m_left);
m_left = val;
}
else if (!m_borderBottom)
m_borderBottom = val;
else {
- assert(!m_borderLeft);
+ ASSERT(!m_borderLeft);
m_borderLeft = val;
}
dynamicPseudo = RenderStyle::SEARCH_RESULTS_BUTTON;
return true;
case CSSSelector::PseudoNotParsed:
- assert(false);
+ ASSERT(false);
break;
}
return false;
m_attribute(a),
m_ignoreChildrenChanged(0)
{
- assert(!m_attribute->attr());
+ ASSERT(!m_attribute->attr());
m_attribute->m_impl = this;
m_specified = true;
}
Attr::~Attr()
{
- assert(m_attribute->attr() == this);
+ ASSERT(m_attribute->attr() == this);
m_attribute->m_impl = 0;
}
if (child->parentNode())
break;
- assert(!child->nextSibling());
- assert(!child->previousSibling());
+ ASSERT(!child->nextSibling());
+ ASSERT(!child->previousSibling());
// Add child before "next".
forbidEventDispatch();
Node* prev = next->previousSibling();
- assert(m_lastChild != prev);
+ ASSERT(m_lastChild != prev);
next->setPreviousSibling(child.get());
if (prev) {
- assert(m_firstChild != next);
- assert(prev->nextSibling() == next);
+ ASSERT(m_firstChild != next);
+ ASSERT(prev->nextSibling() == next);
prev->setNextSibling(child.get());
} else {
- assert(m_firstChild == next);
+ ASSERT(m_firstChild == next);
m_firstChild = child.get();
}
child->setParent(this);
if (child->parentNode())
break;
- assert(!child->nextSibling());
- assert(!child->previousSibling());
+ ASSERT(!child->nextSibling());
+ ASSERT(!child->previousSibling());
// Add child after "prev".
forbidEventDispatch();
Node* next;
if (prev) {
next = prev->nextSibling();
- assert(m_firstChild != next);
+ ASSERT(m_firstChild != next);
prev->setNextSibling(child.get());
} else {
next = m_firstChild;
m_firstChild = child.get();
}
if (next) {
- assert(m_lastChild != prev);
- assert(next->previousSibling() == prev);
+ ASSERT(m_lastChild != prev);
+ ASSERT(next->previousSibling() == prev);
next->setPreviousSibling(child.get());
} else {
- assert(m_lastChild == prev);
+ ASSERT(m_lastChild == prev);
m_lastChild = child.get();
}
child->setParent(this);
static void dispatchChildInsertionEvents(Node* child, ExceptionCode& ec)
{
- assert(!eventDispatchForbidden());
+ ASSERT(!eventDispatchForbidden());
RefPtr<Node> c = child;
RefPtr<Document> doc = child->document();
static bool relinquishesEditingFocus(Node *node)
{
- assert(node);
- assert(node->isContentEditable());
+ ASSERT(node);
+ ASSERT(node->isContentEditable());
Node *root = node->rootEditableElement();
Frame* frame = node->document()->frame();
static bool acceptsEditingFocus(Node *node)
{
- assert(node);
- assert(node->isContentEditable());
+ ASSERT(node);
+ ASSERT(node->isContentEditable());
Node *root = node->rootEditableElement();
Frame* frame = node->document()->frame();
void Document::attach()
{
- assert(!attached());
- assert(!m_inPageCache);
+ ASSERT(!attached());
+ ASSERT(!m_inPageCache);
if (!m_renderArena)
m_renderArena = new RenderArena();
if (!m_tokenizer) {
open();
- assert(m_tokenizer);
+ ASSERT(m_tokenizer);
if (!m_tokenizer)
return;
write(DeprecatedString("<html>"));
int Document::nodeAbsIndex(Node *node)
{
- assert(node->document() == this);
+ ASSERT(node->document() == this);
int absIndex = 0;
for (Node *n = node; n && n != this; n = n->traversePreviousNode())
void Document::processHttpEquiv(const String &equiv, const String &content)
{
- assert(!equiv.isNull() && !content.isNull());
+ ASSERT(!equiv.isNull() && !content.isNull());
Frame *frame = this->frame();
void Document::stylesheetLoaded()
{
// Make sure we knew this sheet was pending, and that our count isn't out of sync.
- assert(m_pendingStylesheets > 0);
+ ASSERT(m_pendingStylesheets > 0);
m_pendingStylesheets--;
void Document::passwordFieldRemoved()
{
- assert(m_passwordFields > 0);
+ ASSERT(m_passwordFields > 0);
m_passwordFields--;
}
void Document::secureFormRemoved()
{
- assert(m_secureForms > 0);
+ ASSERT(m_secureForms > 0);
m_secureForms--;
}
void Document::addMarker(Node *node, DocumentMarker newMarker)
{
- assert(newMarker.endOffset >= newMarker.startOffset);
+ ASSERT(newMarker.endOffset >= newMarker.startOffset);
if (newMarker.endOffset == newMarker.startOffset)
return;
for (size_t i = 0; i != markers.size(); ++i) {
DocumentMarker &marker = markers[i];
if (marker.startOffset >= startOffset && (markerType == DocumentMarker::AllMarkers || marker.type == markerType)) {
- assert((int)marker.startOffset + delta >= 0);
+ ASSERT((int)marker.startOffset + delta >= 0);
marker.startOffset += delta;
marker.endOffset += delta;
docDirty = true;
{
ExceptionCode ec = 0;
RefPtr<Element> clone = document()->createElementNS(namespaceURI(), nodeName(), ec);
- assert(!ec);
+ ASSERT(!ec);
// clone attributes
if (namedAttrMap)
void Element::dispatchAttrRemovalEvent(Attribute*)
{
- assert(!eventDispatchForbidden());
+ ASSERT(!eventDispatchForbidden());
#if 0
if (!document()->hasListenerType(Document::DOMATTRMODIFIED_LISTENER))
return;
void Element::dispatchAttrAdditionEvent(Attribute *attr)
{
- assert(!eventDispatchForbidden());
+ ASSERT(!eventDispatchForbidden());
#if 0
if (!document()->hasListenerType(Document::DOMATTRMODIFIED_LISTENER))
return;
// used during parsing: only inserts if not already there
// no error checking!
void insertAttribute(Attribute* newAttribute) {
- assert(!element);
+ ASSERT(!element);
if (!getAttributeItem(newAttribute->name()))
addAttribute(newAttribute);
else
Node *Node::traverseNextNode(const Node *stayWithin) const
{
if (firstChild()) {
- assert(!stayWithin || firstChild()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || firstChild()->isDescendantOf(stayWithin));
return firstChild();
}
if (this == stayWithin)
return 0;
if (nextSibling()) {
- assert(!stayWithin || nextSibling()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || nextSibling()->isDescendantOf(stayWithin));
return nextSibling();
}
const Node *n = this;
while (n && !n->nextSibling() && (!stayWithin || n->parentNode() != stayWithin))
n = n->parentNode();
if (n) {
- assert(!stayWithin || !n->nextSibling() || n->nextSibling()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || !n->nextSibling() || n->nextSibling()->isDescendantOf(stayWithin));
return n->nextSibling();
}
return 0;
if (this == stayWithin)
return 0;
if (nextSibling()) {
- assert(!stayWithin || nextSibling()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || nextSibling()->isDescendantOf(stayWithin));
return nextSibling();
}
const Node *n = this;
while (n && !n->nextSibling() && (!stayWithin || n->parentNode() != stayWithin))
n = n->parentNode();
if (n) {
- assert(!stayWithin || !n->nextSibling() || n->nextSibling()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || !n->nextSibling() || n->nextSibling()->isDescendantOf(stayWithin));
return n->nextSibling();
}
return 0;
Node *Node::traversePreviousNodePostOrder(const Node *stayWithin) const
{
if (lastChild()) {
- assert(!stayWithin || lastChild()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || lastChild()->isDescendantOf(stayWithin));
return lastChild();
}
if (this == stayWithin)
return 0;
if (previousSibling()) {
- assert(!stayWithin || previousSibling()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || previousSibling()->isDescendantOf(stayWithin));
return previousSibling();
}
const Node *n = this;
while (n && !n->previousSibling() && (!stayWithin || n->parentNode() != stayWithin))
n = n->parentNode();
if (n) {
- assert(!stayWithin || !n->previousSibling() || n->previousSibling()->isDescendantOf(stayWithin));
+ ASSERT(!stayWithin || !n->previousSibling() || n->previousSibling()->isDescendantOf(stayWithin));
return n->previousSibling();
}
return 0;
void Node::attach()
{
- assert(!attached());
- assert(!renderer() || (renderer()->style() && renderer()->parent()));
+ ASSERT(!attached());
+ ASSERT(!renderer() || (renderer()->style() && renderer()->parent()));
document()->incDOMTreeVersion();
m_attached = true;
}
// the last child, it specifies to start at next sibling.
Node *Node::nextEditable(int offset) const
{
- assert(offset>=0);
+ ASSERT(offset>=0);
Node *node;
if (hasChildNodes())
node = (offset >= (int)childNodeCount()) ? nextSibling() : childNode(offset)->nextLeafNode();
if (!document()->shouldCreateRenderers())
return;
- assert(!attached());
- assert(!renderer());
+ ASSERT(!attached());
+ ASSERT(!renderer());
Node *parent = parentNode();
- assert(parent);
+ ASSERT(parent);
RenderObject *parentRenderer = parent->renderer();
if (parentRenderer && parentRenderer->canHaveChildren()
RenderObject *Node::createRenderer(RenderArena *arena, RenderStyle *style)
{
- assert(false);
+ ASSERT(false);
return 0;
}
}
// Should never reach this point.
- assert(0);
+ ASSERT(0);
return 0;
}
colors[0] >>= 4*maxDigit;
colors[1] >>= 4*maxDigit;
colors[2] >>= 4*maxDigit;
- // assert(colors[0] < 0x100 && colors[1] < 0x100 && colors[2] < 0x100);
+ // ASSERT(colors[0] < 0x100 && colors[1] < 0x100 && colors[2] < 0x100);
color = String::format("#%02x%02x%02x", colors[0], colors[1], colors[2]);
if (attr->decl()->setProperty(id, color, false))
tmp = (p[1] << 11) ^ hash;
hash = (hash << 16) ^ tmp;
hash += hash >> 11;
- assert(sizeof(key.name) == 4 || sizeof(key.name) == 8);
+ ASSERT(sizeof(key.name) == 4 || sizeof(key.name) == 8);
if (sizeof(key.name) == 8) {
p += 2;
hash += p[0];
tmp = (p[1] << 11) ^ hash;
hash = (hash << 16) ^ tmp;
hash += hash >> 11;
- assert(sizeof(key.value) == 4 || sizeof(key.value) == 8);
+ ASSERT(sizeof(key.value) == 4 || sizeof(key.value) == 8);
if (sizeof(key.value) == 8) {
p += 2;
hash += p[0];
return 0;
CString value = String(&c, 1).utf8();
- assert(value.length() < 5);
+ ASSERT(value.length() < 5);
sharedXHTMLEntity.length = value.length();
sharedXHTMLEntity.name = name;
memcpy(sharedXHTMLEntityResult, value.data(), sharedXHTMLEntity.length + 1);
if (nodeToRemove) {
ExceptionCode ec = 0;
nodeToRemove->remove(ec);
- assert(ec == 0);
+ ASSERT(ec == 0);
}
return match;
void InsertTextCommand::input(const String &text, bool selectInsertedText)
{
- assert(text.find('\n') == -1);
+ ASSERT(text.find('\n') == -1);
if (endingSelection().isNone())
return;
rebalanceWhitespaceAt(end);
if (m_matchStyle) {
- assert(m_insertionStyle);
+ ASSERT(m_insertionStyle);
applyStyle(m_insertionStyle.get(), start, end);
}
emitCharacter('\n', baseNode->parentNode(), baseNode, 1, 1);
// remember whether to later add a newline for the current node
- assert(!m_needAnotherNewline);
+ ASSERT(!m_needAnotherNewline);
m_needAnotherNewline = addNewline;
} else if (addNewline) {
// insert a newline with a position following this block's contents.
void SimplifiedBackwardsTextIterator::advance()
{
- assert(m_positionNode);
+ ASSERT(m_positionNode);
m_positionNode = 0;
m_textLength = 0;
RefPtr<Range> r = m_textIterator.range();
if (!m_textIterator.atEnd()) {
if (m_textIterator.length() <= 1) {
- assert(m_runOffset == 0);
+ ASSERT(m_runOffset == 0);
} else {
int exception = 0;
Node *n = r->startContainer(exception);
- assert(n == r->endContainer(exception));
+ ASSERT(n == r->endContainer(exception));
int offset = r->startOffset(exception) + m_runOffset;
r->setStart(n, offset, exception);
r->setEnd(n, offset + 1, exception);
// If last time we did a look-ahead, start with that looked-ahead chunk now
if (!m_didLookAhead) {
- assert(!m_textIterator.atEnd());
+ ASSERT(!m_textIterator.atEnd());
m_textIterator.advance();
}
m_didLookAhead = false;
CircularSearchBuffer::CircularSearchBuffer(const String& s, bool isCaseSensitive)
: m_target(s)
{
- assert(!s.isEmpty());
+ ASSERT(!s.isEmpty());
if (!isCaseSensitive)
m_target = s.foldCase();
{
int tailSpace = m_buffer + length() - m_cursor;
- assert(!m_bufferFull);
- assert(count <= tailSpace);
+ ASSERT(!m_bufferFull);
+ ASSERT(count <= tailSpace);
if (m_isCaseSensitive) {
for (int i = 0; i != count; ++i) {
bool CircularSearchBuffer::isMatch() const
{
- assert(m_bufferFull);
+ ASSERT(m_bufferFull);
int headSpace = m_cursor - m_buffer;
int tailSpace = length() - headSpace;
textRunRange = it.range();
resultRange->setStart(textRunRange->startContainer(exception), 0, exception);
- assert(exception == 0);
+ ASSERT(exception == 0);
resultRange->setEnd(textRunRange->startContainer(exception), 0, exception);
- assert(exception == 0);
+ ASSERT(exception == 0);
return resultRange.release();
}
bool isNotNull() const { return m_deepPosition.isNotNull(); }
Position deepEquivalent() const { return m_deepPosition; }
- EAffinity affinity() const { assert(m_affinity == UPSTREAM || m_affinity == DOWNSTREAM); return m_affinity; }
+ EAffinity affinity() const { ASSERT(m_affinity == UPSTREAM || m_affinity == DOWNSTREAM); return m_affinity; }
void setAffinity(EAffinity affinity) { m_affinity = affinity; }
// next() and previous() will increment/decrement by a character cluster.
// make the span to hold the tab
ExceptionCode ec = 0;
RefPtr<Element> spanElement = document->createElementNS(xhtmlNamespaceURI, "span", ec);
- assert(ec == 0);
+ ASSERT(ec == 0);
spanElement->setAttribute(classAttr, AppleTabSpanClass);
spanElement->setAttribute(styleAttr, "white-space:pre");
if (!tabTextNode)
tabTextNode = document->createEditingTextNode("\t");
spanElement->appendChild(tabTextNode, ec);
- assert(ec == 0);
+ ASSERT(ec == 0);
return spanElement.release();
}
return;
}
- assert(string.find('\n') == -1);
+ ASSERT(string.find('\n') == -1);
DeprecatedStringList tabList = DeprecatedStringList::split('\t', string, true);
DeprecatedString tabText = "";
break;
Position pos(n, n->caretMinOffset());
if (pos.isCandidate()) {
- assert(n->renderer());
+ ASSERT(n->renderer());
box = n->renderer()->inlineBox(n->caretMaxOffset());
if (box) {
// previous root line box found
break;
Position pos(n, n->caretMinOffset());
if (pos.isCandidate()) {
- assert(n->renderer());
+ ASSERT(n->renderer());
box = n->renderer()->inlineBox(n->caretMinOffset());
if (box) {
// next root line box found
{
#if USE(JAVASCRIPTCORE_BINDINGS)
// m_instance should have been cleaned up in detach().
- assert(!m_instance);
+ ASSERT(!m_instance);
#endif
}
Node *HTMLCollection::traverseNextItem(Node *current) const
{
- assert(current);
+ ASSERT(current);
if (type == NodeChildren && m_base.get() != current)
current = current->nextSibling();
return;
int oldVal = it->second;
- assert(oldVal != 0);
+ ASSERT(oldVal != 0);
int newVal = oldVal - 1;
if (newVal == 0)
map.remove(it);
hMode = Html4;
break;
default:
- assert(false);
+ ASSERT(false);
}
}
}
for (RefPtr<Node> child = firstChild; child; child = nextChild) {
nextChild = child->nextSibling();
node->removeChild(child.get(), ignoredExceptionCode);
- assert(!ignoredExceptionCode);
+ ASSERT(!ignoredExceptionCode);
fragment->insertBefore(child, node.get(), ignoredExceptionCode);
- assert(!ignoredExceptionCode);
+ ASSERT(!ignoredExceptionCode);
}
fragment->removeChild(node.get(), ignoredExceptionCode);
- assert(!ignoredExceptionCode);
+ ASSERT(!ignoredExceptionCode);
} else if (node->hasTagName(headTag)) {
fragment->removeChild(node.get(), ignoredExceptionCode);
- assert(!ignoredExceptionCode);
+ ASSERT(!ignoredExceptionCode);
}
}
{
#if USE(JAVASCRIPTCORE_BINDINGS)
// m_instance should have been cleaned up in detach().
- assert(!m_instance);
+ ASSERT(!m_instance);
#endif
}
Node *p = parentNode();
if (p && p->hasTagName(objectTag)) {
- assert(p->renderer());
+ ASSERT(p->renderer());
return false;
}
void HTMLGenericFormElement::attach()
{
- assert(!attached());
+ ASSERT(!attached());
HTMLElement::attach();
case HIDDEN:
return false;
}
- assert(false);
+ ASSERT(false);
return false;
}
case TEXT:
return new (arena) RenderTextControl(this, false);
}
- assert(false);
+ ASSERT(false);
return 0;
}
void HTMLLIElement::attach()
{
- assert(!attached());
+ ASSERT(!attached());
HTMLElement::attach();
{
#if USE(JAVASCRIPTCORE_BINDINGS)
// m_instance should have been cleaned up in detach().
- assert(!m_instance);
+ ASSERT(!m_instance);
#endif
delete m_imageLoader;
{
HTMLElement::insertedIntoDocument();
- assert(!m_cachedScript);
+ ASSERT(!m_cachedScript);
if (m_createdByParser)
return;
{
CachedScript *cs = static_cast<CachedScript *>(o);
- assert(cs == m_cachedScript);
+ ASSERT(cs == m_cachedScript);
// Evaluating the script could lead to a garbage collection which
// can delete the script element so we need to protect it.
// The creation of <tbody> elements relies on the "childAllowed" check,
// so we need to do it even for XML documents.
- assert(child->nodeType() != DOCUMENT_FRAGMENT_NODE);
+ ASSERT(child->nodeType() != DOCUMENT_FRAGMENT_NODE);
if (!document()->isHTMLDocument() && !childAllowed(child.get()))
return 0;
void HTMLTableElement::attach()
{
- assert(!m_attached);
+ ASSERT(!m_attached);
HTMLElement::attach();
if (renderer() && renderer()->isTable())
static_cast<RenderTable*>(renderer())->setCellPadding(m_padding);
if (!allDataReceived)
return;
- assert(!m_document);
+ ASSERT(!m_document);
m_document = new XBL::XBLDocument();
m_document->ref();
void Frame::paintDragCaret(GraphicsContext* p, const IntRect& rect) const
{
SelectionController* dragCaretController = d->m_page->dragCaretController();
- assert(dragCaretController->selection().isCaret());
+ ASSERT(dragCaretController->selection().isCaret());
if (dragCaretController->selection().start().node()->document()->frame() == this)
dragCaretController->paintCaret(p, rect);
}
if (nodeToRemove) {
ExceptionCode ec = 0;
nodeToRemove->remove(ec);
- assert(ec == 0);
+ ASSERT(ec == 0);
}
} else {
for (Node* node = selectionController()->start().node(); node; node = node->traverseNextNode()) {
if (nodeToRemove) {
ExceptionCode ec = 0;
nodeToRemove->remove(ec);
- assert(ec == 0);
+ ASSERT(ec == 0);
}
return value;
parent->appendChild(styleElement, ec);
}
}
- assert(ec == 0);
+ ASSERT(ec == 0);
nodeToRemove = styleElement.get();
}
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <wtf/Assertions.h>
#include <wtf/FastMalloc.h>
using namespace std;
Arena *a;
char *rp; /* returned pointer */
- assert((nb & pool->mask) == 0);
+ ASSERT((nb & pool->mask) == 0);
nb = (uword)ARENA_ALIGN(pool, nb); /* force alignment */
#ifdef DEBUG
do {
- assert(a->base <= a->avail && a->avail <= a->limit);
+ ASSERT(a->base <= a->avail && a->avail <= a->limit);
a->avail = a->base;
CLEAR_UNUSED(a);
} while ((a = a->next) != 0);
#ifdef DEBUG
#define FREE_PATTERN 0xDA
-#define CLEAR_UNUSED(a) (assert((a)->avail <= (a)->limit), \
+#define CLEAR_UNUSED(a) (ASSERT((a)->avail <= (a)->limit), \
memset((void*)(a)->avail, FREE_PATTERN, \
(a)->limit - (a)->avail))
#define CLEAR_ARENA(a) memset((void*)(a), FREE_PATTERN, \
const FontData* Font::primaryFont() const
{
- assert(m_fontList);
+ ASSERT(m_fontList);
return m_fontList->primaryFont(this);
}
const FontData* Font::fontDataAt(unsigned index) const
{
- assert(m_fontList);
+ ASSERT(m_fontList);
return m_fontList->fontDataAt(this, index);
}
const FontData* Font::fontDataForCharacters(const UChar* characters, int length) const
{
- assert(m_fontList);
+ ASSERT(m_fontList);
return m_fontList->fontDataForCharacters(this, characters, length);
}
bool Font::isFixedPitch() const
{
- assert(m_fontList);
+ ASSERT(m_fontList);
return m_fontList->isFixedPitch(this);
}
return m_fontList[realizedFontIndex]; // This fallback font is already in our list.
// Make sure we're not passing in some crazy value here.
- assert(realizedFontIndex == m_fontList.size());
+ ASSERT(realizedFontIndex == m_fontList.size());
if (m_familyIndex == cAllFamiliesScanned)
return 0;
{
if (!m_isValid)
return false;
- assert(urlString[schemeEndPos] == ':');
+ ASSERT(urlString[schemeEndPos] == ':');
return urlString[schemeEndPos + 1] == '/';
}
void SegmentedString::prepend(const SegmentedSubstring &s)
{
- assert(!escaped());
+ ASSERT(!escaped());
if (s.m_length) {
if (!m_currentString.m_length)
m_currentString = s;
void SegmentedString::append(const SegmentedString &s)
{
- assert(!s.escaped());
+ ASSERT(!s.escaped());
append(s.m_currentString);
if (s.m_composite) {
DeprecatedValueListConstIterator<SegmentedSubstring> i = s.m_substrings.begin();
void SegmentedString::prepend(const SegmentedString &s)
{
- assert(!escaped());
- assert(!s.escaped());
+ ASSERT(!escaped());
+ ASSERT(!s.escaped());
if (s.m_composite) {
DeprecatedValueListConstIterator<SegmentedSubstring> i = s.m_substrings.fromLast();
DeprecatedValueListConstIterator<SegmentedSubstring> e = s.m_substrings.end();
m_pushedChar1 = c;
m_currentChar = m_pushedChar1 ? &m_pushedChar1 : m_currentString.m_current;
} else {
- assert(!m_pushedChar2);
+ ASSERT(!m_pushedChar2);
m_pushedChar2 = c;
}
}
DataRef(const DataRef<T>& d)
{
- assert(d.m_data);
+ ASSERT(d.m_data);
m_data = d.m_data;
m_data->ref();
}
void init()
{
- assert(!m_data);
+ ASSERT(!m_data);
m_data = new T;
m_data->ref();
}
DataRef<T>& operator=(const DataRef<T>& d)
{
- assert(d.m_data);
+ ASSERT(d.m_data);
d.m_data->ref();
if (m_data)
m_data->deref();
bool operator==(const DataRef<T>& o) const
{
- assert(m_data);
- assert(o.m_data);
+ ASSERT(m_data);
+ ASSERT(o.m_data);
return m_data == o.m_data || *m_data == *o.m_data;
}
bool operator!=(const DataRef<T>& o) const
{
- assert(m_data);
- assert(o.m_data);
+ ASSERT(m_data);
+ ASSERT(o.m_data);
return m_data != o.m_data && *m_data != *o.m_data;
}
void InlineBox::operator delete(void* ptr, size_t sz)
{
- assert(inInlineBoxDetach);
+ ASSERT(inInlineBoxDetach);
// Stash size where destroy can find it.
*(size_t *)ptr = sz;
void InlineTextBox::operator delete(void* ptr, size_t sz)
{
- assert(inInlineTextBoxDetach);
+ ASSERT(inInlineTextBoxDetach);
// Stash size where destroy can find it.
*static_cast<size_t*>(ptr) = sz;
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <wtf/Assertions.h>
#define ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
{
#ifndef NDEBUG
// Use standard malloc so that memory debugging tools work.
- assert(this);
+ ASSERT(this);
void* block = ::malloc(sizeof(RenderArenaDebugHeader) + size);
RenderArenaDebugHeader* header = (RenderArenaDebugHeader*)block;
header->arena = this;
#ifndef NDEBUG
// Use standard free so that memory debugging tools work.
RenderArenaDebugHeader* header = (RenderArenaDebugHeader*)ptr - 1;
- assert(header->signature == signature);
- assert(header->size == size);
- assert(header->arena == this);
+ ASSERT(header->signature == signature);
+ ASSERT(header->size == size);
+ ASSERT(header->arena == this);
header->signature = signatureDead;
::free(header);
#else
default:
return false;
}
- assert(false);
+ ASSERT(false);
return false;
}
default:
return false;
}
- assert(false);
+ ASSERT(false);
return false;
}
delete m_marquee;
// Make sure we have no lingering clip rects.
- assert(!m_clipRects);
+ ASSERT(!m_clipRects);
}
void RenderLayer::checkForRepaintOnResize()
void RenderLayer::operator delete(void* ptr, size_t sz)
{
- assert(inRenderLayerDestroy);
+ ASSERT(inRenderLayerDestroy);
// Stash size where destroy can find it.
*(size_t *)ptr = sz;
while (os && os != stop) {
if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
// Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
-// assert(!selectedObjects.get(os));
selectedObjects.set(os, new SelectionInfo(os));
RenderBlock* cb = os->containingBlock();
while (cb && !cb->isRenderView()) {
#ifndef NDEBUG
--BidiRunCounter::count;
#endif
- assert(inBidiRunDestroy);
+ ASSERT(inBidiRunDestroy);
// Stash size where destroy() can find it.
*(size_t*)ptr = sz;
if (start >= end)
return;
- assert(start >= 0 && end < sBidiRunCount);
+ ASSERT(start >= 0 && end < sBidiRunCount);
// Get the item before the start of the runs to reverse and put it in
// |beforeStart|. |curr| should point to the first run to reverse.
BidiContext *c = bidi.context->parent;
if (c) {
if (!emptyRun && bidi.eor != bidi.last) {
- assert(bidi.status.eor != OtherNeutral);
+ ASSERT(bidi.status.eor != OtherNeutral);
// bidi.sor ... bidi.eor ... bidi.last eor; need to append the bidi.sor-bidi.eor run or extend it through bidi.last
- assert(bidi.status.last == EuropeanNumberSeparator
+ ASSERT(bidi.status.last == EuropeanNumberSeparator
|| bidi.status.last == EuropeanNumberTerminator
|| bidi.status.last == CommonNumberSeparator
|| bidi.status.last == BoundaryNeutral
if (level < 61) {
if (!emptyRun && bidi.eor != bidi.last) {
- assert(bidi.status.eor != OtherNeutral);
+ ASSERT(bidi.status.eor != OtherNeutral);
// bidi.sor ... bidi.eor ... bidi.last eor; need to append the bidi.sor-bidi.eor run or extend it through bidi.last
- assert(bidi.status.last == EuropeanNumberSeparator
+ ASSERT(bidi.status.last == EuropeanNumberSeparator
|| bidi.status.last == EuropeanNumberTerminator
|| bidi.status.last == CommonNumberSeparator
|| bidi.status.last == BoundaryNeutral
// We should have a root inline box. It should be unconstructed and
// be the last continuation of our line list.
- assert(lastLineBox() && !lastLineBox()->isConstructed());
+ ASSERT(lastLineBox() && !lastLineBox()->isConstructed());
// Set bits on our inline flow boxes that indicate which sides should
// paint borders/margins/padding. This knowledge will ultimately be used when
sLastBidiRun = 0;
sBidiRunCount = 0;
- assert(bidi.dir == OtherNeutral);
+ ASSERT(bidi.dir == OtherNeutral);
emptyRun = true;
dirCurrent = bidi.status.last;
}
- assert(bidi.status.eor != OtherNeutral);
+ ASSERT(bidi.status.eor != OtherNeutral);
switch (dirCurrent) {
// embedding and overrides (X1-X9 in the Bidi specs)
bidi.dir = bidi.status.lastStrong == LeftToRight ? LeftToRight : EuropeanNumber;
break;
default:
- assert(false);
+ ASSERT(false);
}
appendRun(bidi);
}
}
} else if (o->isInlineFlow()) {
// Only empty inlines matter. We treat those similarly to replaced elements.
- assert(!o->firstChild());
+ ASSERT(!o->firstChild());
tmpW += o->marginLeft() + o->borderLeft() + o->paddingLeft() +
o->marginRight() + o->borderRight() + o->paddingRight();
} else if (o->isReplaced()) {