Commit graph

18505 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
8c4b401dd3
style: Only expose longhands to rust via iterators.
The key here is that we only filter longhands if the shorthand is accessible to
content and vice-versa. This prevents the bug that prevented me to land this
patch before, which was us not expanding properly chrome-only shorthands.

Again, this is incomplete, and I need to teach LonghandsToSerialize to get a
potentially incomplete list of properties, and all that.
2018-02-28 00:19:31 +01:00
Emilio Cobos Álvarez
650e947c94
style: Make Servo deal with CSS property prefs more correctly.
Right now you could still set preffed-off properties from CSSStyleDeclaration.
2018-02-27 19:29:07 +01:00
bors-servo
030509e66b
Auto merge of #20131 - servo:moz-tab-size, r=emilio
Replace NonNegativeLengthOrNumber by a specific type for -moz-tab-size

This is the only use of this type.

<!-- 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/20131)
<!-- Reviewable:end -->
2018-02-27 12:17:43 -05:00
Emilio Cobos Álvarez
d016278159
style: Remove unused function. 2018-02-27 13:07:37 +01:00
Emilio Cobos Álvarez
17257f94b9
style: Split out NonCustomPropertyId::enabled_for_all_content from allowed_in. 2018-02-27 13:07:36 +01:00
bors-servo
a7f38f0f32
Auto merge of #20133 - emilio:kill-xbl, r=xidorn
style: Make Shadow DOM not use XBL anymore.

Bug: 1425759
Reviewed-by: xidorn
MozReview-Commit-ID: Jf2iGvLC5de

<!-- 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/20133)
<!-- Reviewable:end -->
2018-02-27 05:47:29 -05:00
Anthony Ramine
27732c7dbb Replace NonNegativeLengthOrNumber by a specific type for -moz-tab-size
This is the only use of this type.
2018-02-27 11:26:52 +01:00
Emilio Cobos Álvarez
a5957fadf6
style: Update bindings. 2018-02-27 11:14:19 +01:00
Emilio Cobos Álvarez
cfbdf3d694
style: Make Shadow DOM not use XBL anymore.
More improvements to come. In particular, this still iterates through Shadow DOM
in each_xbl_cascade_data, but that should be changed later. That allows to
cleanup a bunch of stuff and finally fix Shadow DOM cascade order.

We still rely on the binding parent to be setup properly in the shadow tree, but
that requirement can go away later (we can walk the containing shadow chain
instead).

This mostly focuses on removing the XBL binding from the Shadow host.

It'd be nice to do EnumerateShadowRoots faster. I think that should also be a
followup, if needed.

Bug: 1425759
Reviewed-by: xidorn
MozReview-Commit-ID: Jf2iGvLC5de
2018-02-27 11:14:18 +01:00
bors-servo
ac162e8f72
Auto merge of #20012 - alexfjw:avoid_Window-GetComputedStyle_when_checking_for_display-none, r=emilio
Avoid `Window::GetComputedStyle` when checking for `display: none`

<!-- Please describe your changes on the following line: -->
Refactored Window::GetComputedStyle to use Element::Style.

Not sure which tests are relevant, but I've ran the dom, fetch & 2dcontext wpt tests. They don't seem to give errors.

---
<!-- 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 #19885.

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

<!-- 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/20012)
<!-- Reviewable:end -->
2018-02-27 04:52:05 -05:00
bors-servo
b6bd719c5d
Auto merge of #20058 - Eijebong:rayon1.0, r=jdm
Bump rayon to 1.0

<!-- 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/20058)
<!-- Reviewable:end -->
2018-02-27 00:10:51 -05:00
bors-servo
6df0dc5b27
Auto merge of #20124 - servo:perspective, r=emilio
Replace LengthOrNone by a specific type for the perspective property

<!-- 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/20124)
<!-- Reviewable:end -->
2018-02-26 16:35:32 -05:00
Anthony Ramine
260e05320c Replace LengthOrNone by a specific type for the perspective property
This was its only use, and it was bugged: AFAIK this didn't properly
clamp animated values below 0.
2018-02-26 22:32:06 +01:00
Anthony Ramine
4a98fa70bf Streamline parsing of NonNegativeLengthOrNumber a bit 2018-02-26 22:11:17 +01:00
Anthony Ramine
f10e485740 Remove 2 unused type aliases 2018-02-26 16:40:19 +01:00
Anthony Ramine
f097dfad59 Reorder some stuff in gecko.mako.rs 2018-02-26 15:38:30 +01:00
Anthony Ramine
e2a6d07dad Remove TransitionProperty::All 2018-02-26 14:30:53 +01:00
Alex Fong
8d09398230 Avoid Window::GetComputedStyle when checking for display: none 2018-02-26 19:07:04 +08:00
Emilio Cobos Álvarez
28ea593347
style: Make a style sharing check account for Shadow DOM explicitly too.
Good I added tests for this (style-sharing-across-shadow.html).

Bug: 1425759
Reviewed-by: xidorn
MozReview-Commit-ID: 7d4WioCDAn7
2018-02-26 11:40:28 +01:00
Emilio Cobos Álvarez
07f86404cd
style: Make the simplified children iterator check account for Shadow DOM on its own.
We are relying in the XBL binding for the shadow host, we need to check
explicitly.

Also, we were checking in_shadow_tree, which is really broad. Just
is_html_slot_element should do, since the rest of the nodes should have only
light tree children.

Bug: 1425759
Reviewed-by: xidorn
MozReview-Commit-ID: KAFRVxaLsK
2018-02-26 11:40:13 +01:00
bors-servo
7de2043b9c
Auto merge of #20036 - paavininanda:BrowsingNames, r=jdm
Browsing context names

<!-- 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://github.com/servo/servo/issues/14453

<!-- 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/20036)
<!-- Reviewable:end -->
2018-02-25 21:26:08 -05:00
paavininanda
b9f7aa4686 Adding Name and SetName functions for window 2018-02-26 07:38:41 +05:30
bors-servo
b699dfac8b
Auto merge of #20115 - janvi-palan:NoNetworkConnForHtmlListMedia, r=emilio
Dont make a network request when the media attribute of a link element is modified

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this needs to be tested manually

<!-- 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/20115)
<!-- Reviewable:end -->
2018-02-24 19:04:46 -05:00
Emilio Cobos Álvarez
a2382483f0
style: Remove useless dereferencing. 2018-02-24 23:26:55 +01:00
Emilio Cobos Álvarez
13f61a6e5f
style: Indent properly a couple more functions. 2018-02-24 23:23:16 +01:00
Emilio Cobos Álvarez
a6c6ef91e0
style: Reference #20116 from a few places. 2018-02-24 22:49:32 +01:00
Emilio Cobos Álvarez
76dd4ae05e
style: Reindent yet another function. 2018-02-24 22:45:53 +01:00
Emilio Cobos Álvarez
f2a808ad58
style: Break needs_animations_update into pieces.
To hopefully make some sense out of it.
2018-02-24 22:45:51 +01:00
Emilio Cobos Álvarez
e30a4d2ad2
style: return early in needs_animations_update. 2018-02-24 22:45:49 +01:00
Emilio Cobos Álvarez
e5bd8fc5d8
style: Return early instead of indenting in animation code.
And also leave some WTF comments, because they make no sense so far.
2018-02-24 22:45:46 +01:00
Emilio Cobos Álvarez
e77dd773d8
style: Other miscellaneous cleanup. 2018-02-24 22:45:45 +01:00
Emilio Cobos Álvarez
23d9462d23
style: Remove unused and somewhat dubious GeckoElement::set_data. 2018-02-24 22:45:44 +01:00
Emilio Cobos Álvarez
601a351632
style: Remove some get_ prefixes from Gecko functions. 2018-02-24 22:45:43 +01:00
Emilio Cobos Álvarez
f2efd04a5d
style: Make Element::id not clone the attribute. 2018-02-24 22:45:43 +01:00
Emilio Cobos Álvarez
98c9292ecb
style: Remove get_ prefix from get_state and get_id. 2018-02-24 22:45:42 +01:00
Emilio Cobos Álvarez
b8fb41da0c
style: Remove get_css_transitions_info and might_need_transition_update_per_property from TElement.
They're only called from wrapper.rs, there's no need to expose them in the
common trait.
2018-02-24 22:45:41 +01:00
Emilio Cobos Álvarez
607cf5aa3c
style: Remove the get_ prefix from get_smil_override, and other animation stuff. 2018-02-24 22:45:41 +01:00
Emilio Cobos Álvarez
c5bfc81b74
style: Remove get_animation_rule_by_cascade.
It's pretty useless.
2018-02-24 22:45:40 +01:00
Emilio Cobos Álvarez
8d34aacb3b
style: Remove some useless explicit dereferencing. 2018-02-24 22:45:39 +01:00
Emilio Cobos Álvarez
adf1c9fcfd
selectors: Indent two function declarations. 2018-02-24 22:45:39 +01:00
Emilio Cobos Álvarez
7ab4b21bc3
selectors: Remove the get_ prefix from get_local_name and get_namespace. 2018-02-24 22:45:38 +01:00
Emilio Cobos Álvarez
da99f159f4
style: Add a shadow root accessor.
I'm going to use it in a bit.
2018-02-24 20:29:36 +01:00
janvipalan
cef24def1a removed the media match case from the attribute_mutated fn 2018-02-25 00:02:33 +05:30
Bastien Orivel
fae2d9839f Bump rayon to 1.0 2018-02-24 13:50:03 +01:00
Pyfisch
23fcd3a850 Rebase and fix innerText 2018-02-24 10:56:11 +01:00
Pyfisch
bc87b41db3 Remove image_data from tests.
Store multiple indexable text items for a node.
2018-02-24 10:56:11 +01:00
Pyfisch
0d0f2abf12 Move calculation functions out of builder.rs 2018-02-24 10:56:11 +01:00
Pyfisch
8d061118c4 Remove now unnecessary fix_gradient_stops function
Webrender solved the issue with servo/webrender#1189.
2018-02-24 10:36:10 +01:00
Pyfisch
2d74bcfea5 Introduce a dedicated data structure for text queries
Add an IndexableText structure for text queries.
Instead of linear search for a node this now uses a HashMap.
Remove the now irrelevant fields from TextDisplayItem.
2018-02-24 10:36:10 +01:00
Pyfisch
a5115139ba Remove image_data field from display item
It was unused.
2018-02-24 10:36:10 +01:00