mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Implement media queries parser and matching. Improves mobile first sites like bootstrap3.
This commit is contained in:
parent
0aeecfc41d
commit
c7d81fdde6
7 changed files with 686 additions and 64 deletions
|
@ -42,6 +42,25 @@ impl<E, I: Iterator<E>> BufferedIter<E, I> {
|
|||
assert!(self.buffer.is_none());
|
||||
self.buffer = Some(value);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_eof(&mut self) -> bool {
|
||||
match self.next() {
|
||||
Some(value) => {
|
||||
self.push_back(value);
|
||||
false
|
||||
}
|
||||
None => true
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn next_as_result(&mut self) -> Result<E, ()> {
|
||||
match self.next() {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, I: Iterator<E>> Iterator<E> for BufferedIter<E, I> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue