本文整理汇总了C++中HTMLTableSectionElement类的典型用法代码示例。如果您正苦于以下问题:C++ HTMLTableSectionElement类的具体用法?C++ HTMLTableSectionElement怎么用?C++ HTMLTableSectionElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLTableSectionElement类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsHTMLTableSectionElementRows
JSValue jsHTMLTableSectionElementRows(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
JSHTMLTableSectionElement* castedThis = static_cast<JSHTMLTableSectionElement*>(asObject(slot.slotBase()));
UNUSED_PARAM(exec);
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThis->impl());
return toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->rows()));
}
示例2: switch
JSValue* JSHTMLTableSectionElement::getValueProperty(ExecState* exec, int token) const
{
switch (token) {
case AlignAttrNum: {
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
return jsString(exec, imp->align());
}
case ChAttrNum: {
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
return jsString(exec, imp->ch());
}
case ChOffAttrNum: {
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
return jsString(exec, imp->chOff());
}
case VAlignAttrNum: {
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
return jsString(exec, imp->vAlign());
}
case RowsAttrNum: {
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
return toJS(exec, WTF::getPtr(imp->rows()));
}
case ConstructorAttrNum:
return getConstructor(exec);
}
return 0;
}
示例3: jsHTMLTableSectionElementPrototypeFunctionDeleteRow
JSValue* jsHTMLTableSectionElementPrototypeFunctionDeleteRow(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSHTMLTableSectionElement::s_info))
return throwError(exec, TypeError);
JSHTMLTableSectionElement* castedThisObj = static_cast<JSHTMLTableSectionElement*>(thisValue);
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThisObj->impl());
ExceptionCode ec = 0;
int index = args[0]->toInt32(exec);
imp->deleteRow(index, ec);
setDOMException(exec, ec);
return jsUndefined();
}
示例4: provided
HTMLTableRowElement* HTMLTableElement::insertRow(
int index,
ExceptionState& exceptionState) {
if (index < -1) {
exceptionState.throwDOMException(
IndexSizeError,
"The index provided (" + String::number(index) + ") is less than -1.");
return nullptr;
}
HTMLTableRowElement* lastRow = nullptr;
HTMLTableRowElement* row = nullptr;
if (index == -1) {
lastRow = HTMLTableRowsCollection::lastRow(*this);
} else {
for (int i = 0; i <= index; ++i) {
row = HTMLTableRowsCollection::rowAfter(*this, lastRow);
if (!row) {
if (i != index) {
exceptionState.throwDOMException(
IndexSizeError,
"The index provided (" + String::number(index) +
") is greater than the number of rows in the table (" +
String::number(i) + ").");
return nullptr;
}
break;
}
lastRow = row;
}
}
ContainerNode* parent;
if (lastRow) {
parent = row ? row->parentNode() : lastRow->parentNode();
} else {
parent = lastBody();
if (!parent) {
HTMLTableSectionElement* newBody =
HTMLTableSectionElement::create(tbodyTag, document());
HTMLTableRowElement* newRow = HTMLTableRowElement::create(document());
newBody->appendChild(newRow, exceptionState);
appendChild(newBody, exceptionState);
return newRow;
}
}
HTMLTableRowElement* newRow = HTMLTableRowElement::create(document());
parent->insertBefore(newRow, row, exceptionState);
return newRow;
}
示例5: jsHTMLTableSectionElementPrototypeFunctionInsertRow
JSValue* jsHTMLTableSectionElementPrototypeFunctionInsertRow(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSHTMLTableSectionElement::s_info))
return throwError(exec, TypeError);
JSHTMLTableSectionElement* castedThisObj = static_cast<JSHTMLTableSectionElement*>(thisValue);
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThisObj->impl());
ExceptionCode ec = 0;
int index = args[0]->toInt32(exec);
KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->insertRow(index, ec)));
setDOMException(exec, ec);
return result;
}
示例6: jsHTMLTableSectionElementPrototypeFunctionDeleteRow
JSValue JSC_HOST_CALL jsHTMLTableSectionElementPrototypeFunctionDeleteRow(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSHTMLTableSectionElement::s_info))
return throwError(exec, TypeError);
JSHTMLTableSectionElement* castedThisObj = static_cast<JSHTMLTableSectionElement*>(asObject(thisValue));
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThisObj->impl());
ExceptionCode ec = 0;
int index = args.at(0).toInt32(exec);
imp->deleteRow(index, ec);
setDOMException(exec, ec);
return jsUndefined();
}
示例7: parentNode
int HTMLTableRowElement::rowIndex() const
{
ContainerNode* table = parentNode();
if (!table)
return -1;
table = table->parentNode();
if (!table || !table->hasTagName(tableTag))
return -1;
// To match Firefox, the row indices work like this:
// Rows from the first <thead> are numbered before all <tbody> rows.
// Rows from the first <tfoot> are numbered after all <tbody> rows.
// Rows from other <thead> and <tfoot> elements don't get row indices at all.
int rIndex = 0;
if (HTMLTableSectionElement* head = static_cast<HTMLTableElement*>(table)->tHead()) {
for (Node *row = head->firstChild(); row; row = row->nextSibling()) {
if (row == this)
return rIndex;
if (row->hasTagName(trTag))
++rIndex;
}
}
for (Node *node = table->firstChild(); node; node = node->nextSibling()) {
if (node->hasTagName(tbodyTag)) {
HTMLTableSectionElement* section = static_cast<HTMLTableSectionElement*>(node);
for (Node* row = section->firstChild(); row; row = row->nextSibling()) {
if (row == this)
return rIndex;
if (row->hasTagName(trTag))
++rIndex;
}
}
}
if (HTMLTableSectionElement* foot = static_cast<HTMLTableElement*>(table)->tFoot()) {
for (Node *row = foot->firstChild(); row; row = row->nextSibling()) {
if (row == this)
return rIndex;
if (row->hasTagName(trTag))
++rIndex;
}
}
// We get here for rows that are in <thead> or <tfoot> sections other than the main header and footer.
return -1;
}
示例8: jsHTMLTableSectionElementPrototypeFunctionInsertRow
JSValue JSC_HOST_CALL jsHTMLTableSectionElementPrototypeFunctionInsertRow(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSHTMLTableSectionElement::s_info))
return throwError(exec, TypeError);
JSHTMLTableSectionElement* castedThisObj = static_cast<JSHTMLTableSectionElement*>(asObject(thisValue));
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThisObj->impl());
ExceptionCode ec = 0;
int index = args.at(0).toInt32(exec);
JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->insertRow(index, ec)));
setDOMException(exec, ec);
return result;
}
示例9: GetSection
int32_t
HTMLTableRowElement::SectionRowIndex() const
{
HTMLTableSectionElement* section = GetSection();
if (!section) {
return -1;
}
nsCOMPtr<nsIHTMLCollection> coll = section->Rows();
uint32_t numRows = coll->Length();
for (uint32_t i = 0; i < numRows; i++) {
if (coll->GetElementAt(i) == this) {
return i;
}
}
return -1;
}
示例10: throwError
JSValue* JSHTMLTableSectionElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
if (!thisObj->inherits(&JSHTMLTableSectionElement::info))
return throwError(exec, TypeError);
JSHTMLTableSectionElement* castedThisObj = static_cast<JSHTMLTableSectionElement*>(thisObj);
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(castedThisObj->impl());
switch (id) {
case JSHTMLTableSectionElement::InsertRowFuncNum: {
ExceptionCode ec = 0;
bool indexOk;
int index = args[0]->toInt32(exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->insertRow(index, ec)));
setDOMException(exec, ec);
return result;
}
case JSHTMLTableSectionElement::DeleteRowFuncNum: {
ExceptionCode ec = 0;
bool indexOk;
int index = args[0]->toInt32(exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
imp->deleteRow(index, ec);
setDOMException(exec, ec);
return jsUndefined();
}
}
return 0;
}
示例11: Text
void FTPDirectoryTokenizer::appendEntry(const String& filename, const String& size, const String& date, bool isDirectory)
{
ExceptionCode ec;
RefPtr<Element> rowElement = m_doc->createElementNS(xhtmlNamespaceURI, "tr", ec);
rowElement->setAttribute("class", "ftpDirectoryEntryRow", ec);
RefPtr<Element> element = m_doc->createElementNS(xhtmlNamespaceURI, "td", ec);
element->appendChild(new Text(m_doc, String(&noBreakSpace, 1)), ec);
if (isDirectory)
element->setAttribute("class", "ftpDirectoryIcon ftpDirectoryTypeDirectory", ec);
else
element->setAttribute("class", "ftpDirectoryIcon ftpDirectoryTypeFile", ec);
rowElement->appendChild(element, ec);
element = createTDForFilename(filename);
element->setAttribute("class", "ftpDirectoryFileName", ec);
rowElement->appendChild(element, ec);
element = m_doc->createElementNS(xhtmlNamespaceURI, "td", ec);
element->appendChild(new Text(m_doc, date), ec);
element->setAttribute("class", "ftpDirectoryFileDate", ec);
rowElement->appendChild(element, ec);
element = m_doc->createElementNS(xhtmlNamespaceURI, "td", ec);
element->appendChild(new Text(m_doc, size), ec);
element->setAttribute("class", "ftpDirectoryFileSize", ec);
rowElement->appendChild(element, ec);
// Append the new row to the first tbody if it exists.
// Many <TABLE> elements end up having an implicit <TBODY> created for them and in those
// cases, it's more correct to append to the tbody instead of the table itself
HTMLTableSectionElement* body = m_tableElement->firstTBody();
if (body)
body->appendChild(rowElement, ec);
else
m_tableElement->appendChild(rowElement, ec);
}
示例12: setJSHTMLTableSectionElementVAlign
void setJSHTMLTableSectionElementVAlign(ExecState* exec, JSObject* thisObject, JSValue value)
{
HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(static_cast<JSHTMLTableSectionElement*>(thisObject)->impl());
imp->setVAlign(valueToStringWithNullCheck(exec, value));
}