Commit graph

163 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
5820e3ecac
Bug 1364412: Convert pseudo-elements to an enum. r=hiro,xidorn 2017-05-16 02:53:41 +02:00
Nathan Froyd
22db4b4823 provide more information when bindgen fails
Providing the flags we passed into clang can be informative for
double-checking that we set everything up correctly.
2017-05-15 17:02:34 -04:00
bors-servo
94ac822132 Auto merge of #16819 - canaltinova:quirk-mode, r=bholley,emilio
stylo: Propagate quirks mode information from Gecko to Servo

r=bholley in bugzilla

---
<!-- 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 [Bug 1360488](https://bugzilla.mozilla.org/show_bug.cgi?id=1360488)

<!-- 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/16819)
<!-- Reviewable:end -->
2017-05-13 20:50:10 -05:00
Nazım Can Altınova
c54d255d07
stylo: Propagate quirks mode information from Gecko to Servo 2017-05-14 01:51:50 +03:00
Hiroyuki Ikezoe
b6b3187efa Make ParsingMode bitflags.
assert_parsing_mode_match() is mostly the same as
assert_restyle_hints_match().
2017-05-14 07:15:19 +09:00
Hiroyuki Ikezoe
fcc50ea421 Rename LengthParsingMode to ParsingMode and LengthParsingMode::SVG to PasingMode::AllowUnitlessLength.
We need another flag that represents allow-negative-number for SMIL, so
this enum will also comprise the another parsing mode that allows negative number.
2017-05-14 07:15:19 +09:00
bors-servo
9be1fead3c Auto merge of #16843 - froydnj:bindgen-cross-compile, r=emilio
explicitly specify bitness for x86 cross-compilation situations

Despite compiling for architecture X, the user may have specified a
clang that defaults to architecture Y.  We need to ensure that we invoke
clang with the correct architecture selection.  We do not use --target
to do this, however, because that runs into problems with LLVM's default
search paths.  For the x86 case, we can simply use -m$BITNESS to select
the correct architecture.

This is not at all a general solution, but it does unblock compiling Stylo for 32-bit Linux on Gecko's infra.

- [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).

<!-- 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/16843)
<!-- Reviewable:end -->
2017-05-13 02:03:19 -05:00
Nathan Froyd
e966d976fc explicitly specify bitness for x86 cross-compilation situations
Despite compiling for architecture X, the user may have specified a
clang that defaults to architecture Y.  We need to ensure that we invoke
clang with the correct architecture selection.  We do not use --target
to do this, however, because that runs into problems with LLVM's default
search paths.  For the x86 case, we can simply use -m$BITNESS to select
the correct architecture.
2017-05-12 14:29:12 -04:00
Emilio Cobos Álvarez
46bf5d61f0
Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:05:39 +02:00
Emilio Cobos Álvarez
7d45aad9b4
Bug 1355343: Move node restyle bits to Element, and add bits for snapshot handling. r=bholley
MozReview-Commit-ID: 6OrUKX5RcBq
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:05:38 +02:00
bors-servo
2a7ef1d203 Auto merge of #16789 - CJKu:bug-1310885-part-2, r=heycam
stylo: Export RefPtr<ImageValue> to stylo.

<!-- Please describe your changes on the following line: -->
This is the second patch in bug 1310885
"Bug 1310885 - Part 2. (stylo) Export RefPtr<ImageValue> from gecko to stylo."

Bugzilla link:
https://bugzilla.mozilla.org/show_bug.cgi?id=1310885
---
<!-- 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 _____

<!-- 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/16789)
<!-- Reviewable:end -->
2017-05-09 23:00:51 -05:00
Matt Brubeck
32d37795a2 Bug 1349651 - stylo: Implement HasAuthorSpecifiedRules. 2017-05-09 10:01:46 -07:00
Fernando Jiménez Moreno
b22e0e9494 Stylo: Bug 1355408 - add support for @-moz-document 2017-05-09 12:52:44 +02:00
cku
7d1ef34698 stylo: Export RefPtr<ImageValue> to stylo. 2017-05-09 16:46:47 +08:00
Nick Fitzgerald
1cfd3ce5d3 Update the style crate's bindgen dependency 2017-05-08 09:32:16 -07:00
bors-servo
a5fe464e4a Auto merge of #16762 - upsuper:buildtime-pseudo, r=emilio
Generate atom files at build-time

