Commit graph

20 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
31e8e418ea Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
Emilio Cobos Álvarez
f58301ecbc style: Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization.
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2021-02-26 16:44:05 +01:00
Simon Sapin
1d38bc0419 Fix some new warnings 2019-06-22 14:59:09 +02:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Emilio Cobos Álvarez
39a3d93b4f
style: remove unused AsciiExt imports.
eq_ignore_ascii_case is not in AsciiExt since rustc 1.23.
2018-03-04 15:31:06 +01:00
Bobby Holley
5526947500 Avoid the generic writer parameter for PropertyDeclaration serialization.
MozReview-Commit-ID: JR3IcL1NRHO
2018-01-22 14:58:05 -08:00
Simon Sapin
954b2cc3d8
Allow unused imports for AsciiExt in style code.
See #19128, this part is cherry-picked so Gecko can build with rust nightly.
2017-11-09 12:43:23 +01:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Neha
1f1ca3ac8d Parse srcset attribute 2017-10-03 13:18:01 +02:00
Brad Werth
557ffa979d Rework MediaType to be an atom-based struct instead of an enum.
MozReview-Commit-ID: 1Tfrs9PBkhA
2017-08-09 13:25:30 -07:00
Emilio Cobos Álvarez
9e00efc8a5
style: Make starts_with_ignore_ascii_case not lie if the strings are the same length. 2017-07-08 19:41:28 +02:00
Emilio Cobos Álvarez
d8a22d8bd7
style: Fix starts_with_ignore_ascii_case.
In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380
2017-07-08 19:32:11 +02:00
Hiroyuki Ikezoe
973d8287a9 Support vendor prefix keyframes rule.
If there are multiple prefixed/non-prefixed @keyframes with the same name;

* non-prefixed rule overrides earlier rules.
* prefixed rule overrides earlier prefixed rules.
2017-04-21 12:18:12 +09:00
Simon Sapin
2f996e34f5 Use ascii_case_insensitive_phf_map! in PropertyId::parse 2017-02-26 11:10:33 +01:00
bors-servo
d967d89fc0 Auto merge of #14796 - jlevesy:jl-match-to-if-let, r=Wafflespeanut
replace match by if let statements if possible

<!-- Please describe your changes on the following line: -->
Hi there,

This PR replaces `match` statements by `if let` when possible.

Thanks for reviewing

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14788

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this PR is a code cleanup patch.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14796)
<!-- Reviewable:end -->
2016-12-31 21:28:41 -08:00
Julien Levesy
b78979d692 replace match by if let statements if possible 2016-12-31 12:34:05 +01:00
Emilio Cobos Álvarez
a0d425e8ce
style: Document and cleanup str.rs 2016-12-31 12:17:00 +01:00
Simon Sapin
97344b150d cow_to_ascii_lowercase() 2016-12-09 10:56:20 -10:00
Anthony Ramine
8ecb5962f3 Move util::str to style 2016-07-05 10:43:54 +02:00
Renamed from components/util/str.rs (Browse further)