aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/stylesheet_loader.rs
Commit message (Collapse)AuthorAgeFilesLines
* fonts: Add support for WOFF2 and properly load web fonts from @imports (#31879)Martin Robinson2024-03-261-0/+4
| | | | | | | | | | | | This change also makes two fixes that are necessary to get WOFF2 fonts working: 1. It adds support for loading web fonts from stylesheets included via @import rules. 2. It ensure that when web fonts are loaded synchronusly they invalidate the font cache. This led to incorrect font rendering when running tests before. Fixes #31598.
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-2/+2
|
* clippy: Fix some clippy problems in `components/script` (#31778)Rosemary Ajayi2024-03-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix clippy problems in stylesheet * fix clippy problems in task_manager * fix clippy problems in task_queue * fix clippy problems in task_queue * fix clippy problems in file_reading * fix clippy problems in dom_manipulation * fix clippy problems in gamepad * fix clippy problems in networking * fix clippy problems in performance * fix clippy problems in port_message * fix clippy problems in port_message * fix clippy problems in timer * fix clippy problems in stylesheet * fix clippy problems * fix clippy problems * fix clippy problems
* clippy: Fix many warnings in `components/script` (#31717)Richard Dushime2024-03-191-1/+1
| | | | | | | | | | | | | | | | | * Fix Several clippy warnings * Fix Build errors * Fix Unused import * Fix requested changes * Fix rustfmt * Minor fixes --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* style: Remove dependency on servo_url (#31358)Martin Robinson2024-02-161-4/+4
| | | | | In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
* Further changes required by ServoOriol Brufau2023-11-211-1/+1
|
* Further changes required by ServoOriol Brufau2023-11-211-2/+15
|
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-24/+27
| | | | | * strict imports formatting * Reformat all imports
* Avoid assert failure when using @importOriol Brufau2023-06-141-1/+1
|
* Further changes required by ServoOriol Brufau2023-05-301-2/+4
|
* Further changes required by ServoOriol Brufau2023-05-241-13/+7
|
* Fix invalid use of ReferrerUrlMatthias Deiml2020-06-171-1/+1
|
* Make url for "client" referrer mandatoryMatthias Deiml2020-06-171-2/+1
|
* Properly set the url on the Response object when the response is an ↵Bastien Orivel2020-05-061-1/+1
| | | | opaqueredirect
* Modify `script` to prevent further violations of snake_caseKunal Mohan2020-01-181-2/+2
|
* Support CORS attributes for image elements.Josh Matthews2019-10-041-17/+4
|
* Prefetch img and scripts during parsingAlan Jeffrey2019-09-101-19/+42
|
* Rename shadow_root_from_node to containing_shadow_rootFernando Jiménez Moreno2019-04-261-2/+2
|
* Invalidate and flush shadow tree stylesheets where neededFernando Jiménez Moreno2019-04-261-2/+10
|
* set referrer in window.load_urlRussell Cousineau2019-04-191-2/+2
| | | | | | | | - this conforms to follow-hyperlinks spec step 13 - this conforms to window-open spec step 14.3 - replace uses of `referrer_url` with `referrer` - in Request class, change "no-referrer" to "" - set websocket fetch referrer to "no-referrer"
* Implementing the builder pattern for RequestInitLucas Fantacuci2019-04-101-15/+14
|
* refactored performance timing to align with updated specddh2018-11-201-2/+37
| | | | | | | | | | | | refactoring with ResourceFetchMetadata implemented deprecated window.timing functionality created ResourceTimingListener trait fixed w3c links in navigation timing updated include.ini to run resource timing tests on ci
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Unify the task source and task canceller APIAgustin Chiappe Berrini2018-11-141-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I moved away from the `Window` struct all the logic to handle task sources, into a new struct called `TaskManager`. In a happy world, I'd be able to just have there two functions, of the types: ```rust fn task_source<T: TaskSource>(&self, name: TaskSourceName) -> Box<T> fn task_source_with_canceller<T: TaskSource>(&self, name: TaskSourceName) -> (Box<T>, TaskSourceCanceller) ``` And not so much duplicated code. However, because TaskSource can't be a trait object (because it has generic type parameters), that's not possible. Instead, I decided to reduce duplicated logic through macros. For reasons[1], I have to pass both the name of the function with canceller and the name of the function without, as I'm not able to concatenate them in the macro itself. I could probably use `concat_idents` to create both types already defined and reduce the amount of arguments by one, but that macro is nightly only. At the same time, not being able to declare macros inside `impl` forces me to pass `self` as an argument. All this makes this solution more verbose than it would be ideally. It does reduce duplication, but it doesn't reduce the size of the file. [1](https://github.com/rust-lang/rust/issues/29599)
* Reorder importsPyfisch2018-11-061-5/+9
|
* Format remaining filesPyfisch2018-11-061-1/+5
|
* Sort `use` statementsSimon Sapin2018-11-061-3/+3
|
* `cargo fix --edition`Simon Sapin2018-11-061-12/+12
|
* Update hyper to 0.12Bastien Orivel2018-11-011-15/+7
|
* Format script componentchansuke2018-09-191-55/+84
|
* introduce "per task source" ignoring of tasksGregory Terzian2018-07-101-1/+2
|
* Split CssUrl from SpecifiedUrl for non-value URLs.Xidorn Quan2018-03-081-2/+2
|
* Use encoding-rs instead of rust-encoding for CSS parsingSimon Sapin2017-10-311-3/+2
|
* Merge request type and destinationKeith Yeung2017-10-231-2/+1
|
* Remove use of unstable box syntax.Simon Sapin2017-10-161-2/+2
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Rename Runnable to TaskAnthony Ramine2017-09-161-1/+1
| | | | | | | | | | | | The changes are: * `*Runnable` -> `*Task`; * `RunnableMsg` -> `Task`; * `RunnableWrapper` -> `TaskCanceller`; * `MainThreadRunnable` -> `MainThreadTask`; * `wrap_runnable` -> `wrap_task`; * `get_runnable_wrapper` -> `task_canceller`; * `handler` -> `run`; * `main_thread_handler` -> `run_with_script_thread`.
* Preserve sourceURL comment on style sheetsTom Tromey2017-09-141-0/+1
| | | | | | | | | | | | | In addition to the sourceMappingURL comment, there is a second special comment, "sourceURL", that can be used to set the "display name" of a style sheet for developer tools. This name is also used as the base URL for the source-map URL resolution algorithm. sourceURL is described here: https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/ The devtools feature bug is here: https://bugzilla.mozilla.org/show_bug.cgi?id=880831 This patch changes servo to preserve and expose this value for use in M-C.
* style: Don't look for viewport units in stylesheets.Emilio Cobos Álvarez2017-08-281-1/+0
| | | | | | | | | | Use whether we've computed any viewport unit instead. This is more accurate (we avoid restyling unnecessarily if we've found anything ever on the stylesheet, but that hasn't matched). This has the benefit of also matching Gecko, and simplify some code and fishyness around, and also hopefully speeding up stylesheet parsing.
* Expose the source map URL on a style sheetTom Tromey2017-08-171-0/+1
| | | | | | This changes Servo to track the source map URL of a style sheet. This parallels a change going in to Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1388855
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | The alias is left there temporarilly and will be removed completely in a later commit where also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still use the old alias).
* Change RequestInit origin type to ImmutableOriginFausto Núñez Alberro2017-07-161-1/+1
|
* stylo: Fix StyleSheetInner/Stylesheet mappingEmilio Cobos Álvarez2017-07-021-10/+39
| | | | | | The key of this patch is the split between Stylesheet and StylesheetContents. Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
* Bug 1331291 part 1 - Set stylesheet url_data correctly for import rule.Xidorn Quan2017-06-131-1/+1
|
* Fix up script and layout.Bobby Holley2017-05-021-2/+3
|
* Propagate quirks mode all the way to ParserContextAnthony Ramine2017-04-271-1/+2
| | | | The quirks mode is still not properly propagated in geckolib.
* Auto merge of #16407 - jdm:style_panic, r=emiliobors-servo2017-04-131-4/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Allow loading multiple stylesheets for the same link element. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #16399 - [x] There are tests for these changes <!-- 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/16407) <!-- Reviewable:end -->
| * Allow loading multiple stylesheets for the same link element.Josh Matthews2017-04-131-4/+1
| |
* | Bug 1325878: Pass the MediaList down to Servo, making <style media> work. ↵Emilio Cobos Álvarez2017-04-121-2/+2
| | | | | | | | | | | | | | r=xidorn MozReview-Commit-ID: BUCSQJs2CNI Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* | Bug 1325878: Don't use nsMediaList for loading imports. r=xidornEmilio Cobos Álvarez2017-04-121-4/+4
|/ | | | | MozReview-Commit-ID: HR23bqZcmcA Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Use final url for updating stylesheet from @import rule.Xidorn Quan2017-04-031-0/+1
|