Commit graph

6840 commits

Author SHA1 Message Date
Bastien Orivel
ba9cbd87fb Update parking_lot to 0.6 2018-07-20 00:44:08 +02:00
bors-servo
e57187305f
Auto merge of #21181 - nupurbaghel:update_source_set, r=jdm
Implement update source set & select image source

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

- [x] These changes require tests but cannot be written until implementation of responsive images is complete

<!-- 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/21181)
<!-- Reviewable:end -->
2018-07-19 08:18:12 -04:00
nupurbaghel
8d06da8afd implement update_source_set, select_image_source 2018-07-19 09:20:46 +05:30
Bastien Orivel
9e446971a8 Update euclid to 0.18 2018-07-18 09:27:24 +02:00
Emilio Cobos Álvarez
5227c7572e
style: Gecko build fix for Servo PR #21156.
MozReview-Commit-ID: FbN0hiUGzYa
2018-07-16 19:44:31 +02:00
Emilio Cobos Álvarez
bad4f7d729
style: Gecko build fix for Servo PR #21139.
MozReview-Commit-ID: 3ocJrRB3jeO
2018-07-16 19:44:23 +02:00
Dan Glastonbury
96e812e732
style: Correct background/foreground ratio mixing.
Bug: 1467622
Reviewed-by: xidorn
MozReview-Commit-ID: InAZVcH2Vkt
2018-07-16 19:44:04 +02:00
Dan Glastonbury
a76f5393d4
style: Change nscolor to StyleComplexColor.
Bug: 1467622
Reviewed-by: xidorn
MozReview-Commit-ID: 1bbQzOoOuBe
2018-07-16 19:43:50 +02:00
Emilio Cobos Álvarez
6f9b47be25
style: Cleanup push_applicable_declarations. r=xidorn
This patch changes the behavior to skipping XBL rules for
getDefaultComputedStyle.

Bug: 1475220
Reviewed-by: xidorn
MozReview-Commit-ID: 52cwDyBAXO
2018-07-16 19:43:39 +02:00
Xidorn Quan
db74d0c579
style: Remove unused parent parameter in ComputedValues::new.
Bug: 1475229
MozReview-Commit-ID: EBG0TS7tI4P
2018-07-16 19:43:30 +02:00
Cameron McCormack
a41127152b
style: Measure heap allocations hanging off selector components.
Bug: 1475191
Reviewed-by: emilio
MozReview-Commit-ID: D7vZQ7v8owS
2018-07-16 19:43:15 +02:00
Xidorn Quan
dd277be487
style: Remove a unused line to fix a warning.
Bug: 1461285
2018-07-16 19:43:08 +02:00
Xidorn Quan
d4ea70fd34
style: Have the CSSOM appending behavior behind a pref and only enable it on Nightly.
Bug: 1461285
Reviewed-by: emilio
MozReview-Commit-ID: 6BzPTNjXjyA
2018-07-16 19:42:53 +02:00
Xidorn Quan
2be1375745
style: Add a declaration iterator to AllShorthand for simplify code.
Bug: 1461285
Reviewed-by: emilio
MozReview-Commit-ID: 9w2B3SpdkQo
2018-07-16 19:42:42 +02:00
Xidorn Quan
36038869aa
style: Rename DeclarationSource to DeclarationPushMode.
Bug: 1461285
Reviewed-by: emilio
MozReview-Commit-ID: Iyv9JrXrpzl
2018-07-16 19:42:27 +02:00
Cameron McCormack
f526af7f01
style: Remove angle values from image-orientation.
Bug: 1473450
Reviewed-by: emilio
MozReview-Commit-ID: FB74ILJM6Fm
2018-07-16 19:42:12 +02:00
Oriol Brufau
4e8d3fce38
style: Honor logical border colors in visited links.
Bug: 1472567
Reviewed-by: emilio
MozReview-Commit-ID: IF8yvkFmPc4
2018-07-16 19:41:58 +02:00
Emilio Cobos Álvarez
1c799dd296
style: Make writing-mode and direction non-animatable.
Per https://github.com/w3c/csswg-drafts/issues/2751

Bug: 1473779
Reviewed-by: heycam
MozReview-Commit-ID: GCG3vJWNPfC
2018-07-16 19:41:46 +02:00
Emilio Cobos Álvarez
4d005cb90e
style: Reformat most of inherited_box.mako.rs.
image-orientation is being changed as we speak, so I left it there to avoid
bitrot.

