コード例 #1
0
 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);
 }
コード例 #2
0
 private StyleSheetRequestProcessor(HtmlLinkElement link, Document document, IResourceLoader loader)
     : base(loader)
 {
     _link = link;
     _document = document;
     _loader = loader;
 }
コード例 #3
0
ファイル: Element.cs プロジェクト: howej/AngleSharp
 /// <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);
 }
コード例 #4
0
 /// <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;
 }
コード例 #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;
 }
コード例 #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);
        }
コード例 #7
0
ファイル: Element.cs プロジェクト: sparra/AngleSharp
 /// <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>>();
 }
コード例 #8
0
ファイル: XmlDomBuilder.cs プロジェクト: Wojdav/AngleSharp
 /// <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;
 }
コード例 #9
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)
        {
            var creator = default(Creator);

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

            return new SvgElement(document, localName);
        }
コード例 #10
0
ファイル: Window.cs プロジェクト: JackieyLi/AngleSharp
 public Window(Document document)
 {
     _document = document;
     _tasks = new List<CancellationTokenSource>();
 }
コード例 #11
0
ファイル: Notation.cs プロジェクト: sparra/AngleSharp
 /// <summary>
 /// Creates a new notation node.
 /// </summary>
 internal Notation(Document owner)
     : base(owner, "#notation", NodeType.Notation)
 {
 }
コード例 #12
0
        /// <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);
        }
コード例 #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;
 }
コード例 #14
0
ファイル: DocumentFragment.cs プロジェクト: JBTech/AngleSharp
 /// <summary>
 /// Creates a new document fragment.
 /// </summary>
 internal DocumentFragment(Document owner)
     : base(owner, "#document-fragment", NodeType.DocumentFragment)
 {
 }
コード例 #15
0
ファイル: Entity.cs プロジェクト: sparra/AngleSharp
 /// <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)
 {
 }
コード例 #16
0
ファイル: CharacterData.cs プロジェクト: Wojdav/AngleSharp
 internal CharacterData(Document owner, String name, NodeType type, String content)
     : base(owner, name, type)
 {
     _content = content;
 }
コード例 #17
0
ファイル: Element.cs プロジェクト: sparra/AngleSharp
 /// <summary>
 /// Creates a new element node.
 /// </summary>
 public Element(Document owner, String name, NodeFlags flags = NodeFlags.None)
     : this(owner, name, null, null, flags)
 {
 }
コード例 #18
0
 /// <summary>
 /// Creates a new processing instruction node.
 /// </summary>
 internal ProcessingInstruction(Document owner, String name)
     : base(owner, name, NodeType.ProcessingInstruction)
 {
 }
コード例 #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;
 }
コード例 #20
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 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);
 }
コード例 #21
0
 private ScriptRequestProcessor(HtmlScriptElement script, Document document, IResourceLoader loader)
 {
     _script = script;
     _document = document;
     _loader = loader;
 }
コード例 #22
0
 public DomImplementation(Document owner)
 {
     _owner = owner;
 }
コード例 #23
0
ファイル: CharacterData.cs プロジェクト: Wojdav/AngleSharp
 internal CharacterData(Document owner, String name, NodeType type)
     : this(owner, name, type, String.Empty)
 {
 }
コード例 #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)
 {
 }
コード例 #25
0
ファイル: TextNode.cs プロジェクト: fjwuyongzhi/AngleSharp
 /// <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)
 {
 }
コード例 #26
0
ファイル: Entity.cs プロジェクト: sparra/AngleSharp
 /// <summary>
 /// Creates a new entity node.
 /// </summary>
 internal Entity(Document owner)
     : this(owner, String.Empty)
 {
 }
コード例 #27
0
ファイル: Element.cs プロジェクト: sparra/AngleSharp
 /// <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)
 {
 }
コード例 #28
0
ファイル: XmlDomBuilder.cs プロジェクト: Wojdav/AngleSharp
 static Element CreateElement(Document document, String name, String prefix)
 {
     return new XmlElement(document, name, prefix);
 }
コード例 #29
0
 public HtmlIFrameElement(Document owner, String prefix = null)
     : base(owner, TagNames.Iframe, prefix, NodeFlags.LiteralText)
 {
 }
コード例 #30
0
ファイル: TextNode.cs プロジェクト: fjwuyongzhi/AngleSharp
 /// <summary>
 /// Creates a new empty text node.
 /// </summary>
 internal TextNode(Document owner)
     : this(owner, String.Empty)
 {
 }