void MarkupAccumulator::appendDocumentType(StringBuilder& result, const DocumentType& n) { if (n.name().isEmpty()) return; result.appendLiteral("<!DOCTYPE "); result.append(n.name()); if (!n.publicId().isEmpty()) { result.appendLiteral(" PUBLIC \""); result.append(n.publicId()); result.append('"'); if (!n.systemId().isEmpty()) { result.appendLiteral(" \""); result.append(n.systemId()); result.append('"'); } } else if (!n.systemId().isEmpty()) { result.appendLiteral(" SYSTEM \""); result.append(n.systemId()); result.append('"'); } if (!n.internalSubset().isEmpty()) { result.appendLiteral(" ["); result.append(n.internalSubset()); result.append(']'); } result.append('>'); }
JSValue jsDocumentTypeInternalSubset(ExecState* exec, const Identifier&, const PropertySlot& slot) { JSDocumentType* castedThis = static_cast<JSDocumentType*>(asObject(slot.slotBase())); UNUSED_PARAM(exec); DocumentType* imp = static_cast<DocumentType*>(castedThis->impl()); return jsStringOrNull(exec, imp->internalSubset()); }
JSValue* JSDocumentType::getValueProperty(ExecState* exec, int token) const { switch (token) { case NameAttrNum: { DocumentType* imp = static_cast<DocumentType*>(impl()); return jsString(exec, imp->name()); } case EntitiesAttrNum: { DocumentType* imp = static_cast<DocumentType*>(impl()); return toJS(exec, WTF::getPtr(imp->entities())); } case NotationsAttrNum: { DocumentType* imp = static_cast<DocumentType*>(impl()); return toJS(exec, WTF::getPtr(imp->notations())); } case PublicIdAttrNum: { DocumentType* imp = static_cast<DocumentType*>(impl()); return jsStringOrNull(exec, imp->publicId()); } case SystemIdAttrNum: { DocumentType* imp = static_cast<DocumentType*>(impl()); return jsStringOrNull(exec, imp->systemId()); } case InternalSubsetAttrNum: { DocumentType* imp = static_cast<DocumentType*>(impl()); return jsStringOrNull(exec, imp->internalSubset()); } case ConstructorAttrNum: return getConstructor(exec); } return 0; }
JSValue jsDocumentTypeInternalSubset(ExecState* exec, JSValue slotBase, const Identifier&) { JSDocumentType* castedThis = static_cast<JSDocumentType*>(asObject(slotBase)); UNUSED_PARAM(exec); DocumentType* imp = static_cast<DocumentType*>(castedThis->impl()); JSValue result = jsStringOrNull(exec, imp->internalSubset()); return result; }