public HtmlIFrameElement(Document owner, String prefix = null)
     : base(owner, Tags.Iframe, prefix, NodeFlags.LiteralText)
 {
     _context = owner.NewChildContext(Sandboxes.None);
     RegisterAttributeObserver(AttributeNames.Src, UpdateSource);
     RegisterAttributeObserver(AttributeNames.SrcDoc, UpdateSource);
 }
 private StyleSheetRequestProcessor(HtmlLinkElement link, Document document, IResourceLoader loader)
     : base(loader)
 {
     _link = link;
     _document = document;
     _loader = loader;
 }
Example #3
0
 /// <summary>
 /// Creates a new element node.
 /// </summary>
 public Element(Document owner, String name, String localName, String prefix, String namespaceUri, NodeFlags flags = NodeFlags.None)
     : base(owner, name, NodeType.Element, flags)
 {
     _localName = localName;
     _prefix = prefix;
     _namespace = namespaceUri;
     _attributes = new NamedNodeMap(this);
 }
 /// <summary>
 /// Creates a new instance of the XML parser with the specified document.
 /// </summary>
 /// <param name="document">The document instance to be constructed.</param>
 internal XmlDomBuilder(Document document)
 {
     _tokenizer = new XmlTokenizer(document.Source, document.Options.Events);
     _document = document;
     _standalone = false;
     _openElements = new List<Element>();
     _currentMode = XmlTreeMode.Initial;
 }
Example #5
0
 /// <summary>
 /// Creates a new instance of the XML parser.
 /// </summary>
 /// <param name="document">The document instance to be filled.</param>
 internal XmlDomBuilder(Document document)
 {
     var resolver = document.Options.GetService<IEntityService>() ?? XmlEntityService.Resolver;
     _tokenizer = new XmlTokenizer(document.Source, document.Options.Events, resolver);
     _document = document;
     _standalone = false;
     _openElements = new List<Element>();
     _currentMode = XmlTreeMode.Initial;
 }
Example #6
0
        /// <summary>
        /// Returns a specialized SVGElement instance for the given tag name.
        /// </summary>
        /// <param name="document">The document that owns the element.</param>
        /// <param name="localName">The given tag name.</param>
        /// <param name="prefix">The prefix of the element, if any.</param>
        /// <returns>The specialized SVGElement instance.</returns>
        public SvgElement Create(Document document, String localName, String prefix = null)
        {
            Creator creator;

            if (creators.TryGetValue(localName, out creator))
                return creator(document, prefix);

            return new SvgElement(document, localName);
        }
Example #7
0
 /// <summary>
 /// Creates a new element node.
 /// </summary>
 public Element(Document owner, String name, String localName, String prefix, String namespaceUri, NodeFlags flags = NodeFlags.None)
     : base(owner, name, NodeType.Element, flags)
 {
     _localName = localName;
     _prefix = prefix;
     _namespace = namespaceUri;
     _attributes = new List<IAttr>();
     _attributeHandlers = new Dictionary<String, Action<String>>();
 }
Example #8
0
 /// <summary>
 /// Creates a new instance of the XML parser.
 /// </summary>
 /// <param name="document">The document instance to be filled.</param>
 /// <param name="creator">The optional non-standard creator to use.</param>
 internal XmlDomBuilder(Document document, Func<Document, String, String, Element> creator = null)
 {
     var resolver = document.Options.GetProvider<IEntityProvider>() ?? XmlEntityService.Resolver;
     _tokenizer = new XmlTokenizer(document.Source, resolver);
     _document = document;
     _standalone = false;
     _openElements = new List<Element>();
     _currentMode = XmlTreeMode.Initial;
     _creator = creator ?? CreateElement;
 }
        /// <summary>
        /// Returns a specialized SVGElement instance for the given tag name.
        /// </summary>
        /// <param name="document">The document that owns the element.</param>
        /// <param name="localName">The given tag name.</param>
        /// <param name="prefix">The prefix of the element, if any.</param>
        /// <returns>The specialized SVGElement instance.</returns>
        public SvgElement Create(Document document, String localName, String prefix = null)
        {
            var creator = default(Creator);

            if (creators.TryGetValue(localName, out creator))
            {
                return creator(document, prefix);
            }

            return new SvgElement(document, localName);
        }
Example #10
0
 public Window(Document document)
 {
     _document = document;
     _tasks = new List<CancellationTokenSource>();
 }
Example #11
0
 /// <summary>
 /// Creates a new notation node.
 /// </summary>
 internal Notation(Document owner)
     : base(owner, "#notation", NodeType.Notation)
 {
 }
        /// <summary>
        /// Returns a specialized HTMLElement instance for the given tag name.
        /// </summary>
        /// <param name="document">The document that owns the element.</param>
        /// <param name="localName">The given tag name.</param>
        /// <param name="prefix">The prefix of the element, if any.</param>
        /// <returns>The specialized HTMLElement instance.</returns>
        public HtmlElement Create(Document document, String localName, String prefix = null)
        {
            var creator = default(Creator);

            if (creators.TryGetValue(localName, out creator))
            {
                return creator(document, prefix);
            }

            return new HtmlUnknownElement(document, localName.ToLowerInvariant(), prefix);
        }
