stylo: need -moz-image-rect support

RESOLVED FIXED in Firefox 55

Status

()

Core
CSS Parsing and Computation
P1
normal
RESOLVED FIXED
2 months ago
a month ago

People

(Reporter: bz, Assigned: canaltinova)

Tracking

(Blocks: 2 bugs)

Trunk
mozilla55
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox54 affected, firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments, 1 obsolete attachment)

Again, probably this is mostly servo-side....
Flags: needinfo?(simon.sapin)
Blocks: 1345200
Priority: -- → P1
Assignee: nobody → canaltinova
Flags: needinfo?(simon.sapin)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 3

a month ago
mozreview-review
Comment on attachment 8851221 [details]
Bug 1341763 - stylo: Rename and move PercentageOrNumber to values

https://reviewboard.mozilla.org/r/123590/#review126082

::: servo/components/style/gecko/values.rs:69
(Diff revision 1)
>  
> +impl GeckoStyleCoordConvertible for NumberOrPercentage {
> +    fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
> +        match *self {
> +            NumberOrPercentage::Number(ref n) => n.to_gecko_style_coord(coord),
> +            NumberOrPercentage::Percentage(p) => coord.set_value(CoordDataValue::Percent(p)),

does p.to_gecko_style_coord not work?

(If it doesn't,  we should probably add a GSCC impl for Percentage)

Edit: Oh, I see, you are using CSSFloat and not Percent -- that should be changed.

::: servo/components/style/values/computed/mod.rs:271
(Diff revision 1)
>  
> +#[derive(Debug, Clone, PartialEq)]
> +#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
> +#[allow(missing_docs)]
> +pub enum NumberOrPercentage {
> +    Percentage(CSSFloat),

Use the Percentage type here, it has ToCss impls and stuff that are useful.

::: servo/components/style/values/specified/mod.rs:567
(Diff revision 1)
> +        if let Ok(per) = input.try(|input| Percentage::parse(context, input)) {
> +            return Ok(NumberOrPercentage::Percentage(per));
> +        }
> +
> +        let num = try!(Number::parse_non_negative(input));
> +        Ok(NumberOrPercentage::Number(num))

nonnegativeness of the number should be documented somewhere, preferably on numberorpercentage itself
Attachment #8851221 - Flags: review?(manishearth) → review+

Comment 4

a month ago
mozreview-review
Comment on attachment 8851222 [details]
Bug 1341763 - stylo: Add support for -moz-image-rect value

https://reviewboard.mozilla.org/r/123592/#review126084
Attachment #8851222 - Flags: review?(manishearth) → review+
(Assignee)

Comment 5

a month ago
mozreview-review-reply
Comment on attachment 8851221 [details]
Bug 1341763 - stylo: Rename and move PercentageOrNumber to values

https://reviewboard.mozilla.org/r/123590/#review126082

> Use the Percentage type here, it has ToCss impls and stuff that are useful.

I thought this too when I wrote it but there is no computed Percentage type in servo currently. All other types like LengthOrPercentage uses CSSFloat for computed percentage. I should write that.

> nonnegativeness of the number should be documented somewhere, preferably on numberorpercentage itself

Ok, will do.
(Assignee)

Comment 6

a month ago
mozreview-review-reply
Comment on attachment 8851221 [details]
Bug 1341763 - stylo: Rename and move PercentageOrNumber to values

https://reviewboard.mozilla.org/r/123590/#review126082

> I thought this too when I wrote it but there is no computed Percentage type in servo currently. All other types like LengthOrPercentage uses CSSFloat for computed percentage. I should write that.

Oh, or probably I can use specified Percentage and add `ComputedValueAsSpecified` to Percentage for this since there are no differences with specified and computed.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 10

a month ago
mozreview-review
Comment on attachment 8851260 [details]
Bug 1341763 - stylo: Update test expectations

https://reviewboard.mozilla.org/r/123612/#review126102

Go forth and split the commits :)
Attachment #8851260 - Flags: review+
(Assignee)

Comment 11

a month ago
Btw, the gecko and stylo test reference listings were different at some places. For example it was `== dom-api-computed-style.html dom-api-ref.html` in the gecko side but `fails == dom-api-computed-style.html dom-api-computed-style.html` in stylo side. I changed to match with gecko. Is it true?
No, keep it as is. The gecko tests test gecko rendering of foo.html with gecko rendering of foo-ref.html. The stylo tests test stylo rendering of foo.html against gecko rendering of foo.html -- for stylo correctness we want it to look like gecko, not necessarily pass all reftests.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Updated

a month ago
Attachment #8851221 - Attachment is obsolete: true
(Assignee)

Comment 15

a month ago
Ok, reversed the reftests. Related Servo part: https://github.com/servo/servo/pull/16133

Comment 16

a month ago
Pushed by manishearth@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b315010da573
stylo: Add support for -moz-image-rect value r=manishearth
https://hg.mozilla.org/integration/autoland/rev/aadf315df1f8
stylo: Update test expectations r=manishearth

Comment 17

a month ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b315010da573
https://hg.mozilla.org/mozilla-central/rev/aadf315df1f8
Status: NEW → RESOLVED
Last Resolved: a month ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Depends on: 1350714
You need to log in before you can comment on or make changes to this bug.