Commit graph

14946 commits

Author SHA1 Message Date
bors-servo
f93fccac57 Auto merge of #17523 - emilio:cleanup-traversal, r=nox
style: Cleanup traversal.rs

Mostly reflowing comments that have become too long or two short with
refactorings, and using consistent indentation.

<!-- 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/17523)
<!-- Reviewable:end -->
2017-06-27 07:08:42 -07:00
bors-servo
4e8cf678bf Auto merge of #17528 - bzbarsky:first-letter-better, r=emilio
Fix stylo support for first-letter

<!-- 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: -->
- [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=1324618

<!-- 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/17528)
<!-- Reviewable:end -->
2017-06-26 23:46:13 -07:00
Boris Zbarsky
746f245f32 Fix style computation for first-letter pseudo-elements with inline ancestors.
We should inherit from the inline, not its parent block.

Gecko bug 1324618 part 10 servo bits: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:29:18 -07:00
Boris Zbarsky
d40e27d6e5 Reframe less on restyles that involve nonexistent first-letter frames in Gecko.
Gecko bug 1324618 part 9 servo bits: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:27:39 -07:00
Boris Zbarsky
40dd807df3 Assert that compute_style_difference is only called with eager pseudos.
Gecko bug 1324618 part 3: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:24:56 -07:00
Boris Zbarsky
18ab0087ae Add some comments to may_generate_pseudo; no real behavior changes for now.
Gecko bug 1324618 part 2: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:24:08 -07:00
Boris Zbarsky
acb27de71c Fix dynamic restyling that changes whether our element may generate a pseudo to clear out stale pseudo styles.
Gecko bug 1324618 part 1: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:23:04 -07:00
bors-servo
8d9b995b34 Auto merge of #17522 - streichgeorg:master, r=emilio
Replace ParseNodeID with ParseNodeId

<!-- Please describe your changes on the following line: -->
---
Not really much to this...
<!-- 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 #17519 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] 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/17522)
<!-- Reviewable:end -->
2017-06-26 22:46:27 -07:00
Hiroyuki Ikezoe
ae1ccdd456 Check has_new_animation_style along with for_css_rule_changes() in needs_animations_update(). 2017-06-27 08:26:16 +09:00
Emilio Cobos Álvarez
5a481547b8
style: Cleanup traversal.rs
Mostly reflowing comments that have become too long or two short with
refactorings, and using consistent indentation.
2017-06-26 22:48:17 +02:00
streichgeorg
fa6fc141c8 replaced ParseNodeID with ParseNodeId 2017-06-26 14:06:26 +02:00
bors-servo
3f2d747689 Auto merge of #17514 - HarveyHunt:deny-public-fields-error-message, r=jdm
deny_public_fields: display field identifier in help message

Use a binding's field identifier to produce more descriptive output.
Fall back to a binding's identifier if a field identifier is not
available.

Additionally, make the privatize.rs compiletest more specific and
wrap the identifier in backticks to aid readability.

As an aside, should I send a PR to rename ```compile-fail/privatize.rs``` to ```compile-fail/deny_public_fields.rs``` as privatize isn't mentioned in the codebase any more?

