Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dolt #18846

Closed
wants to merge 6 commits into from
Closed

Dolt #18846

Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Parse Sizes Attribute

  • Loading branch information
Rakhisharma committed Sep 21, 2017
commit f4321b52f91facf45858af410e51823de213ebe3
@@ -798,7 +798,6 @@ impl LayoutHTMLImageElementHelpers for LayoutJS<HTMLImageElement> {
pub fn parse_a_sizes_attribute(input: DOMString, width: Option<u32>) -> Vec<Size> {
let mut sizes = Vec::<Size>::new();
let unparsed_sizes = input.split(',').collect::<Vec<_>>();

for unparsed_size in &unparsed_sizes {
let whitespace = unparsed_size.chars().rev().take_while(|c| char::is_whitespace(*c)).count();
let trimmed: String = unparsed_size.chars().take(unparsed_size.chars().count() - whitespace).collect();
@@ -814,7 +813,6 @@ pub fn parse_a_sizes_attribute(input: DOMString, width: Option<u32>) -> Vec<Size
QuirksMode::NoQuirks);
let mut parser = Parser::new(&mut input);
let length = parser.try(|i| Length::parse_non_negative(&context, i));
println!("\n{:?}", length);
match length {
Ok(len) => sizes.push(Size {
length: len,
@@ -100,4 +100,4 @@ fn extra_whitespace() {
let a = &[size, size1];
assert_eq!(parse_a_sizes_attribute(DOMString::from("(max-width: 900px) 1000px, (max-width: 900px) 50px"),
None), a);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.