Skip to content

Commit 25c9b49

Browse files
committed
Fix minor issue with attribute selector unification
1 parent 8b97eed commit 25c9b49

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ast.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,28 +513,28 @@ namespace Sass {
513513
// check for pseudo elements because they are always last
514514
size_t i, L;
515515
bool found = false;
516-
if (typeid(*this) == typeid(Pseudo_Selector) || typeid(*this) == typeid(Wrapped_Selector))
516+
if (typeid(*this) == typeid(Pseudo_Selector) || typeid(*this) == typeid(Wrapped_Selector) || typeid(*this) == typeid(Attribute_Selector))
517517
{
518518
for (i = 0, L = rhs->length(); i < L; ++i)
519519
{
520-
if ((Cast<Pseudo_Selector>((*rhs)[i]) || Cast<Wrapped_Selector>((*rhs)[i])) && (*rhs)[L-1]->is_pseudo_element())
520+
if ((Cast<Pseudo_Selector>((*rhs)[i]) || Cast<Wrapped_Selector>((*rhs)[i]) || Cast<Attribute_Selector>((*rhs)[i])) && (*rhs)[L-1]->is_pseudo_element())
521521
{ found = true; break; }
522522
}
523523
}
524524
else
525525
{
526526
for (i = 0, L = rhs->length(); i < L; ++i)
527527
{
528-
if (Cast<Pseudo_Selector>((*rhs)[i]) || Cast<Wrapped_Selector>((*rhs)[i]))
528+
if (Cast<Pseudo_Selector>((*rhs)[i]) || Cast<Wrapped_Selector>((*rhs)[i]) || Cast<Attribute_Selector>((*rhs)[i]))
529529
{ found = true; break; }
530530
}
531531
}
532532
if (!found)
533533
{
534534
rhs->append(this);
535-
return rhs;
535+
} else {
536+
rhs->elements().insert(rhs->elements().begin() + i, this);
536537
}
537-
rhs->elements().insert(rhs->elements().begin() + i, this);
538538
return rhs;
539539
}
540540

0 commit comments

Comments
 (0)