internal Document(IBrowsingContext context, TextSource source) : base(null, "#document", NodeType.Document) { _async = true; _designMode = false; _firedUnload = false; _salvageable = true; _shown = false; _context = context; _source = source; Referrer = String.Empty; ContentType = MimeTypeNames.ApplicationXml; _ready = DocumentReadyState.Loading; _sandbox = Sandboxes.None; _quirksMode = QuirksMode.Off; _loadingScripts = new Queue <HtmlScriptElement>(); _location = new Location("about:blank"); _ranges = new List <WeakReference <Range> >(); _location.Changed += LocationChanged; _view = new Window(this); _loader = context.CreateService <IResourceLoader>(); _loop = context.CreateService <IEventLoop>(); _mutations = new MutationHost(_loop); _subtasks = new List <Task>(); _statusCode = HttpStatusCode.OK; }