Skip to content

Commit

Permalink
Issue jamietre#134
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietre committed Feb 1, 2014
1 parent a46a19b commit aba9f82
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 51 deletions.
184 changes: 145 additions & 39 deletions distribution/CsQuery.XML
Original file line number Diff line number Diff line change
Expand Up @@ -5081,6 +5081,35 @@
A page rule.
</summary>
</member>
<member name="T:CsQuery.IFormReassociateableElement">
<summary>
An element that can be associated with a form during form submission.
</summary>
<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#category-form-attr
</url>
</member>
<member name="T:CsQuery.IFormAssociatedElement">
<summary>
An element that can be associated with a form during form submission.
</summary>
<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#form-associated-element
</url>
</member>
<member name="P:CsQuery.IFormAssociatedElement.Form">
<summary>
The form with which to associate the element.
</summary>
</member>
<member name="T:CsQuery.IFormSubmittableElement">
<summary>
An element that can be associated with a form during form submission.
</summary>
<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#category-submit
</url>
</member>
<member name="T:CsQuery.IHTMLButtonElement">
<summary>
An HTML BUTTON element.
Expand Down Expand Up @@ -5267,6 +5296,24 @@
IDomFragment object.
</summary>
</member>
<member name="M:CsQuery.IDomObject.GetAncestors">
<summary>
Returns all of the ancestors of the given node, in descending order of their depth from the root node.
</summary>
<returns>The ancestors.</returns>
</member>
<member name="M:CsQuery.IDomObject.GetDescendents">
<summary>
Returns all of the descendents of the given node, in pre-order depth first order.
</summary>
<returns>The descendents.</returns>
</member>
<member name="M:CsQuery.IDomObject.GetDescendentElements">
<summary>
Returns all IDomElement descendents of the given node, in pre-order depth first order.
</summary>
<returns>The descendents.</returns>
</member>
<member name="M:CsQuery.IDomObject.AppendChild(CsQuery.IDomObject)">
<summary>
Adds a node to the end of the list of children of a specified parent node. If the node
Expand Down Expand Up @@ -5868,6 +5915,19 @@
https://developer.mozilla.org/en/XUL/Property/checked
</url>
</member>
<member name="P:CsQuery.IDomObject.Disabled">
<summary>
Gets or sets a value indicating whether the element is disabled.
</summary>

<remarks>
In CsQuery, this property simply indicates the presence of a "disabled" attribute.
</remarks>

<url>
https://developer.mozilla.org/en/XUL/Property/disabled
</url>
</member>
<member name="P:CsQuery.IDomObject.ReadOnly">
<summary>
Gets or sets a value indicating whether the only should be read.
Expand Down Expand Up @@ -6004,11 +6064,6 @@
element node types)
</summary>
</member>
<member name="P:CsQuery.IHTMLButtonElement.Form">
<summary>
The form with which to associate the element.
</summary>
</member>
<member name="T:CsQuery.IHTMLTextAreaElement">
<summary>
An HTML TEXTAREA element.
Expand All @@ -6018,11 +6073,6 @@
http://dev.w3.org/html5/markup/textarea.html
</url>
</member>
<member name="P:CsQuery.IHTMLTextAreaElement.Form">
<summary>
The form with which to associate the element.
</summary>
</member>
<member name="T:CsQuery.ICSSRule">
<summary>
Interface for icss rule.
Expand Down Expand Up @@ -6276,10 +6326,23 @@
The CSS rules.
</value>
</member>
<member name="T:CsQuery.Implementation.HTMLButtonElement">
<member name="T:CsQuery.Implementation.FormSubmittableElement">
<summary>
An HTML button element.
An implementation of properties shared by all form submittable elements.
</summary>

<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#category-submit
</url>
</member>
<member name="T:CsQuery.Implementation.FormReassociateableElement">
<summary>
An implementation of properties shared by all form reassociateable elements.
</summary>

