Skip to content

Commit

Permalink
Added HTML Button.
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Jul 30, 2013
1 parent b7a6b28 commit 7e42bd7
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/CsQuery/CsQuery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
<Compile Include="CQ_jQuery\Not.cs" />
<Compile Include="CQ_jQuery\Parents.cs" />
<Compile Include="Dom\enumCSSRuleType.cs" />
<Compile Include="Dom\HtmlElements\IHTMLButtonElement.cs" />
<Compile Include="Dom\HtmlElements\IHTMLTextAreaElement.cs" />
<Compile Include="Dom\ICSSRule.cs" />
<Compile Include="Dom\ICSSStyleRule.cs" />
Expand All @@ -178,6 +179,7 @@
<Compile Include="Dom\Implementation\CSSStyleChangedArgs.cs" />
<Compile Include="Dom\Implementation\CSSStyleRule.cs" />
<Compile Include="Dom\Implementation\CSSStyleSheet.cs" />
<Compile Include="Dom\Implementation\HtmlElements\HTMLButtonElement.cs" />
<Compile Include="Dom\Implementation\HtmlElements\FormAssociatedElement.cs" />
<Compile Include="Dom\Implementation\HtmlElements\FormReassociateableElement.cs" />
<Compile Include="Dom\Implementation\HtmlElements\HTMLStyleElement.cs" />
Expand Down
24 changes: 24 additions & 0 deletions source/CsQuery/Dom/HtmlElements/IHTMLButtonElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CsQuery
{
/// <summary>
/// An HTML BUTTON element.
/// </summary>
///
/// <url>
/// http://dev.w3.org/html5/markup/button.html
/// </url>

public interface IHTMLButtonElement : IDomElement
{
/// <summary>
/// The form with which to associate the element.
/// </summary>

IHTMLFormElement Form {get;}
}
}
2 changes: 2 additions & 0 deletions source/CsQuery/Dom/Implementation/DomElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ internal static DomElement Create(ushort nodeNameId)
return new HtmlAnchorElement();
case HtmlData.tagFORM:
return new HtmlFormElement();
case HtmlData.tagBUTTON:
return new HTMLButtonElement();
case HtmlData.tagINPUT:
return new HTMLInputElement();
case HtmlData.tagLABEL:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CsQuery.Dom.Implementation.HtmlElements;
using CsQuery.HtmlParser;

namespace CsQuery.Implementation
{
/// <summary>
/// An HTML button element.
/// </summary>

public class HTMLButtonElement : FormReassociateableElement, IHTMLButtonElement
{
/// <summary>
/// Default constructor.
/// </summary>

public HTMLButtonElement()
: base(HtmlData.tagBUTTON)
{
}

/// <summary>
/// The value of the "type" attribute. For button elements, this property always returns a
/// lowercase value and defaults to "submit" if there is no type attribute.
/// </summary>
///
/// <value>
/// The type.
/// </value>

public override string Type
{
get
{
return GetAttribute(HtmlData.attrTYPE, "submit").ToLower();
}
set
{
base.Type = value;
}
}
}
}

0 comments on commit 7e42bd7

Please sign in to comment.