Skip to content

Commit 97d159f

Browse files
committed
docs: update rule weight doc
1 parent bea1809 commit 97d159f

File tree

1 file changed

+6
-4
lines changed
  • float-pigment-css/src/sheet

1 file changed

+6
-4
lines changed

float-pigment-css/src/sheet/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,12 @@ impl StyleSheet {
614614
///
615615
/// Weight of a rule is composed of multiple factors.
616616
///
617-
/// * High 2nd bit is preserved for important bit.
618-
/// * High 3rd bit is for the ID selector.
619-
/// * High 4th~10th bits is for the class selector (255 at most).
620-
/// * High 15th bit is for the tag name selector.
617+
/// * High 16 bits is for the selector, while the detailed layout is `-MICCCCCCCCP--TT`:
618+
/// * `M` - the important bit;
619+
/// * `I` - the ID selector bit;
620+
/// * `C` - the sum of the class selectors and the attribute selectors (max 255);
621+
/// * `P` - the pseudo class bit;
622+
/// * `T` - the sum of the tag name selector and the pseudo element selector.
621623
/// * High 16th~31st bits is the style sheet index (0-based index).
622624
/// * High 32nd~63rd bits is the rule index in the whole linked style sheet (1-based index).
623625
#[derive(Debug, Clone, Copy, PartialEq, Eq)]

0 commit comments

Comments
 (0)