Selector Project
Selector is a project written in Haskell, I am developing this project as a part of a web browser in Haskell, the objective’s project is to test the CSS selectors.
Selector draw an html tree in which each html tag is a box.
If a tag is selected by some selector, it is brushed with yellow color
and is specified with the corresponding number in the list of selector that was applied.
Download and Install
- Download from Git (http://github.com/carliros/Selector)
- In order to get installed, you will need:
- wxhaskell (http://hackage.haskell.org/package/wx)
- uulib (http://hackage.haskell.org/package/uulib)
- uuagc (http://hackage.haskell.org/package/uuagc)
- Use the Makefile to compile and install: make all
- To run, use the generated file: ./sel
There are some examples in the test directory.
- 07/2010: Fixed Combined Selectors; now we can use any operator (descendant, child or sibling selector) with a list of two or more selectors.
- 05/2010: Support style tag in an html file and remove dependency with uu-parsinglib.
To Fix
Please, if you know some error, send a mail to: carliros.g at gmail dot com.
- There are errors when we try to select long list of simple
selectors [fixed]
To Implement
- Implement the cascading style sheet (author, user, user agent
style sheet definition) - Implement the specificity of a selector
- Implement the cascading algorithm
Type of css selectors implemented
- Typed Selector: simple name selector,examples: p {display: block}big {display: none}
- Universal Selector: simple selector represented by ‘*’,example: * {display: block}
- Descendant Selector: Two or more simple selectors separated with
space,examples: body p big {display: inline}p small {display: inline}
- Child Selector: Two or more simple selectors separated with
‘>’,examples: body > p > big {display: inline}p > small display: inline}
- Sibling Selector: Two or more simple selectors separated with ‘+’,examples: body + p + big {display: inline}p + small {display: inline}
Html Tags implemented
The following tags are reconised by the parser: style, html, head,
body, h1, h2, …, h6, p, big, small
