Add parsing of double values in style attributes#10608
Add parsing of double values in style attributes#10608bors-servo merged 1 commit intoservo:masterfrom
Conversation
Not my fault! |
|
Yep, #10610 clears that up. |
components/style/attr.rs
Outdated
|
|
||
| /// Parse a floating-point number according to | ||
| /// <https://html.spec.whatwg.org/multipage/#rules-for-parsing-floating-point-number-values> | ||
| pub fn parse_double(string: &DOMString) -> Option<f64> { |
There was a problem hiding this comment.
Nit: could it return Result<f64, ()> instead?
|
Shouldn't that make new tests pass? -S-awaiting-review +S-needs-code-changes Reviewed 7 of 7 files at r1. components/servo/Cargo.lock, line 2193 [r1] (raw file): components/style/attr.rs, line 82 [r1] (raw file): components/style/attr.rs, line 106 [r1] (raw file): components/util/str.rs, line 166 [r1] (raw file): components/util/str.rs, line 170 [r1] (raw file): components/util/str.rs, line 196 [r1] (raw file): Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 7 unresolved discussions. components/style/attr.rs, line 79 [r1] (raw file): components/style/attr.rs, line 106 [r1] (raw file): components/util/str.rs, line 196 [r1] (raw file): Comments from Reviewable |
|
-S-awaiting-review +S-needs-code-changes Reviewed 5 of 5 files at r2. components/style/attr.rs, line 79 [r1] (raw file): components/style/attr.rs, line 106 [r1] (raw file): components/util/str.rs, line 196 [r1] (raw file): components/util/str.rs, line 170 [r2] (raw file): Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. components/style/attr.rs, line 106 [r1] (raw file): Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. components/style/attr.rs, line 106 [r1] (raw file): Comments from Reviewable |
|
☔ The latest upstream changes (presumably #10745) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Reviewed 3 of 3 files at r3. components/style/attr.rs, line 106 [r1] (raw file): Anyway I don't think having to decode a string multiple times should be needed to just parse an integer string. components/style/attr.rs, line 66 [r3] (raw file): Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. components/style/attr.rs, line 106 [r1] (raw file): Comments from Reviewable |
|
Seems good enough. Please file an issue about No WPT test? -S-awaiting-review +S-awaiting-answer Reviewed 10 of 10 files at r4. Comments from Reviewable |
|
Seems good enough. Please file an issue about No WPT test? -S-awaiting-review +S-awaiting-answer Reviewed 10 of 10 files at r4. Comments from Reviewable |
|
I have another branch that actually utilizes the parse_double utility function (it's for parsing HTMLInputElement doubles), but for this PR, I've added a unit test instead since it's only a util crate modification. |
|
@bors-servo r=nox |
|
📌 Commit 48b2e9c has been approved by |
Add parsing of double values in style attributes <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10608) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt |
This change is