Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mincss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
mincss
Commits
369ee206
Commit
369ee206
authored
Oct 02, 2014
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix in unused code
parent
f69c40b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
selector.ml
selector.ml
+2
-9
No files found.
selector.ml
View file @
369ee206
...
@@ -5,10 +5,6 @@ open Types
...
@@ -5,10 +5,6 @@ open Types
* - http://www.w3.org/TR/CSS2/cascade.html#specificity
* - http://www.w3.org/TR/CSS2/cascade.html#specificity
*)
*)
let
is_pseudo_class
=
function
|
Pseudo_class
(
_
,
(
"link"
|
"hover"
|
"visited"
|
"active"
)
,
None
)
->
true
|
_
->
false
(* Specificity (a, b, c, d):
(* Specificity (a, b, c, d):
* a = 0 (1 if in style="" definition which is always false in a stylesheet)
* a = 0 (1 if in style="" definition which is always false in a stylesheet)
* b = number of ID attributes
* b = number of ID attributes
...
@@ -24,13 +20,10 @@ let rec specificity =
...
@@ -24,13 +20,10 @@ let rec specificity =
(
0
,
0
,
0
,
1
)
(
0
,
0
,
0
,
1
)
|
Id
(
base
,
_
)
->
|
Id
(
base
,
_
)
->
add
(
0
,
1
,
0
,
0
)
(
specificity
base
)
add
(
0
,
1
,
0
,
0
)
(
specificity
base
)
|
Class
(
base
,
_
)
|
Attribute
(
base
,
_
,
_
)
->
|
Class
(
base
,
_
)
|
Attribute
(
base
,
_
,
_
)
|
Pseudo_class
(
base
,
_
,
_
)
->
add
(
0
,
0
,
1
,
0
)
(
specificity
base
)
|
Pseudo_class
(
base
,
_
,
_
)
as
addon
when
is_pseudo_class
addon
->
add
(
0
,
0
,
1
,
0
)
(
specificity
base
)
add
(
0
,
0
,
1
,
0
)
(
specificity
base
)
|
Pseudo_
class
(
base
,
_
,
_
)
->
|
Pseudo_
element
(
base
,
_
)
->
add
(
0
,
0
,
0
,
1
)
(
specificity
base
)
add
(
0
,
0
,
0
,
1
)
(
specificity
base
)
(* XXX: Pseudo_element *)
|
Combinator
(
left
,
_
,
right
)
->
|
Combinator
(
left
,
_
,
right
)
->
add
(
specificity
left
)
(
specificity
right
)
add
(
specificity
left
)
(
specificity
right
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment