Commit graph

3197 commits

Author SHA1 Message Date
Paul Rouget
2bbf35f2aa Use black on blue color for default selection color 2016-03-28 18:26:17 +08:00
Paul Rouget
dd08e904eb Disable cross origin check for mozbrowser-enabled top level pipelines 2016-03-28 10:29:31 +02:00
Guillaume Gomez
c05a9b039e Add insert_adjacent methods into Element 2016-03-27 18:32:55 +02:00
bors-servo
4cb626ae29 Auto merge of #10204 - awalGarg:fix10161, r=Manishearth
Allow setting preferences to false in WPT tests

First patch to servo - apologies if I did something stupid :)

This is a fix for #10161. I have squashed the commits into one.

<!-- 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/10204)
<!-- Reviewable:end -->
2016-03-27 00:46:55 +05:30
Awal Garg
b1ff30f752 Allow setting preferences to false in WPT tests. closes #10161 2016-03-26 23:53:56 +05:30
bors-servo
d82f97a9cd Auto merge of #10188 - ConnorGBrewster:http-global-state, r=jdm
Add Http Global State Object

This adds a new HttpState object which holds common http state(#10175). This reduces the amount of work that is required to add extra things to the Http state.

The HttpState object currently holds:
```
hsts_list: Arc::new(RwLock::new(HSTSList::new())),
cookie_jar: Arc::new(RwLock::new(CookieStorage::new())),
auth_cache: Arc::new(RwLock::new(HashMap::new())),
```

<!-- 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/10188)
<!-- Reviewable:end -->
2016-03-26 19:06:52 +05:30
bors-servo
bed91b3334 Auto merge of #10176 - mbrubeck:selection-range, r=pcwalton
Highlight selected text in input fields

Fixes #9993.  This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.

r? @pcwalton

<!-- 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/10176)
<!-- Reviewable:end -->
2016-03-26 08:16:20 +05:30
Patrick Walton
b29719e36b layout: Rewrite the block formatting context/float inline-size
speculation code.

The old code tried to do the speculation as a single bottom-up pass
after intrinsic inline-size calculation, which was unable to handle
cases like this:

    <div>
        <div style="float: left">Foo</div>
    </div>
    <div>
        <div style="overflow: hidden">Bar</div>
    </div>

No single bottom-up pass could possibly handle this case, because the
inline-size of the float flowing out of the "Foo" block could never make
it down to the "Bar" block, where it is needed for speculation.

On the pages I tried, this regresses layout performance by 1%-2%.

I first noticed this breaking some pages, like the Google SERPs, several
months ago.
2016-03-25 18:39:16 -07:00
Connor Brewster
b09570b2b6 Added global state struct
Replace hsts_list, auth_cache, and cookie_jar with http_state

Reverted a few changes

Moved http_state back to factory
Removed unnecessary Arc

Removed Arc for http_state
2016-03-25 12:35:40 -06:00
Matt Brubeck
db2c1841cb Fix delete_char when selection range is empty
An empty selection range should be treated the same as no selection.
Fixes browserhtml/browserhtml#930.
2016-03-25 08:39:53 -07:00
bors-servo
59ba00ed84 Auto merge of #9353 - nox:domtokenlist-replace, r=asajeffrey
Implement and test DOMTokenList.replace (fixes #8511)

Thanks to @sankha93 for the original work in #8525.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9353)
<!-- Reviewable:end -->
2016-03-25 18:26:27 +05:30
bors-servo
38e8c923b5 Auto merge of #10154 - stjepang:fix-local-urls-only-10147, r=KiChjang
Fix #10147: Correctly handle flag local_urls_only

In function Request::fetch_main, flag local_urls_only (if set)
should allow fetching local urls only. Before this change, the flag had
the inverse behaviour.

Fixes #10147.
Test with: `./mach test-unit -p net fetch::test_fetch_with_local_urls_only`

<!-- 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/10154)
<!-- Reviewable:end -->
2016-03-25 12:42:48 +05:30
bors-servo
9a8d62286c Auto merge of #9887 - schuster:HTMLHyperlinkElementUtils, r=jdm
Implement HTMLHyperlinkElementUtils for HTMLAnchorElement

Fixes #7857

Origin is omitted since it's still not available in rust-url, but since the previous PR also left it out, I'm assuming that's okay.

Please let me know if there are any style issues. There might be more concise ways to do the pattern matching that I don't know about, I guessed at the indentation style in one or two places.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9887)
<!-- Reviewable:end -->
2016-03-25 11:36:35 +05:30
Matt Brubeck
6171000875 Highlight selected text in input fields
Fixes #9993.  This does not yet allow stylesheets to set the selection colors;
instead it uses a hard-coded orange background and white foreground.
2016-03-24 18:33:26 -07:00
Jaydeep
c96c26b4f7 Implement HTMLHyperlinkElementUtils for HTMLAnchorElement 2016-03-24 21:14:28 -04:00
bors-servo
605842f193 Auto merge of #10155 - bholley:generalize_style_structs, r=SimonSapin
Generalize the style structs

