Commit graph

14374 commits

Author SHA1 Message Date
Hiroyuki Ikezoe
636c47da29 Set the dirty flag of DeclarationBlock when the DeclarationBlock is modified and clear the flag when it's resyled. 2017-05-31 05:48:27 +09:00
bors-servo
dd0813b3f2 Auto merge of #17090 - upsuper:upgrade-bindgen, r=nox
Upgrade bindgen to 0.25.3

This fixes #17070.

<!-- 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/17090)
<!-- Reviewable:end -->
2017-05-30 12:32:08 -05:00
bors-servo
9d32b9cc35 Auto merge of #16317 - eloycoto:issue6799, r=emilio
Fix #6799: set stacking_context_position correctly on fragment_border_iterator

Hey,

First of all, this is my first PR to Servo project and I'm learning Rust, so sorry if you see something that it's not correct. I did that as best as I know.

This PR fix the issue #6799; I tried all the corner cases that I can think about it and always get the right result and the same as other browsers.

Related to the build:

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #6799

In the other hand, I added the test in the cssom folder, is where getBoundingClientRect  is defined, so I think that is the best place.

I'm sure that the line 122 can be better, but I didn't find a way to transform a Point2D from f32 to px in a easy way.

I'm here to listen to your recommendations and fix any issue.
Thanks!

<!-- 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/16317)
<!-- Reviewable:end -->
2017-05-30 11:28:26 -05:00
bors-servo
fe7d039416 Auto merge of #16238 - gterzian:implement_update_the_image_data, r=jdm
Implement "update the image data"

<!-- Please describe your changes on the following line: -->
Spec compliant implementation of the [update the image data algorithm](https://html.spec.whatwg.org/multipage/embedded-content.html#update-the-image-data).

Currently still a work in progress, the ['async src complete test`](https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/img.complete.html#L33) is still passing as it was before, even though I switched to the new code, so I guess that's something.

@jdm I will be picking this up next weekend, I left a bunch of TODO and NOTES in the code, if you or someone else have time this week I would appreciate an initial scan and feedback.

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

<!-- Either: -->
- [x] 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/16238)
<!-- Reviewable:end -->
2017-05-30 10:27:08 -05:00
bors-servo
ad4a5411a9 Auto merge of #17080 - jdm:updaterust, r=nox
Update rustc.

This brings in https://github.com/rust-lang/rust/issues/39160 which significantly improves the default debugging experience on macOS.

<!-- 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/17080)
<!-- Reviewable:end -->
2017-05-30 08:54:49 -05:00
bors-servo
38a6a3bff6 Auto merge of #17063 - emilio:pres-hints-sharing, r=bholley
style: Allow sharing styles across elements with presentational hints.

<!-- 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/17063)
<!-- Reviewable:end -->
2017-05-30 07:28:06 -05:00
bors-servo
43862ba045 Auto merge of #17092 - heycam:document-colors, r=xidorn
style: Add support for disabled document colors.

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1355716.

<!-- 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/17092)
<!-- Reviewable:end -->
2017-05-30 06:10:42 -05:00
bors-servo
433d68955b Auto merge of #17071 - servo:derive-all-the-things, r=emilio
Reuse Rect<T> some more

<!-- 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/17071)
<!-- Reviewable:end -->
2017-05-30 05:11:28 -05:00
Emilio Cobos Álvarez
7db2776348
s/CachedStyleSharingData/ValidationData.
I still think CachedStyleSharingData should be the name, but not going to fight
over it.
2017-05-30 11:23:59 +02:00
bors-servo
25d0c56141 Auto merge of #17061 - servo:utf8, r=nox
EventSource: decode UTF-8 code points across network packets

<!-- 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/17061)
<!-- Reviewable:end -->
2017-05-30 03:50:18 -05:00
Cameron McCormack
c768169149 style: Add support for disabled document colors. 2017-05-30 16:25:08 +08:00
Eloy Coto
33a46597ed Fix #6799: set stacking_context_position correctly on
fragment_border_iterator
2017-05-30 09:38:37 +02:00
Xidorn Quan
4b687b02fe Upgrade bindgen to 0.25.3 2017-05-30 17:22:00 +10:00
Hiroyuki Ikezoe
33e16fe630 Support currentColor for fill and stroke. 2017-05-30 15:44:05 +09:00
Cameron McCormack
d0d43707fb style: Support a restyle hint that indicates all descendants must be recascaded.
This also moves the result of deciding whether to recascade from the
RestyleData into the RestyleHint.
2017-05-30 09:14:23 +08:00
bors-servo
085743560c Auto merge of #17086 - upsuper:bug1352968, r=heycam
Add CSSOM support of @import rule for stylo

This is the Servo side change of [bug 1352968](https://bugzilla.mozilla.org/show_bug.cgi?id=1352968).

<!-- 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/17086)
<!-- Reviewable:end -->
2017-05-29 18:51:45 -05:00
Xidorn Quan
571d4c272b Update binding files. 2017-05-30 09:41:31 +10:00
Xidorn Quan
33deafba12 Add basic CSSOM support for @import rule. 2017-05-30 09:41:30 +10:00
bors-servo
76daf46295 Auto merge of #17073 - upsuper:flex-basis-zero, r=emilio
Set flex-basis to 0% when omitted in flex shorthand.

This should fix [bug 1331530](https://bugzilla.mozilla.org/show_bug.cgi?id=1331530).

<!-- 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/17073)
<!-- Reviewable:end -->
2017-05-29 17:58:44 -05:00
Xidorn Quan
acb7242304 Set flex-basis to 0% when omitted in flex shorthand. 2017-05-30 08:58:11 +10:00
Emilio Cobos Álvarez
0adc02a317
style: Avoid some cfg checks in context.rs 2017-05-29 23:24:06 +02:00
Emilio Cobos Álvarez
10bd5636dc
style: Allow sharing style for elements with presentational hints. 2017-05-29 23:12:44 +02:00
Emilio Cobos Álvarez
03952a0c27
style: Also cache the class list in the CurrentElementInfo.
This patch also removes all notion of style sharing from matching.rs, which is
nice.
2017-05-29 22:54:17 +02:00
Emilio Cobos Álvarez
abcc9b301c
style: Add a CachedStyleSharingData to hold the candidate class list and revalidation results. 2017-05-29 21:56:21 +02:00
Emilio Cobos Álvarez
fb6339bbf9
style: rewrap some comments to 80 columns for consistency with the rest of the code. 2017-05-29 21:39:41 +02:00
Emilio Cobos Álvarez
544e0f4cd6
style: Allow ApplicableDeclarationBlocks to be compared.
We'll need this to cache pres hints, which generate these.
2017-05-29 21:38:21 +02:00
Emilio Cobos Álvarez
3ebd48039e
style: Allow StyleSource to be compared. 2017-05-29 21:31:04 +02:00
bors-servo
939716a7bc Auto merge of #17078 - emilio:stylesheet-invalidation-scopes, r=heycam
stylo: Avoid restyling the whole document when adding stylesheets.

This is for bug 1357583.

<!-- 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/17078)
<!-- Reviewable:end -->
2017-05-29 14:19:16 -05:00
Josh Matthews
be98fef8f7 Conditionally define macro that's only used in Linux builds. 2017-05-29 14:52:44 -04:00
Emilio Cobos Álvarez
9c77dd8de6
style: Sync bindings. 2017-05-29 20:27:47 +02:00
Emilio Cobos Álvarez
7c5fabaf83
Bug 1357583: Avoid unconditionally popping under RulesIterator. r=heycam
Not sure it's worth it, really, but seemed like it could be.

Feel free to r- if it doesn't feel like it.

MozReview-Commit-ID: HTsBNfEqQy4
2017-05-29 20:27:45 +02:00
Emilio Cobos Álvarez
ac5872b48c
Bug 1357583: style: Make effective_rules return an iterator, stop refcounting the Device. r=heycam
This makes the code cleaner, and also documents the fact that effective_rules
recurses into imports.

No we're not adding the imported stylesheets twice, and we share code with the
invalidation analysis.

