aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/media_queries.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-8/+8
| | | | | | | | 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.
* Use the location in the error value when reporting a CSS errorSimon Sapin2017-10-101-1/+2
|
* Update to cssparser 0.22 (source location in error types)Simon Sapin2017-10-101-4/+4
|
* Use the current parser location for CSS errorSimon Sapin2017-10-101-2/+1
| | | | | | | | … rather than the start location of the current construct. This likely places the error just *after* of the unexpected token whereas before would be best, but that’s likely a much bigger change. See https://bugzilla.mozilla.org/show_bug.cgi?id=1378861
* stylo: Error reporting for unknown media featuresFernando Jiménez Moreno2017-09-081-4/+19
|
* Replace some more uses of `write!` in components/styleSimon Sapin2017-09-041-4/+4
|
* order derivable traits listsClément DAVID2017-08-231-4/+4
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Rework MediaType to be an atom-based struct instead of an enum.Brad Werth2017-08-091-30/+30
| | | | MozReview-Commit-ID: 1Tfrs9PBkhA
* Utilize match_ignore_ascii_case! in more places.Corey Farwell2017-07-291-15/+9
|
* Update cssparser to 0.18Simon Sapin2017-07-241-3/+3
| | | | https://github.com/servo/rust-cssparser/pull/171
* Untry styleSimon Sapin2017-06-181-13/+13
|
* Derive ToCss for media query qualifiersAnthony Ramine2017-06-171-12/+1
|
* Thread ParseError return values through CSS parsing.Josh Matthews2017-06-091-9/+17
|
* Propagate quirks mode all the way to ParserContextAnthony Ramine2017-04-271-2/+3
| | | | The quirks mode is still not properly propagated in geckolib.
* Bug 1325878: Pass the MediaList down to Servo, making <style media> work. ↵Emilio Cobos Álvarez2017-04-121-3/+4
| | | | | | | r=xidorn MozReview-Commit-ID: BUCSQJs2CNI Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Bug 1325878: Support deep-cloning of ServoMediaLists. r=xidornEmilio Cobos Álvarez2017-04-121-1/+1
| | | | | MozReview-Commit-ID: K7NFe1tKrAZ Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Pass ParserContext down to lengthsJ. Ryan Stinnett2017-04-121-10/+11
| | | | | | | | | | To make it possible to check the rule type when parsing lengths, we need to pass the `ParserContext` down through many layers to the place where length units are parsed. This change leaves it unused, so it's only to prepare for the next change. MozReview-Commit-ID: 70YwtcCxnWw
* Fix a few media query parsing bugs.Emilio Cobos Álvarez2017-04-111-9/+20
| | | | | MozReview-Commit-ID: 6nUd2vA6zO Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Fix media query parsing when invalid queries are present.Emilio Cobos Álvarez2017-03-151-10/+2
|
* Implement MediaList for Stylo.Xidorn Quan2017-03-131-1/+34
|
* Bug 1331213: Bootstrap a Gecko-side Device, and track it's dirtiness ↵Emilio Cobos Álvarez2017-01-171-2/+2
| | | | | | | | | | | | | | | | manually in the per-doc data. r=heycam The setup is quite different to Servo-land, so add a comment about the different setup. Also, check viewport rules when flushing stylesheets. I believe that the previous behavior is plain wrong, though I haven't taken the time to come up with a test case. In any case, it doesn't hurt any of both back-ends. MozReview-Commit-ID: 46gtTkesOsr Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Isolate the soon-to-be style-backend-specific from the media_query ↵Emilio Cobos Álvarez2017-01-071-156/+70
| | | | module.
* Bug 1298588 part 13. Make sure Device has a ComputedValues for stylo. r=bholleyBoris Zbarsky2017-01-041-4/+37
|
* style: Serialize also "only" qualifier, and fix serialization of all media ↵Emilio Cobos Álvarez2016-12-301-9/+29
| | | | expressions without explicit qualifiers.
* style: Simplify media-query parsing so it's easier to split out.Emilio Cobos Álvarez2016-12-301-16/+35
|
* style: Refactor media query serialization so it doesn't use an intermediate ↵Emilio Cobos Álvarez2016-12-301-9/+12
| | | | | | buffer. I plan to move MediaType to ToCss soon.
* style: Cleanup and refactor how media types are represented.Emilio Cobos Álvarez2016-12-301-18/+27
| | | | | | This is necessary for the upcoming work in Stylo, given I plan to make MediaType different for Servo and Gecko, and the Unknown variant doesn't fit in MediaType to be fair, the device is never going to have any unknown media type.
* style: Add a way to update an empty stylesheet for @import.Emilio Cobos Álvarez2016-12-161-0/+4
| | | | | We'll update the empty stylesheet we've created when instantiating the ImportRule when the stylesheet finishes loading.
* style: Simplify some code in media_queries.rsEmilio Cobos Álvarez2016-12-161-15/+17
|
* Implement MediaList interfaceNazım Can Altınova2016-12-021-2/+2
|
* implement support for the width media queryGregory2016-11-261-6/+10
| | | | | | | | | | | | | | failing test for correct to_css of "width" separate test for mq and to_css implement css serialization for Eq remove PASS test expectation remove FIXME simplify serialization
* style: Refactor and add infrastructure for font metrics in style.Emilio Cobos Álvarez2016-11-131-21/+4
| | | | | | | | | | | This commit itself only moves things around and adds an extra parameter to the `apply_declarations` function to eventually handle #14079 correctly. Probably needs a more granular API to query fonts, á la nsFontMetrics, but that's trivial to do once this is landed. Then we should make the font provider mandatory, and implement the missing stylo bits.
* Allow empty media query listXidorn Quan2016-11-101-7/+13
| | | | | | | And make empty list the default value of MediaList. This commit also removes Option wrapper of Stylesheet.media because a stylesheet should always have an associated media query list.
* Rename media_queries::MediaQueryList to MediaListXidorn Quan2016-11-081-5/+5
|
* Prefer Servo-specific ToCss for all typesRavi Shankar2016-11-071-2/+2
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* Implement matchMedia and MediaQueryListJack Moffitt2016-11-021-7/+56
| | | | Fixes #13376.
* style: Don't incorrectly clamp values in calc that might not be only lengths.Emilio Cobos Álvarez2016-09-011-5/+6
| | | | | | | Expressions with percentages may be negative or positive at computed value time. So, we can only clamp lengths at computed value time, which is what the other browsers do.
* style: Allow calc in media queries.Emilio Cobos Álvarez2016-08-301-9/+14
|
* Update to euclid 0.8Martin Robinson2016-08-121-4/+4
|
* Move some unit type definitions to style_traits.Ms2ger2016-07-111-1/+1
|
* Add some documentation to the style crate.Ms2ger2016-06-271-0/+4
|
* Make the style crate almost build on stable Rust.Simon Sapin2016-06-221-8/+16
| | | | `discriminant_value` will need to be replaced with something else later.
* Removed unused importsPer Lundberg2016-05-151-1/+0
| | | | This fixes #11185.
* style: Support lazy pseudo-elementsEmilio Cobos Álvarez2016-05-031-2/+8
| | | | | | | | These can't be supported in Servo as of right now, because I'm not totally sure the accesses that should be done in layout would be thread-safe. It can be revisited later though.
* Say farewell to in-tree HeapSizeOfAnthony Ramine2016-02-041-1/+0
|
* Update cssparser.Simon Sapin2016-01-211-2/+2
| | | | https://github.com/servo/rust-cssparser/pull/91
* Derive HeapSizeOf on more Stylesheet-related typesTill Schneidereit2015-11-071-8/+9
| | | | In preparation of storing `Stylesheet`s on nodes.
* Split Au type into separate crate, with minimal dependencies.Glenn Watson2015-10-011-1/+2
|