Commit graph

35 commits

Author SHA1 Message Date
Gregory Terzian
671627e97e introduce "per task source" ignoring of tasks 2018-07-10 13:42:28 +08:00
Xidorn Quan
fa5d76c395 Split CssUrl from SpecifiedUrl for non-value URLs. 2018-03-08 23:34:34 +11:00
Simon Sapin
3c36a36cc9 Use encoding-rs instead of rust-encoding for CSS parsing 2017-10-31 19:08:43 +01:00
Keith Yeung
c6bb1cb9d5 Merge request type and destination 2017-10-23 11:19:35 -07:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
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.
2017-10-16 17:16:20 +02:00
Anthony Ramine
56117d3185 Rename Runnable to Task
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`.
2017-09-16 15:43:26 +02:00
Tom Tromey
c48226ff6f Preserve sourceURL comment on style sheets
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.
2017-09-14 12:39:18 -06:00
Emilio Cobos Álvarez
15e71c5670
style: Don't look for viewport units in stylesheets.
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.
2017-08-28 12:05:22 +02:00
Tom Tromey
7224a5617f Expose the source map URL on a style sheet
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
2017-08-17 06:51:30 -06:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
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).
2017-07-19 09:29:05 +02:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
The key of this patch is the split between Stylesheet and StylesheetContents.

Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Xidorn Quan
cdc537f23e Bug 1331291 part 1 - Set stylesheet url_data correctly for import rule. 2017-06-13 10:07:06 +10:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Anthony Ramine
f68e2fded9 Propagate quirks mode all the way to ParserContext
The quirks mode is still not properly propagated in geckolib.
2017-04-27 10:41:55 +02:00
bors-servo
ebc61bb2c3 Auto merge of #16407 - jdm:style_panic, r=emilio
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 -->
2017-04-13 11:29:58 -05:00
Josh Matthews
3c3311b16a Allow loading multiple stylesheets for the same link element. 2017-04-13 16:02:17 +10:00
Emilio Cobos Álvarez
ac7bc414d9
Bug 1325878: Pass the MediaList down to Servo, making <style media> work. r=xidorn
MozReview-Commit-ID: BUCSQJs2CNI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 22:27:45 +08:00
Emilio Cobos Álvarez
2999222436
Bug 1325878: Don't use nsMediaList for loading imports. r=xidorn
MozReview-Commit-ID: HR23bqZcmcA
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-12 21:24:51 +08:00
Xidorn Quan
2628ebe612 Use final url for updating stylesheet from @import rule. 2017-04-03 21:57:17 +10:00
Xidorn Quan
37585309e9 Use a UrlExtraData type alias to unify url handling logic. 2017-04-03 21:57:16 +10:00
Simon Sapin
d9491187dc Parse stylesheets without acquiring a shared lock. 2017-03-19 22:30:40 +01:00
Simon Sapin
cc046300f0 Remove some indirection. 2017-03-19 22:30:39 +01:00
Simon Sapin
1e38013783 Refactor StylesheetLoader so impls do not need to acquire a shared lock.
This fixes a deadlock:
https://github.com/servo/servo/pull/16014#issuecomment-287527067
2017-03-19 22:30:39 +01:00
Simon Sapin
adb97d4cbe Wrap most CSS rules in Locked<_> instead of RwLock<_> 2017-03-19 22:30:36 +01:00
Simon Sapin
f35b4e27b3 Replace RwLock<CssRules> with Locked<CssRules> 2017-03-19 22:30:35 +01:00
Simon Sapin
c5a7294e05 Replace RwLock<MediaList> with shared_lock::Locked<MediaList> 2017-03-19 22:30:31 +01:00
SwagColoredKitteh
bb2826e41f fix issue #15101 and make sure out-of-order stylesheet loads work correctly for the same element 2017-01-24 15:52:01 +01:00
Nazım Can Altınova
fd950a7309 Support origins in CSSOM stylesheets 2017-01-20 22:00:49 +03:00
mrnayak
3d9e44a8c4 Handle crossorigin in link and refactor crossorigin handling
Implemented Step three and handled step four of obtain the resource part
of 4.2.4 The link element.
Link to spec : https://html.spec.whatwg.org/multipage/semantics.html#concept-link-obtain

Refactored crossOrigin handling in HTMLScriptElement, HTMLImageElement
2017-01-13 23:35:00 +05:30
charlesvdv
19e31d5c50 Handle properly alternate stylesheet 2017-01-10 15:38:38 +01:00
mrnayak
a3026499f4 Implement Subresource Integrity
Implemented response validation part of
https://w3c.github.io/webappsec-subresource-integrity/.
Implemented step eighteen of the main fetch. If a request has integrity
metadata, then following steps are performed
*Wait for response body
*If the response does not have a termination reason and response does not
match request’s integrity metadata, set response to a
network error.# Please enter the commit message for your changes. Lines starting
2017-01-08 08:52:18 +05:30
Josh Matthews
318a047ee5 Interact with the originating document for stylesheet loads, rather than the element's current document. 2017-01-04 09:55:45 -05:00
Emilio Cobos Álvarez
b9901fbd89
script: Abstract HTMLLinkElement and StyleElement into StylesheetOwner. 2016-12-16 17:59:45 +01:00
Emilio Cobos Álvarez
7582a2d59d
script: Move the stylesheet loading code from htmllinkelement to stylesheet_loader. Make it track subresource loads properly. 2016-12-16 16:57:20 +01:00