Commit graph

19710 commits

Author SHA1 Message Date
Simon Sapin
4ade6656dc Publish selectors v0.20.0 2018-08-23 17:22:38 +02:00
bors-servo
3b9055510a
Auto merge of #21487 - cdisselkoen:remove-comment, r=jdm
Remove outdated comment in stylist.rs

<!-- Please describe your changes on the following line: -->
This comment on `cascade_style_and_visited` is unclear because it refers to `is_link`, which is not a parameter of that function.  It used to refer to a flag in `CascadeFlags` back when there was a `cascade_flags: CascadeFlags` parameter; that parameter was removed in commit cd04664.  I don't believe it accurately reflects how the code works anymore, and is best just removed.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they only touch comments

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/21487)
<!-- Reviewable:end -->
2018-08-22 16:55:01 -04:00
Craig Disselkoen
916e2c206d Remove outdated comment in stylist.rs 2018-08-22 13:26:39 -07:00
bors-servo
aac4a3485f
Auto merge of #21430 - Eijebong:ws-origin, r=jdm
Properly set the origin on websocket messages

<!-- 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/21430)
<!-- Reviewable:end -->
2018-08-22 15:53:26 -04:00
Alan Jeffrey
74c1e00d81 Upgraded to SM 60 2018-08-20 18:22:29 -04:00
bors-servo
e7791f9a00
Auto merge of #21452 - emilio:gecko-sync, r=emilio
style: Import changes from mozilla-central.

See each individual commit for details.

<!-- 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/21452)
<!-- Reviewable:end -->
2018-08-19 07:57:53 -04:00
tigercosmos
696e856464 Network: Preserve HEAD on 303 redirect
fixed #21449. This is an update for spec.
2018-08-19 03:14:34 +08:00
Emilio Cobos Álvarez
38a00745e2
Appease tidy. 2018-08-18 18:41:40 +02:00
Emilio Cobos Álvarez
935b5393a9
Port servo to the new media query system.
Port `width`, and also add the `scan` media feature so I don't need to add
ugliness just to workaround the unused keyword_evaluator macro.
2018-08-18 18:23:26 +02:00
Emilio Cobos Álvarez
8ae1322fb3
Add scan as a static atom. 2018-08-18 18:19:27 +02:00
Emilio Cobos Álvarez
eccea52093
Add width as a static atom. 2018-08-18 18:17:03 +02:00
Emilio Cobos Álvarez
4d3f96f562
style: Relax the version requirement of num-integer. 2018-08-18 17:58:44 +02:00
Emilio Cobos Álvarez
67f2185f54
style: Make webkit device-pixel-ratio media queries a proper alias to resolution.
According to the spec:

  https://compat.spec.whatwg.org/#css-media-queries-webkit-device-pixel-ratio

And to the Chromium implementation:

  https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/css/media_query_evaluator.cc?l=366&rcl=1d7328865bcf06a687aafc18ff95d55317030672

They're no different than resolution.

In our implementation `resolution` does slightly different stuff. Given we
still haven't shipped -webkit-device-pixel-ratio, making this match resolution
looks better than the opposite.

Differential Revision: https://phabricator.services.mozilla.com/D3588
2018-08-18 17:54:54 +02:00
Xidorn Quan
c9c5e56079
style: Use AspectRatio directly for RangeOrOperator::evaluate.
Differential Revision: https://phabricator.services.mozilla.com/D3587
2018-08-18 17:54:54 +02:00
Nicholas Nethercote
07ffc0955f
style: Remove use of fnv in bloom.rs.
To support that, this patch also does the following.

- Removes the insert(), remove() and might_contain() methods, because they are
  specialized versions of insert_hash(), remove_hash(), and
  might_contain_hash(), and they are only used by tests within this file.

- Moves hash() from the top level into create_and_insert_some_stuff().

- Changes create_and_insert_some_stuff() so that instead of hashing consecutive
  integers, it instead hashes stringified consecutive integers, which matches
  real usage a little better.

- Raises the false_positives limit a little to account for the above changes.

