Commit graph

11591 commits

Author SHA1 Message Date
Xidorn Quan
aa33dfff05 Add support for -moz-top-layer 2017-01-05 22:03:25 +11:00
bors-servo
143dfc879e Auto merge of #14848 - bzbarsky:initial-styles, r=bholley
Stop using global initial styles for stylo; the initial styles need to be per-document

<!-- 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 https://bugzilla.mozilla.org/show_bug.cgi?id=1298588

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests on the servo side because behavior is unchanged.  Gecko-side tests probably exist.

<!-- 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/14848)
<!-- Reviewable:end -->
2017-01-04 21:01:38 -08:00
Boris Zbarsky
dd80b5c0e7 Bug 1298588 part 15, servo piece. Rip out the initial() methods on style structs in stylo. r=bholley 2017-01-04 23:13:55 -05:00
Boris Zbarsky
8e2acee24e Bug 1298588 part 14. Remove ComputedValues::initial_values for stylo. r=bholley 2017-01-04 23:13:53 -05:00
Boris Zbarsky
369fdddcd9 Bug 1298588 part 13. Make sure Device has a ComputedValues for stylo. r=bholley 2017-01-04 23:13:52 -05:00
Boris Zbarsky
62961370ec Bug 1298588 part 12. Compile some bits that call ComputedValues::initial_values only for servo, not stylo. r=bholley
Stylist::set_device seems to only be used in servo code, and is the only consumer of ViewportConstraints::maybe_new.
2017-01-04 23:13:50 -05:00
Boris Zbarsky
8367c96c1b Bug 1298588 part 11. Pass through useful default styles to CascadePropertyFn. r=bholley 2017-01-04 23:13:49 -05:00
Boris Zbarsky
c826b18f87 Bug 1298588 part 10, servo piece. Pass through useful default styles to apply_declarations(). r=bholley 2017-01-04 23:13:48 -05:00
Boris Zbarsky
61f6025dc3 Bug 1298588 part 9, servo piece. Pass through useful default styles to cascade(). r=bholley 2017-01-04 23:13:46 -05:00
Boris Zbarsky
09c74190b9 Bug 1298588 part 8. Pass a SharedStyleContext, not a Stylist, to Legalizer methods. r=bholley 2017-01-04 23:13:45 -05:00
Boris Zbarsky
d3e34db508 Bug 1298588 part 7, servo piece. Stop using initial_values in general in Gecko glue code. r=bholley 2017-01-04 23:13:43 -05:00
Boris Zbarsky
c313c8d17e Bug 1298588 part 6, servo piece. Stop using initial_values when doing inheritance in Gecko glue code. r=bholley 2017-01-04 23:13:42 -05:00
Boris Zbarsky
56941d61a7 Bug 1298588 part 5. Store a ComputedValues on SharedStyleContext. r=bholley 2017-01-04 23:13:40 -05:00
Boris Zbarsky
a5ac55c8ff Bug 1298588 part 4, servo piece. Recreate the default computed values for a document as needed. r=bholley 2017-01-04 23:13:39 -05:00
Boris Zbarsky
34bb2f1e6c Bug 1298588 part 3, servo piece. Add a default ComputedValues member to PerDocumentStyleData. r=bholley 2017-01-04 23:13:31 -05:00
bors-servo
16b0da5004 Auto merge of #14312 - asajeffrey:script-discard-documents, r=cbrewster
Implement discarding Document objects to reclaim space.

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

This PR implements document discarding. Active documents are kept alive strongly, but inactive documents are only kept alive weakly. When a document is GCd, it is marked as discarded, and if it is every reactivated, a reload of the URL is triggered.

Note that this PR is pretty aggressive about discarding, and can any inactive document (other than those being kept alive by other same-origin pipelines). We might want to damp it down a bit.

Also note that this interacts with browser.html in that the reloading triggered by reactivating a document triggers mozbrowser events.

To test this, I added a `-Zdiscard-inactive-documents` debug flag, which discards all inactive documents, even ones which are reachable through other same-origin pipelines.

---
<!-- 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 #14262.
- [X] These changes do not require tests because we should be able to use the existing tests with `-Zdiscard-inactive-documents`.

<!-- 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/14312)
<!-- Reviewable:end -->
2017-01-04 13:58:57 -08:00
bors-servo
2fe914e2fa Auto merge of #14845 - jdm:restyle-ood, r=emilio
Avoid restyling elements that aren't in a document

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14480
- [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/14845)
<!-- Reviewable:end -->
2017-01-04 12:19:00 -08:00
Boris Zbarsky
8908743719 Bug 1298588 part 2, servo piece. Pass through an nsPresContext to the PerDocumentStyleData constructor. r=bholley 2017-01-04 14:42:15 -05:00
bors-servo
6f9ff7b8bf Auto merge of #14738 - Wafflespeanut:keypress, r=jdm
Properly dispatch keypress event

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

This was an attempt to fix #14659. It turned out that the problem wasn't what I thought it was. So, I didn't fix that. On the brighter side, this fixes two related issues.

