From kde-commits Thu Jun 10 21:46:34 2010 From: Maks Orlovich Date: Thu, 10 Jun 2010 21:46:34 +0000 To: kde-commits Subject: KDE/kdelibs/khtml/css Message-Id: <20100610214634.B0C81AC8CF () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=127620595019724 SVN commit 1136838 by orlovich: Check things we're combined with as well (and not just the target) for invalid pseudos when checking parse result for querySelector[All]. Occurs in slashdot's automore code (needs an another commit to fix that fully, though) M +4 -1 cssparser.cpp --- trunk/KDE/kdelibs/khtml/css/cssparser.cpp #1136837:1136838 @@ -326,7 +326,9 @@ // Make sure to detect problems with pseudos, too bool ok = true; for (int i = 0; i < selectors.size(); ++i) { - DOM::CSSSelector* sel = selectors[i]; + // we need to check not only us, but also other things we're connected to via + // combinators + for (DOM::CSSSelector* sel = selectors[i]; sel; sel = sel->tagHistory) { if(sel->match == CSSSelector::PseudoClass || sel->match == CSSSelector::PseudoElement) { if (sel->pseudoType() == CSSSelector::PseudoOther) { ok = false; @@ -334,6 +336,7 @@ } } } + } if (!ok) { qDeleteAll(selectors);