Commit graph

1384 commits

Author SHA1 Message Date
Xidorn Quan
09cbe3bce0 Make style context use parking_lot::RwLock 2016-11-02 10:10:11 +11:00
Bobby Holley
d252c8e42a Implement AtomicRef::map.
MozReview-Commit-ID: 8iOALQylOuK
2016-11-01 20:39:51 +01:00
Bobby Holley
fb70ee2c0c Drop style data from descendants on display:none.
MozReview-Commit-ID: 8ls43oAGWRg
2016-11-01 11:03:04 -07:00
Bobby Holley
1a5e2b4673 Eliminate RestyleResult.
The new incremental restyle algorithm will make traversal decisions in a more
centralized way.

MozReview-Commit-ID: GH6gFt4VUJO
2016-11-01 11:03:04 -07:00
Bobby Holley
71b9004d86 Replace begin_styling with a centralized mechanism to set a node up for either styling or restyling.
We also make sure that an element never has an ElementData with ElementDataStyles::Uninitialized,
and eagerly call prepare_for_styling whenever an ElementData is instantiated.

MozReview-Commit-ID: 9YP6eSmdMt0
2016-11-01 11:03:04 -07:00
Bobby Holley
b98bb241dc Implement dump() for gecko nodes.
MozReview-Commit-ID: I1G65zpQoOm
2016-11-01 11:03:04 -07:00
Daan Sprenkels
66059904b7 Remove extra spaces in function calls and declarations 2016-10-31 18:11:37 +01:00
Bobby Holley
833af4521a Regenerate bindings for mozilla-central rev e3279760cd977aac30bd9e8032d3ee71f55d2a67. 2016-10-30 15:25:40 -07:00
bors-servo
398f505ace Auto merge of #13974 - heycam:rm-bindgen-option, r=emilio
Stop passing now-unrecognized --no-type-renaming to rust-bindgen.

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

r? @emilio

---
<!-- 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
- [ ] These changes do not require tests because _____

<!-- 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/13974)
<!-- Reviewable:end -->
2016-10-29 22:26:10 -05:00
bors-servo
357e746a9a Auto merge of #13908 - aethanyc:add-border-width-keyword, r=emilio
Use enum BorderWidth as SpecifiedValue

Use enum BorderWidth instead of a tuple-like struct to store the specified
value. BorderWidth is needed to be used in both longhand and shorthand
border width properties, so I put it in `specified` module.

Fixed #13869.

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

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

<!-- 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/13908)
<!-- Reviewable:end -->
2016-10-29 19:48:27 -05:00
Bobby Holley
be89f73675 Rename NodeData and associated data structures to Element*.
MozReview-Commit-ID: 96VsmsoZtjZ
2016-10-29 14:58:07 -07:00
Bobby Holley
5442fbec3f Hoist most styling functionality from TNode to TElement.
MozReview-Commit-ID: DZ8ZrsZIiAU
2016-10-29 13:45:40 -07:00
Mateusz 'Haggus' Mrowiec
41b003fc30 Implement column-fill 2016-10-29 21:04:01 +02:00
Cameron McCormack
99cd19e410 Stop passing now-unrecognized --no-type-renaming to rust-bindgen. 2016-10-29 17:50:05 +08:00
bors-servo
c6ef48ccc1 Auto merge of #13950 - bheart:parse-font-language-override-property, r=emilio
Implement parsing for font-language-override property

Implement and test parsing of the `font-language-override` style property.

---
<!-- 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 #13874
- [x] There are tests for these changes

<!-- 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/13950)
<!-- Reviewable:end -->
2016-10-28 11:23:39 -05:00
bors-servo
09d4ba25a7 Auto merge of #13960 - servo:selectorsup, r=nox
Update to selectors 0.14

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

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

<!-- 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/13960)
<!-- Reviewable:end -->
2016-10-28 09:27:28 -05:00
Simon Sapin
465efd784c Update to selectors 0.14 2016-10-28 15:56:37 +02:00
Will Tange
4a9c3cec5c Parse font-language-override style property 2016-10-28 15:25:02 +02:00
bors-servo
a27d54e07f Auto merge of #13786 - heycam:background-image, r=Manishearth
support url() values in background-image, mask-image and list-style-image in stylo

<!-- Please describe your changes on the following line: -->
Corresponding Gecko bugs, where @Manishearth has given r+s:

* https://bugzilla.mozilla.org/show_bug.cgi?id=1288302
* https://bugzilla.mozilla.org/show_bug.cgi?id=1310463

(Sorry for the large structs_{debug,release}.rs changes; I thought it was too much trouble to disentangle the useless changes from the legitimate ones.)

Holding off on landing this until the Gecko patches are reviewed and landed.

---
<!-- 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 I've tested the stylo functionality manually and we can rely on Gecko's existing tests going forward

<!-- 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/13786)
<!-- Reviewable:end -->
2016-10-28 07:16:30 -05:00
Cameron McCormack
e65bbdee01 Support list-style-image in stylo. r=manishearth
MozReview-Commit-ID: HyGWZevQYEo
2016-10-28 19:31:07 +08:00
Cameron McCormack
f491f61bb3 Regenerate bindings.
MozReview-Commit-ID: JqgkZ4zjQER
2016-10-28 19:29:02 +08:00
Cameron McCormack
2d232cecb2 Support url() values in background-image and mask-image in stylo. r=manishearth
MozReview-Commit-ID: 7IUzzVV9rOi
2016-10-28 19:29:01 +08:00
Cameron McCormack
df4194154e Regenerate bindings.
MozReview-Commit-ID: LTpO8Kt3ALk
2016-10-28 19:28:59 +08:00
bors-servo
0193f987f6 Auto merge of #13937 - iamrohit7:font-synthesis, r=emilio
Implements parser/serialization for font-synthesis

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

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

