Commit graph

19254 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
5b05aa7c52
style: Derive ToComputedValue in grid properties. 2017-09-11 11:22:20 +02:00
Emilio Cobos Álvarez
b9f5388635
style: Use derive for -x-span. 2017-09-11 11:22:20 +02:00
Emilio Cobos Álvarez
156b371376
style: Use derive(TCV) in GeometryBox. 2017-09-11 11:22:19 +02:00
Emilio Cobos Álvarez
900eaec3cc
style: Remove the special-case in single_keyword_computed.
The other case is pretty much the same.
2017-09-11 11:22:18 +02:00
Emilio Cobos Álvarez
9788ffe3e4
style: Derive ToComputedValue for font-variant-caps. 2017-09-11 11:22:17 +02:00
Emilio Cobos Álvarez
c87b485fa6
style: Derive ToComputedValue for keyword types. 2017-09-11 11:22:17 +02:00
Emilio Cobos Álvarez
06c8e0163e
style: Manually expand ComputedValueAsSpecified in the keyword macros. 2017-09-11 11:22:16 +02:00
Emilio Cobos Álvarez
95712d5edf
style: Minor reformatting in macros.rs 2017-09-11 11:22:15 +02:00
bors-servo
8129cf5563 Auto merge of #18206 - ferjm:bug1382369.grid.repeat.function, r=wafflespeanut
stylo: store specified value of grid layout repeat() function

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1382369](https://bugzilla.mozilla.org/show_bug.cgi?id=1382369)

<!-- 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/18206)
<!-- Reviewable:end -->
2017-09-11 02:32:38 -05:00
Emilio Cobos Álvarez
7a6b891a29
hashglobe: Inline error constructor so we don't pay a function call even when there's no error. 2017-09-10 16:57:09 +02:00
Emilio Cobos Álvarez
6661bfa838
fallible: Avoid using system malloc in servo. 2017-09-10 16:53:42 +02:00
Julian Seward
c85633f48e
stylo: Add uses of fallible Vec, SmallVec and HashMap facilities.
Bug: 1395064
Reviewed-by: emilio
2017-09-10 16:42:06 +02:00
Boris Zbarsky
385e34acee Avoid array overallocation when parsing background shorthand. r=xidorn
This is part 2 of the fix for Gecko bug 1397614
<https://bugzilla.mozilla.org/show_bug.cgi?id=1397614>
2017-09-09 10:55:59 -04:00
Boris Zbarsky
26b39241f9 Box gradients and rects in Image. r=xidorn
Gradients and rects are rare, and large.  Image is much smaller with them boxed.

This is part of of the fix for Gecko bug 1397614
<https://bugzilla.mozilla.org/show_bug.cgi?id=1397614>
2017-09-09 10:55:58 -04:00
bors-servo
91b748ec22 Auto merge of #18428 - emilio:find-push, r=nox
style: remove selector_map::find_push.

It has a single caller and is overly generic, which is going to make harder to
add fallible allocations to 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/18428)
<!-- Reviewable:end -->
2017-09-09 07:56:35 -05:00
bors-servo
40c8a6389a Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdm
"javascript:" urls: execute in correct global scope

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

#### Summary

This pull request makes `javascript:` urls execute in the correct global scope.

#### Example

```html
<script> var x = 4; </script>

<!-- this branch: logs "4" -->
<!-- master: undefined variable error -->
<a href="javascript:console.log(x)">link</a>
```

#### Questions

I'm new to servo and rust, so I'm unsure about these changes. In particular:
  * What's the appropriate place to evaluate the js?
    * I moved it to `handle_navigate`, but I'm not sure if this will catch all occurrences of `javascript:` urls. I also don't know if this will execute in the correct thread and the correct window.
  * What should I do with the result of the js evaluation?
    * I just ignored it. The previous behavior displayed it as the content of a new page load.

---
<!-- 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 #15147, #16718

<!-- 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/17083)
<!-- Reviewable:end -->
2017-09-09 04:39:43 -05:00
Emilio Cobos Álvarez
0a1a134050
style: remove selector_map::find_push.
It has a single caller and is overly generic, which is going to make harder to
add fallible allocations to it.
2017-09-09 09:56:09 +02:00
bors-servo
c0c43da1f9 Auto merge of #18426 - hiikezoe:transition-shorthand, r=xidorn,boris
Transition shorthand fix

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

