roverdotcom/django-inlinecss

Handle Greater Selector Depth

Opened this issue · 0 comments

Currently the test_immediate_child_with_additional_child_selector fails because the selector tests are run against the MATCHED element, rather than the intermediate layer.

The CSS used in this test is:

.wrapper > .header input { ... }

Although it will initially match on input, once it sees the > operator it will check for an immediate parent of input with the wrapper class, instead of a parent of input with class header that has an immediate parent wrapper.

Passing the failing test should be sufficient to prove this is resolved.

FAIL: test_immediate_child_with_additional_child_selector (django_inlinecss.tests.pynliner_tests.ComplexSelectors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/philip/workspace/django-inlinecss/django_inlinecss/tests/pynliner_tests.py", line 468, in test_immediate_child_with_additional_child_selector
    self.assertEqual(output, expected)
AssertionError: u'<div class="wrapper"><div class="header"><input type="text" /></div></div>' != u'<div class="wrapper"><div class="header"><input type="text" style="color: red" [truncated]...
- <div class="wrapper"><div class="header"><input type="text" /></div></div>
+ <div class="wrapper"><div class="header"><input type="text" style="color: red" /></div></div>
?                                                            +++++++++++++++++++