Commit graph

19710 commits

Author SHA1 Message Date
Bastien Orivel
2e11bc10fb Replace servo-websocket by ws
This is heavily based on previous work done in #16012.

Fixes #14517
2018-08-15 16:53:48 +02:00
bors-servo
3ccfc288de
Auto merge of #21394 - servo:jdm-patch-6, r=cbrewster
Remove unnecessary CEReactions.

This incorporates a spec update in https://github.com/whatwg/html/pull/3901.

<!-- 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/21394)
<!-- Reviewable:end -->
2018-08-15 00:04:13 -04:00
bors-servo
bc82521eb7
Auto merge of #21372 - Eijebong:num-traits, r=jdm
Dedupe num-traits

<!-- 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/21372)
<!-- Reviewable:end -->
2018-08-14 11:09:46 -04:00
Josh Matthews
6d3ff9f742
Remove unnecessary CEReactions.
This incorporates a spec update in https://github.com/whatwg/html/pull/3901.
2018-08-13 11:16:46 -04:00
Gregory Terzian
e784f5a9f7 Refactor embedder NewBrowser flow 2018-08-11 01:13:11 +02:00
Gregory Terzian
fee5428316 make auxiliary browsing-context script-closeable 2018-08-11 01:13:11 +02:00
Gregory Terzian
a0082c57c8 iframe: use value of name attr to set nested bc name 2018-08-11 01:13:11 +02:00
Gregory Terzian
e27ba16c3f share event-loops based on eTLD+1 2018-08-11 01:13:11 +02:00
Gregory Terzian
21bf5a3a4b implement opener, disowning 2018-08-11 01:13:11 +02:00
Gregory Terzian
f408b798c4 implement window.open, create auxiliary browsing context 2018-08-11 01:12:55 +02:00
Bastien Orivel
71fd4477d6 Dedupe num-traits 2018-08-09 18:26:28 +02:00
bors-servo
8a691f74e7
Auto merge of #21365 - jdm:android-font, r=mbrubeck
Avoid crash using freetype in debug android builds

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21327
- [x] These changes do not require tests because this code is only executed in debug builds

<!-- 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/21365)
<!-- Reviewable:end -->
2018-08-08 16:56:21 -04:00
Josh Matthews
4f596edcbf gfx: Make FontHandleMethods::family_name return an optional value. 2018-08-08 15:29:22 -04:00
bors-servo
53159770e2
Auto merge of #21346 - georgeroman:unused_bluetooth_dep, r=paulrouget
Remove unused compositing dependency from bluetooth crate

Closes #21176

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/21346)
<!-- Reviewable:end -->
2018-08-08 04:24:39 -04:00
bors-servo
ea86eb64be
Auto merge of #21357 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each individual commit.

<!-- 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/21357)
<!-- Reviewable:end -->
2018-08-07 20:27:24 -04:00
Josh Matthews
7c32ad7c3d Revert "Fix the build for NLL"
This reverts commit d1733aa502.
2018-08-07 20:24:55 -04:00
Emilio Cobos Álvarez
689293e4fb
Fix Servo build. 2018-08-08 01:34:35 +02:00
Emilio Cobos Álvarez
6c5456b4b6
Appease tidy. 2018-08-08 01:34:35 +02:00
Emilio Cobos Álvarez
ffae32f844
style: Fixup some indentation. 2018-08-08 01:37:57 +02:00
Emilio Cobos Álvarez
0ae47b2659
style: Cleanup invalidation processor constructor.
It used to be this way because of lifetime issues (plus the shadow
datas were in RwLocks at some point IIRC). Now we guarantee that as long as the
element is away the cascade data is as well, so we don't need to thread it
around.

Differential Revision: https://phabricator.services.mozilla.com/D2768
2018-08-08 01:37:50 +02:00
Emilio Cobos Álvarez
bbcd7e414a
style: Remove unused selectors methods.
Differential Revision: https://phabricator.services.mozilla.com/D2767
2018-08-08 01:37:45 +02:00
Emilio Cobos Álvarez
489e224cb6
style: Don't print rerun-if-changed files until binding generation has succeeded.
Otherwise they may clobber useful output.

