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)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: heycam, Assigned: emilio)
References
Details
Attachments
(1 file)
Currently it uses nsCSSParser to produce arrays of nsMediaQuery and nsCSSValue objects.
Updated•7 years ago
|
status-firefox57:
--- → wontfix
Assignee | ||
Comment 2•7 years ago
|
||
https://github.com/servo/servo/pull/19126 introduces the CSS parsing and evaluation bits.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•7 years ago
|
||
(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 hidden (mozreview-request) |
Assignee | ||
Comment 6•7 years ago
|
||
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 7•7 years ago
|
||
mozreview-review |
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+
Assignee | ||
Comment 8•7 years ago
|
||
(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
Comment 10•7 years ago
|
||
Backed out 1 changesets (bug 1408308) for bustage in [toolkit/library/target] r=backout on a CLOSED TREE
https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=b59ffea83e0abe345853fa76dba4bca551464858&selectedJob=144188189
https://hg.mozilla.org/integration/autoland/rev/168af2eb1faf085e06768dd11431175242afb5ee
Flags: needinfo?(emilio)
Comment 11•7 years ago
|
||
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
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(emilio)
Keywords: leave-open
Assignee | ||
Comment 12•7 years ago
|
||
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)
Comment 13•7 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/78d7ac2ce842
Integrate Servo SourceSizeList in ResponsiveImageSelector. r=Manishearth
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(emilio)
Comment 14•7 years ago
|
||
Bug 1416756 is the MinGW build break. I'll put details there.
Comment 15•7 years ago
|
||
bugherder |
Assignee | ||
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Comment 16•7 years ago
|
||
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.
Description
•