Bug: 1484096
Reviewed-by: heycam
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
d63ce552f7
style: Deduplicate system metric atoms.
Now that :-moz-system-metric is gone, there's no real reason for the atoms to
be separate.

Differential Revision: https://phabricator.services.mozilla.com/D3497
2018-08-18 17:54:54 +02:00
Xidorn Quan
cd4d281984
style: Add scrollbar-width property.
Bug: 1475033
Reviewed-by: heycam
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
9350fa4c55
style: Remove an inaccurate and useless debug message. 2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
e9a99b2a7f
style: Manually inline class and ID getters.
Somewhat ugly but hopefully not too much. Somehow it ends up removing more lines
than adding.

Differential Revision: https://phabricator.services.mozilla.com/D3536
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
fe05c8ecad
style: Add some spec links to media queries.
Differential Revision: https://phabricator.services.mozilla.com/D3489
2018-08-18 17:54:54 +02:00
Xidorn Quan
f1fe15981a
style: Simplify some code in NoCalcLength::parse_dimension.
Differential Revision: https://phabricator.services.mozilla.com/D3473
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
dc0f937224
style: Rewrite media queries so that they work on an evaluator function.
This moves most of the code to be Rust, except potentially some evaluator
functions, and allows to unblock the use case from any-hover / any-pointer and
remove nsMediaFeatures.

Differential Revision: https://phabricator.services.mozilla.com/D2976
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
a0cb37d29d
style: Simplify visited-related code in invalidation.
We match with AllLinksVisitedAndUnvisited for style invalidation, and we already
do a subtree restyle because :visited matching doesn't depend on the actual
element state.

So all this stuff is just not needed. The comment points to the attribute tests
in bug 1328509, but those still trivially pass with this change.

I think this was unneeded since I introduced AllLinksVisitedAndUnvisited, or
maybe since https://github.com/servo/servo/pull/19520. In any case it doesn't
really matter, and I already had done this cleanup in my WIP patches for
bug 1406622, but I guess this is a slightly more suitable place to land them :)

Differential Revision: https://phabricator.services.mozilla.com/D3305
2018-08-18 17:54:54 +02:00
Emilio Cobos Álvarez
87b1e1cdc9
style: no-op visited changes earlier if visited links are disabled.
We force a repaint from ContentStateChangedInternal if visited links are
disabled, and that's observable. Let's cut it off as early as we can to avoid
timing attacks even when :visited is disabled.

Differential Revision: https://phabricator.services.mozilla.com/D3304
2018-08-18 17:54:54 +02:00
Cameron McCormack
cc1897597c
style: Generate static atom hash in StaticAtoms.py.
Differential Revision: https://phabricator.services.mozilla.com/D3295
2018-08-18 17:54:54 +02:00
Cameron McCormack
f86e9a411a
style: Remove support for multiple static atom sources.
Differential Revision: https://phabricator.services.mozilla.com/D3285
2018-08-18 17:54:54 +02:00
Cameron McCormack
f75419dd7a
style: Move CSS anonymous box atoms to nsGkAtoms.
Differential Revision: https://phabricator.services.mozilla.com/D3284
2018-08-18 17:54:54 +02:00
Cameron McCormack
99a292dd6d
style: Move CSS pseudo-element atoms to nsGkAtoms.
Differential Revision: https://phabricator.services.mozilla.com/D3283
2018-08-18 17:54:54 +02:00
Cameron McCormack
cc3c059bfc
style: Define atom type in nsGkAtomList.h.
Differential Revision: https://phabricator.services.mozilla.com/D3282
2018-08-18 17:54:54 +02:00
Nathan Froyd
064252437b
style: remove unused kernel32-sys dependency from style.
Bug: 1483344
Reviewed-by: emilio
2018-08-18 17:49:21 +02:00
Henri Sivonen
0ec5db90a6
Use encoding_rs for XPCOM string encoding conversions.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