https://bugzilla.mozilla.org/show_bug.cgi?id=1397122
---
- [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/18426)
<!-- Reviewable:end -->
2017-09-08 22:11:50 -05:00
bors-servo
8065eac0eb Auto merge of #18423 - emilio:more-stale-todos, r=nox
More stale todos

Just removing or rewording stale stuff.

<!-- 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/18423)
<!-- Reviewable:end -->
2017-09-08 21:09:58 -05:00
sendilkumarn
8b33e0f60e moving to oncecell
adding oncecell for JS references

removing option<JS<T>> to <JS<T>>

changing return types

removing get method and refactoring the function

changing getElements method

lint fixes

moving to default

simplifying return

ordering

Removing elements

linting
2017-09-09 05:56:25 +05:30
Hiroyuki Ikezoe
aad63f241c Handle values as valid in single transition shorthand even if the transition-property is 'none'.
A single transition value that includes 'none' for transition-property is
valid, so we should store whole specified values (if it's valid).  Whereas,
the spec [1] clearly says for the case where there are multiple entries;
  If there is more than one <single-transition> in the shorthand, and any of
  the transitions has none as the <single-transition-property>, then the
  declaration is invalid.

'none 2s linear 2s' is a test case for the former, '1s width, 2s none' is a
test case for the latter.

Note that with this patch, 'transition: none' is serialized as 'none 0s ease 0s'
instead of 'none' but it matches Gecko.

[1] https://drafts.csswg.org/css-transitions/#single-transition

MozReview-Commit-ID: 3o3z5GFyMqh
2017-09-09 09:00:55 +09:00
Hiroyuki Ikezoe
42873abe84 Simplify transition-property parser. 2017-09-09 09:00:22 +09:00
Emilio Cobos Álvarez
56282f4fab
style: Reword a TODO in the stylesheet invalidation code.
We already run that for removals.
2017-09-09 00:10:00 +02:00
Emilio Cobos Álvarez
d5a24b79d9
style: Remove another stale todo in animation.rs
There's no mutex anymore.
2017-09-09 00:09:59 +02:00
Emilio Cobos Álvarez
7f2a9478f0
style: Minimal cleanup in bloom.rs 2017-09-09 00:09:58 +02:00
Emilio Cobos Álvarez
caa83fc421
style: Remove another stale todo.
This was fixed by me in 1e6999b02b.
2017-09-09 00:09:56 +02:00
bors-servo
9c0abfea23 Auto merge of #18422 - emilio:stale-todo, r=bholley
style: Remove stale todo about handling scrollbars in viewport units.

This is effectively not going to happen, per
https://github.com/w3c/csswg-drafts/issues/1766

<!-- 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/18422)
<!-- Reviewable:end -->
2017-09-08 16:30:26 -05:00
Emilio Cobos Álvarez
9a55b1e469
style: Remove stale todo about handling scrollbars in viewport units.
This is effectively not going to happen, per
https://github.com/w3c/csswg-drafts/issues/1766
2017-09-08 23:24:12 +02:00
bors-servo
2b73735539 Auto merge of #18413 - Manishearth:bump-au, r=jdm
Bump app_units; use from_f64_au

<!-- 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/18413)
<!-- Reviewable:end -->
2017-09-08 14:06:26 -05:00
tigercosmos
3877e9162f fix observer comparing and test 2017-09-09 03:00:42 +08:00
bors-servo
867d542261 Auto merge of #18370 - pylbrecht:observer, r=ferjm
An observer disconnected after a mark must receive the mark

<!-- Please describe your changes on the following line: -->
I worked on top of #18283 as suggested [here](https://github.com/servo/servo/issues/18284#issuecomment-326043873).

r? @ferjm

