another bug introduced by the new css leser :(

This commit is contained in:
Adam D. Ruppe 2015-12-10 22:36:02 -05:00
parent a9af0b624a
commit 6b4301c25a
1 changed files with 16 additions and 8 deletions

24
dom.d
View File

@ -4900,6 +4900,12 @@ int intFromHex(string hex) {
int separation = -1; /// -1 == only itself; the null selector, 0 == tree, 1 == childNodes, 2 == childAfter, 3 == youngerSibling, 4 == parentOf int separation = -1; /// -1 == only itself; the null selector, 0 == tree, 1 == childNodes, 2 == childAfter, 3 == youngerSibling, 4 == parentOf
bool isCleanSlateExceptSeparation() {
auto cp = this;
cp.separation = -1;
return cp is SelectorPart.init;
}
///. ///.
string toString() { string toString() {
string ret; string ret;
@ -4907,10 +4913,10 @@ int intFromHex(string hex) {
default: assert(0); default: assert(0);
case -1: break; case -1: break;
case 0: ret ~= " "; break; case 0: ret ~= " "; break;
case 1: ret ~= ">"; break; case 1: ret ~= " > "; break;
case 2: ret ~= "+"; break; case 2: ret ~= " + "; break;
case 3: ret ~= "~"; break; case 3: ret ~= " ~ "; break;
case 4: ret ~= "<"; break; case 4: ret ~= " < "; break;
} }
ret ~= tagNameFilter; ret ~= tagNameFilter;
foreach(a; attributesPresent) ret ~= "[" ~ a ~ "]"; foreach(a; attributesPresent) ret ~= "[" ~ a ~ "]";
@ -5181,9 +5187,8 @@ int intFromHex(string hex) {
SelectorPart current; SelectorPart current;
void commit() { void commit() {
// might as well skip null items // might as well skip null items
if(current != current.init) { if(current !is SelectorPart.init) {
s.parts ~= current; s.parts ~= current;
current = current.init; // start right over current = current.init; // start right over
} }
} }
@ -5211,13 +5216,16 @@ int intFromHex(string hex) {
if(tid == -1) { if(tid == -1) {
if(!caseSensitiveTags) if(!caseSensitiveTags)
token = token.toLower(); token = token.toLower();
if(current.tagNameFilter) {
if(current.isCleanSlateExceptSeparation()) {
current.tagNameFilter = token;
} else {
// if it was already set, we must see two thingies // if it was already set, we must see two thingies
// separated by whitespace... // separated by whitespace...
commit(); commit();
current.separation = 0; // tree current.separation = 0; // tree
current.tagNameFilter = token;
} }
current.tagNameFilter = token;
} else { } else {
// Selector operators // Selector operators
switch(token) { switch(token) {