servo: Merge #18761 - style: Iterate in the expected order in the custom_properties module (from emilio:custom-props-iter); r=SimonSapin

In #18745, I replaced a few manual iterations over `index` with the iterator,
and it changed the behavior of `layout/style/test/test_variables_order.html`,
since it turns out that the iterator iterates right to left.

I think this is just an accident that happened due to inconsistencies in how we
were iterating over it, and that our behavior was inconsistent (since we
iterated rtl in some cases, but ltr in others seems like it'd be inconsistent
depending on the depth of the tree and different stuff).

This brings back the expected behavior again, and ensures we iterate over a
consistent order every time.

Source-Repo: https://github.com/servo/servo
Source-Revision: 00a2f55e5f39f8f077b83d43caf4710fa0647f76

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 69135c70790ee12996723dc69fcd2bea21980c0e
This commit is contained in:
Emilio Cobos Álvarez 2017-10-05 09:22:24 -05:00
Родитель 84bf318644
Коммит 44a83b02ce
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -190,14 +190,14 @@ where
type Item = (&'a K, &'a V);
fn next(&mut self) -> Option<Self::Item> {
let ref index = self.inner.index;
if self.pos >= index.len() {
return None;
}
let key = match self.inner.index.get(self.pos) {
Some(k) => k,
None => return None,
};
let ref key = index[index.len() - self.pos - 1];
self.pos += 1;
let value = &self.inner.values[key];
Some((key, value))
}
}