Bug: 1402247
Reviewed-by: Nika,erahm,froydnj
2018-08-18 17:48:29 +02:00
Xidorn Quan
916dc79dc9
style: Rename StyleUserInterface to StyleUI.
Differential Revision: https://phabricator.services.mozilla.com/D3276
2018-08-18 17:48:22 +02:00
Cameron McCormack
e305b5a1f8
style: Remove unused BorrowedAtom.
Differential Revision: https://phabricator.services.mozilla.com/D3159
2018-08-18 17:48:12 +02:00
L. David Baron
9206283f7e
style: Swap order of values in 'overflow' shorthand property.
Differential Revision: https://phabricator.services.mozilla.com/D3069
2018-08-18 17:48:02 +02:00
Xidorn Quan
f14a3edd7d
style: Use function pointer rather than Fn trait object for collect_property_completion_keywords.
Differential Revision: https://phabricator.services.mozilla.com/D2985
2018-08-18 17:47:56 +02:00
Xidorn Quan
c77ecd6984
style: Implement flow-relative values for resize property.
Differential Revision: https://phabricator.services.mozilla.com/D2908
2018-08-18 17:47:51 +02:00
Xidorn Quan
5299ce31aa
style: Make several more specified values Copy.
Differential Revision: https://phabricator.services.mozilla.com/D2932
2018-08-18 17:47:44 +02:00
Xidorn Quan
e22850dc85
style: Add check for non-Copy specified value to ensure specified_is_copy always returns the right result.
Differential Revision: https://phabricator.services.mozilla.com/D2931
2018-08-18 17:47:37 +02:00
Xidorn Quan
e7945bbfcb
style: Put overflow: -moz-scrollbar-* behind pref.
Differential Revision: https://phabricator.services.mozilla.com/D2845
2018-08-18 17:47:30 +02:00
Boris Chiou
c87668fcd5
style: Use union to wrap different shape-like types. r=xidorn
1. We will add more shape-like types in the future, so it's better to
   use union to reduce the memory usage.
2. Those shape-like types are mutual exclusive, so we could use union to
   wrap them.

Differential Revision: https://phabricator.services.mozilla.com/D2746
2018-08-18 17:47:24 +02:00
bors-servo
ad83faa745
Auto merge of #21442 - kingdido999:rustfmt/bluetooth, r=jdm
Format components bluetooth and bluetooth_traits

<!-- Please describe your changes on the following line: -->

```bash
rustfmt components/bluetooth/*.rs
rustfmt components/bluetooth_traits/*.rs
```
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix a part of #21373 .
- [x] These changes do not require tests because it's code format change.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/21442)
<!-- Reviewable:end -->
2018-08-17 03:14:56 -04:00
kingdido999
0e3131a54c Format component bluetooth_traits 2018-08-17 11:09:38 +08:00
kingdido999
949e50d662 Format component bluetooth 2018-08-17 11:08:56 +08:00
kingdido999
8badac82db Format components atoms #21373 2018-08-17 09:12:29 +08:00
bors-servo
25ebde78aa
Auto merge of #21428 - kingdido999:rustfmt/allocator, r=jdm
Format component allocator

<!-- Please describe your changes on the following line: -->
Format `components/allocator` with:

```bash
rustfmt components/allocator/*.rs
```

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors. Waiting for #21423 to be resolved.
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix a part of #21373.
- [x] These changes do not require tests because they format the code only.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/21428)
<!-- Reviewable:end -->
2018-08-16 16:43:23 -04:00
Bastien Orivel
a1925aab52 Properly set the origin on websocket messages 2018-08-16 16:53:38 +02:00
Bastien Orivel
75c746655c The WS protocols should be case sensitive, not insensitive 2018-08-16 15:50:50 +02:00
kingdido999
b25a01f492 Format component allocator #21373 2018-08-16 15:44:54 +08:00
Bastien Orivel
73ef02ff17 Handle secure websockets
Fixes #20816
2018-08-16 00:24:19 +02:00
bors-servo
97c6246385
Auto merge of #21386 - Eijebong:remove-websocket, r=jdm
Replace servo-websocket by ws

This is heavily based on previous work done in #16012.

Fixes #14517

<!-- 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/21386)
<!-- Reviewable:end -->
2018-08-15 14:54:32 -04:00