Exemple #1
0
 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              = this.CreateWindow();
     _loader            = context.CreateResourceLoader();
     _loop              = this.CreateLoop();
     _mutations         = new MutationHost(_loop);
     _subtasks          = new List <Task>();
 }
Exemple #2
0
 /// <summary>
 /// Creates a new document node.
 /// </summary>
 /// <param name="context">The context of the document.</param>
 /// <param name="source">The underlying source.</param>
 internal Document(IBrowsingContext context, TextSource source)
     : base(null, "#document", NodeType.Document)
 {
     _async = true;
     _designMode = false;
     _firedUnload = false;
     _salvageable = true;
     _shown = false;
     _preferredStyleSheetSet = String.Empty;
     _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(AboutBlank);
     _ranges = new List<WeakReference<Range>>();
     _location.Changed += LocationChanged;
     _styleSheets = this.CreateStyleSheets();
     _view = this.CreateWindow();
     _loader = context.CreateResourceLoader();
     _loop = this.CreateLoop();
     _mutations = new MutationHost(_loop);
     _subtasks = new List<Task>();
 }