From 00cafe488273eab18e9c93bf59191efaa722fc3b Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 9 Jun 2019 15:44:04 +0100 Subject: Stylesheet: Increase size of storage for selector count for rules. We've found instances of well over 256 selectors for a rule in the wild. `for N in $(seq 0 254); do echo ".selector-$N,"; done; echo ".selector-255 {}"` --- src/stylesheet.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stylesheet.h b/src/stylesheet.h index a44ad1f..a71fca6 100644 --- a/src/stylesheet.h +++ b/src/stylesheet.h @@ -117,10 +117,10 @@ struct css_rule { css_rule *next; /**< next in list */ css_rule *prev; /**< previous in list */ - unsigned int type : 4, /**< css_rule_type */ - index : 16, /**< index in sheet */ - items : 8, /**< # items in rule */ - ptype : 1; /**< css_rule_parent_type */ + uint32_t index; /**< index in sheet */ + uint16_t items; /**< number of items (selectors) in rule */ + uint8_t type; /**< css_rule_type */ + uint8_t ptype; /**< css_rule_parent_type */ } _ALIGNED; typedef struct css_rule_selector { -- cgit v1.2.3