```
$ find . -name "*privatize*"
./tests/compiletest/plugin/compile-fail/privatize.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 #17438 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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/17514)
<!-- Reviewable:end -->
2017-06-25 10:45:42 -07:00
Harvey Hunt
6081241962 deny_public_fields: display field identifier in help message
Use a binding's field identifier to produce more descriptive output.
Fall back to a binding's identifier if a field identifier is not
available.

Additionally, make the privatize.rs compiletest more specific and
wrap the identifier in backticks to aid readability.
2017-06-25 18:12:43 +01:00
Jeremy Lempereur
60de05d77d Passing ProfilerChan by reference to the send_profile_data method. 2017-06-25 14:29:44 +02:00
bors-servo
f740366c61 Auto merge of #17515 - frewsxcv:frewsxcv-simple-node-iterator, r=KiChjang
Merge explicit node iterator structures into single generic structure.

<!-- 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/17515)
<!-- Reviewable:end -->
2017-06-25 00:38:23 -07:00
Corey Farwell
011ff28aee Merge explicit node iterator structures into single generic structure. 2017-06-25 00:29:08 -04:00
Emilio Cobos Álvarez
6f57a9b4ba
style: Fix rem computation on the root element.
Bug: 1375930
Reviewed-By: heycam
MozReview-Commit-ID: DK98SS1w5nO
2017-06-25 02:45:56 +02:00
bors-servo
946c9aede1 Auto merge of #17508 - servo:derive-all-the-things, r=emilio
Use generics for SimpleShadow

<!-- 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/17508)
<!-- Reviewable:end -->
2017-06-24 04:46:56 -07:00
Anthony Ramine
81a01f6ce1 Use generics for SimpleShadow 2017-06-24 13:01:20 +02:00
Emilio Cobos Álvarez
26f4e2bf51
style: Fix misindented code in font.mako.rs. 2017-06-24 09:31:07 +02:00
bors-servo
bc3ec0ce1b Auto merge of #17381 - cbrewster:custom_element_creation, r=jdm
Custom element creation

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

This implements the CE-related steps when creating elements. `is` is now support by `document.createElement` and is stored on `Element`s. Only synchronously created autonomous elements are supported as async element creation and customized built-in elements both require custom element upgrade reactions.

Spec: https://dom.spec.whatwg.org/#concept-create-element

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

<!-- Either: -->
- [X] 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/17381)
<!-- Reviewable:end -->
2017-06-23 21:08:40 -07:00
Connor Brewster
37e8b89377 Allow element prefix to be set
Implements step 6.1.10 of
https://dom.spec.whatwg.org/#concept-create-element
2017-06-23 21:10:01 -06:00
Connor Brewster
062b128688 Add flag for sync/async CE creation 2017-06-23 21:09:57 -06:00
Connor Brewster
2f36d3544f Support is option when creating elements 2017-06-23 21:09:55 -06:00
Connor Brewster
6697f5469d Hook CE registry into element creation 2017-06-23 21:09:53 -06:00
bors-servo
a29261dec1 Auto merge of #17504 - bholley:arc_pseudos, r=bholley
Make EagerPseudoStyles use an Arc, not a Box

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1371049

Fixes #17300

<!-- 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/17504)
<!-- Reviewable:end -->
2017-06-23 20:07:45 -07:00
bors-servo
1d045e5c3b Auto merge of #17503 - frewsxcv:frewsxcv-return-node-list-2, r=mbrubeck
Replace iterator struct with anonymous return iterator types.

Similar to https://github.com/servo/servo/pull/17488.

<!-- 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/17503)
<!-- Reviewable:end -->
2017-06-23 19:01:33 -07:00
bors-servo
c586a241bb Auto merge of #17494 - servo:derive-all-the-things, r=emilio
Marginally improve shadows

<!-- 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/17494)
<!-- Reviewable:end -->
2017-06-23 17:45:58 -07:00
Bobby Holley
eeb62edfea Use an Arc for eager pseudo styles.
MozReview-Commit-ID: BdYkXxYvUQ3
2017-06-23 16:19:06 -07:00
Bobby Holley
af89c74ab7 Use a newtype within EagerPseudoValues.
MozReview-Commit-ID: IIDxBJ8mqvJ
2017-06-23 16:19:05 -07:00
bors-servo
bb9391ba2c Auto merge of #17493 - froydnj:rust-117-fixes, r=jdm
remove various things now that Rust 1.17 is required

std::ptr::eq and Arc::ptr_eq are now usuable, and we can replace a
panic!() with abort().

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because they are trivial replacements.

<!-- 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/17493)
<!-- Reviewable:end -->
2017-06-23 16:01:02 -07:00
Corey Farwell
0cabc5c7fd Replace iterator struct with anonymous return iterator types.
Similar to https://github.com/servo/servo/pull/17488.
2017-06-23 18:51:46 -04:00
bors-servo
e2a26e7bd0 Auto merge of #17491 - KiChjang:update-fetch, r=jdm
Introduce service-worker mode

Bringing in the spec changes from whatwg/fetch#435.

<!-- 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/17491)
<!-- Reviewable:end -->
2017-06-23 14:56:00 -07:00
bors-servo
bc5e8f89ff Auto merge of #17488 - frewsxcv:frewsxcv-return-node-list, r=jdm
Replace iterator struct with anonymous return iterator type.

```
hi servo. it's been
some time. here's a pull request.
i hope you like it.
```

<!-- 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/17488)
<!-- Reviewable:end -->
2017-06-23 12:38:02 -07:00
bors-servo
7e493529f0 Auto merge of #17259 - jyc:new-CSSStyleSheet, r=emilio
Force HTMLStyleElement to create a new CSSStyleSheet when re-parsing.

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

- [X] These changes do not require tests because I'm pushing to find out what test results this changes; this is part of a series of PRs to fix bug #17182

<!-- 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/17259)
<!-- Reviewable:end -->
2017-06-23 11:37:23 -07:00
bors-servo
3e4021ef1a Auto merge of #17492 - glandium:master, r=emilio
Separate thread pool from global state for Gecko

When stylo is not enabled in Gecko, the global state initialization
still creates the style thread pool, even when it's not going to be
used. This wastes address space and a little memory.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1374824#c38 and
following comment.

<!-- 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/17492)
<!-- Reviewable:end -->
2017-06-23 10:37:43 -07:00
bors-servo
56cc39433f Auto merge of #17487 - MattWis:patch-1, r=emilio
Correct bloom hash bitpacking documentation

The two 12 bit keys add to 24 bits, which leaves 8 bits free in each word. (And 8 * 3 = 24, to pack in the fourth hash.)

<!-- Please describe your changes on the following line: -->
I have never actually built servo, but I'm pretty sure that's not necessary for a 1 line comment-only change

---
<!-- 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 this is a comment only 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/17487)
<!-- Reviewable:end -->
2017-06-23 09:39:11 -07:00
Nathan Froyd
096cee8ebc remove various things now that Rust 1.17 is required
std::ptr::eq and Arc::ptr_eq are now usuable, and we can replace a
panic!() with abort().
2017-06-23 10:39:41 -04:00
Anthony Ramine
c9b123266d Unconditionally compile SimpleShadow even in Servo 2017-06-23 16:26:09 +02:00
Anthony Ramine
ae1c890c9e Rename DropShadow to SimpleShadow 2017-06-23 16:25:50 +02:00
bors-servo
92679480b1 Auto merge of #17469 - nox:empty-vs-initial, r=emilio
Distinguish the emptiness of a property from its initial value

<!-- 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/17469)
<!-- Reviewable:end -->
2017-06-23 05:59:49 -07:00
bors-servo
567f5e8985 Auto merge of #17477 - servo:closures-by-ref, r=emilio
Pass some 48-bytes closures by references instead of by value.

This reduced the generated code size by 74 KB: https://bugzilla.mozilla.org/show_bug.cgi?id=1375222#c4

<!-- 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/17477)
<!-- Reviewable:end -->
2017-06-23 03:51:23 -07:00
Anthony Ramine
f01ea53ac1 Distinguish the emptiness of a property from its initial value 2017-06-23 12:39:44 +02:00
Emilio Cobos Álvarez
12309543d3 style: fix the check for specified transitions.
Check both transition-property and transition-duration.
2017-06-23 12:37:36 +02:00
Mike Hommey
513833d9b9 Separate thread pool from global state for Gecko
When stylo is not enabled in Gecko, the global state initialization
still creates the style thread pool, even when it's not going to be
used. This wastes address space and a little memory.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1374824#c38 and
following comment.
2017-06-23 19:36:58 +09:00
bors-servo
626c029623 Auto merge of #17385 - pyfisch:better-scroll, r=mrobinson
Fix several bugs related to scrolling

* scrollLeft/scrollTop returned values of parent or even document root
   Only the scroll of the node itself is returned. Otherwise 0.0.
* Scrolling via script had set viewport.
   This resulted in other nodes appearing scrolled.
   Now scroll_offsets are updated with correct node id.

These bugs caused other odd behavior like both body and
document.documentElement being scrolled or the view for scrolled
elements jumping.

Also try scrolling this [example page](https://pyfisch.org/stuff/scrolltest.html) in servo with and without this change.

<!-- 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: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17342 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes (partially)

<!-- 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/17385)
<!-- Reviewable:end -->
2017-06-23 01:50:39 -07:00
Keith Yeung
6adc653083 Introduce service-worker mode 2017-06-22 23:48:07 -07:00
bors-servo
dd7540a5d4 Auto merge of #17472 - moonlightdrive:globalscope-current-option, r=asajeffrey
return Option from GlobalScope::current

<!-- Please describe your changes on the following line: -->
handles the case where `GlobalScope::current` calls `CurrentGlobalOrNull` and the result is null

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because: no functionality change & ./mach build -d has no errors

<!-- 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/17472)
<!-- Reviewable:end -->
2017-06-22 22:01:43 -07:00
bors-servo
d2bc0ff631 Auto merge of #17467 - mantaroh:svg-zero-value, r=birtles
Add get_zero_value for IntermediateSVGPaint.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1371199

---
<!-- 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: -->
There are tests for these changes, a test case will be landed in reftests in https://bugzilla.mozilla.org/show_bug.cgi?id=1371199

<!-- 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/17288)
<!-- Reviewable:end -->
2017-06-22 20:58:24 -07:00
Corey Farwell
917fe9241a Replace iterator struct with anonymous return iterator type. 2017-06-22 23:49:38 -04:00