mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #16742 - nox:font-feature-settings, r=emilio
Properly use big endianness to parse font feature tags <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16742) <!-- Reviewable:end -->
This commit is contained in:
commit
ce874d72ec
2 changed files with 7 additions and 7 deletions
|
@ -1815,10 +1815,10 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
impl ToCss for FeatureTagValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
use std::str;
|
||||
use byteorder::{WriteBytesExt, NativeEndian};
|
||||
use byteorder::{WriteBytesExt, BigEndian};
|
||||
|
||||
let mut raw: Vec<u8> = vec!();
|
||||
raw.write_u32::<NativeEndian>(self.tag).unwrap();
|
||||
raw.write_u32::<BigEndian>(self.tag).unwrap();
|
||||
let str_print = str::from_utf8(&raw).unwrap_or_default();
|
||||
|
||||
match self.value {
|
||||
|
@ -1836,7 +1836,7 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
use std::io::Cursor;
|
||||
use std::str;
|
||||
use std::ops::Deref;
|
||||
use byteorder::{ReadBytesExt, NativeEndian};
|
||||
use byteorder::{ReadBytesExt, BigEndian};
|
||||
|
||||
let tag = try!(input.expect_string());
|
||||
|
||||
|
@ -1848,7 +1848,7 @@ ${helpers.single_keyword_system("font-variant-position",
|
|||
}
|
||||
|
||||
let mut raw = Cursor::new(tag.as_bytes());
|
||||
let u_tag = raw.read_u32::<NativeEndian>().unwrap();
|
||||
let u_tag = raw.read_u32::<BigEndian>().unwrap();
|
||||
|
||||
if let Ok(value) = input.try(|input| input.expect_integer()) {
|
||||
// handle integer, throw if it is negative
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue