Beispiel #1
0
        public void HtmlHasRightHeadElement()
        {
            var document = new HtmlDocument();
            var root     = new HtmlHtmlElement(document);

            document.AppendChild(root);
            var head = new HtmlHeadElement(document);

            root.AppendChild(head);
            Assert.AreEqual(head, document.Head);
        }
Beispiel #2
0
        public void HtmlHasRightBodyElement()
        {
            var document = new HtmlDocument();
            var root     = new HtmlHtmlElement(document);

            document.AppendChild(root);
            var body = new HtmlBodyElement(document);

            root.AppendChild(body);
            Assert.AreEqual(body, document.Body);
        }
Beispiel #3
0
        /// <summary>
        /// Applies the manifest to the given document.
        /// </summary>
        /// <param name="document">The document to modify.</param>
        /// <param name="root">The document's element.</param>
        public static void ApplyManifest(this Document document, HtmlHtmlElement root)
        {
            if (!document.IsInBrowsingContext)
            {
                return;
            }

            var manifest = root.Manifest;
            //TODO
            //Replace by algorithm to resolve the value of that attribute to an absolute URL,
            //relative to the newly created element.
            Predicate <String> CanResolve = str => false;

            if (!String.IsNullOrEmpty(manifest) && CanResolve(manifest))
            {
                //Run the application cache selection algorithm with the result of applying the URL serializer
                //algorithm to the resulting parsed URL with the exclude fragment flag set.
            }
            else
            {
                //Run the application cache selection algorithm with no manifest.
                //The algorithm must be passed the Document object.
            }
        }