- Previously, we were unable to launch `keypress` events from `input` and `textarea` elements, because [we'd been cancelling](1327ebd52f/components/script/dom/htmlinputelement.rs (L1120-L1124)) the key events, so that they don't trigger window navigation - #8400). I've introduced an enum to represent an additional state to an event's cancellation.
- [According to the spec](https://w3c.github.io/uievents/#keypress-event-order), `keypress` (if available) should be dispatched immediately after `keydown`, and it should be followed by `input`. Canceling `keypress` should also cancel `input`. But, we'd been dispatching `input` before `keypress`. We now dispatch `input` once the `keypress` event is on the respective elements.

---
<!-- 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

<!-- Either: -->
- [x] These changes do not require tests because it's a refactor?

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

r? @jdm or anyone interested

<!-- 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/14738)
<!-- Reviewable:end -->
2017-01-04 10:52:06 -08:00
Josh Matthews
9a264c8173 Only pass nodes to layout for restyling that are actually in the document. 2017-01-04 12:42:12 -05:00
bors-servo
96fd0837d3 Auto merge of #14844 - emilio:to-css-simplification, r=SimonSapin
style: Simplify Debug impl for PropertyDeclaration reusing to_css.

These two functions appear in the data from bug 1328497, and the second part of one is identical to the other.

I think the way to fix this is another one (either using static arrays to get
the interesting data, or making rust generate the equivalent code).

<!-- 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/14844)
<!-- Reviewable:end -->
2017-01-04 09:37:48 -08:00
Emilio Cobos Álvarez
c8ea840106
style: Simplify Debug impl for PropertyDeclaration reusing to_css.
These two functions appear in the data from bug 1328497.

I think the way to fix this is another one (either using static arrays to get
the interesting data, or making rust generate the equivalent code).
2017-01-04 18:24:04 +01:00
Alan Jeffrey
c14c431d0a Default --max-session-history is now 16. 2017-01-04 17:02:03 +00:00
Alan Jeffrey
1a201fc702 Pass test-tidy. 2017-01-04 15:23:37 +00:00
Alan Jeffrey
ef50a64598 Updated comment. 2017-01-04 15:22:46 +00:00
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
Alan Jeffrey
67bf23016e Added warnings for idempotent freeze/thaw. 2017-01-04 13:56:14 +00:00
Alan Jeffrey
78c87ea8d7 Implement discarding Document objects to reclaim space. 2017-01-04 11:29:31 +00:00
bors-servo
1e927ca88b Auto merge of #14835 - bholley:external_atomic_refcell, r=Manishearth
Switch to crates.io for atomic_refcell

r? @Manishearth

See #14828 for backstory.

<!-- 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/14835)
<!-- Reviewable:end -->
2017-01-03 19:20:59 -08:00
Bobby Holley
b9d99390ad Switch to crates.io for atomic_refcell. 2017-01-03 18:14:27 -08:00
bors-servo
61f6454b9c Auto merge of #14827 - Manishearth:spec-doc, r=emilio
Add spec links to all CSS properties

<!-- 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/14827)
<!-- Reviewable:end -->
2017-01-03 14:28:29 -08:00
Manish Goregaokar
94412ab6b0 Fix image-orientation line-wrap 2017-01-03 14:28:11 -08:00
Manish Goregaokar
1094c68a55 Add spec link for text-emphasis 2017-01-03 14:03:43 -08:00
Manish Goregaokar
d873bb8fa4 Add spec links for border shorthands 2017-01-03 14:03:42 -08:00
Manish Goregaokar
c89368dcc5 Add spec links for opacity 2017-01-03 14:03:40 -08:00
Manish Goregaokar
ca6ada8b83 Make spec links mandatory 2017-01-03 14:03:39 -08:00
Manish Goregaokar
9a2945bd3a Add spec links for xul properties 2017-01-03 14:03:38 -08:00
Manish Goregaokar
0c6829aea1 Add spec links for ui properties 2017-01-03 14:03:37 -08:00
Manish Goregaokar
450a5d1ae0 Add spec links for text properties 2017-01-03 14:03:35 -08:00
Manish Goregaokar
24f4388b5b Add spec links for table properties 2017-01-03 14:03:34 -08:00
Manish Goregaokar
7238cfb349 Add spec links for svg properties 2017-01-03 14:03:33 -08:00
Manish Goregaokar
baaddf651d Add spec links for pointing properties 2017-01-03 14:03:32 -08:00
Manish Goregaokar
6cf15de868 Add spec links for padding properties 2017-01-03 14:03:30 -08:00
Manish Goregaokar
e7464b5fd5 Add spec links for outline properties 2017-01-03 14:03:28 -08:00
Manish Goregaokar
fdd6a409fb Add spec links for mask properties 2017-01-03 14:03:26 -08:00
Manish Goregaokar
3128694bff Add spec links for margin properties, support spec links on four_sides_shorthand 2017-01-03 14:03:25 -08:00
Manish Goregaokar
6138b6aa75 Add spec links for list properties 2017-01-03 14:03:23 -08:00
Manish Goregaokar
26a9b450a2 Add spec links for inherited_text properties 2017-01-03 14:03:20 -08:00
Manish Goregaokar
096dca9171 Add spec links for inherited_table properties 2017-01-03 14:03:18 -08:00
Manish Goregaokar
ff4893e17e Add spec links for inherited_svg properties 2017-01-03 14:03:17 -08:00