Bug: 1473779
Reviewed-by: heycam
MozReview-Commit-ID: IwpA5HEuVU
2018-07-16 19:41:28 +02:00
Philipp Klein
5e43fe330d Add doc comments to specified float and clear CSS property 2018-07-11 08:07:58 +02:00
Philipp Klein
85af4145c3 style: Move clear CSS property outside mako
closes #21155
2018-07-10 09:18:33 +02:00
bors-servo
2bc70e738b
Auto merge of #21139 - kleinph:move-float-clear-outside-mako, r=emilio
style: Move `float` CSS property outside mako

Hi, I am fairly new to Rust and this is my first contribution to a Rust project.

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

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

I'm not sure if the approach with the two enums is good. Please let me know if this can be improved.
Regarding the tests I'm unsure: `tests/wpt/web-platform-tests/css/css-display/display-contents-float-001.html` seems to fail already before this PR, (and the cause is maybe not related to the style property definition).

Also I would like to add some docs, is it allowed to use the descriptions from MDN (https://developer.mozilla.org/en-US/docs/Web/CSS/float).

<!-- 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/21139)
<!-- Reviewable:end -->
2018-07-09 22:00:25 -04:00
Philipp Klein
c7871811c8 style: Move float CSS property outside mako
closes #21130
2018-07-09 12:47:07 +02:00
Emilio Cobos Álvarez
628ab7db01
style: Fix servo build. 2018-07-09 03:22:52 +02:00
Emilio Cobos Álvarez
d9d0186117
style: Trivial indentation fix.
MozReview-Commit-ID: JqBxF7i0HQZ
2018-07-09 03:05:45 +02:00
Emilio Cobos Álvarez
9f8c80fb3a
style: Make writing-mode and direction non-animatable.
Per https://github.com/w3c/csswg-drafts/issues/2751

Bug: 1473779
Reviewed-by: heycam
2018-07-09 03:05:32 +02:00
Emilio Cobos Álvarez
a11dcefee7
style: Reformat most of inherited_box.mako.rs.
image-orientation is being changed as we speak, so I left it there to avoid
bitrot.

Bug: 1473779
Reviewed-by: heycam
2018-07-09 03:05:19 +02:00
Emilio Cobos Álvarez
6518b0adfa
style: Other minor properties.mako.rs cleanups and improvements.
Also, add an is_logical method, which we'll use in a bit.

Bug: 1473793
Reviewed-by: heycam
MozReview-Commit-ID: Hq63wgbiRRu
2018-07-09 03:05:04 +02:00
Emilio Cobos Álvarez
263d4258ea
style: Add a clone helper that works regardless of whether the property is logical.
Bug: 1473793
Reviewed-by: heycam
2018-07-09 03:04:36 +02:00
Emilio Cobos Álvarez
769188ddbb
style: Remove dead code.
Bug: 1473793
Reviewed-by: heycam
2018-07-09 03:04:21 +02:00
Bobby Holley
50a85a5dd6
style: Cap the number of style threads at six.
Differential Revision: https://phabricator.services.mozilla.com/D1928
Bug: 1431285
Reviewed-by: emilio
2018-07-09 03:04:01 +02:00
Emilio Cobos Álvarez
c23dca874f
style: Reformat font.mako.rs.
To be consistent, use the block indentation the rest of the Rust code uses.

Differential Revision: https://phabricator.services.mozilla.com/D1906
Bug: 1472552
Reviewed-by: xidorn
2018-07-09 03:03:41 +02:00
Bastien Orivel
1766867cf4 Update regex to 1.0 2018-07-07 12:03:17 +02:00
Emilio Cobos Álvarez
8e5c853fca
style: Appease tidy. 2018-07-01 01:01:46 +02:00
Emilio Cobos Álvarez
e149059608
style: Fix build / unit tests. 2018-07-01 00:54:30 +02:00
Emilio Cobos Álvarez
fc5dbc1bae
style: Remove stray newline. 2018-07-01 00:11:08 +02:00
Emilio Cobos Álvarez
c2d21a8497
style: Serialize content properties using Servo.
Bug: 1472443
Reviewed-by: xidorn
Differential Revision: https://phabricator.services.mozilla.com/D1901
2018-07-01 00:10:46 +02:00
Emilio Cobos Álvarez
856924f167
style: Make StyleContentType an enum class.
Most of it is automated by:

  %s/eStyleContentType_/StyleContentType::/g
  %s/nsStyleContentType/StyleContentType/g

But I removed some parentheses by hand.

Bug: 1472443
Reviewed-by: xidorn
Differential Revision: https://phabricator.services.mozilla.com/D1900
2018-07-01 00:10:31 +02:00
Emilio Cobos Álvarez
28c9820dd9
style: Expose logical props in computed style.
Bug: 1116638
Reviewed-by: xidorn
Differential Revision: https://phabricator.services.mozilla.com/D1862
2018-07-01 00:10:13 +02:00
Olli Pettay
6483a89848
if ExtendedDOMSlots are used before slots, use FatSlots to have fewer allocations.
Bug: 1419661
2018-07-01 00:09:54 +02:00
Gerald Squelart
8488875a56
style: Removed layout.css.all-shorthand.enabled pref.
The 'all' shorthand has shipped a long time ago, so this pref is not needed
anymore.

Bug: 1459524
Reviewed-by: heycam
MozReview-Commit-ID: GND8qSVAfCG
2018-07-01 00:09:38 +02:00
Olli Pettay
8688c53f07
style: Unconditionally enable :defined in chrome.
Bug: 1471871
Reviewed-by: emilio
2018-07-01 00:08:48 +02:00
Olli Pettay
b68e4c2352
style: Implement :defined pseudo-class for custom elements.
Bug: 1331334
Reviewed-by: emilio
2018-07-01 00:08:33 +02:00
Emilio Cobos Álvarez
06fa3406de
style: Put offset-* aliases behind a pref.
Bug: 1464782
Reviewed-by: xidorn
MozReview-Commit-ID: Hl6Muim3wVH
2018-07-01 00:08:20 +02:00
Emilio Cobos Álvarez
65953fb158
style: Rename offset-* logical properties to inset-*.
Bug: 1464782
Reviewed-by: xidorn
MozReview-Commit-ID: BW44sru99RF
2018-07-01 00:08:09 +02:00
Xidorn Quan
ce0496e116
style: Generate ComputedStyleMap entry list from property data.
This changes the order of properties returned from gCS. The old order
doesn't make much sense, and other browsers don't agree on an identical
order either, so it should be trivial to change it. Also the spec isn't
super clear / useful in this case.

Several -moz-prefixed properties are excluded from the list due to their
being internal. I suspect they are never accessible anyway, so probably
nothing gets changed by this.

Bug: 1471114
Reviewed-by: xidorn
MozReview-Commit-ID: 9LfangjpJ3P
2018-07-01 00:07:50 +02:00
Xidorn Quan
9d1ae1840f
style: Upgrade cssparser.
Bug: 1471104
MozReview-Commit-ID: 74rBgkJEcYd
2018-07-01 00:07:36 +02:00
Xidorn Quan
26a9c9f53c
style: Remove location from preludes and take it from argument.
Bug: 1471104
Reviewed-by: emilio
MozReview-Commit-ID: HeJUQvkacaf
2018-07-01 00:07:20 +02:00
Xidorn Quan
0d0c6bd29e
style: Use RUSTFMT env in stylo build script.
Bug: 1471486
Reviewed-by: emilio
MozReview-Commit-ID: JOg0xkmG5Yx
2018-07-01 00:07:01 +02:00
Hiroyuki Ikezoe
2274f392d8
style: Try to allocate possible size for AnimationValueMap before composing.
The EffectSet count does not exactly represent the count what we really need
for AnimationValueMap, but in most cases it matches.  For example;

1) The element has two different keyframes animations

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { transform: rotate(360deg); }
 }

 In this case the number matches.

2) The element has two animations but both keyframes have the same CSS property

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { opacity: 0.1; }
 }

 In this case the number doesn't match, moreover it results more memory than we
 ever needed, but this case is presumably less common.

3) The element has an animation having keyframes for two different CSS
   properties.

 @keyframes anim {
   from { opacity: 0; transform: rotate(360deg); }
 }

 In this kind of cases, the number doesn't match.  But even so, this patch
 reduces the opportunities that the AnimationValueMap tries to allocate a new
 memory (i.e. less opportunities on expanding the map).

Note that when the hash map is expanded, we do allocate a new RawTable with the
new size then replace the old one with the new one [1], so I believe this
change will reduce the crash rate to some extent.

[1] https://hg.mozilla.org/mozilla-central/file/15c95df467be/servo/components/hashglobe/src/hash_map.rs#l734

Bug: 1418806
Reviewed-by: birtles
MozReview-Commit-ID: 6tcF9aqXh7a
2018-07-01 00:05:46 +02:00