The commits here basically do the following things:
1. move all generated files for gecko into "gecko/generated" so that we can copy all of them around
2. make regen_atoms.py generate file to the out dir rather than in-tree
3. make the build script invoke regen_atoms.py when bindgen feature is enabled

<!-- 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/16762)
<!-- Reviewable:end -->
2017-05-08 07:35:19 -05:00
Xidorn Quan
ff76ec8d2f Copy all generated files to dist dir for packaging. 2017-05-08 21:34:00 +10:00
Xidorn Quan
10b7001dd1 Make atom files generated at build-time. 2017-05-08 21:33:58 +10:00
Xidorn Quan
a60e5f0218 Move binding files into another directory.
So that we can copy them when not using bindgen altogether.
2017-05-08 21:26:58 +10:00
cku
ba8e33a30c stylo: Export mozilla::css::ImageValue to stylo. 2017-05-08 15:45:31 +08:00
Xidorn Quan
1d6ede3245 Expose a single function for bindings mod in build_gecko. 2017-05-08 10:52:23 +10:00
Anthony Ramine
3c68c28ff7 Implement grid-template-areas (fixes #16079) 2017-05-04 19:10:45 +02:00
Hiroyuki Ikezoe
83a4935b60 Pass AnimationValueMap raw pointer instead of Arc to Gecko_GetAnimationRule() 2017-05-01 19:23:34 +09:00
Emilio Cobos Álvarez
5cbc6a9b16
Bug 1360508: Adjust text-combine properly. r=jryans
Text style is always resolved via ServoStyleSet::ResolveStyleForText, either
from the frame constructor initially, or from
ServoRestyleManager::ProcessPostTraversalForText.

So text-only adjustments should go there instead. Since that doesn't call into
cascade(), all the code that passes `pseudo` there is dead code we can remove.

MozReview-Commit-ID: jpbBYpLlUL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-28 17:21:10 +02:00
Boris Chiou
02fc1789e8 Bug 1357357 - Make the parser of transition-property match the spec.
1. We add a new arm to TransitionProperty, TransitionProperty::Unsupported,
   which contains an Atom, so it's better to remove the Copy trait from
   TransitionProperty.
2. TransitionProperty::Unsupported(Atom) represents any non-animatable, custom,
   or unrecognized property, and we use Atom to store the ident string for
   serialization.
2017-04-26 21:35:05 +08:00
Jeremy Chen
13f6cf6e3a Stylo: add -moz-border-*-colors support
In Gecko, we use double pointers to nsBorderColors to store -moz-border-*-colors.
We can simplify the implementation of computed value in Servo by using Option<Vec>.
As to passing computed values from Servo to Gecko, we might need to use some
binding functions (pre-added in the same Gecko bug, see Bug 1348173).

Note that we added -moz-border-*-colors as sub_properties of the 'border'
shorthand, so we can make the 'border' shorthand reset -moz-border-*-colors
(See Gecko Bug 482692). However, since they are Gecko only non-standard properties,
we should skip these sub_properties while doing unit testing in Servo. The test part
should be convered by Stylo/Gecko already.

A bit refactoring of replacing all ["top", "right", "bottom", "left"] with PHYSICAL_SIDES
is included in this patch, since we've already had PHYSICAL_SIDES for a while.
2017-04-25 09:52:19 +08:00
J. Ryan Stinnett
8144aa1163 Expose CSS length mode in Stylo glue
Add length mode args to Stylo glue functions so that Gecko can enable the
special SVG mode as needed.

MozReview-Commit-ID: 1luM13MFEXX
2017-04-14 17:22:16 +08:00
Cameron McCormack
fb26ae7df5 stylo: Generate eCSSPropertyID_all as a const rather than an enum value. 2017-04-14 13:33:21 +08:00
Manish Goregaokar
2e22a006db stylo: Support -moz-script-size-multiplier, -moz-script-level, -moz-math-display 2017-04-12 22:15:49 +08:00
bors-servo
a0a60ba61d Auto merge of #16328 - bradwerth:computedStyles, r=heycam
Stylo: Add FFI interfaces for exposing style sources.

https://bugzilla.mozilla.org/show_bug.cgi?id=1346256
https://reviewboard.mozilla.org/r/119044/

<!-- 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/16328)
<!-- Reviewable:end -->
2017-04-10 04:04:54 -05:00
Brad Werth
bfc7e84767 Stylo: Add FFI interfaces for exposing style sources.
MozReview-Commit-ID: BlAb8sQ5WYl
2017-04-10 16:40:46 +08:00
Manish Goregaokar
1154600dd4 stylo: Add bindings for fetching font metrics from Gecko 2017-04-10 14:16:02 +08:00
Manish Goregaokar
2febe7ccde stylo: Use font metrics provider as a cache for font size results 2017-04-09 19:15:37 +08:00
Manish Goregaokar
2ea8d61fbf stylo: Bypass cache when fetching font size prefs from Stylo 2017-04-09 17:44:00 +08:00
bors-servo
6020c2feeb Auto merge of #16314 - Wafflespeanut:bind, r=heycam
Include bindings for StyleGridTemplate