Differential Revision: https://phabricator.services.mozilla.com/D2783
2018-08-08 01:37:37 +02:00
Olli Pettay
87deddb631
style: Change storage of previous and next children in nsINode. 2018-08-08 01:37:28 +02:00
Emilio Cobos Álvarez
888ad3eabe
style: Restrict XUL tree pseudos on nightly and early-beta.
Differential Revision: https://phabricator.services.mozilla.com/D2598
2018-08-08 01:37:20 +02:00
Emilio Cobos Álvarez
998e6f1797
style: Remove the concept of 'canonical' pseudos.
We only have this so that ::-moz-placeholder keeps serializing as
::-moz-placeholder, but I don't think anybody really cares.

Edge aliases ::-webkit-input-placeholder to ::-ms-input-placeholder at parse
time as well, as can be seen in:

```
let s = document.createElement('style');
s.innerHTML = `input::-webkit-input-placeholder { color: red };`;
document.body.appendChild(s);
document.body.innerHTML = s.sheet.cssRules[0].cssText;
```

And I think this is more consistent with what we do for CSS properties that are
aliases.

Differential Revision: https://phabricator.services.mozilla.com/D2595
2018-08-08 01:37:07 +02:00
Cameron McCormack
62419adaaa
style: Shrink selectors::Component to 24 bytes.
This saves about 37 KiB of memory across the UA style sheets.

Bug: 1475197
Reviewed-by: emilio
2018-08-08 01:36:53 +02:00
Jonathan Watt
b05ace3e4a
style: Add a '-moz-menulist-button' value to '-moz-appearance'.
The '-moz-menulist-button' value currently behavies identically to the
'menulist-button' value.  This is not implemented as an alias because later
patches in this patch series will change the behavior of our pre-existing
'menulist-button' value to more closely match what Chrome does.

Bug: 1428676
Reviewed-by: emilio
2018-08-08 01:36:33 +02:00
Emilio Cobos Álvarez
bee7cbad0d
style: Micro-optimize is_root to avoid poking at the parent in the common case.
We can discard the common case of an element having another element or document
fragment parent, which is the common case.

Then we can discard detached subtrees looking at is_in_document().

The only case where we have a non-content parent is the document case:

  https://searchfox.org/mozilla-central/rev/033d45ca70ff32acf04286244644d19308c359d5/dom/base/Element.cpp#1683

Differential Revision: https://phabricator.services.mozilla.com/D2505
2018-08-08 01:36:25 +02:00
Emilio Cobos Álvarez
eb49995737
style: Convert GetStringValue to use Servo.
And remove gPropertyTable / kCSSRawProperties while at it.

Differential Revision: https://phabricator.services.mozilla.com/D2516
2018-08-08 01:36:18 +02:00
Emilio Cobos Álvarez
694d00eb5e
style: Implement nsCSSProps::LookupProperty using Rust.
Always assume allowed-for-all-content. There are a couple callers which weren't
doing that:

 * A unit test -> removed.

 * ComputeAnimationDistance: Used for testing (in transitions_per_property), and
   for the animation inspector. The animation inspector shouldn't show
   non-enabled properties. The transitions_per_property test already relies on
   getComputedStyle stuff which only uses eForAllContent.

 * GetCSSImageURLs: I added this API for the context menu page and such. It
   doesn't rely on non-enabled-everywhere properties, it was only using
   eInChrome because it was a ChromeOnly API, but it doesn't really need this.

Differential Revision: https://phabricator.services.mozilla.com/D2514
2018-08-08 01:36:10 +02:00
Emilio Cobos Álvarez
c3289ad46e
style: Improve logging for attribute changes.
And general Element logging. We now print all the attributes for comparison.

If this turns out to be too verbose we can change it to diff them or something.

Differential Revision: https://phabricator.services.mozilla.com/D2471
2018-08-08 01:36:03 +02:00
Emilio Cobos Álvarez
2e3aacdf80
style: Add a root bucket to the selector map.
:root can't change without getting unbound from the tree so no fancy stuff other
than that needed.

This removes a lot of revalidation and attribute invalidation matching from the
Chrome, and looks like it should be a good idea in general.

Differential Revision: https://phabricator.services.mozilla.com/D2462
2018-08-08 01:35:54 +02:00
Emilio Cobos Álvarez
0b520c9558
style: Make NonCustomPropertyId <-> nsCSSPropertyId conversions fast.
We have a different order in nsCSSPropertyId for no good reason. The only
invariant there is that longhands come before shorthands, and shorthands before
aliases.

Luckily that's also an invariant that NonCustomPropertyId has, so we can reuse
them.

Differential Revision: https://phabricator.services.mozilla.com/D2463

