Commit 369ee206 authored by Taddeus Kroes's avatar Taddeus Kroes

Bugfix in unused code

parent f69c40b6
...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment