Commit graph

16255 commits

Author SHA1 Message Date
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
bors-servo
1554331f06 Auto merge of #10085 - pcwalton:floats-inout-revamp, r=mbrubeck
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.

r? @mbrubeck

<!-- 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/10085)
<!-- Reviewable:end -->
2016-03-26 07:08:41 +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
bors-servo
9b2ae3a62f Auto merge of #10198 - pcwalton:negative-ceiling, r=mbrubeck
layout: Allow floats to have negative ceilings due to negative margins.

This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.

r? @mbrubeck

<!-- 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/10198)
<!-- Reviewable:end -->
2016-03-26 05:48:25 +05:30
Patrick Walton
aee0c44509 layout: Minor whitespace cleanup. 2016-03-25 15:29:18 -07:00
Patrick Walton
24d81e95b4 layout: Allow floats to have negative ceilings due to negative margins.
This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.
2016-03-25 15:29:17 -07:00
bors-servo
8984d95a28 Auto merge of #10197 - mbrubeck:force-repaint, r=pcwalton
Fix forced repaint on image load

After #10021, `LayoutThread::repaint` no longer forced a repaint because of the `restyle_damage` check.  This patch adds the correct restyle damage and fixes #10163.

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/10197)
<!-- Reviewable:end -->
2016-03-26 03:47:05 +05:30
Matt Brubeck
afb36ec8de Fix forced repaint on image load
After #10021, `LayoutThread::repaint` no longer forced a repaint because of
the `restyle_damage` check.  This patch adds the correct restyle damage and
fixes #10163.
2016-03-25 14:54:00 -07:00
bors-servo
d77c7b21ae Auto merge of #10194 - emilio:stylo-fixes-and-doc, r=bholley
geckolib: Add style structs bindings and documentation

See the description of 6c851c8 to see which incorrect bindings remain. They're just nine types.

cc @bholley @SimonSapin @pcwalton

(I don't know who should review this actually)

<!-- 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/10194)
<!-- Reviewable:end -->
2016-03-26 00:10:55 +05:30
Emilio Cobos Álvarez
0a609e81c7 geckolib: Update docs to point to the bindings file. 2016-03-25 18:55:58 +01:00
Emilio Cobos Álvarez
6c851c88ea geckolib: Update bindings with vtable generation and anonymous unions
Only 9 tests failing!

```
bindgen_test_layout_FontFamilyList
bindgen_test_layout_StyleAnimation
bindgen_test_layout_nsFont
bindgen_test_layout_nsStyleBackground
bindgen_test_layout_nsStyleDisplay
bindgen_test_layout_nsStyleFont
bindgen_test_layout_nsStyleGridTemplate
bindgen_test_layout_nsStylePosition
bindgen_test_layout_nsStyleSVG
```

The dependencies are:

 * FontFamilyList makes nsFont fail which makes nsStyleFont fail.
 * nsStyleGridTemplate makes nsStylePosition fail
 * StyleAnimation makes nsStyleDisplay fail

nsStyleGridTemplate and nsStyleSVG failures seem to be bitfield-related.

Except the bitfield-related values and those deps, I don't know what
might cause the other failures, we'll have to check carefully C++
member alignments.
2016-03-25 18:49:23 +01:00
Emilio Cobos Álvarez
c220fcdb00 geckolib: Update bindings with enum name mangling 2016-03-25 18:49:10 +01:00
Emilio Cobos Álvarez
58591652f8 geckolib: Add 100% compilable bindings for the first time! \o/
This still fails some tests (20 of 130 IIRC).

Most of them are derived from others, and those who arent I think it's
because of:

 1. A vtable: Since we don't generate functions I think we don't do the
vtable calculation.

 2. Premature opaque structs: It's the case for nsDataHashtable, where
we generate a 0 byte struct, since we calculate it using sizeof() and
the type is not complete without the type parameters.

 3. Some other subtlety? I think we miss a case of enum-in-union or
something like that, that is explicitely disabled in bindgen since the C
standard forbids it. I think it can be enabled without too much problem.

Anyways, I'll leave it for tomorrow! \o/
2016-03-25 18:48:58 +01:00
Emilio Cobos Álvarez
ef59da51d5 geckolib: Get nsMargin and nsCoord working
I had to make them opaque types since there were so many template
parameters and inheritance when including gfx that... I got scared.
2016-03-25 18:48:43 +01:00
Emilio Cobos Álvarez
247ac2542a geckolib: Stop blacklisting empty types
My fork of bindgen supports them now and doesn't generate tests for
them now.
2016-03-25 18:48:23 +01:00
Emilio Cobos Álvarez
b433d80deb geckolib: Blacklist some more comparators in regen_style_structs.sh
We *do* generate bindings for them, and they compile fine, but the
expected size for them is not correct.

My guess is that C++ types without members have at least 1 byte to be
addressable.

I'll test that later, but for now we don't care about them...
2016-03-25 18:48:00 +01:00
Emilio Cobos Álvarez
88c42cb58f geckolib: tools: Checkout correct nsString bindings 2016-03-25 18:47:35 +01:00
Emilio Cobos Álvarez
3df2eaa410 geckolib: Allow generating correct bindings for nsString
Which is already a win!

I'll keep moving into other style structs later.
2016-03-25 18:47:13 +01:00
Emilio Cobos Álvarez
706285123c geckolib: tools: Switch to llvm+clang 38
It also has our patches, and we'll benefit from improvements.
2016-03-25 18:46:45 +01:00
Emilio Cobos Álvarez
13d7b33a04 geckolib: Define a few MOZ_* things to hack around more easily. 2016-03-25 18:43:42 +01:00
Emilio Cobos Álvarez
18b1cc68db geckolib: Quote paths and remove things after the first non-preceding whitespace
This should allow `regen_style_structs.sh` to run on mac, where a path
like:

/.../Frameworks (framework dir)

was reported.
2016-03-25 18:43:42 +01:00
Emilio Cobos Álvarez
a6ffabb2ad geckolib: Add basic documentation, be consistent and safe with quotes 2016-03-25 18:43:42 +01:00
Emilio Cobos Álvarez
38b30c6490 geckolib: Don't hardcode library paths
It feels like a hack but it's supposed to work in any clang...
2016-03-25 18:43:42 +01:00
Emilio Cobos Álvarez
0128e985f6 geckolib: export LD_LIBRARY_PATH for linux 2016-03-25 18:43:42 +01:00
bors-servo
a211bd1a12 Auto merge of #10193 - larsbergstrom:use_rustflags, r=Ms2ger
Use rustflags

r? @Ms2ger

<!-- 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/10193)
<!-- Reviewable:end -->
2016-03-25 22:42:17 +05:30
Lars Bergstrom
e83369dd25 Enable NEON feature to get hard floats on Android devices 2016-03-25 10:50:54 -05:00
Lars Bergstrom
0f1107baef Remove rustc wrapper script for gold in favor of using RUSTFLAGS 2016-03-25 10:50:21 -05:00
Lars Bergstrom
dbd25fc41a Update Cargo to pick up RUSTFLAGS support 2016-03-25 10:49:37 -05: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
08caf7412f Convert ScannedTextFragment fields into bitflags 2016-03-24 18:33:27 -07:00
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
2f6388c301 Auto merge of #10174 - larsbergstrom:update_egl, r=zmike
Update servo-egl to fix CEF linkage

Fixes #10130
r? @zmike

<!-- 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/10174)
<!-- Reviewable:end -->
2016-03-25 06:30:30 +05:30
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
e82aa66245 Implement more glue methods. 2016-03-24 11:50:59 -07:00
Bobby Holley
3c44dbae21 Add a skeleton implementation of TComputedValues in geckolib. 2016-03-24 11:50:58 -07:00
Bobby Holley
c2daea2c9c Parameterize the rest of the style system on TNode. 2016-03-24 11:50:57 -07:00
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
Lars Bergstrom
a3818cf574 Update servo-egl to fix CEF linkage 2016-03-24 12:03:01 -05: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
bors-servo
a8264ecc1f Auto merge of #10168 - Ms2ger:gaol, r=nox
Update gaol.

<!-- 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/10168)
<!-- Reviewable:end -->
2016-03-24 18:22:23 +05:30
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