MozReview-Commit-ID: 1hsQu6hmqiN
2018-08-08 01:35:48 +02:00
Emilio Cobos Álvarez
5a7358b833
style: Restore the order of Scrollbarbutton appearance values.
The patch at bug 1478391 comment 6 changed the way the math in Scrollbarbutton*
worked, which pretty surely caused this.

Restore the original order and math to be the same as before bug 1478391.

Bug: 1479216
Reviewed-by: xidorn
MozReview-Commit-ID: CK3iOqeX2NW
2018-08-08 01:35:34 +02:00
Nicholas Nethercote
fc9df0bcf3
style: Convert FnvHash{Set,Map} instances to FxHash{Set,Map}.
Bug: 1477628
Reviewed-by: heycam
2018-08-08 01:34:35 +02:00
Emilio Cobos Álvarez
0cab212052
style: Autogenerate StyleAppearance.
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.

Really sorry for the size of the patch.

There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.

Differential Revision: https://phabricator.services.mozilla.com/D2361
2018-08-08 01:35:08 +02:00
Emilio Cobos Álvarez
798d45f38d
style: Generate StyleDisplay using cbindgen.
We use the same setup WR uses, which is checking-in the files.

But I think it's much better than keeping the two things in sync manually :)

When you add a new value, you need to add it to the rust source, then run the
command, but since it doesn't need to build the style crate (it uses the Rust
AST, doesn't build) there's no problem.

Differential Revision: https://phabricator.services.mozilla.com/D2354
2018-08-08 01:34:49 +02:00
Hiroyuki Ikezoe
c63a9a37a9
style: Introduce nsCSSKeywordAndBoolTableEntry.
The values in the boolean context depend on its feature.  For examples, in the
case of prefers-reduced-motion 'no-preference' means false and 'reduced' mean
true in the boolean context, whereas in the case of prefers-contrast
'no-preference' means false and other two values, 'high' and 'low' means true
in the boolean context.  To support it we introduce a child struct of
nsCSSKTableEntry that has an additional field representing the value in the
boolean context and use it when we have no specified value in the media feature
(i.e. in the boolean context).

Bug: 1365045
Reviewed-by: heycam
MozReview-Commit-ID: 79HiW8l5ous
2018-08-08 01:34:35 +02:00
Simon Sapin
d1733aa502 Fix the build for NLL
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`

https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
2018-08-08 00:09:56 +02:00
bors-servo
2ceb8dcd22
Auto merge of #21218 - gterzian:root_cloned_blobs, r=jdm
Use a structured clone holder to store rooted clones

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

---
<!-- 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 #21164 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/21218)
<!-- Reviewable:end -->
2018-08-07 12:49:25 -04:00
Gregory Terzian
a5d7cd1a7f use a structured clone holder to store rooted clones 2018-08-07 17:40:46 +02:00
Paul Rouget
0d9161dd7b WR update 2018-08-06 07:22:24 +02:00
George Roman
232addbd06 Remove unused compositing dependency from bluetooth crate 2018-08-05 15:41:09 +03:00
Anthony Ramine
04c81c5cc3 Merge code from Draw* and Draw*Instanced methods
This made me realise we weren't supporting OES_element_index_uint in the
ANGLE_instanced_arrays extension.
2018-08-02 22:54:39 +02:00
bors-servo
c5aaae7333
Auto merge of #21324 - servo:webgl, r=emilio
Properly set initial values for WebGL texture filters

<!-- 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/21324)
<!-- Reviewable:end -->
2018-08-02 12:08:12 -04:00
Anthony Ramine
f7124886bc Use the DOM cache for gl.getTexParameter(gl.TEXTURE_*_FILTER)
Part of #20596.
2018-08-02 18:06:58 +02:00
Anthony Ramine
9e912be4ea Properly set initial values for WebGL texture filters 2018-08-02 15:53:57 +02:00
bors-servo
bde8a1e239
Auto merge of #21313 - jdm:glstuff, r=nox
Framebuffer and renderbuffer fixes

This commits address two separate panics that occur when running the framebuffer-object-attachment.html test. The test still panics due to another framebuffer completion status problem, so the overall test results don't demonstrate any improvement.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21252
- [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/21313)
<!-- Reviewable:end -->
2018-08-02 09:26:35 -04:00
Anthony Ramine
fba6d801a1 Always use a WebGLVertexArrayObject to handle vertex attribs
This lets us clean up how buffers are reference-counted.
2018-08-02 12:46:19 +02:00
Josh Matthews
03eb7e4dd2 webgl: Emulate some renderbuffer formats in non-GLES. 2018-08-02 02:05:53 -04:00