3 | Textarea
4 |
9 |
10 | script
11 |
12 |
17 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/anchor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Anchor
6 |
7 |
8 |
9 | View Submit Button
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/anchor2.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - Anchor
7 |
8 |
9 |
10 | View Submit Button
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/anchor3.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - Anchor
7 |
8 |
9 |
10 | View Submit Button
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/applet.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Applet
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/applet2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Applet
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/area.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Area
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/area2.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - Area
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/base.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - Base
7 |
8 |
9 |
Some Text
10 |
11 |
12 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/base2.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
NIST DOM HTML Test - Base2
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/basefont.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - BaseFont
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/body.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Body
6 |
7 |
8 |
Hello, World
9 |
10 |
11 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/br.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - BR
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/button.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Button
6 |
7 |
8 |
13 |
14 |
15 |
16 | Extra Button
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/directory.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Directory
6 |
7 |
8 |
9 | DIR item number 1.
10 | DIR item number 2.
11 | DIR item number 3.
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/div.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - DIV
6 |
7 |
8 |
The DIV element is a generic block container. This text should be centered.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/dl.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - DL
6 |
7 |
8 |
9 | Accountant
10 | 56,000
11 | Female
12 | 1230 North Ave. Dallas, Texas 98551
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/fieldset.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - FieldSet
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 | All data entered must be valid
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/font.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Font
6 |
7 |
8 |
Test Tables
9 |
10 |
11 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - FORM
6 |
7 |
8 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/form2.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - FORM
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/form3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
FORM3
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/frame.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - FRAME
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/frame2.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - FRAME2
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/frameset.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - FRAMESET
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - HEAD
6 |
7 |
8 |
Hello, World.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/heading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - HEADING
6 |
7 |
8 |
Head Element 1
9 |
Head Element 2
10 |
Head Element 3
11 |
Head Element 4
12 |
Head Element 5
13 |
Head Element 6
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/hr.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - HR
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/html.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - Html
6 |
7 |
8 |
Hello, World.
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - IFRAME
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/iframe2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - IFRAME2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/img.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - IMG
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/img/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery.Tests/Resources/jsdom/Level2/img/right.png
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/img/w3c_main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery.Tests/Resources/jsdom/Level2/img/w3c_main.png
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/isindex.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - ISINDEX
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/js/script1.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery.Tests/Resources/jsdom/Level2/js/script1.js
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/label.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - LABEL
6 |
7 |
8 |
9 |
10 | Enter Your First Password:
11 |
12 |
13 |
14 |
15 | Enter Your Second Password:
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/legend.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - LEGEND
6 |
7 |
8 |
9 |
10 | Enter Password1:
11 |
12 |
13 |
14 |
15 | Enter Password2:
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/li.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - LI
6 |
7 |
8 |
9 | EMP0001
10 |
11 | Margaret Martin
12 |
13 | Accountant
14 | 56,000
15 | Female
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/link.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - LINK
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/link2.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - LINK
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/map.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - MAP
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/menu.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - MENU
6 |
7 |
8 |
9 | Interview
10 | Paperwork
11 | Give start date
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/meta.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - META
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/mod.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - MOD
6 |
7 |
8 |
9 | The INS element is used to indicate that a section of a document had been inserted.
10 |
11 | The DEL element is used to indicate that a section of a document had been removed.
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/object.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - OBJECT
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/object2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - OBJECT
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/olist.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - OLIST
6 |
7 |
8 |
9 | EMP0001
10 |
11 | Margaret Martin
12 |
13 | Accountant
14 | 56,000
15 |
16 |
17 |
18 |
19 | EMP0002
20 |
21 | Martha Raynolds
22 |
23 | Secretary
24 | 35,000
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/optgroup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - OPTGROUP
6 |
7 |
8 |
9 |
10 |
11 |
12 | EMP0001
13 | EMP0002
14 | EMP0003A
15 |
16 |
17 | EMP0004
18 | EMP0005
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/option.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - OPTION
6 |
7 |
8 |
9 |
10 |
11 | EMP10001
12 | EMP10002
13 | EMP10003
14 | EMP10004
15 | EMP10005
16 |
17 |
18 |
19 |
20 |
21 | EMP20001
22 | EMP20002
23 | EMP20003
24 | EMP20004
25 | EMP20005
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/optionscollection.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - OPTIONSCOLLECTION
6 |
7 |
8 |
9 |
10 |
11 | EMP10001
12 | EMP10002
13 | EMP10003
14 | EMP10004
15 | EMP10005
16 |
17 |
18 |
19 |
20 |
21 | EMP20001
22 | EMP20002
23 | EMP20003
24 | EMP20004
25 | EMP20005
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/paragraph.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - PARAGRAPH
6 |
7 |
8 |
9 | TEXT
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/param.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - PARAM
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/pre.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - PRE
6 |
7 |
8 |
The PRE is used to indicate pre-formatted text. Visual agents may:
9 |
10 | leave white space intact.
11 | May render text with a fixed-pitch font.
12 | May disable automatic word wrap.
13 | Must not disable bidirectional processing.
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/quote.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - QUOTE
6 |
7 |
8 |
9 | The Q element is intended for short quotations
10 |
11 |
12 | The BLOCKQUOTE element is used for long quotations.
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery.Tests/Resources/jsdom/Level2/right.png
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/script.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - SCRIPT
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/select.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - SELECT
6 |
7 |
8 |
9 |
10 |
11 | EMP10001
12 | EMP10002
13 | EMP10003
14 | EMP10004
15 | EMP10005
16 |
17 |
18 |
19 |
20 |
21 | EMP20001
22 | EMP20002
23 | EMP20003
24 | EMP20004
25 | EMP20005
26 |
27 |
28 |
29 |
30 | EMP30001
31 | EMP30002
32 | EMP30003
33 | EMP30004
34 | EMP30005
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/style.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
NIST DOM HTML Test - STYLE
7 |
8 |
9 |
Hello, World.
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/table1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - TABLE
6 |
7 |
8 |
9 | HTML can't abide empty table
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/tablecaption.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - TABLECAPTION
6 |
7 |
8 |
9 | CAPTION 1
10 |
11 | Employee Id
12 | Employee Name
13 | Position
14 | Salary
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/tablecell.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - TABLECELL
6 |
7 |
8 |
9 |
10 |
11 |
12 | Position
13 | Salary
14 |
15 |
16 |
17 |
18 | Accountant
19 | 56,000
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/tablecol.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - TABLECOL
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Id
14 | Name
15 | Position
16 | Salary
17 |
18 |
19 | EMP0001
20 | Martin
21 | Accountant
22 | 56,000
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/textarea.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - TEXTAREA
6 |
7 |
8 |
9 |
10 | TEXTAREA1
11 |
12 |
13 |
14 |
15 |
16 | TEXTAREA2
17 |
18 |
19 | TEXTAREA3
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/title.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - TITLE
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/ulist.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
NIST DOM HTML Test - ULIST
6 |
7 |
8 |
9 | EMP0001
10 |
11 | Margaret Martin
12 |
13 | Accountant
14 | 56,000
15 | Female
16 | 1230 North Ave. Dallas, Texas 98551
17 |
18 |
19 |
20 |
21 | EMP0002
22 |
23 | Martha Raynolds
24 |
25 | Secretary
26 | 35,000
27 | Female
28 | 1900 Dallas Road. Dallas, Texas 98554
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/Resources/jsdom/Level2/w3c_main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery.Tests/Resources/jsdom/Level2/w3c_main.png
--------------------------------------------------------------------------------
/source/CsQuery.Tests/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/jsdom/JsdomTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Tests.jsdom
7 | {
8 | public abstract class JsDomTest : CsQueryTest
9 | {
10 | protected abstract string Root { get; }
11 | protected IDomDocument Load(string file)
12 | {
13 | return TestDom("jsdom\\" + Root + "\\" + file + ".html").Document;
14 | }
15 | }
16 |
17 |
18 | public abstract class JsDomTest_Level2 : JsDomTest
19 | {
20 |
21 | protected override string Root
22 | {
23 | get { return "Level2"; }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/CsQuery.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_CsQuery/FirstElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using CsQuery.Utility;
7 | using CsQuery.ExtensionMethods;
8 | using CsQuery.ExtensionMethods.Internal;
9 | using CsQuery.Engine;
10 | using CsQuery.Implementation;
11 |
12 | namespace CsQuery
13 | {
14 | public partial class CQ
15 | {
16 | ///
17 | /// The first IDomElement (e.g. not text/special nodes) in the selection set, or null if none
18 | /// exists.
19 | ///
20 | ///
21 | ///
22 | /// An IDomElement object.
23 | ///
24 |
25 | public IDomElement FirstElement()
26 | {
27 |
28 | using (IEnumerator
sequence = Elements.GetEnumerator())
29 | {
30 | if (sequence.MoveNext())
31 | {
32 | return sequence.Current;
33 | }
34 | else
35 | {
36 | return null;
37 | }
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_CsQuery/HasAttr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using CsQuery.Utility;
7 | using CsQuery.ExtensionMethods;
8 | using CsQuery.ExtensionMethods.Internal;
9 | using CsQuery.Engine;
10 | using CsQuery.Implementation;
11 | using CsQuery.HtmlParser;
12 |
13 | namespace CsQuery
14 | {
15 | public partial class CQ
16 | {
17 |
18 | ///
19 | /// Test for the existence of an attribute.
20 | ///
21 | ///
22 | ///
23 | /// The name of the attribute to get.
24 | ///
25 | ///
26 | ///
27 | /// A string of the attribute value, or null if the attribute does not exist.
28 | ///
29 |
30 | public bool HasAttr(string name)
31 | {
32 | if (Length > 0 && !string.IsNullOrEmpty(name))
33 | {
34 | return this[0].HasAttribute(name);
35 | }
36 | return false;
37 | }
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_CsQuery/IncludeWhen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using CsQuery.Utility;
7 | using CsQuery.ExtensionMethods;
8 | using CsQuery.ExtensionMethods.Internal;
9 | using CsQuery.Engine;
10 | using CsQuery.Implementation;
11 |
12 | namespace CsQuery
13 | {
14 | public partial class CQ
15 | {
16 |
17 |
18 | ///
19 | /// Conditionally includes a selection. This is the equivalent of calling Remove() only when
20 | /// "include" is false.
21 | ///
22 | ///
23 | ///
24 | /// true to include, false to exclude.
25 | ///
26 | ///
27 | ///
28 | /// The current CQ object
29 | ///
30 |
31 | public CQ IncludeWhen(bool include)
32 | {
33 | if (!include)
34 | {
35 | Remove();
36 | }
37 | return this;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_CsQuery/Save.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.IO;
7 | using CsQuery.Utility;
8 | using CsQuery.ExtensionMethods;
9 | using CsQuery.ExtensionMethods.Internal;
10 | using CsQuery.Engine;
11 | using CsQuery.Implementation;
12 |
13 | namespace CsQuery
14 | {
15 | public partial class CQ
16 | {
17 | ///
18 | /// Save the current Document to an HTML file.
19 | ///
20 | ///
21 | ///
22 | /// A new CQ object.
23 | ///
24 |
25 | public void Save(string fileName, DomRenderingOptions renderingOptions=DomRenderingOptions.Default)
26 | {
27 | File.WriteAllText(fileName, Render(renderingOptions));
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_CsQuery/Version.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Reflection;
7 | using CsQuery.Utility;
8 | using CsQuery.ExtensionMethods;
9 | using CsQuery.ExtensionMethods.Internal;
10 | using CsQuery.Engine;
11 | using CsQuery.Implementation;
12 |
13 | namespace CsQuery
14 | {
15 | public partial class CQ
16 | {
17 | ///
18 | /// Return the current assembly's version.
19 | ///
20 | ///
21 | ///
22 | /// A string
23 | ///
24 |
25 | public static string Version()
26 | {
27 | return typeof(CQ).Assembly.GetName().Version.ToString();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_jQuery/AndSelf.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using CsQuery.Utility;
7 | using CsQuery.ExtensionMethods;
8 | using CsQuery.ExtensionMethods.Internal;
9 | using CsQuery.Engine;
10 | using CsQuery.Implementation;
11 |
12 | namespace CsQuery
13 | {
14 | public partial class CQ
15 | {
16 |
17 | ///
18 | /// Add the previous set of elements on the stack to the current set.
19 | ///
20 | ///
21 | ///
22 | /// A new CQ object.
23 | ///
24 | ///
25 | ///
26 | /// http://api.jquery.com/andself/
27 | ///
28 |
29 | public CQ AndSelf()
30 | {
31 | var csq = NewInstance(this);
32 | csq.Order = SelectionSetOrder.Ascending;
33 |
34 | if (CsQueryParent == null)
35 | {
36 | return csq;
37 | }
38 | else
39 | {
40 | csq.SelectionSet.AddRange(CsQueryParent.SelectionSet);
41 | return csq;
42 | }
43 | }
44 |
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_jQuery/Empty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using CsQuery.Utility;
7 | using CsQuery.ExtensionMethods;
8 | using CsQuery.ExtensionMethods.Internal;
9 | using CsQuery.Engine;
10 | using CsQuery.Implementation;
11 |
12 | namespace CsQuery
13 | {
14 | public partial class CQ
15 | {
16 | ///
17 | /// Remove all child nodes of the set of matched elements from the DOM.
18 | ///
19 | ///
20 | ///
21 | /// The current CQ object.
22 | ///
23 | ///
24 | ///
25 | /// http://api.jquery.com/empty/
26 | ///
27 |
28 | public CQ Empty()
29 | {
30 |
31 | return Each((IDomObject e) =>
32 | {
33 | if (e.HasChildren)
34 | {
35 | e.ChildNodes.Clear();
36 | }
37 | });
38 | }
39 |
40 |
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/source/CsQuery/CQ_jQuery/End.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using CsQuery.Utility;
7 | using CsQuery.ExtensionMethods;
8 | using CsQuery.ExtensionMethods.Internal;
9 | using CsQuery.Engine;
10 | using CsQuery.Implementation;
11 |
12 | namespace CsQuery
13 | {
14 | public partial class CQ
15 | {
16 | ///
17 | /// End the most recent filtering operation in the current chain and return the set of matched
18 | /// elements to its previous state.
19 | ///
20 | ///
21 | ///
22 | /// The CQ object at the root of the current chain, or a new, empty selection if this CQ object
23 | /// is the direct result of a Create()
24 | ///
25 | ///
26 | ///
27 | /// http://api.jquery.com/end/
28 | ///
29 |
30 | public CQ End()
31 | {
32 | return CsQueryParent ?? NewCqInDomain();
33 | }
34 |
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/source/CsQuery/Config/enumStartupOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Flags for specifying initial configuration behavior of CsQuery.
10 | ///
11 |
12 | [Flags]
13 | public enum StartupOptions
14 | {
15 |
16 | ///
17 | /// When true, CsQuery will scan the client assembly for extensions. Any classes
18 | /// found in a namespace CsQuery.Extensions will be configured automatically. Default is true;
19 | /// disable this flag to disable this behavior
20 | ///
21 |
22 | LookForExtensions = 1
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/CsQuery/CsQuery.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery/CsQuery.snk
--------------------------------------------------------------------------------
/source/CsQuery/Documentation/Architecture.md:
--------------------------------------------------------------------------------
1 | ###Architecture (notes)
2 |
3 | Namespaces
4 |
5 | CsQuery
6 | CsQuery.Engine CSS selection engine
7 | CsQuery.Engine.PseudoClassSelectors Implemenation of mose pseudoclass selectors.
8 | CsQuery.Implementation Concrete classes
9 | CsQuery.HtmlParser
10 | CsQuery.StringScanner
11 | CsQuery.EquationParser
12 | CsQuery.ExtensionMethodsD:\projects\csharp\CsQuery-mvc\source\CsQuery\Documentation\Changes.md
13 | CsQuery.ExtensionMethods.Forms Include this to add form-posting specific extension methods
14 | CsQuery.ExtensionMethods.Internal
15 | CsQuery.Promises Promises API
16 |
17 | Objects
18 |
19 | CsQuery.CQ
20 | CsQuery.Config Static class for configuration
21 | CsQuery.
22 | CsQuery.Promises.When Static factory for promises
--------------------------------------------------------------------------------
/source/CsQuery/Documentation/DifferencesFromJQuery.md:
--------------------------------------------------------------------------------
1 |
2 | ### Important Differences from jQuery
3 |
4 | ##### Option Groups
5 |
6 | jQuery and some browsers consider the first member of an option group to be selected, even if it is not explicitly marked as such. This behaviour has not been implemented.
7 |
8 |
--------------------------------------------------------------------------------
/source/CsQuery/Documentation/Todo.md:
--------------------------------------------------------------------------------
1 | INTEGRATION with validator.nu
2 |
3 | THE PROBLEM:
4 |
5 | dom[""].AppendTo("#something");
6 |
7 | The context of "" is not associated with dom, because it's a fragment. At the same time if we bound it to the DOM,
8 | selectors won't work, because it will use the index.
9 |
10 | We need a way to associate a context for new selectors. Select or [] should always operate against a root context.
11 |
12 | ### Todo (punch list)
13 |
14 | Performance:
15 | -Share a dictionary between styles and attributes; just set a bit flag and use an integer.
16 | -Move indexing from CSSStyleDeclaration into DomElement (like attributes)
17 | -Standarize the interface for CSSStyleDeclaration and AttributeCollection with the browser DOM
18 |
19 | (done) nth-child could be alot more efficient by caching the index postions of all siblings when checking the 1st one.
20 | (done) Cache equations AFTER parsing
21 |
22 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IFormAssociatedElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An element that can be associated with a form during form submission.
10 | ///
11 | ///
12 | /// http://www.w3.org/html/wg/drafts/html/master/forms.html#form-associated-element
13 | ///
14 | public interface IFormAssociatedElement
15 | {
16 | ///
17 | /// The form with which to associate the element.
18 | ///
19 | IHTMLFormElement Form { get; }
20 | }
21 | }
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IFormReassociateableElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An element that can be associated with a form during form submission.
10 | ///
11 | ///
12 | /// http://www.w3.org/html/wg/drafts/html/master/forms.html#category-form-attr
13 | ///
14 | public interface IFormReassociateableElement : IFormAssociatedElement
15 | {
16 | }
17 | }
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IFormSubmittableElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An element that can be associated with a form during form submission.
10 | ///
11 | ///
12 | /// http://www.w3.org/html/wg/drafts/html/master/forms.html#category-submit
13 | ///
14 | public interface IFormSubmittableElement : IFormAssociatedElement
15 | {
16 | }
17 | }
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IHTMLButtonElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An HTML BUTTON element.
10 | ///
11 | ///
12 | ///
13 | /// http://dev.w3.org/html5/markup/button.html
14 | ///
15 |
16 | public interface IHTMLButtonElement : IDomElement, IFormSubmittableElement, IFormReassociateableElement
17 | {
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IHTMLInputElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An HTML INPUT element.
10 | ///
11 | ///
12 | ///
13 | /// http://dev.w3.org/html5/markup/input.html
14 | ///
15 |
16 | public interface IHTMLInputElement : IDomElement, IFormSubmittableElement, IFormReassociateableElement
17 | {
18 | ///
19 | /// A URL that provides the destination of the hyperlink. If the href attribute is not specified,
20 | /// the element represents a placeholder hyperlink.
21 | ///
22 |
23 | bool Autofocus { get; set; }
24 |
25 | ///
26 | /// Specifies that the element is a required part of form submission.
27 | ///
28 |
29 | bool Required {get;set;}
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IHTMLLIElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An LI element.
10 | ///
11 | ///
12 | ///
13 | /// http://dev.w3.org/html5/spec/single-page.html#the-li-element
14 | ///
15 |
16 | public interface IHTMLLIElement : IDomElement
17 | {
18 | ///
19 | /// A valid integer giving the ordinal value of the list item.
20 | ///
21 |
22 | new int Value { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IHTMLLabelElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// A LABEL element.
10 | ///
11 | ///
12 | ///
13 | /// http://dev.w3.org/html5/spec/single-page.html#the-label-element
14 | ///
15 |
16 | public interface IHTMLLabelElement : IDomElement, IFormReassociateableElement
17 | {
18 | ///
19 | /// Gets or sets the for attribute
20 | ///
21 |
22 | string HtmlFor {get;set;}
23 |
24 | ///
25 | /// The control bound to this label
26 | ///
27 |
28 | IDomElement Control { get; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IHTMLOptionElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An HTMLOPTION element
10 | ///
11 | /// http://dev.w3.org/html5/spec/single-page.html#attr-option-disabled
12 |
13 | public interface IHTMLOptionElement : IDomElement
14 | {
15 | ///
16 | /// The form with which the element is associated
17 | ///
18 |
19 | IHTMLFormElement Form {get;}
20 |
21 | ///
22 | /// Gets or sets the label attribute.
23 | ///
24 |
25 | string Label {get;set;}
26 |
27 | //bool DefaultSelected {get;set;}
28 |
29 | // inherited from IDomObject
30 | //bool Selected {get;set;}
31 |
32 | //string Value;
33 | // string Text;
34 |
35 | //int Index { get; }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/HtmlElements/IHTMLTextAreaElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An HTML TEXTAREA element.
10 | ///
11 | ///
12 | ///
13 | /// http://dev.w3.org/html5/markup/textarea.html
14 | ///
15 |
16 | public interface IHTMLTextAreaElement : IDomElement, IFormSubmittableElement, IFormReassociateableElement
17 | {
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/ICSSStyleRule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Interface for a CSS style rule.
10 | ///
11 | ///
12 | ///
13 | /// http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule
14 | ///
15 |
16 | public interface ICSSStyleRule: ICSSRule
17 | {
18 | ///
19 | /// The textual representation of the selector for the rule set. The implementation may have
20 | /// stripped out insignificant whitespace while parsing the selector.
21 | ///
22 |
23 | string SelectorText { get; set; }
24 |
25 | ///
26 | /// The declaration-block of this rule set.
27 | ///
28 |
29 | ICSSStyleDeclaration Style { get; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/ICssStyle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// A single CSS style definition.
10 | ///
11 |
12 | public interface ICSSStyle
13 | {
14 | ///
15 | /// The name of the style
16 | ///
17 |
18 | string Name { get; set; }
19 |
20 | ///
21 | /// The type of data contained by this style.
22 | ///
23 |
24 | CSSStyleType Type { get; set; }
25 |
26 | ///
27 | /// Gets or sets a format required by this style
28 | ///
29 |
30 | string Format { get; set; }
31 |
32 | ///
33 | /// The acceptable options for Option-type styles
34 | ///
35 |
36 | HashSet Options { get; set; }
37 |
38 | ///
39 | /// A description of this style.
40 | ///
41 |
42 | string Description { get; set; }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomCData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// A marker interface for CDATA elements.
10 | ///
11 |
12 | public interface IDomCData : IDomSpecialElement
13 | {
14 |
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomComment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An interface for HTML Comment elements.
10 | ///
11 |
12 | public interface IDomComment : IDomSpecialElement
13 | {
14 | ///
15 | /// Gets or sets a value indicating whether this object is quoted.
16 | ///
17 |
18 | bool IsQuoted { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomContainer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 |
9 | ///
10 | /// Interface for objects that can contain other objects. Note that to allow some consistency with how DOM
11 | /// objects are used in the browser DOM, many methods are part of the base IDomObject interface so that they
12 | /// can be used (and return null/missing data) on elements to which they don't apply. So in actuality the only
13 | /// unique methods are nonstandard ones.
14 | ///
15 | public interface IDomContainer : IDomObject
16 | {
17 | ///
18 | /// An enumeration of clones of the chilren of this object
19 | ///
20 | ///
21 | ///
22 | /// An enumerator
23 | ///
24 |
25 | IEnumerable CloneChildren();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomDocumentType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// DOCTYPE node
10 | ///
11 | public interface IDomDocumentType : IDomSpecialElement
12 | {
13 | ///
14 | /// Gets the type of the document.
15 | ///
16 |
17 | DocType DocType { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.Output;
6 |
7 | namespace CsQuery
8 | {
9 | ///
10 | /// A regular DOM element
11 | ///
12 |
13 | public interface IDomElement : IDomContainer, IDomIndexedNode
14 | {
15 | ///
16 | /// The element is a block element.
17 | ///
18 |
19 | bool IsBlock { get; }
20 |
21 | ///
22 | /// Returns the HTML for this element, but ignoring children/innerHTML.
23 | ///
24 | ///
25 | ///
26 | /// A string of HTML.
27 | ///
28 |
29 | string ElementHtml();
30 |
31 | ///
32 | /// Get this element's index only among other elements (e.g. excluding text & other non-
33 | /// element node types)
34 | ///
35 |
36 | int ElementIndex { get; }
37 |
38 |
39 |
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomFragment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Interface for a fragment. This is content that does not represent a complete HTML document.
10 | ///
11 |
12 | public interface IDomFragment : IDomDocument
13 | {
14 |
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomInnerText.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Special element for the text contents of SCRIPT & TEXTAREA objects.
10 | ///
11 |
12 | public interface IDomInnerText : IDomText
13 | {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomInvalidElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An element that will be rendered as text because it was determined to be a mismatched tag
10 | ///
11 | [Obsolete]
12 | public interface IDomInvalidElement : IDomText
13 | {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomObjectT.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Strongly-typed interface for building typed subclasses of IDomObject.
10 | ///
11 | ///
12 | ///
13 | /// Type of the out.
14 | ///
15 |
16 | public interface IDomObject : IDomObject
17 | {
18 | ///
19 | /// Clone this element.
20 | ///
21 | ///
22 | ///
23 | /// A copy of this element that is not bound to the original.
24 | ///
25 | new T Clone();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomSpecialElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Interface for an IDomSpecialElement; and element whose data is contained as non-structured
10 | /// data in the tag itself.
11 | ///
12 |
13 | public interface IDomSpecialElement : IDomObject
14 | {
15 | ///
16 | /// Gets or sets the non-structured data in the tag
17 | ///
18 |
19 | string NonAttributeData { get; set; }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/IDomText.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Defines an interface for elements whose defintion (not innerhtml) contain non-tag or attribute formed data
10 | ///
11 |
12 | public interface IDomText : IDomObject
13 | {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/INodeList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Runtime.CompilerServices;
7 | using CsQuery.Implementation;
8 |
9 | namespace CsQuery
10 | {
11 | ///
12 | /// Interface for node list, a read/write collection of nodes.
13 | ///
14 |
15 | public interface INodeList: IEnumerable, IList, ICollection
16 | {
17 | ///
18 | /// The number of nodes in this INodeList
19 | ///
20 |
21 | int Length { get; }
22 |
23 | ///
24 | /// Get the item at the specified index
25 | ///
26 | ///
27 | ///
28 | /// Zero-based index of the item
29 | ///
30 | ///
31 | ///
32 | /// An item
33 | ///
34 |
35 | IDomObject Item(int index);
36 |
37 | ///
38 | /// Event raised when the NodeList changes
39 | ///
40 |
41 | event EventHandler OnChanged;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/CSSStyleChangedArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Implementation
7 | {
8 | ///
9 | /// Arguments for when a style is changed.
10 | ///
11 |
12 | public class CSSStyleChangedArgs : EventArgs
13 | {
14 | ///
15 | /// Constructor.
16 | ///
17 | ///
18 | ///
19 | /// A value indicating whether this object has styles following the change.
20 | ///
21 |
22 | public CSSStyleChangedArgs(bool hasStyleAttribute)
23 | {
24 | HasStyleAttribute = hasStyleAttribute;
25 | }
26 | ///
27 | /// Gets a value indicating whether this object has styles following the change.
28 | ///
29 |
30 | public bool HasStyleAttribute
31 | {
32 | get;
33 | protected set;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/CssStyle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Implementation
7 | {
8 | ///
9 | /// A single CSS style definition.
10 | ///
11 |
12 | public class CssStyle : ICSSStyle
13 | {
14 | ///
15 | /// The name of the style.
16 | ///
17 |
18 | public string Name { get; set; }
19 |
20 | ///
21 | /// The type of data contained by this style.
22 | ///
23 |
24 | public CSSStyleType Type { get; set; }
25 |
26 | ///
27 | /// Gets or sets a format required by this style.
28 | ///
29 |
30 | public string Format { get; set; }
31 |
32 | ///
33 | /// A description of this style.
34 | ///
35 |
36 | public string Description { get; set; }
37 |
38 | ///
39 | /// The acceptable options for Option-type styles.
40 | ///
41 |
42 | public HashSet Options { get; set; }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/HtmlElements/HTMLButtonElement.cs:
--------------------------------------------------------------------------------
1 | using CsQuery.HtmlParser;
2 |
3 | namespace CsQuery.Implementation
4 | {
5 | ///
6 | /// An HTML button element.
7 | ///
8 |
9 | public class HTMLButtonElement : FormSubmittableElement, IHTMLButtonElement
10 | {
11 | ///
12 | /// Default constructor.
13 | ///
14 |
15 | public HTMLButtonElement()
16 | : base(HtmlData.tagBUTTON)
17 | {
18 | }
19 |
20 | ///
21 | /// The value of the "type" attribute. For button elements, this property always returns a
22 | /// lowercase value and defaults to "submit" if there is no type attribute.
23 | ///
24 | ///
25 | ///
26 | /// The type.
27 | ///
28 |
29 | public override string Type
30 | {
31 | get
32 | {
33 | return GetAttribute(HtmlData.attrTYPE, "submit").ToLower();
34 | }
35 | set
36 | {
37 | base.Type = value;
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/HtmlElements/HTMLLIElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.HtmlParser;
6 | using CsQuery.Utility;
7 |
8 | namespace CsQuery.Implementation
9 | {
10 | ///
11 | /// An HTML LI element.
12 | ///
13 |
14 | public class HTMLLIElement : DomElement, IHTMLLIElement
15 | {
16 | ///
17 | /// Default constructor.
18 | ///
19 |
20 | public HTMLLIElement()
21 | : base(HtmlData.tagLI)
22 | {
23 | }
24 |
25 | ///
26 | /// The Value property of this LI element, or zero if it is not set.
27 | ///
28 |
29 | public new int Value
30 | {
31 | get
32 | {
33 | return Support.IntOrZero(GetAttribute(HtmlData.ValueAttrId));
34 | }
35 | set
36 | {
37 | SetAttribute(HtmlData.ValueAttrId, value.ToString());
38 | }
39 | }
40 |
41 |
42 |
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/HtmlElements/HTMLScriptElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.HtmlParser;
6 |
7 | namespace CsQuery.Implementation
8 | {
9 | ///
10 | /// A SCRIPT
11 | ///
12 |
13 | public class HTMLScriptElement : DomElement
14 | {
15 | ///
16 | /// Default constructor
17 | ///
18 |
19 |
20 | public HTMLScriptElement()
21 | : base(HtmlData.tagSCRIPT)
22 | {
23 |
24 | }
25 |
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/HtmlElements/HTMLStyleElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.HtmlParser;
6 |
7 | namespace CsQuery.Implementation
8 | {
9 | ///
10 | /// A STYLE element
11 | ///
12 |
13 | public class HTMLStyleElement : DomElement
14 | {
15 | ///
16 | /// Default constructor
17 | ///
18 |
19 |
20 | public HTMLStyleElement()
21 | : base(HtmlData.tagSTYLE)
22 | {
23 |
24 | }
25 |
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/NodeEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Implementation
7 | {
8 | ///
9 | /// Additional information for node events.
10 | ///
11 |
12 | public class NodeEventArgs: EventArgs
13 | {
14 | ///
15 | /// Constructor.
16 | ///
17 | ///
18 | ///
19 | /// The node.
20 | ///
21 |
22 | public NodeEventArgs(IDomObject node)
23 | {
24 | Node = node;
25 | }
26 |
27 | ///
28 | /// The node that was added or removed.
29 | ///
30 |
31 | public IDomObject Node { get; protected set; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/Implementation/StyleSheet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Implementation
7 | {
8 | class StyleSheet
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/enumCSSRuleType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Values that represent CSSRuleType.
10 | ///
11 |
12 | public enum CSSRuleType
13 | {
14 | ///
15 | /// An unknown rule.
16 | ///
17 | UNKNOWN_RULE =0,
18 | ///
19 | /// A CSS Style rule.
20 | ///
21 | STYLE_RULE=1,
22 | ///
23 | /// A character set rule.
24 | ///
25 | CHARSET_RULE=2,
26 | ///
27 | /// An import rule.
28 | ///
29 | IMPORT_RULE=3,
30 | ///
31 | /// A media rule.
32 | ///
33 | MEDIA_RULE=4,
34 | ///
35 | /// A font face rule.
36 | ///
37 | FONT_FACE_RULE=5,
38 | ///
39 | /// A page rule.
40 | ///
41 | PAGE_RULE=6
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/source/CsQuery/Dom/enumDocType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// Values that represent the HTML document type.
10 | ///
11 |
12 | public enum DocType: byte
13 | {
14 | ///
15 | /// Use the default doc type (from CsQuery.Config.DocType).
16 | ///
17 | Default = 0,
18 | ///
19 | /// HTML5
20 | ///
21 | HTML5 = 1,
22 | ///
23 | /// HTML 4 Transitional
24 | ///
25 | HTML4 = 2,
26 |
27 | ///
28 | /// XHTML Transitional
29 | ///
30 | XHTML = 3,
31 | ///
32 | /// An unsupported document type.
33 | ///
34 | Unknown = 4,
35 | ///
36 | /// HTML 4 Strict
37 | ///
38 | HTML4Strict = 5,
39 |
40 | ///
41 | /// XHTML Strict.
42 | ///
43 | XHTMLStrict = 6
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/IDomIndexProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine
7 | {
8 | ///
9 | /// Interface for a service locator providing in instance of a DomIndex
10 | ///
11 |
12 | public interface IDomIndexProvider
13 | {
14 | ///
15 | /// Return an instance of a DomIndex class
16 | ///
17 |
18 | IDomIndex GetDomIndex();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/IDomIndexQueue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.Implementation;
6 |
7 | namespace CsQuery.Engine
8 | {
9 | ///
10 | /// Interface for a DOM index that contains a Queue feature.
11 | ///
12 | public interface IDomIndexQueue
13 | {
14 | ///
15 | /// When true, changes are queued until the next read operation
16 | ///
17 |
18 | bool QueueChanges { get; set; }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/IDomIndexRanged.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.Implementation;
6 |
7 | namespace CsQuery.Engine
8 | {
9 | ///
10 | /// Interface for a DOM index that can be queried for a range of elements
11 | ///
12 | public interface IDomIndexRanged
13 | {
14 |
15 | ///
16 | /// Queries the index, returning all matching elements
17 | ///
18 | ///
19 | ///
20 | /// The sub key.
21 | ///
22 | ///
23 | /// The depth.
24 | ///
25 | ///
26 | /// true to include, false to exclude the descendants.
27 | ///
28 | ///
29 | ///
30 | /// An enumerator that allows foreach to be used to process query index in this collection.
31 | ///
32 |
33 | IEnumerable QueryIndex(ushort[] subKey, int depth, bool includeDescendants);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/IDomIndexSimple.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.Implementation;
6 |
7 | namespace CsQuery.Engine
8 | {
9 | ///
10 | /// Interface for a DOM index that is queryable.
11 | ///
12 |
13 | public interface IDomIndexSimple
14 | {
15 | ///
16 | /// Queries the index.
17 | ///
18 | ///
19 | ///
20 | /// The sub key.
21 | ///
22 | ///
23 | ///
24 | /// An enumerator that allows foreach to be used to process query index in this collection.
25 | ///
26 |
27 | IEnumerable QueryIndex(ushort[] subKey);
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/IDomIndexedNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// An marker and interface exposing properties required for a node that should be indexed
10 | ///
11 |
12 | public interface IDomIndexedNode: IDomNode
13 | {
14 |
15 | ///
16 | /// Enumerates index keys in this collection.
17 | ///
18 | ///
19 | ///
20 | /// An enumerator that allows foreach to be used to process index keys in this collection.
21 | ///
22 |
23 | IEnumerable IndexKeys();
24 |
25 | ///
26 | /// The object that is the target of the index (normally, the object itself)
27 | ///
28 |
29 | IDomObject IndexReference { get; }
30 |
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/IndexOperation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine
7 | {
8 | internal enum IndexOperationType
9 | {
10 | ///
11 | /// Adds to the index
12 | ///
13 | Add=1,
14 | ///
15 | /// Remove from the index.
16 | ///
17 | Remove=2,
18 | ///
19 | /// Change the value only.
20 | ///
21 | Change =3
22 | }
23 |
24 | internal struct IndexOperation
25 | {
26 | public IndexOperationType IndexOperationType;
27 | public ushort[] Key;
28 | public IDomObject Value;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/MatchElement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine
7 | {
8 | ///
9 | /// Wrapper class used by the engine to store info on the selector stack.
10 | ///
11 | internal class MatchElement
12 | {
13 | public MatchElement(IDomElement element)
14 | {
15 | Initialize(element, 0);
16 | }
17 | public MatchElement(IDomElement element, int depth)
18 | {
19 | Initialize(element, depth);
20 | }
21 | protected void Initialize(IDomElement element, int depth)
22 | {
23 | Depth = depth;
24 | Element = element;
25 | }
26 | public int Depth { get; protected set; }
27 | public IDomElement Element { get; protected set; }
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/IPseudoSelectorFilter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine
7 | {
8 | ///
9 | /// A pseudoselector that filters a list of elements. Most jQuery extensions fall within this
10 | /// category.
11 | ///
12 |
13 | public interface IPseudoSelectorFilter: IPseudoSelector
14 | {
15 | ///
16 | /// Filter only the elements matching this result-list position type selector.
17 | ///
18 | ///
19 | ///
20 | /// The sequence of elements prior to this filter being applied.
21 | ///
22 | ///
23 | ///
24 | /// A sequence of matching elements.
25 | ///
26 |
27 | IEnumerable Filter(IEnumerable selection);
28 |
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/enumQuotingRule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine
7 | {
8 | ///
9 | /// Enumerator of possible quoting rules that determine how parameters for CSS selector functions
10 | /// should be parsed.
11 | ///
12 |
13 | public enum QuotingRule
14 | {
15 | ///
16 | /// The parameter value should never be quoted (e.g. is numeric data, or the function simply doesn't expect quotes).
17 | ///
18 | NeverQuoted = 1,
19 | ///
20 | /// The parameter value should always be quoted.
21 | ///
22 | AlwaysQuoted = 2,
23 | ///
24 | /// The parameter value may be quoted: if the first character is a double- or single-quote, then a matching quote terminates the parameter value..
25 | ///
26 | OptionallyQuoted = 3
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/Even.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine.PseudoClassSelectors
7 | {
8 | ///
9 | /// Return only odd-numbered elements from the selection
10 | ///
11 |
12 | public class Even : PseudoSelector, IPseudoSelectorFilter
13 | {
14 | ///
15 | /// Filter a sequence of elements, returning only the elements at even-numbered ordinal positions
16 | ///
17 | ///
18 | ///
19 | /// The sequence to filter
20 | ///
21 | ///
22 | ///
23 | /// A sequence of elements
24 | ///
25 |
26 | public IEnumerable Filter(IEnumerable selection)
27 | {
28 | int index = 0;
29 | foreach (var child in selection)
30 | {
31 | if (index % 2 == 0)
32 | {
33 | yield return child;
34 | }
35 | index++;
36 | }
37 | }
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/First.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine.PseudoClassSelectors
7 | {
8 | ///
9 | /// Return only odd-numbered elements from the selection
10 | ///
11 |
12 | public class First : PseudoSelector, IPseudoSelectorFilter
13 | {
14 | ///
15 | /// Filter the sequence, returning only the first element.
16 | ///
17 | ///
18 | ///
19 | /// A sequence of elements
20 | ///
21 | ///
22 | ///
23 | /// The first element in the sequence, or an empty sequence if the original sequence is empty.
24 | ///
25 |
26 | public IEnumerable Filter(IEnumerable selection)
27 | {
28 | var first = selection.FirstOrDefault();
29 | if (first != null)
30 | {
31 | yield return first;
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/Header.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine.PseudoClassSelectors
7 | {
8 | ///
9 | /// The jQuery ":header" selector
10 | ///
11 |
12 | public class Header: PseudoSelectorFilter
13 | {
14 | ///
15 | /// Test whether an element is a header (H1-H6)
16 | ///
17 | ///
18 | ///
19 | /// The element to test.
20 | ///
21 | ///
22 | ///
23 | /// true if it matches, false if not.
24 | ///
25 |
26 | public override bool Matches(IDomObject element)
27 | {
28 | var nodeName = element.NodeName;
29 | return nodeName[0] == 'H'
30 | && nodeName.Length == 2
31 | && nodeName[1] >= '0'
32 | && nodeName[1] <= '6';
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/Hidden.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.HtmlParser;
6 |
7 | namespace CsQuery.Engine.PseudoClassSelectors
8 | {
9 | ///
10 | /// A pseudoselector that returns elements that are hidden. Visibility is defined by CSS: a
11 | /// nonzero opacity, a display that is not "hidden", and the absence of zero-valued width &
12 | /// heights. Additionally, input elements of type "hidden" are always considered not visible.
13 | ///
14 |
15 | public class Hidden: PseudoSelectorFilter
16 | {
17 | ///
18 | /// Test whether an element is hidden.
19 | ///
20 | ///
21 | ///
22 | /// The element to test.
23 | ///
24 | ///
25 | ///
26 | /// true if it matches, false if not.
27 | ///
28 |
29 | public override bool Matches(IDomObject element)
30 | {
31 | return !Visible.IsVisible(element);
32 | }
33 |
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/Last.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine.PseudoClassSelectors
7 | {
8 | ///
9 | /// Return only the last element from a selection
10 | ///
11 |
12 | public class Last : PseudoSelector, IPseudoSelectorFilter
13 | {
14 | ///
15 | /// Filter for the last element in the selection set
16 | ///
17 | ///
18 | ///
19 | /// The sequence of elements prior to this filter being applied.
20 | ///
21 | ///
22 | ///
23 | /// The last element in the selection.
24 | ///
25 |
26 | public IEnumerable Filter(IEnumerable selection)
27 | {
28 | var last = selection.LastOrDefault();
29 | if (last != null)
30 | {
31 | yield return last;
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/Odd.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine.PseudoClassSelectors
7 | {
8 | ///
9 | /// Return only odd-numbered elements from the selection
10 | ///
11 |
12 | public class Odd : PseudoSelector, IPseudoSelectorFilter
13 | {
14 | ///
15 | /// Filter the sequence of elements for only those in odd-number ordinal indices
16 | ///
17 | ///
18 | ///
19 | /// The sequence of elements prior to this filter being applied.
20 | ///
21 | ///
22 | ///
23 | /// A sequence of matching elements.
24 | ///
25 |
26 | public IEnumerable Filter(IEnumerable selection)
27 | {
28 | int index = 0;
29 | foreach (var child in selection)
30 | {
31 | if (index % 2 != 0)
32 | {
33 | yield return child;
34 | }
35 | index++;
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/PseudoClassSelectors/jQuery/Parent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine.PseudoClassSelectors
7 | {
8 | ///
9 | /// Determines whether the target is a parent.
10 | ///
11 |
12 | public class Parent: PseudoSelectorFilter
13 | {
14 | ///
15 | /// Test whether an element is a parent; e.g. has children.
16 | ///
17 | ///
18 | ///
19 | /// The element to test.
20 | ///
21 | ///
22 | ///
23 | /// true if it matches, false if not.
24 | ///
25 |
26 | public override bool Matches(IDomObject element)
27 | {
28 |
29 | return element.HasChildren ?
30 | !Empty.IsEmpty(element) :
31 | false;
32 | }
33 |
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/source/CsQuery/Engine/enumDomIndexFeatures.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Engine
7 | {
8 | ///
9 | /// Flags specifying the features that a given IndexProvider offers
10 | ///
11 |
12 | [Flags]
13 | public enum DomIndexFeatures
14 | {
15 | ///
16 | /// Index is capable of returning a sequence of elements matching a key
17 | ///
18 | Lookup = 1,
19 | ///
20 | /// Index is capable of returning a range of elements matching a subkey.
21 | ///
22 | Range = 2,
23 | ///
24 | /// Indexes implementing this feature can queue changes to improve performance. When this is true, the QueueChanges method must be implemented.
25 | ///
26 | Queue = 4
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IEquationParser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 |
12 | namespace CsQuery.EquationParser
13 | {
14 | public interface IEquationParser
15 | {
16 | bool TryParse(string text, out IOperand operand);
17 | IOperand Parse(string text);
18 | IOperand Parse(string text) where T : IConvertible;
19 | string Error { get; }
20 | }
21 | public interface IEquationParser : IEquationParser where T : IConvertible
22 | {
23 | bool TryParse(string text, out IOperand operand);
24 | new IOperand Parse(string text);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/ILiteral.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 |
12 | namespace CsQuery.EquationParser
13 | {
14 | public interface ILiteral: IOperand
15 | {
16 | void Set(IConvertible value);
17 | new ILiteral Clone();
18 | }
19 | public interface ILiteral : IOperand, ILiteral where T : IConvertible
20 | {
21 | void Set(T value);
22 | new ILiteral Clone();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/INativeOperation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 |
12 | namespace CsQuery.EquationParser
13 | {
14 | public interface INativeOperation: IFunction
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IOperand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 |
12 | namespace CsQuery.EquationParser
13 | {
14 | public interface IOperand : IConvertible, ICloneable
15 | {
16 | IConvertible Value { get; }
17 | bool IsInteger { get; }
18 | new IOperand Clone();
19 | }
20 | public interface IOperand : IOperand where T : IConvertible
21 | {
22 | new T Value { get;}
23 | new IOperand Clone();
24 |
25 | }
26 |
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IOperation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 | namespace CsQuery.EquationParser
12 | {
13 | public interface IOperation: IFunction
14 | {
15 | IList Operators { get; }
16 | void AddOperand(IConvertible operand, bool invert);
17 | ///
18 | /// Replaces the last item
19 | ///
20 | ///
21 |
22 | void ReplaceLastOperand(IOperand operand);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IOperator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 |
12 | namespace CsQuery.EquationParser
13 | {
14 | public interface IOperator: ICloneable
15 | {
16 | void Set(string value);
17 | bool TrySet(string value);
18 | OperationType OperationType { get; }
19 | AssociationType AssociationType { get; }
20 | bool IsInverted { get; }
21 | new IOperator Clone();
22 |
23 | IOperation GetFunction();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IOrderedDictionary.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.EquationParser
7 | {
8 | ///
9 | /// An interface representing a dictionary that also has intrinsic element order.
10 | ///
11 | ///
12 | ///
13 | /// Type of the key.
14 | ///
15 | ///
16 | /// Type of the value.
17 | ///
18 |
19 | public interface IOrderedDictionary : IDictionary, IList>, ICollection>, IEnumerable>
20 | {
21 | ///
22 | /// Obtain the zero-based index of the given key.
23 | ///
24 | ///
25 | ///
26 | /// The key.
27 | ///
28 | ///
29 | ///
30 | /// The zero-based index of the key in the ordered dictionary
31 | ///
32 |
33 | int IndexOf(TKey key);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IVariable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using CsQuery.EquationParser.Implementation;
6 |
7 | // TODO this should be fully commented; however it's not part of the main public API
8 |
9 | #pragma warning disable 1591
10 | #pragma warning disable 1570
11 |
12 |
13 | namespace CsQuery.EquationParser
14 | {
15 | public interface IVariable : IOperand, IVariableContainer
16 | {
17 | ///
18 | /// The name of this variable
19 | ///
20 | string Name { get; }
21 | // void Clear();
22 | event EventHandler OnGetValue;
23 | new IVariable Clone();
24 | }
25 | public interface IVariable : IOperand, IVariable where T : IConvertible
26 | {
27 | Type Type { get; }
28 | ///
29 | /// Release stored value for this variable, causing it to be re-read from the owner
30 | ///
31 | new IVariable Clone();
32 | //IVariable CloneAs() where U : IConvertible;
33 | new T Value { get; set; }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/IVariableContainer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 |
12 | namespace CsQuery.EquationParser
13 | {
14 | public interface IVariableContainer
15 | {
16 | IEnumerable Variables {get;}
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/Implementation/Types.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.EquationParser.Implementation
7 | {
8 |
9 | interface IIntegerValue : IComparable, IConvertible,
10 | IEquatable, IEquatable, IEquatable,
11 | IEquatable, IEquatable,
12 | IEquatable, IEquatable,
13 | IEquatable, IEquatable,
14 | IComparable, IComparable, IComparable,
15 | IComparable, IComparable,
16 | IComparable, IComparable
17 | {
18 |
19 | }
20 | interface INumericValue : IIntegerValue,
21 | IComparable, IComparable, IComparable,
22 | IEquatable, IEquatable, IEquatable
23 | {
24 |
25 | }
26 | interface ITextValue : IComparable, IConvertible,
27 | IComparable, IComparable,
28 | IEquatable, IEquatable
29 | {
30 |
31 | }
32 | interface IBooleanValue : IComparable, IConvertible,
33 | IComparable, IEquatable
34 | {
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/Implementation/VariableReadEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | // TODO this should be fully commented; however it's not part of the main public API
7 |
8 | #pragma warning disable 1591
9 | #pragma warning disable 1570
10 |
11 | namespace CsQuery.EquationParser.Implementation
12 | {
13 | public class VariableReadEventArgs : EventArgs
14 | {
15 | public VariableReadEventArgs(string name)
16 | {
17 | Name = name;
18 | }
19 | public IConvertible Value
20 | {
21 | get
22 | {
23 | return _Value;
24 | }
25 | set
26 | {
27 | _Value = value;
28 | }
29 | }
30 | protected IConvertible _Value;
31 |
32 | public Type Type
33 | {
34 | get;
35 | set;
36 | }
37 | public string Name
38 | {
39 | get;
40 | protected set;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/enumAssociation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.EquationParser
7 | {
8 | ///
9 | /// Values that represent AssociationType; which determines how to group adjacent operands when
10 | /// parsing an equation.
11 | ///
12 |
13 | public enum AssociationType
14 | {
15 | ///
16 | /// Associate with other Addition operands
17 | ///
18 | Addition= 1,
19 | ///
20 | /// associate with other Multiplcation operands
21 | ///
22 | Multiplicaton =2,
23 | ///
24 | /// never associate, associate only directly adjacent operands.
25 | ///
26 | Power = 3,
27 | ///
28 | /// never associate, and use parenthesized operands.
29 | ///
30 | Function = 4
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/CsQuery/EquationParser/enumOperationType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.EquationParser
7 | {
8 | ///
9 | /// Values that represent OperationType for an arithmetic operator.
10 | ///
11 |
12 | public enum OperationType
13 | {
14 | ///
15 | /// Addition or +
16 | ///
17 | Addition=1,
18 | ///
19 | /// Subtraction or -.
20 | ///
21 | Subtraction=2,
22 | ///
23 | /// Multiplication or *.
24 | ///
25 | Multiplication=3,
26 | ///
27 | /// Division or /.
28 | ///
29 | Division=4,
30 | ///
31 | /// Modulus or %.
32 | ///
33 | Modulus = 5,
34 | ///
35 | /// Power or ^.
36 | ///
37 | Power=6
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/source/CsQuery/HtmlParser/Deprecated/enumInsertionMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.HtmlParser.Deprecated
7 | {
8 |
9 | public enum InsertionMode : byte
10 | {
11 | Default = 0,
12 | Script = 1,
13 | Text = 2,
14 | Invalid = 3
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/source/CsQuery/HtmlParser/Deprecated/enumTokenizerState.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Text;
4 |
5 | namespace CsQuery.HtmlParser.Deprecated
6 | {
7 | ///
8 | /// Values that represent the current state of the tokenizer for an IterationData object
9 | ///
10 |
11 | public enum TokenizerState : byte
12 | {
13 | ///
14 | /// The normal (default) state; means content / looking for tags.
15 | ///
16 |
17 | Default = 0,
18 |
19 | ///
20 | /// The tokenizer is inside an opening tag and parsing attributes.
21 | ///
22 |
23 | TagStart = 1,
24 |
25 | ///
26 | /// The tokenizer is finished parsing this node.
27 | ///
28 |
29 | Finished = 2
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/source/CsQuery/HtmlParser/enumHtmlParsingMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// The methodology applied when parsing strings of HTML
10 | ///
11 |
12 | public enum HtmlParsingMode : byte
13 | {
14 |
15 | ///
16 | /// Automatically detect the document type. When no DocType node is provided, will default to FragmentWithSelfClosingTags.
17 | ///
18 |
19 | Auto = 0,
20 |
21 | ///
22 | /// A fragment whose context is determined by the first tag.
23 | ///
24 |
25 | Fragment = 1,
26 |
27 | ///
28 | /// A content block, assumed to be in BODY context.
29 | ///
30 |
31 | Content = 2,
32 |
33 | ///
34 | /// A complete document; the HTML and BODY tag constructs will be addded if missing..
35 | ///
36 |
37 | Document = 3
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/source/CsQuery/HtmlParser/enumHtmlParsingOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery
7 | {
8 | ///
9 | /// The options used when parsing strings of HTML
10 | ///
11 |
12 | [Flags]
13 | public enum HtmlParsingOptions : byte
14 | {
15 | ///
16 | /// No options applied.
17 | ///
18 |
19 | None=0,
20 |
21 | ///
22 | /// Default options (from Config.HtmlParsingOptions) are applied.
23 | ///
24 |
25 | Default=1,
26 |
27 | ///
28 | /// Tags may be self-closing.
29 | ///
30 |
31 | AllowSelfClosingTags=2,
32 |
33 |
34 | ///
35 | /// Comments are ignored entirely.
36 | ///
37 |
38 | IgnoreComments=4
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/source/CsQuery/Implementation/IRangeSortedDictionary.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Implementation
7 | {
8 | ///
9 | /// A sorted dictionary that allows lookup by range.
10 | ///
11 | interface IRangeSortedDictionary : IDictionary
12 | {
13 | ///
14 | /// Return all keys starting with subKey
15 | ///
16 | /// The substring to match
17 | ///
18 | IEnumerable GetRangeKeys(TKey[] subKey);
19 |
20 | ///
21 | /// Return all values having keys beginning with subKey
22 | ///
23 | ///
24 | ///
25 | IEnumerable GetRange(TKey[] subKey);
26 |
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/source/CsQuery/Implementation/IReadOnlyCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace CsQuery.Implementation
8 | {
9 | ///
10 | /// Interface for read only collection.
11 | ///
12 | ///
13 | ///
14 | /// Generic type parameter.
15 | ///
16 |
17 | public interface IReadOnlyCollection : IEnumerable, IEnumerable
18 | {
19 | ///
20 | /// Gets the number of items in the collection.
21 | ///
22 |
23 | int Count {get;}
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/source/CsQuery/Implementation/IReadOnlyList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace CsQuery.Implementation
8 | {
9 | ///
10 | /// Interface for read only list.
11 | ///
12 | ///
13 | ///
14 | /// Generic type parameter.
15 | ///
16 |
17 | public interface IReadOnlyList : IReadOnlyCollection, IEnumerable, IEnumerable
18 | {
19 | ///
20 | /// Indexer to get items within this collection using array index syntax.
21 | ///
22 | ///
23 | ///
24 | /// Zero-based index of the entry to access.
25 | ///
26 | ///
27 | ///
28 | /// The indexed item.
29 | ///
30 |
31 | T this[int index] { get; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/CsQuery/Implementation/enumSelectionSetOrder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Implementation
7 | {
8 | ///
9 | /// Orders in which the selection set can be arranged. Ascending and Descending refer to to the
10 | /// DOM element order.
11 | ///
12 |
13 | public enum SelectionSetOrder
14 | {
15 | ///
16 | /// The items should be returned in the order they were added to the selection set.
17 | ///
18 | OrderAdded = 1,
19 | ///
20 | /// The items should be returned in the order they appear in the DOM.
21 | ///
22 | Ascending = 2,
23 | ///
24 | /// The items should be returned in the reverse order they appear in the DOM.
25 | ///
26 | Descending = 3
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/source/CsQuery/Output/HtmlEncoderNone.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.IO;
6 |
7 | namespace CsQuery.Output
8 | {
9 | ///
10 | /// Minimum HTML encoder. This only parses the absolute minimum required for correct
11 | /// interpretation (less-than, greater-than, ampersand). Everthing else is passed through.
12 | ///
13 |
14 | public class HtmlEncoderNone: IHtmlEncoder
15 | {
16 | ///
17 | /// Encodes text as HTML, writing the processed output to the TextWriter.
18 | ///
19 | ///
20 | ///
21 | /// The text to be encoded.
22 | ///
23 | ///
24 | /// The target for the ouput.
25 | ///
26 |
27 | public void Encode(string text, TextWriter output)
28 | {
29 | output.Write(text);
30 | }
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/source/CsQuery/Output/IHtmlEncoder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.IO;
6 |
7 | namespace CsQuery.Output
8 | {
9 | ///
10 | /// Interface for HTML encoder/decoder
11 | ///
12 |
13 | public interface IHtmlEncoder
14 | {
15 | ///
16 | /// Encodes text as HTML, writing the processed output to the TextWriter.
17 | ///
18 | ///
19 | ///
20 | /// The text to be encoded.
21 | ///
22 | ///
23 | /// The target for the ouput
24 | ///
25 |
26 | void Encode(string text, TextWriter output);
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/source/CsQuery/Output/IOutputFormatter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.IO;
6 | using CsQuery.Implementation;
7 |
8 | namespace CsQuery.Output
9 | {
10 | ///
11 | /// Interface for an OutputFormatter. This is an object that renders a CsQuery tree to a TextWriter
12 | ///
13 |
14 | public interface IOutputFormatter
15 | {
16 | ///
17 | /// Renders this object to the passed TextWriter
18 | ///
19 | ///
20 | ///
21 | /// The node.
22 | ///
23 | ///
24 | /// The writer.
25 | ///
26 |
27 | void Render(IDomObject node, TextWriter writer);
28 |
29 | ///
30 | /// Renders this object and returns the output as a string
31 | ///
32 | ///
33 | ///
34 | /// The node.
35 | ///
36 | ///
37 | ///
38 | /// A string of HTML
39 | ///
40 |
41 | string Render(IDomObject node);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/source/CsQuery/README-compilation.md:
--------------------------------------------------------------------------------
1 | #####CsQuery Compilation Options
2 |
3 | threadsafe Build CQ object in threadsafe way (not tested much)
4 |
5 |
--------------------------------------------------------------------------------
/source/CsQuery/StringScanner/IStringInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.StringScanner
7 | {
8 | ///
9 | /// Interface that describes characterstics of a string
10 | ///
11 |
12 | public interface IStringInfo : IValueInfo
13 | {
14 | ///
15 | /// The string is a valid HTML attribute name
16 | ///
17 |
18 | bool HtmlAttributeName { get; }
19 |
20 | ///
21 | /// The string contains alpha characters.
22 | ///
23 |
24 | bool HasAlpha { get; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/CsQuery/StringScanner/IValueInfoT.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.StringScanner
7 | {
8 | ///
9 | /// Interface for a strongly typed IValueInfo
10 | ///
11 | ///
12 | ///
13 | /// The type of value
14 | ///
15 |
16 | public interface IValueInfo : IValueInfo where T : IConvertible
17 | {
18 | ///
19 | /// The target of the tests.
20 | ///
21 |
22 | new T Target { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source/CsQuery/StringScanner/Scanner.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.StringScanner
7 | {
8 | ///
9 | /// Factory for StringScanner objects
10 | ///
11 |
12 | public static class Scanner
13 | {
14 | ///
15 | /// Creates a new StringScanner from a string.
16 | ///
17 | ///
18 | ///
19 | /// The text.
20 | ///
21 | ///
22 | ///
23 | /// A new StringScsanner.
24 | ///
25 |
26 | public static IStringScanner Create(string text)
27 | {
28 | return new Implementation.StringScannerEngine(text);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/source/CsQuery/Trewtech.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamietre/CsQuery/5a22e28a39c139cbb8170a0eeeee59e73f9e02f9/source/CsQuery/Trewtech.pfx
--------------------------------------------------------------------------------
/source/CsQuery/Web/ICsqWebRequestMetadata.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Web
7 | {
8 | ///
9 | /// Data about a web request.
10 | ///
11 |
12 | public interface ICsqWebRequestMetadata
13 | {
14 | ///
15 | /// The time, in milliseconds, after which to abort an incompete request.
16 | ///
17 |
18 | int Timeout { get; set; }
19 |
20 | ///
21 | /// The UserAgent string to present to the remote server.
22 | ///
23 |
24 | string UserAgent { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/source/CsQuery/Web/IWebRequestInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Web
7 | {
8 | ///
9 | /// Interface representing a WebRequest
10 | ///
11 |
12 | public interface IWebRequestInfo
13 | {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/source/CsQuery/Web/enumRequestState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CsQuery.Web
7 | {
8 | ///
9 | /// Values that represent the current CsqWebRequest state.
10 | /// NOT YET IMPLEMENTED
11 | ///
12 |
13 | public enum RequestState
14 | {
15 | ///
16 | /// The request is idle.
17 | ///
18 | Idle = 1,
19 | ///
20 | /// The request is in progress.
21 | ///
22 | Active = 2,
23 | ///
24 | /// The request failed.
25 | ///
26 | Fail = 3,
27 | ///
28 | /// The request .
29 | ///
30 | PartialSuccess = 4,
31 |
32 | ///
33 | /// The request finished successfully.
34 | ///
35 | Success = 5
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/source/Local.testsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 | These are default test settings for a local test run.
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/source/TraceAndTestImpact.testsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 | These are test settings for Trace and Test Impact.
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------