Commit graph

796 commits

Author SHA1 Message Date
Ms2ger
06a1d04ca6 Move LengthOrPercentageOrAuto to style::attr. 2016-06-06 08:54:34 +02:00
Ms2ger
1c65ce8f36 Deny unsafe code in some more modules. 2016-06-04 18:07:16 +02:00
Bobby Holley
decf8c40f7
Stop mapping overflow-wrap to mWordWrap.
This was fixed in gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=955857
2016-06-01 14:07:04 +02:00
Emilio Cobos Álvarez
abf8ced0bf
stylo: Support linear-gradients as background-image 2016-06-01 14:07:04 +02:00
bors-servo
8caa17a466 Auto merge of #11445 - mbrubeck:line-height, r=emilio
Support line-height in geckolib

r? @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11445)
<!-- Reviewable:end -->
2016-06-01 05:58:56 -05:00
bors-servo
f0b3d1e77d Auto merge of #11417 - stshine:flex-longhand-properties, r=mbrubeck
Support remaining longhand flexbox style properties for servo

- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy --faster` does not report any errors
- [X] There are tests for these changes

Add the remaining longhand CSS properties of flexbox for servo,
including `flex-wrap`, `flex-grow`, `flex-shrink`, `justify-content`,
`align-items`, `align-self` and `align-content`.

Tests for the remaining longhand properties are also enabled. Test for
default value of `align-self` is modified because the new default value
for this property is "auto" is current flexbox CR.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11417)
<!-- Reviewable:end -->
2016-05-31 21:44:06 -05:00
Pu Xingyu
f4b8f9766c Fixup for align-self and tests
This is a fixup for `align-self`, the computed value of which should now
properly inherit `align-items` value of its parent. Additional passed
tests is also removed from ini folder. Fixup for geckolib errors.
2016-06-01 00:15:28 +08:00
Mitchell Hentges
41d26700b2 Allow either comma or space seperated css rect() 2016-05-30 20:13:18 +02:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Matt Brubeck
1389fbe6ff Support line-height in geckolib 2016-05-26 11:51:25 -07:00
bors-servo
73b4042bb3 Auto merge of #11412 - heycam:text-deco, r=mbrubeck
Support remaining text-decoration related properties in geckolib

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 --faster` 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 mostly it's geckolib-only, and the servo-relevant changes should be covered by existing tests

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

----

Not sure if there's a better way to do the loop in the text-decoration(-line) longhand parsing, having all of the guts in the loop condition is a bit awkward.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11412)
<!-- Reviewable:end -->
2016-05-25 20:35:50 -05:00
Cameron McCormack
0580e1854e Support text-decoration-line and the text-decoration shorthand in geckolib. 2016-05-26 11:06:37 +10:00
Cameron McCormack
53a9defa9f Don't consume invalid idents when parsing text-decoration. 2016-05-26 11:06:30 +10:00
bors-servo
92ae502765 Auto merge of #11427 - mbrubeck:under-display-none, r=pcwalton
Stop generating flows under display: none.

