/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Make sure mCells is initialized.
nsIHTMLCollection* cells = Cells();
NS_ASSERTION(mCells, "How did that happen?");
nsCOMPtr<nsINode> nextSibling; // -1 means append, so should use null nextSibling if (aIndex != -1) {
nextSibling = cells->Item(aIndex); // Check whether we're inserting past end of list. We want to avoid doing // this unless we really have to, since this has to walk all our kids. If // we have a nextSibling, we're clearly not past end of list. if (!nextSibling) {
uint32_t cellCount = cells->Length(); if (aIndex > int32_t(cellCount)) {
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); return nullptr;
}
}
}
// create the cell
RefPtr<mozilla::dom::NodeInfo> nodeInfo;
nsContentUtils::QNameChanged(mNodeInfo, nsGkAtoms::td,
getter_AddRefs(nodeInfo));
if (aNamespaceID == kNameSpaceID_None) { if (aAttribute == nsGkAtoms::height) { // Per spec should be ParseNonzeroHTMLDimension, but no browsers do that. // See https://github.com/whatwg/html/issues/4716 return aResult.ParseHTMLDimension(aValue);
} if (aAttribute == nsGkAtoms::align) { return ParseTableCellHAlignValue(aValue, aResult);
} if (aAttribute == nsGkAtoms::bgcolor) { return aResult.ParseColor(aValue);
} if (aAttribute == nsGkAtoms::valign) { return ParseTableVAlignValue(aValue, aResult);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.