<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#categories
</url>
</member>
<member name="T:CsQuery.Implementation.DomElement">
<summary>
Expand Down Expand Up @@ -6349,6 +6412,24 @@
The path.
</returns>
</member>
<member name="M:CsQuery.Implementation.DomObject.GetAncestors">
<summary>
Returns all of the ancestors of the given node, in descending order of their depth from the root node.
</summary>
<returns>The ancestors.</returns>
</member>
<member name="M:CsQuery.Implementation.DomObject.GetDescendents">
<summary>
Returns all of the descendents of the given node, in pre-order depth first order.
</summary>
<returns>The descendents.</returns>
</member>
<member name="M:CsQuery.Implementation.DomObject.GetDescendentElements">
<summary>
Returns all IDomElement descendents of the given node, in pre-order depth first order.
</summary>
<returns>The descendents.</returns>
</member>
<member name="M:CsQuery.Implementation.DomObject.GetDepth">
<summary>
Gets the depth of the current node.
Expand Down Expand Up @@ -7151,6 +7232,15 @@
https://developer.mozilla.org/en/XUL/Property/checked
</url>
</member>
<member name="P:CsQuery.Implementation.DomObject.Disabled">
<summary>
Gets or sets a value indicating whether the element is disabled.
</summary>

<url>
https://developer.mozilla.org/en/XUL/Property/disabled
</url>
</member>
<member name="P:CsQuery.Implementation.DomObject.ReadOnly">
<summary>
Gets or sets a value indicating whether the only should be read.
Expand Down Expand Up @@ -8312,6 +8402,15 @@
https://developer.mozilla.org/en/XUL/Property/checked
</url>
</member>
<member name="P:CsQuery.Implementation.DomElement.Disabled">
<summary>
Gets or sets a value indicating whether the element is disabled.
</summary>

<url>
https://developer.mozilla.org/en/XUL/Property/disabled
</url>
</member>
<member name="P:CsQuery.Implementation.DomElement.ReadOnly">
<summary>
Gets or sets a value indicating whether the only should be read.
Expand Down Expand Up @@ -8390,13 +8489,13 @@
int
</returntype>
</member>
<member name="M:CsQuery.Dom.Implementation.HtmlElements.FormReassociateableElement.#ctor(System.UInt16)">
<member name="M:CsQuery.Implementation.FormReassociateableElement.#ctor(System.UInt16)">
<summary>
Constructor to specify the element's token ID.
</summary>
<param name="tokenId">The token ID of the element.</param>
</member>
<member name="P:CsQuery.Dom.Implementation.HtmlElements.FormReassociateableElement.Form">
<member name="P:CsQuery.Implementation.FormReassociateableElement.Form">
<summary>
The value of form element with which to associate the element.
</summary>
Expand All @@ -8408,6 +8507,27 @@
matching the value will be returned instead.
</remarks>
</member>
<member name="M:CsQuery.Implementation.FormSubmittableElement.#ctor(System.UInt16)">
<summary>
Constructor to specify the element's token ID.
</summary>
<param name="tokenId">The token ID of the element.</param>
</member>
<member name="P:CsQuery.Implementation.FormSubmittableElement.Disabled">
<summary>
A form submittable element is disabled if it has the disabled attribute,
or it is in a disabled fieldset and not in the legend.
</summary>

<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-fe-disabled
</url>
</member>
<member name="T:CsQuery.Implementation.HTMLButtonElement">
<summary>
An HTML button element.
</summary>
</member>
<member name="M:CsQuery.Implementation.HTMLButtonElement.#ctor">
<summary>
Default constructor.
Expand All @@ -8423,13 +8543,22 @@
The type.
</value>
</member>
<member name="M:CsQuery.Dom.Implementation.HtmlElements.FormAssociatedElement.#ctor(System.UInt16)">
<member name="T:CsQuery.Implementation.FormAssociatedElement">
<summary>
An implementation of properties shared by all form associated elements.
</summary>