This allows geckolib to pass gecko style structs and have the style system write to them directly, provided we implement all the traits.

<!-- 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/10155)
<!-- Reviewable:end -->
2016-03-25 03:27:33 +05:30
Bobby Holley
5c749127cc Introduce traits for style structs and computed values. 2016-03-24 11:49:46 -07:00
bors-servo
7f944afee8 Auto merge of #10111 - DDEFISHER:master, r=jdm
add auth cache to resources + set auth header from it if url does not have creds

initial attempt of

- in resource_thread.rs, define an HTTP authorization cache storage (username, password, URL) and instantiate it like the cookie_storage member (inside an Arc<Rwlock<>> value, to enable sharing it between threads)
- in modify_request_headers in http_loader.rs, implement the remaining pieces of step 12(13?) of the appropriate specification using this new authorization cache.

 for the NCSU student project Implement HTTP authorization UI and persistent sessions.

<!-- 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/10111)
<!-- Reviewable:end -->
2016-03-24 23:54:13 +05:30
Michael Howell
a5a299ea88 Disable template-contents-owner-test-002.html
https://github.com/servo/servo/issues/9723
2016-03-24 11:19:11 -07:00
Daniel
d49d3b01f2 add auth cache to resources + set auth header if url does not have creds 2016-03-24 12:24:08 -04:00
bors-servo
f2f05869d6 Auto merge of #10171 - frewsxcv:parse-length-style, r=mbrubeck
Move `util::str::parse_length` into 'style' component.

The function is only used in the 'style' component, so we'll move it
there alongside other relevant parse functions.

<!-- 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/10171)
<!-- Reviewable:end -->
2016-03-24 20:49:50 +05:30
Corey Farwell
5efbf0fa8f Move util::str::parse_length into 'style' component.
The function is only used in the 'style' component, so we'll move it
there alongside other relevant parse functions.
2016-03-24 10:45:33 -04:00
bors-servo
f56062b069 Auto merge of #10169 - jdm:formvalidation, r=jdm
Implement initial pieces of form validation.

Rebase of #10108.

<!-- 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/10169)
<!-- Reviewable:end -->
2016-03-24 19:13:02 +05:30
Sagar Muchhal
051ffba0e5 Implement initial pieces of form validation. 2016-03-24 09:07:38 -04:00
Stjepan Glavina
4965c93d16 Merge branch 'master' into fix-local-urls-only-10147 2016-03-24 13:45:25 +01:00
Stjepan Glavina
3ec4515a73 Address PR comments
- Remove fn `url_is_local`
- Remove fn `set_local_urls_only`
- Fix `test_fetch_with_local_urls_only`
2016-03-24 13:42:40 +01:00
bors-servo
446783f7b6 Auto merge of #10167 - stjepang:fix-aboutblank-body, r=KiChjang
Fix fetching about:blank

When fetching about:blank, response body should be the empty byte
sequence.
Spec: https://fetch.spec.whatwg.org/#concept-basic-fetch

Before this change, response body would be set to `ResponseBody::Empty`,
and then fetching would result in an infinite loop at step 19 in fn
`main_fetch` (methods.rs).

r? @KiChjang

<!-- 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/10167)
<!-- Reviewable:end -->
2016-03-24 16:40:19 +05:30
Stjepan Glavina
bcd813d961 Fix fetching about:blank
When fetching about:blank, response body should be the empty byte
sequence.
Spec: https://fetch.spec.whatwg.org/#concept-basic-fetch

Before this change, response body would be set to `ResponseBody::Empty`,
and then fetching would result in an infinite loop at step 19 in fn
`main_fetch` (methods.rs).
2016-03-24 11:17:12 +01:00
Sankha Narayan Guria
d010df92cf Implement and test DOMTokenList.replace (fixes #8511) 2016-03-24 10:37:42 +01:00
bors-servo
2887623c4a Auto merge of #10150 - emilio:canvas-cleanup, r=jdm
Canvas cleanup

This PR cleans up the layerization infrastructure for canvas, which was unused, and removes unused dependencies.

It also takes in account my recent username change to update angle's dependency (offscreen_gl_context requires extra work due to webrender depending on it).

r? @jdm

<!-- 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/10150)
<!-- Reviewable:end -->
2016-03-24 08:44:40 +05:30
Emilio Cobos Álvarez
5ed93a5c4a Change old references of ecoal95 2016-03-23 18:12:40 +01:00
Stjepan Glavina
6576fde29b Correctly handle flag local_urls_only
In function Request::fetch_main, flag local_urls_only (if set)
should allow fetching local urls only. Before this change, the flag had
the inverse behaviour.
2016-03-23 18:01:43 +01:00
Jussi Räsänen
ddeb33bb41 Fixed missing test image for filter inline reftests 2016-03-23 16:44:36 +02:00
Jussi Räsänen
7d6fbcf90a Bug #10128 - Fixed missing rust.png in reftests 2016-03-23 14:28:12 +02:00
bors-servo
f3abfeeadd Auto merge of #9979 - stspyder:master, r=jdm
Implementation of Blob Constructor with test changes