Because this is a bottom-up traversal it can generates flows and throw them away. To prevent that, this cascades an internal `-servo-under-display-none` property and then checks that during flow construction.  Fixes #1536.

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11427)
<!-- Reviewable:end -->
2016-05-25 18:29:48 -05:00
bors-servo
6c08c570bf Auto merge of #11399 - heycam:parent-style, r=pcwalton
Look past restyle root for parent node when restyling.

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 --faster` 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 existing tests should be sufficient

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

----

Currently when traversing a the tree to restyle, we look at whether a
given element to restyle is the root.  This seems to always be the root
of the entire document, since we start our processing from the top.  If
the current element being restyled is the root of the restyle, then we
use None as the parent node for restyling purposes.

In stylo we want to invoke restyling starting from an arbitrary node in
the document, not just the root of the document, so this change looks
for the parent element regardless of whether we're at the root of the
restyle.

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11399)
<!-- Reviewable:end -->
2016-05-25 15:36:51 -05:00
Matt Brubeck
5c09e26e55 Stop generating flows under display: none.
Because this is a bottom-up traversal it can generates flows and throw them away. To prevent that, this cascades an internal `-servo-under-display-none` property and then checks that during flow construction.  Fixes #1536.
2016-05-25 11:54:21 -07:00
bors-servo
7ad3c313d3 Auto merge of #11401 - heycam:moz-box, r=mbrubeck
Support display:-moz-(inline-)box in geckolib.

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 --faster` 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 they are geckolib-only changes

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

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11401)
<!-- Reviewable:end -->
2016-05-25 13:49:23 -05:00
bors-servo
116faa7617 Auto merge of #11376 - creativcoder:update-string-cache, r=nox
Bump string-cache to 0.2.18

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy --faster` does not report any errors
- [X] These changes do not require tests because its a crate version bump.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11376)
<!-- Reviewable:end -->
2016-05-25 10:13:29 -05:00
Pu Xingyu
a7733b38d4 Add remaining longhand flexbox style properties
Add the remaining longhand CSS properties of flexbox for servo,
including `flex-wrap`, `flex-grow`, `flex-shrink`, `justify-content`,
`align-items`, `align-self` and `align-content`.

tests for the remaining longhand properties are also enabled. Test for
default value of `align-self` is modified because the new default value
for this property is "auto" is current flexbox CR.
2016-05-25 21:40:34 +08:00
Rahul Sharma
6a0dde6485 Bump string-cache to 0.2.18 2016-05-25 14:35:36 +05:30
Cameron McCormack
61fd5e79f7 Make text-decoration-style initial value 'solid'. 2016-05-25 18:25:28 +10:00
David Raifaizen
f6bbeae67f Removing unnecessary field from serialization css enum 2016-05-25 09:25:36 +02:00
David Raifaizen
3dafd558c5 Changing update_inline_style to process multiple declarations at once to handle shorthand serialization better 2016-05-25 09:25:35 +02:00
David Raifaizen
f38607967e Fixing python to_css codegen error 2016-05-25 09:25:34 +02:00
Simon Sapin
dc829da07e Less cloning and dynamic dispatch. 2016-05-25 09:25:33 +02:00
David Raifaizen
7d7aac212b Shorthand serialization now takes iterators instead of array slice as argument 2016-05-25 09:25:32 +02:00
David Raifaizen
be2f70393f Adding more efficient way of determining if PropertyDeclaration is important 2016-05-25 09:25:31 +02:00
David Raifaizen
51e642e875 Converted serialization methods to implement the to_css trait, writing to string buffers to save string allocations for every result 2016-05-25 09:25:29 +02:00
David Raifaizen
0985d7563f Making fixes based on suggestions from nox and SimonSapin 2016-05-25 09:24:10 +02:00
David Raifaizen
feff32c4ab For Shorthand impl, added to_name method and copied serialize_shorthand
from cssstyledeclaration.rs file

For PropertyDeclaration impl, added shorthands method to get the shorthands associated
with the current longhand

For PropertyDeclarationBlock impl, added serialize algorithm
2016-05-25 09:24:04 +02:00
Cameron McCormack
cb7f2a1c1b Support display:-moz-(inline-)box in geckolib. 2016-05-25 11:59:33 +10:00
Cameron McCormack
2c9cfae830 Look past restyle root for parent node when restyling.
Currently when traversing a the tree to restyle, we look at whether a
given element to restyle is the root.  This seems to always be the root
of the entire document, since we start our processing from the top.  If
the current element being restyled is the root of the restyle, then we
use None as the parent node for restyling purposes.

In stylo we want to invoke restyling starting from an arbitrary node in
the document, not just the root of the document, so this change looks
for the parent element regardless of whether we're at the root of the
restyle.
2016-05-25 11:52:42 +10:00
bors-servo
2a2b88f42c Auto merge of #11287 - heycam:moz-binding, r=bholley
Support -moz-binding in geckolib

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 --faster` 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 changes target stylo

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11287)
<!-- Reviewable:end -->
2016-05-24 14:41:04 -07:00
Keith Yeung
c93ed39f33 Parse HTMLInputElement attributes 2016-05-24 10:12:18 -04:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Cameron McCormack
e75b1c3b32 Re-use Url serialization in values::specified::Image. 2016-05-24 12:12:39 +10:00
Cameron McCormack
44bdbed989 Support -moz-binding in geckolib. 2016-05-24 12:12:34 +10:00
Cameron McCormack
6d67aa8a01 Pass Gecko sheet base/referrer/principal from Servo_StylesheetFromUTF8Bytes through ParserContext. 2016-05-24 12:12:17 +10:00
Cameron McCormack
bb85f5faf0 Add an extra data field to ParserContext.
This will be used for passing Gecko-specific information through
the CSS parser in stylo.
2016-05-24 12:12:10 +10:00
Keith Yeung
b2ae32917b Update string_cache to 0.2.17 2016-05-23 09:19:14 -04:00
Keith Yeung
6d7b3a4c55 Add -moz-appearance and include nsThemeConstants.h in struct.rs 2016-05-20 04:53:15 -04:00
Keith Yeung
5170f46455 Add -moz-float-edge 2016-05-19 13:42:55 -04:00
bors-servo
f02c4c6403 Auto merge of #11240 - mbrubeck:font-style, r=bholley
Support font-style in geckolib

r? @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11240)
<!-- Reviewable:end -->
2016-05-18 13:12:55 -07:00
Bobby Holley
b521c293dc Add string_cache override for geckolib based on gecko atoms.
The work in these patches is based on Ms2ger's gecko-atom crate.
2016-05-18 11:33:38 -07:00
Matt Brubeck
8cab1d6948 Support font-style in geckolib 2016-05-17 16:59:39 -07:00
bors-servo
6c08ad857e Auto merge of #11191 - servo:bitflags, r=pcwalton
Update bitflags to 0.7

- [x] https://github.com/servo/cocoa-rs/pull/126 https://github.com/servo/cocoa-rs/pull/127 https://github.com/servo/cocoa-rs/pull/128 https://github.com/servo/glutin/pull/91
- [x] https://github.com/cyderize/rust-websocket/pull/78
- [x] https://github.com/sfackler/rust-openssl/pull/393
- [x] https://github.com/PistonDevelopers/image-png/pull/36
- [x] https://github.com/servo/rust-selectors/pull/87
- [x] https://github.com/vberger/wayland-kbd/pull/12
- [x] https://github.com/vberger/wayland-client-rs/pull/50
- [x] https://github.com/netvl/xml-rs/pull/122 https://github.com/netvl/xml-rs/pull/123

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11191)
<!-- Reviewable:end -->
2016-05-17 15:43:14 -07:00
bors-servo
e0addae51c Auto merge of #11222 - KiChjang:stylo-keywords, r=bholley
Add -moz-user-* CSS longhands for Gecko

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` does not report any errors
- [x] These changes do not require tests because stylo

r? @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11222)
<!-- Reviewable:end -->
2016-05-17 14:57:32 -07:00
Anthony Ramine
b9cda99ca5 Update internal crates to bitflags 0.7 2016-05-17 23:34:04 +02:00
Anthony Ramine
d580226a9c Reorder dependencies in many Cargo.toml files 2016-05-17 23:34:02 +02:00