<!-- 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 #18284 (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/18370)
<!-- Reviewable:end -->
2017-09-08 13:04:26 -05:00
bors-servo
fef2cfde8c Auto merge of #18341 - ferjm:bug1384225.media.errors, r=jdm
stylo: Error reporting for unknown media features

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1384225](https://bugzilla.mozilla.org/show_bug.cgi?id=1384225)

<!-- 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/18341)
<!-- Reviewable:end -->
2017-09-08 11:14:51 -05:00
P. Albrecht
354ed65c21 Observer receives pending marks before removed 2017-09-08 15:36:43 +02:00
bors-servo
84ac9f384a Auto merge of #18418 - servo:tasks, r=emilio
Simplify some task-related 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/18418)
<!-- Reviewable:end -->
2017-09-08 06:01:22 -05:00
Fernando Jiménez Moreno
337a90329c stylo: Error reporting for unknown media features 2017-09-08 12:48:50 +02:00
Anthony Ramine
0c33d6168e Panic from the default impl of Runnable::handler
This will allow us to make sure that tasks using main_thread_handler don't
actually get consumed through a call to the bare handler method.
2017-09-08 10:21:28 +02:00
Anthony Ramine
53d30d85b3 Reformat some task-related functions 2017-09-08 10:19:06 +02:00
Anthony Ramine
35a7252254 Kill UserInteractionTask
Just use a bare Runnable value.
2017-09-08 10:17:23 +02:00
Anthony Ramine
9252f2b8a2 Kill DOMManipulationTask
Just use a bare Runnable value.
2017-09-08 10:06:18 +02:00
Manish Goregaokar
489bbb849a Bump app_units; use from_f64_au 2017-09-08 00:37:25 -07:00
bors-servo
44072163eb Auto merge of #18417 - emilio:grid-gap-shorthand, r=heycam
style: Stop the grid shorthand from resetting grid-gap properties.

Bug: 1387410
Reviewed-by: heycam
MozReview-Commit-ID: GxU9YuAUc00

<!-- 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/18417)
<!-- Reviewable:end -->
2017-09-08 01:30:07 -05:00
Emilio Cobos Álvarez
7bf6b528b1
style: Stop the grid shorthand from resetting grid-gap properties.
Bug: 1387410
Reviewed-by: heycam
MozReview-Commit-ID: GxU9YuAUc00
2017-09-08 08:24:53 +02:00
bors-servo
dfc38fabdc Auto merge of #18404 - nnethercote:measure-PropertyDeclaration, r=heycam
Measure PropertyDeclaration better.

This increases the style-sheets counts for gmail by about 30 MiB.

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

r? @heycam

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because code is tested on the Gecko side.

<!-- 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/18404)
<!-- Reviewable:end -->
2017-09-08 00:22:05 -05:00
Nicholas Nethercote
0ee32cc8c5 Measure PropertyDeclaration better.
This increases the style-sheets counts for gmail by about 30 MiB.
2017-09-08 13:36:06 +10:00
bors-servo
c8bc6ca420 Auto merge of #18409 - BorisChiou:stylo/calc/unit, r=emilio
Keep the unit of the serialization of specified::CalcLengthOrPercentage.

For the serialization of specified values of calc(), we should keep the
units of absolute lengths, so use AbsoluteLength.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1396692](https://bugzilla.mozilla.org/show_bug.cgi?id=1396692).
- [X] These changes do not require tests because we have wpt tests for this already.

<!-- 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/18409)
<!-- Reviewable:end -->
2017-09-07 21:34:28 -05:00
Daniel Johnson
709cd3a0b6 "javascript:" urls: remove unnecessary block
Remove this block and unindent the code one level.

Doing this required cloning `load_data.url` so that we could
later mutate `load_data.url` in the same block.
2017-09-07 17:03:41 -07:00
bors-servo
e9336b39a6 Auto merge of #18411 - servo:rename-preshint-method, r=emilio
Rename VirtualMethods::attribute_is_mapped

<!-- 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/18411)
<!-- Reviewable:end -->
2017-09-07 15:56:01 -05:00
bors-servo
867a982fa7 Auto merge of #18407 - servo:kill-is-cancelled, r=emilio
Kill Runnable::is_cancelled ⚔️

<!-- 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/18407)
<!-- Reviewable:end -->
2017-09-07 14:53:35 -05:00
bors-servo
8868d2223d Auto merge of #18412 - bholley:bump_style_stacks, r=bholley
Increase stack safety margin for stylo

https://bugzilla.mozilla.org/show_bug.cgi?id=1395708

<!-- 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/18412)
<!-- Reviewable:end -->
2017-09-07 13:52:48 -05:00
Bobby Holley
f3abbb4ee3 Increase stack safety margin for stylo.
MozReview-Commit-ID: Fv9DttU20hM
2017-09-07 11:44:45 -07:00