Apologize for the late PR. I see that #9977 already overlaps with some of the work. If that is accepted, then I'll change my PR to reflect just the WPT changes.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9979)
<!-- Reviewable:end -->
2016-03-23 09:07:38 +05:30
bors-servo
50193e9119 Auto merge of #9518 - shinglyu:responseurl, r=jdm
Implemented XMLHttpRequest.responseURL

Resolves #8830

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9518)
<!-- Reviewable:end -->
2016-03-23 00:12:57 +05:30
Sankha Narayan Guria
feddb52e59 Test that any call to classList.add() create the class attribute 2016-03-22 13:27:33 +01:00
Shing Lyu
f55b0765d1 Bug 8830 - Implemented XMLHttpRequest.responseURL 2016-03-22 13:56:31 +08:00
bors-servo
d1e27eb4f4 Auto merge of #10109 - mbrubeck:compute_damage_short_circuit, r=pcwalton
Fixes for compute_damage

A few changes:

* Make `compute_damage` short-circuit more, by skipping comparisons if they will only set flags that are already set.

* Update some obsolete comments.

* Add a bunch of missing properties to `compute_damage`.

* Set `RECONSTRUCT_FLOW` when `text-decoration` changes, because it can affect text fragment splitting/merging.

I believe this is all of the computed properties except for the animation properties. (I wasn't sure what to do with those.)  After this lands I'd like to work on moving this information into `properties.mako.rs` so that this function can be auto-generated, and so that newly-added properties can default to setting all flags instead of none.

<!-- 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/10109)
<!-- Reviewable:end -->
2016-03-22 10:29:48 +05:30
Matt Brubeck
f7d490a7e7 Add missing properties to compute_damage 2016-03-21 16:28:07 -07:00
Paul Rouget
6577409b95 Add history information to mozbrowserlocationchange event 2016-03-21 19:19:48 +08:00
bors-servo
090da52913 Auto merge of #9586 - notriddle:details_ui, r=SimonSapin
Details ui

Requires a patch to rust-selectors, and doesn't currently recalculate the styles correctly (which is needed to make actual toggling work correctly).

Still trying to figure out what it takes to get style recalc to do what this needs.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9586)
<!-- Reviewable:end -->
2016-03-20 13:27:59 +05:30
bors-servo
8e95f54501 Auto merge of #10079 - servo:script-encoding, r=jdm
Implement encoding determination for external scripts.

<!-- 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/10079)
<!-- Reviewable:end -->
2016-03-20 06:28:25 +05:30
Michael Howell
9d9c5398a8 Get the fundamentals of the HTMLDetailsElement rendering stuff working.
Still need to implement the style invalidation.

Part of #9395
2016-03-19 16:02:11 -07:00
bors-servo
a4251c832d Auto merge of #9876 - mbrubeck:seen-viewport-percentages, r=SimonSapin
Recompute styles on viewport size change if they contain viewport percentages

Fixes #8754.  Depends on servo/rust-cssparser#99.  r? @SimonSapin

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9876)
<!-- Reviewable:end -->
2016-03-20 02:20:54 +05:30
Matt Brubeck
25c1bce9f6 Recompute viewport-dependent styles on viewport size change
Fixes #8754.
2016-03-19 13:23:39 -07:00
Patrick Walton
5ea8c34276 layout: Move overflow calculation to be a separate, sequential,
bottom-up pass.

Right now, the only reason that overflow calculation works is that we
rely on script inducing extra reflows that are sent for display. This
was preventing #10021 from landing.

This change regresses layout performance by about 1% in my tests.

Fixes #7797 properly.
2016-03-18 22:11:51 -07:00
bors-servo
2d6283c64b Auto merge of #9929 - servo:cascade, r=pcwalton
Refactor the cascade

Converting the specified value of some properties into a computed value depends on the value of other properties. For example, the `em` unit of any length depends on the `font-size` property.

Previously, we would do a first pass over applicable declarations to build up a `values::computed::Context` struct with a number of fields for each such piece of data from other properties.

This simplies the struct by instead having it contain the set of computed values (for a given element) that is being populated and classify properties into "early" and "other", such that the only dependencies can be from "other" to "early". We iterate applicable_declarations twice, first cascading "early" properties then "other". Unfortunately, it’s not easy to check that this classification is correct.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9929)
<!-- Reviewable:end -->
2016-03-19 08:08:56 +05:30
askalski
89b8499df8 Implement encoding determination for external scripts. 2016-03-18 16:51:25 +01:00
bors-servo
14c6497dbd Auto merge of #9971 - danlrobertson:i9357, r=KiChjang
Add wpt tests for send

Add wpt tests for send that do not set the responseType and compare the result against a string.

Fixes #9357

r? @KiChjang

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9971)
<!-- Reviewable:end -->
2016-03-18 16:27:40 +05:30