MozReview-Commit-ID: DOF2AViTlmR
2017-05-29 20:27:43 +02:00
Emilio Cobos Álvarez
ebd6f47be3
Bug 1357583: style: Recurse into @import rules when looking at the added rules. r=heycam
Apparently my whole conception of how the list of sheets in the styleset looked
like was flawled, and we only ever get one append_sheet for the topmost
stylesheet, instead of one for each.

MozReview-Commit-ID: FMClygMJkTc
2017-05-29 20:27:41 +02:00
Emilio Cobos Álvarez
f569274cca
Bug 1357583: Add a bunch of logging, shortcuts, and look also at the rightmost selector while invalidating sheets. r=heycam
MozReview-Commit-ID: 2XGcOCTa7MV
2017-05-29 20:27:38 +02:00
Emilio Cobos Álvarez
39e836966e
Bug 1357583: style: Hook up the invalidator in the StyleSheetSet. r=heycam
MozReview-Commit-ID: IhgKAovTJMX
2017-05-29 20:27:36 +02:00
Emilio Cobos Álvarez
658075af32
Bug 1357583: style: Add an initial version of the stylesheet invalidation code. r=heycam
MozReview-Commit-ID: 4jLxPYNF07U
2017-05-29 20:15:35 +02:00
bors-servo
63533ce72a Auto merge of #17075 - dadaa:bug1367283, r=hiikezoe
Bug1367283

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

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes. The tests will land in dom/animation/test of m-c.  Test code is patch 9 of https://bugzilla.mozilla.org/show_bug.cgi?id=1367283

<!-- 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/17075)
<!-- Reviewable:end -->
2017-05-29 12:44:38 -05:00
bors-servo
8dc7879230 Auto merge of #16987 - tictakk:ticbranch, r=emilio
Using stack-allocated variable for font feature setting

<!-- Please describe your changes on the following line: -->
Using stack-allocated small vector instead of the previous vector<u8>.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this is an optimization

<!-- 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/16987)
<!-- Reviewable:end -->
2017-05-29 09:58:43 -05:00
daisuke
8a5c7a50d1 Implements box related discrete animatable properties 2017-05-29 23:10:04 +09:00
daisuke
f46678cea8 Implements position related discrete animatable properties 2017-05-29 23:10:02 +09:00
daisuke
545a7420c8 Implements xul related discrete animatable properties 2017-05-29 23:10:00 +09:00
daisuke
1a915fa07c Implements svg related discrete animatable properties 2017-05-29 23:09:58 +09:00
daisuke
23e673f2a2 Implements ui related discrete animatable properties 2017-05-29 23:09:30 +09:00
Matthew
c26fb34108 Using stack-allocated variable for font feature setting 2017-05-29 08:39:39 -04:00
bors-servo
86dcd5366f Auto merge of #17074 - paulrouget:remove_viewport, r=emilio
remove no-op viewport code

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

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

<!-- 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/17074)
<!-- Reviewable:end -->
2017-05-29 07:13:58 -05:00
Paul Rouget
b0afc2694c remove no-op viewport code 2017-05-29 09:49:03 +02:00
daisuke
3e37278d9e Implements pointing related discrete animatable properties 2017-05-29 16:09:57 +09:00
daisuke
d0cf7d65f0 Implements background related discrete animatable properties 2017-05-29 16:09:20 +09:00
daisuke
917dbdfdbd Implements simple discrete animatable properties 2017-05-29 16:08:09 +09:00
Nicholas Nethercote
6d5b1242db Introduce and start using the MallocSizeOf trait.
MallocSizeOf is similar to the existing HeapSizeOf trait from the
heapsize crate. The only difference is that MallocSizeOf's
malloc_size_of_children() function takes an additional MallocSizeOfFn
argument, which is used to measure heap blocks. This extra argument
makes MallocSizeOf match how Gecko's memory measurements work, and is
required for Stylo to integrate with DMD.

The patch also introduces a second trait, MallocSizeOfWithGuard, which
is much the same as MallocSizeOf, but with a |guard| argument for the
global style lock.

Finally, the patch uses the new traits to measure a small amount of
Stylo's memory usage.
2017-05-29 10:16:55 +10:00