Example #13
0
 /// <summary>
 /// Copies all (Document) properties of the source to the target.
 /// </summary>
 /// <param name="source">The source document.</param>
 /// <param name="target">The target document.</param>
 /// <param name="deep">Is a deep-copy required?</param>
 static protected void CopyDocumentProperties(Document source, Document target, Boolean deep)
 {
     target._ready = source._ready;
     target._referrer = source._referrer;
     target._location.Href = source._location.Href;
     target._quirksMode = source._quirksMode;
     target._sandbox = source._sandbox;
     target._async = source._async;
     target._contentType = source._contentType;
 }
Example #14
0
 /// <summary>
 /// Creates a new document fragment.
 /// </summary>
 internal DocumentFragment(Document owner)
     : base(owner, "#document-fragment", NodeType.DocumentFragment)
 {
 }
Example #15
0
 /// <summary>
 /// Creates a new entity node.
 /// </summary>
 /// <param name="owner">The initial owner.</param>
 /// <param name="name">Name of the entity.</param>
 internal Entity(Document owner, String name)
     : base(owner, name, NodeType.Entity)
 {
 }
Example #16
0
 internal CharacterData(Document owner, String name, NodeType type, String content)
     : base(owner, name, type)
 {
     _content = content;
 }
Example #17
0
 /// <summary>
 /// Creates a new element node.
 /// </summary>
 public Element(Document owner, String name, NodeFlags flags = NodeFlags.None)
     : this(owner, name, null, null, flags)
 {
 }
 /// <summary>
 /// Creates a new processing instruction node.
 /// </summary>
 internal ProcessingInstruction(Document owner, String name)
     : base(owner, name, NodeType.ProcessingInstruction)
 {
 }
Example #19
0
 /// <summary>
 /// Creates a new document type node.
 /// </summary>
 internal DocumentType(Document owner, String name)
     : base(owner, name, NodeType.DocumentType)
 {
     PublicIdentifier = String.Empty;
     SystemIdentifier = String.Empty;
 }
 /// <summary>
 /// Returns a specialized SVGElement instance for the given tag name.
 /// </summary>
 /// <param name="document">The document that owns the element.</param>
 /// <param name="localName">The name to be sanatized.</param>
 /// <returns>The specialized SVGElement instance.</returns>
 public SvgElement CreateSanatized(Document document, String localName)
 {
     var newTag = SanatizeTag(localName);
     return Create(document, newTag);
 }
 private ScriptRequestProcessor(HtmlScriptElement script, Document document, IResourceLoader loader)
 {
     _script = script;
     _document = document;
     _loader = loader;
 }
Example #22
0
 public DomImplementation(Document owner)
 {
     _owner = owner;
 }
Example #23
0
 internal CharacterData(Document owner, String name, NodeType type)
     : this(owner, name, type, String.Empty)
 {
 }
Example #24
0
 /// <summary>
 /// Creates a new entity node.
 /// </summary>
 /// <param name="owner">The initial owner.</param>
 /// <param name="name">Name of the entity reference.</param>
 internal EntityReference(Document owner, String name)
     : base(owner, name, NodeType.EntityReference)
 {
 }
Example #25
0
 /// <summary>
 /// Creates a new text node with the given text.
 /// </summary>
 /// <param name="owner">The initial owner.</param>
 /// <param name="text">The text to set.</param>
 internal TextNode(Document owner, String text)
     : base(owner, "#text", NodeType.Text, text)
 {
 }
Example #26
0
 /// <summary>
 /// Creates a new entity node.
 /// </summary>
 internal Entity(Document owner)
     : this(owner, String.Empty)
 {
 }
Example #27
0
 /// <summary>
 /// Creates a new element node.
 /// </summary>
 public Element(Document owner, String localName, String prefix, String namespaceUri, NodeFlags flags = NodeFlags.None)
     : this(owner, prefix != null ? String.Concat(prefix, ":", localName) : localName, localName, prefix, namespaceUri, flags)
 {
 }
Example #28
0
 static Element CreateElement(Document document, String name, String prefix)
 {
     return new XmlElement(document, name, prefix);
 }
 public HtmlIFrameElement(Document owner, String prefix = null)
     : base(owner, TagNames.Iframe, prefix, NodeFlags.LiteralText)
 {
 }
Example #30
0
 /// <summary>
 /// Creates a new empty text node.
 /// </summary>
 internal TextNode(Document owner)
     : this(owner, String.Empty)
 {
 }