internal DocumentWrapper(GumboDocumentNode node, WrapperFactory factory) : base(node, null) { _Children = factory.CreateDisposalAwareLazy(() => ImmutableArray.CreateRange(node.GetChildren().OrderBy(x => x.index_within_parent).Select(x => factory.CreateNodeWrapper(x, this)))); HasDocType = node.document.has_doctype; Name = NativeUtf8Helper.StringFromNativeUtf8(node.document.name); PublicIdentifier = NativeUtf8Helper.StringFromNativeUtf8(node.document.public_identifier); SystemIdentifier = NativeUtf8Helper.StringFromNativeUtf8(node.document.system_identifier); DocTypeQuirksMode = node.document.doc_type_quirks_mode; }
internal DocumentWrapper(GumboDocumentNode node, WrapperFactory factory) : base(node, null) { _Children = factory.CreateDisposalAwareLazy(() => ImmutableArray.CreateRange(node.GetChildren().OrderBy(x => x.index_within_parent).Select(x => factory.CreateNodeWrapper(x, this)))); HasDocType = node.document.has_doctype; Name = NativeUtf8Helper.StringFromNativeUtf8(node.document.name); PublicIdentifier = NativeUtf8Helper.StringFromNativeUtf8(node.document.public_identifier); SystemIdentifier = NativeUtf8Helper.StringFromNativeUtf8(node.document.system_identifier); DocTypeQuirksMode = node.document.doc_type_quirks_mode; }
internal DocumentWrapper(GumboDocumentNode node, DisposalAwareLazyFactory lazyFactory, Action <string, ElementWrapper> addElementWithId) : base(node, null) { _Children = lazyFactory.Create <IEnumerable <ElementWrapper> >(() => { return(node.GetChildren().Select(x => new ElementWrapper((GumboElementNode)x, this, lazyFactory, addElementWithId)).ToList().AsReadOnly()); }); HasDocType = node.document.has_doctype; Name = NativeUtf8Helper.StringFromNativeUtf8(node.document.name); PublicIdentifier = NativeUtf8Helper.StringFromNativeUtf8(node.document.public_identifier); SystemIdentifier = NativeUtf8Helper.StringFromNativeUtf8(node.document.system_identifier); DocTypeQuirksMode = node.document.doc_type_quirks_mode; }