Closed Bug 1408308 Opened 7 years ago Closed 7 years ago

make ResponsiveImageSelector use Servo for parsing its source size list

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: heycam, Assigned: emilio)

References

Details

Attachments

(1 file)

Currently it uses nsCSSParser to produce arrays of nsMediaQuery and nsCSSValue objects.
I'll take this one, I think.
Assignee: nobody → emilio
https://github.com/servo/servo/pull/19126 introduces the CSS parsing and evaluation bits.
(In reply to Emilio Cobos Álvarez [:emilio] from comment #3) This is a WIP. The wpt tests expect less strict grammar, so will work on that, but I didn't want to lose track of this.
Comment on attachment 8926931 [details] Bug 1408308: Integrate Servo SourceSizeList in ResponsiveImageSelector. Hmm, Xidorn and Cam are on PTO... Over to Manish I guess? Note to self and reviewer: Need to update the spec links to reflect spec discussions, also probably add the HasBoxFFI boilerplate.
Attachment #8926931 - Flags: review?(xidorn+moz) → review?(manishearth)
Comment on attachment 8926931 [details] Bug 1408308: Integrate Servo SourceSizeList in ResponsiveImageSelector. https://reviewboard.mozilla.org/r/198170/#review203966 ::: servo/components/style/values/specified/source_size_list.rs:99 (Diff revision 2) > - }).unwrap_or(vec![]); > > - let value = Length::parse_non_negative(context, input)?; > + loop { > + let result = input.parse_until_before(Delimiter::Comma, |input| { > + if let Ok(size) = input.try(|input| SourceSize::parse(context, input)) { > + return Ok(SourceSizeOrLength::SourceSize(size)); could you structure this as an implicit return in an if let ... else block? The explicit return makes it seem as if it returns out of the entire function, which is kinda confusing. ::: servo/ports/geckolib/glue.rs:4672 (Diff revision 2) > + > + result.0 > +} > + > +#[no_mangle] > +pub unsafe extern "C" fn Servo_SourceSizeList_Drop(list: *mut SourceSizeList) { We don't bind to this or use it. Who handles the destructor?
Attachment #8926931 - Flags: review?(manishearth) → review+
(In reply to Manish Goregaokar [:manishearth] from comment #7) > Comment on attachment 8926931 [details] > Bug 1408308: Integrate Servo SourceSizeList in ResponsiveImageSelector. > > https://reviewboard.mozilla.org/r/198170/#review203966 > > ::: servo/components/style/values/specified/source_size_list.rs:99 > (Diff revision 2) > > - }).unwrap_or(vec![]); > > > > - let value = Length::parse_non_negative(context, input)?; > > + loop { > > + let result = input.parse_until_before(Delimiter::Comma, |input| { > > + if let Ok(size) = input.try(|input| SourceSize::parse(context, input)) { > > + return Ok(SourceSizeOrLength::SourceSize(size)); > > could you structure this as an implicit return in an if let ... else block? > > The explicit return makes it seem as if it returns out of the entire > function, which is kinda confusing. Sure, sounds ok. > ::: servo/ports/geckolib/glue.rs:4672 > (Diff revision 2) > > + > > + result.0 > > +} > > + > > +#[no_mangle] > > +pub unsafe extern "C" fn Servo_SourceSizeList_Drop(list: *mut SourceSizeList) { > > We don't bind to this or use it. Who handles the destructor? The DEFINE_BOXED_TYPE thing. You wrote that :P
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b59ffea83e0a Integrate Servo SourceSizeList in ResponsiveImageSelector. r=Manishearth
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/136ee1bdf20d Reland the bindings so the build isn't busted, but we don't need to backout the servo bits. r=me
Flags: needinfo?(emilio)
Keywords: leave-open
I think it's the mingw build and the asan fuzzing build... I suspect I'm missing includes or something. Will fix up tomorrow.
Flags: needinfo?(emilio)
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/78d7ac2ce842 Integrate Servo SourceSizeList in ResponsiveImageSelector. r=Manishearth
Flags: needinfo?(emilio)
Bug 1416756 is the MinGW build break. I'll put details there.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Removing leave-open keyword from resolved bugs, per :sylvestre.
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: