Loading src/css.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -281,9 +281,17 @@ namespace { std::vector<std::string> splitCombinatorChain(const std::string &selector) { std::vector<std::string> parts; std::string cur; int bracketDepth = 0; for (char c : selector) { if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '>' || c == '+' || c == '~') { if (c == '[') ++bracketDepth; else if (c == ']' && bracketDepth > 0) --bracketDepth; // Inside "[...]", '~' (and '+'/'>') are attribute-operator // characters (e.g. "[rel~=external]"), not combinators -- only // split on them outside of brackets, same bracket-awareness // stripAttributeSelectors already needs for its own scan. bool isCombinatorChar = (c == '>' || c == '+' || c == '~') && bracketDepth == 0; if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || isCombinatorChar) { if (!cur.empty()) { parts.push_back(cur); cur.clear(); } } else { cur += c; Loading Loading
src/css.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -281,9 +281,17 @@ namespace { std::vector<std::string> splitCombinatorChain(const std::string &selector) { std::vector<std::string> parts; std::string cur; int bracketDepth = 0; for (char c : selector) { if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '>' || c == '+' || c == '~') { if (c == '[') ++bracketDepth; else if (c == ']' && bracketDepth > 0) --bracketDepth; // Inside "[...]", '~' (and '+'/'>') are attribute-operator // characters (e.g. "[rel~=external]"), not combinators -- only // split on them outside of brackets, same bracket-awareness // stripAttributeSelectors already needs for its own scan. bool isCombinatorChar = (c == '>' || c == '+' || c == '~') && bracketDepth == 0; if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || isCombinatorChar) { if (!cur.empty()) { parts.push_back(cur); cur.clear(); } } else { cur += c; Loading