<!-- 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/13937)
<!-- Reviewable:end -->
2016-10-28 06:09:27 -05:00
Rohit Burra
690cf65a85 Implements parser/serializer for font-synthesis 2016-10-28 15:02:15 +05:30
bors-servo
b4a882f81a Auto merge of #13914 - TooManyBees:13894-use-graphemes, r=emilio
13894 Use graphenes in text-emphasis-style

<!-- Please describe your changes on the following line: -->
Use `unicode_segmentation` crate to truncate strings on grapheme boundaries.

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

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

<!-- 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/13914)
<!-- Reviewable:end -->
2016-10-27 15:58:17 -05:00
bors-servo
87ef548717 Auto merge of #13934 - bholley:skip_text_nodes, r=emilio
Only traverse elements from style

This is part of the new incremental restyle architecture work. I have patches to element-ify things more, but want to get this in the tree first.

<!-- 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/13934)
<!-- Reviewable:end -->
2016-10-27 12:32:45 -05:00
Bobby Holley
2fce2fbb0c Move all *MatchMethods to TElement.
MozReview-Commit-ID: 3V6JIlOVVhw
2016-10-27 10:22:33 -07:00
Bobby Holley
1090abae87 Don't traverse text nodes during styling.
MozReview-Commit-ID: 6CtQMxbcLnF
2016-10-27 10:22:32 -07:00
Bobby Holley
1cfd5e8172 Hoist RestyleDamage onto TElement.
Instead of maintaining a dummy restyle damage field for text nodes, we can just
perform the necessary parent inheritance and is_changed adjustments on the fly
in ThreadSafeLayoutNode, simplifying the requirements on the style system.

MozReview-Commit-ID: DCqiCRLsLUF
2016-10-27 09:15:36 -07:00
bors-servo
a1dfa0fd85 Auto merge of #13910 - rwakulszowa:font-feature-settings, r=emilio
Font feature settings

<!-- Please describe your changes on the following line: -->
Implement parsing/serialization for font-feature-settings

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

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

<!-- 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/13910)
<!-- Reviewable:end -->
2016-10-27 10:48:41 -05:00
Jesse Kipp
06db231f5f 13894 Use Unicode Segmentation's graphemes
Add test with multi-character grapheme

Run cargo update
2016-10-26 18:54:37 -04:00
Patrick Walton
8b138e5e75 style: Remove modify_style_for_anonymous_table_object, now that the
cascade takes care of it.
2016-10-26 14:14:08 -07:00
Patrick Walton
fb2d1e1020 layout: Add a new cascading mode that inherits all properties, even
non-inheritable ones.

This works like the `modify_style_for_*` functions and will allow us to
easily migrate from them to real cascading.
2016-10-26 14:14:01 -07:00
Patrick Walton
93e41ba4aa style: Add some new Servo-specific pseudo-classes for anonymous flows.
This allows us to remove `modify_style_for_anonymous_table_object`.
2016-10-26 14:04:16 -07:00
bors-servo
c8b6ece97b Auto merge of #13913 - bholley:styling_mode, r=emilio
incremental restyle: Introduce StylingMode and deprecate explicit dirtiness

This is another chunk of work to move us toward the new incremental restyle architecture.

Eventually, we'll make a fine-grained decision at each node about what style to recompute based on the RestyleHint on the node data (along with other things). For now, we use the existence of RestyleData as a coarse-grained approximation of this.

<!-- 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/13913)
<!-- Reviewable:end -->
2016-10-26 06:36:06 -05:00
Ting-Yu Lin
0fc38f79d6 Use enum BorderWidth as SpecifiedValue
Use enum BorderWidth instead of a tuple-like struct to store the specified
value. BorderWidth is needed to be used in both longhand and shorthand
border width properties, so I put it in `specified` module.

Fixed #13869.
2016-10-26 16:24:12 +08:00
bors-servo
3c16dde1f2 Auto merge of #13902 - Wafflespeanut:keyword, r=emilio
Prefer auto-generation for some keyword props

<!-- 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-geckolib` 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? @Manishearth or @emilio

<!-- 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/13902)
<!-- Reviewable:end -->
2016-10-26 02:27:13 -05:00
Ravi Shankar
e7cbd10ece Auto-generate 'image-rendering' using 'single_keyword' 2016-10-26 12:56:11 +05:30
Bobby Holley
05c1f1e016 Introduce StylingMode and deprecate explicit dirtiness.
MozReview-Commit-ID: 5tF075EJKBa
2016-10-26 00:23:18 -07:00
Ravi Shankar
12f429e23b Keyword argument for custom constant mapping 2016-10-26 11:56:54 +05:30
Ravi Shankar
1c34162220 Make use of existing codegen methods for font-* 2016-10-26 11:56:53 +05:30
Ravi Shankar
af8899edf0 Merge keyword and predefined type longhands 2016-10-26 11:56:52 +05:30
rwakulszowa
19463d0904 write optimization 2016-10-25 21:36:19 +02:00
rwakulszowa
d6fa6e453a Use off/- instead of 0/1 when serializing 2016-10-25 20:06:48 +02:00
rwakulszowa
d94496c896 Refactoring; negative tests 2016-10-25 13:55:32 +02:00
Xidorn Quan
3303a978b9 Use nsACString to pass string params for bindings 2016-10-25 18:22:45 +11:00
Xidorn Quan
eeada5ac51 Add as_str_unchecked() to nsACString 2016-10-25 10:21:01 +11:00
rwakulszowa
89020022a3 Fixed 'on' bug, to_css bug; added tests 2016-10-24 18:42:16 +02:00
rwakulszowa
b9e03f3f4b Integer handling; products 2016-10-24 12:19:10 +02:00