Closed
Bug 1361303
Opened 8 years ago
Closed 8 years ago
stylo: custom property name serialization is wrong
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(2 files, 1 obsolete file)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8863637 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 4•8 years ago
|
||
Comment 5•8 years ago
|
||
mozreview-review |
Comment on attachment 8863637 [details]
Correctly serialize CSS Custom Property names.
https://reviewboard.mozilla.org/r/135434/#review138382
::: servo/components/style/properties/properties.mako.rs:813
(Diff revision 1)
> _ => false,
> }
> }
> +
> + /// Returns the name of the property without CSS escaping.
> + pub fn name(&self) -> String {
We can probably use `Cow<'static, str>` here, but that probably doesn't matter a lot.
::: servo/components/style/properties/properties.mako.rs:817
(Diff revision 1)
> + let mut s = String::from("--");
> + s += name.to_string().as_str();
> + s
Maybe better
```rust
let mut s = String::new();
write!(&mut s, "--{}", name).unwrap();
s
```
so that we can avoid the allocation from `name.to_string()`.
::: servo/components/style/properties/properties.mako.rs:961
(Diff revision 1)
> + let mut s = String::from("--");
> + s += name.to_string().as_str();
> + s
Ditto.
Attachment #8863637 -
Flags: review?(xidorn+moz) → review+
Comment 6•8 years ago
|
||
mozreview-review |
Comment on attachment 8863638 [details]
Bug 1361303 - Part 1: Add test for serialization of CSS Custom Property names.
https://reviewboard.mozilla.org/r/135436/#review138392
Attachment #8863638 -
Flags: review?(xidorn+moz) → review+
Comment 7•8 years ago
|
||
mozreview-review |
Comment on attachment 8863639 [details]
Bug 1361303 - Part 2: Update test expectations.
https://reviewboard.mozilla.org/r/135438/#review138394
Attachment #8863639 -
Flags: review?(xidorn+moz) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8863637 -
Attachment is obsolete: true
Comment 10•8 years ago
|
||
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dc77087efa2e
Part 1: Add test for serialization of CSS Custom Property names. r=xidorn
https://hg.mozilla.org/integration/autoland/rev/545f5678ceaf
Part 2: Update test expectations. r=xidorn
Comment 11•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dc77087efa2e
https://hg.mozilla.org/mozilla-central/rev/545f5678ceaf
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → cam
You need to log in
before you can comment on or make changes to this bug.
Description
•