Document.isValid

Is this a valid html5 document?

struct Document
@property pure @safe nothrow const
bool
isValid
()

Examples

version(DigitalMars) scope(exit) assert(Document.RefCounter.refs.length == 0);
version(DigitalMars) scope(exit) assert(Element.RefCounter.refs.length == 0);

Document doc = Document("<html><body>");
Document doc2;
Document docCpy = doc;

assert(doc != null);
assert(doc.isValid);
assert(docCpy != null);
assert(docCpy.isValid);

assert(doc2 == null);
assert(!doc2.isValid);

assert(doc == docCpy);
assert(doc2 != doc);
assert(doc2 != docCpy);

assert(Document.RefCounter.refs.length == 1);
assert(Document.RefCounter.refs[doc.payload] == 2);

Meta