Rct567/DomQuery

2nd or further comma separated selectors effect entire dom not just context node's children.

silverham opened this issue · 2 comments

2nd or further comma separated selectors effect entire dom not just context node's children.

Given:

$dom = new DomQuery('
<body>
  <div class="test"><p class="bob">111</p></div>
  <div class="test"><p class="bob">222</p></div>
</body>
');
$dom->find('.test')->first()->find('.someotherclass,.bob')->addClass('myextraclass');
// expected
<body>
  <div class="test"><p class="bob myextraclass">111</p></div>
  <div class="test"><p class="bob">222</p></div>
</body>

// produced.
<body>
  <div class="test"><p class="bob myextraclass">111</p></div>
  <div class="test"><p class="bob myextraclass">222</p></div>
</body>

Fixed in PR #29