<url>
http://www.w3.org/html/wg/drafts/html/master/forms.html#form-associated-element
</url>
</member>
<member name="M:CsQuery.Implementation.FormAssociatedElement.#ctor(System.UInt16)">
<summary>
Constructor to specify the element's token ID.
</summary>
<param name="tokenId">The token ID of the element.</param>
</member>
<member name="P:CsQuery.Dom.Implementation.HtmlElements.FormAssociatedElement.Form">
<member name="P:CsQuery.Implementation.FormAssociatedElement.Form">
<summary>
The value of form element with which to associate the element.
</summary>
Expand Down Expand Up @@ -8478,11 +8607,6 @@
http://dev.w3.org/html5/spec/single-page.html#the-label-element
</url>
</member>
<member name="P:CsQuery.IHTMLLabelElement.Form">
<summary>
The form to which the label belongs
</summary>
</member>
<member name="P:CsQuery.IHTMLLabelElement.HtmlFor">
<summary>
Gets or sets the for attribute
Expand Down Expand Up @@ -8804,11 +8928,6 @@
</summary>
<url>http://dev.w3.org/html5/spec/single-page.html#attr-option-disabled</url>
</member>
<member name="P:CsQuery.IHTMLOptionElement.Disabled">
<summary>
Gets or sets a value indicating whether this object is disabled.
</summary>
</member>
<member name="P:CsQuery.IHTMLOptionElement.Form">
<summary>
The form with which the element is associated
Expand All @@ -8828,11 +8947,6 @@
http://dev.w3.org/html5/markup/input.html
</url>
</member>
<member name="P:CsQuery.IHTMLInputElement.Form">
<summary>
The form with which to associate the element.
</summary>
</member>
<member name="P:CsQuery.IHTMLInputElement.Autofocus">
<summary>
A URL that provides the destination of the hyperlink. If the href attribute is not specified,
Expand Down Expand Up @@ -9377,11 +9491,6 @@
A SELECT element
</summary>
</member>
<member name="P:CsQuery.IHTMLSelectElement.Form">
<summary>
The form with which to associate the element.
</summary>
</member>
<member name="P:CsQuery.IHTMLSelectElement.Options">
<summary>
A collection of HTML option elements (in document order)
Expand Down Expand Up @@ -14781,9 +14890,6 @@
<member name="M:CsQuery.Implementation.CombinedStream.Read(System.Byte[],System.Int32,System.Int32)">
<summary> Reads from the next stream available </summary>
</member>
<member name="M:CsQuery.Implementation.CombinedStream.Dispose(System.Boolean)">
<summary> Disposes of all remaining streams. </summary>
</member>
<member name="P:CsQuery.Implementation.CombinedStream.CanRead">
<summary>
Gets a value indicating whether we can read.
Expand Down
Binary file modified distribution/CsQuery.dll
Binary file not shown.
Binary file modified distribution/CsQuery.pdb
Binary file not shown.
29 changes: 28 additions & 1 deletion source/CsQuery.Tests/Miscellaneous/Miscellaneous2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Reflection;
using System.Diagnostics;
using System.IO;
using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using Assert = NUnit.Framework.Assert;
Expand All @@ -14,7 +15,7 @@
using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext;
using CsQuery;
using CsQuery.Utility;
using System.Net;
using CsQuery.ExtensionMethods.Internal;

namespace CsQuery.Tests.Miscellaneous
{
Expand Down Expand Up @@ -263,6 +264,32 @@ public void Issue80()
var query = dom["div#123"];
Assert.AreEqual(1, query.Length);
}

[Test, TestMethod]
public void Issue145()
{
var dom= @"<html xmlns=""http://www.w3.org/1999/xhtml"" xmlns:xi=""http://www.w3.org/2001/XInclude""><body></html>";

var cq = CQ.CreateDocument(dom);
Assert.AreEqual(cq["html"].Attr("xmlns:xi"),"http://www.w3.org/2001/XInclude");
}

[Test, TestMethod]
public void Issue134()
{
var dom = @"<html xmlns=""http://www.w3.org/1999/xhtml"" xmlns:xi=""http://www.w3.org/2001/XInclude""><body></html>";

var str = dom.ToStream();

var cq = CQ.CreateDocument(str);

str.Position = 0;

var reader = new StreamReader(str);
var textOut = reader.ReadToEnd();
Assert.AreEqual(dom, textOut);
}

#region setup
public override void FixtureSetUp()
{
Expand Down
22 changes: 11 additions & 11 deletions source/CsQuery/Implementation/CombinedStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ public override int Read(byte[] buffer, int offset, int count)
if (len > 0)
return len;

_streams.Current.Dispose();
//_streams.Current.Dispose();
_valid = _streams.MoveNext();
}

return 0;
}
/// <summary> Disposes of all remaining streams. </summary>
protected override void Dispose(bool disposing)
{
while (disposing && _valid)
{
_streams.Current.Dispose();
_valid = _streams.MoveNext();
}

base.Dispose(disposing);
}
//protected override void Dispose(bool disposing)
//{
// while (disposing && _valid)
// {
// _streams.Current.Dispose();
// _valid = _streams.MoveNext();
// }

// base.Dispose(disposing);
//}
}

/// <summary>
Expand Down

0 comments on commit aba9f82

Please sign in to comment.