Servo-side changes for [Bug 1354775](https://bugzilla.mozilla.org/show_bug.cgi?id=1354775)

<!-- 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/16314)
<!-- Reviewable:end -->
2017-04-09 02:29:32 -05:00
Ravi Shankar
00bb0d6a12 Include bindings for StyleGridTemplate 2017-04-09 12:38:44 +05:30
Cameron McCormack
3f71c80e2f style: Handle TraversalRestyleBehavior::ForReconstruct in the Servo restyle. 2017-04-08 23:09:00 +08:00
bors-servo
d7fb2cc27f Auto merge of #16280 - hiikezoe:handle-base-style, r=heycam,birtles
Handle base style

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

---
<!-- 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: -->
- [X] These changes do not require tests because it's for stylo.

<!-- 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/16280)
<!-- Reviewable:end -->
2017-04-05 22:53:30 -05:00
Xidorn Quan
ed5c49c102 Add std::atomic to opaque_types in build_gecko
Recent change in bug 1277709 makes ThreadSafeAutoRefCnt start using std::atomic, which somehow doesn't not have #[derive(Debug)] on Windows, which makes all objects which includes ThreadSafeAutoRefCnt to stop having #[derive(Debug)]. This breaks stylo build on Windows.

By adding it as an opaque type, std::atomic would derive Debug again.
2017-04-06 13:06:51 +10:00
Hiroyuki Ikezoe
56dc7294e5 Add FFI functions to get progress value and current position in a segment.
Two functions added in this patch get progress value from ComputedTiming
or get the position in a given AnimationPropertySegment.
Without these FFIs, we need to expose Maybe<> and Nullable<> and handle
them in Rust.
2017-04-06 10:30:39 +09:00
Hiroyuki Ikezoe
f1d3f23bfa Expose ComputedTiming to FFI.
This will be also used for animation value composition in Rust.
2017-04-06 10:30:38 +09:00
Hiroyuki Ikezoe
68be131165 Move AnimationPropertySegment in a separate header and expose it in FFI.
This will be used for animation value composition in Rust.
2017-04-06 10:30:37 +09:00
Xidorn Quan
0a97a0df0c Create URLExtraData for holding base uri, referrer, and principal. 2017-04-03 14:30:33 +10:00
bors-servo
54e2b7b2d5 Auto merge of #16192 - upsuper:bug1350810, r=emilio
Output binding files to dist dir in addition

https://bugzilla.mozilla.org/show_bug.cgi?id=1350810
2017-03-30 08:23:31 -05:00
Xidorn Quan
f3a5e28949 Output binding files to dist dir in addition. 2017-03-31 00:22:15 +11:00
Xidorn Quan
0a57dbc110 Provide @font-face rules for stylo backend. 2017-03-30 11:41:13 +11:00
Xidorn Quan
e0c9a3fa12 Add function for sugar of nsCSSValue. 2017-03-30 11:41:08 +11:00
Xidorn Quan
e36b92507e Add FFI for nsCSSFontFaceRule. 2017-03-30 10:46:46 +11:00
Xidorn Quan
83badaa718 Lots of fixup for the next patch. 2017-03-30 10:46:32 +11:00
Hiroyuki Ikezoe
4183b0dff2 Introduce UpdateAnimationTasks to perform a bunch of animation's tasks in a SequentialTask.
The UpdateAnimationsTasks is a bitflags and each bit is generated from
Gecko's UpdateAnimationsTasks (enum class) values for matching values
between C++ and Rust. For this reason, the bitflags is annotated as
(feature = "gecko"), as a result update_animations() which uses this bitflags
also became gecko-only function.
2017-03-27 17:38:09 +09:00