Commit graph

19501 commits

Author SHA1 Message Date
bors-servo
d6edd5b438
Auto merge of #21045 - jonathanKingston:make-parent-replaceable, r=jdm
Allow window.parent attribute to be replaceable by JavaScript.

Permit JS to override the window.parent attribute.

---
<!-- 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 #20932 (github issue number if applicable).
- [x] There are tests for these changes OR

<!-- 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/21045)
<!-- Reviewable:end -->
2018-06-14 04:07:51 -04:00
bors-servo
98ac66d015
Auto merge of #21046 - servo:stable-alloc, r=nox
Upgrade to rustc 1.28.0-nightly (b68432d56 2018-06-12)

<!-- 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/21046)
<!-- Reviewable:end -->
2018-06-13 22:19:52 -04:00
Simon Sapin
c94c2b6f76 Upgrade to rustc 1.28.0-nightly (b68432d56 2018-06-12) 2018-06-14 04:19:17 +02:00
bors-servo
36f5b69224
Auto merge of #20891 - KiChjang:reversed-bc-iter, r=asajeffrey
Implement getter for child BCs correctly

Fixes #20890.

<!-- 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/20891)
<!-- Reviewable:end -->
2018-06-13 15:06:46 -04:00
Jonathan Kingston
51db660175 Allow window.parent attribute to be relaceable by JavaScript. 2018-06-13 10:16:13 -07:00
bors-servo
5c4f54c403
Auto merge of #21034 - servo:desktop-oes-element-index-uint, r=KiChjang
Don't check for GL_OES_element_index_unit with desktop GL (fixes #20921)

<!-- 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/21034)
<!-- Reviewable:end -->
2018-06-13 05:11:33 -04:00
Emilio Cobos Álvarez
4cd16ee63c
style: Derive Animate for ComplexColorRatios. 2018-06-12 12:15:18 -07:00
Emilio Cobos Álvarez
ab760033fd
style: Fix servo build. 2018-06-12 12:15:18 -07:00
Emilio Cobos Álvarez
e94395b523
style_derive: Fix tidy lint. 2018-06-12 12:15:17 -07:00
Emilio Cobos Álvarez
572a93142f
style: Add diagnostics.
Bug: 1416282
Reviewed-by: xidorn
MozReview-Commit-ID: GTnFyZnXR84
2018-06-12 12:15:16 -07:00
Emilio Cobos Álvarez
d65b29da27
style: Add CssPropFlags::SerializedByServo and use it on some simple properties.
The idea is to turn the simple properties into a blacklist instead really soon,
and fix the offending ones soon after, so that only shorthands and properties
with layout dependence (and maybe the scrollbar properties, because the poke at
LookAndFeel) are not serialized by Servo.

Bug: 1467536
Reviewed-by: xidorn
MozReview-Commit-ID: JTLNnmXzny8
2018-06-12 12:15:16 -07:00
Emilio Cobos Álvarez
011cad2534
style: Add a Servo API to get the serialized style of a property.
This is intended to be used by GetComputedStyle when there's no layout
dependency.

Bug: 1467536
Reviewed-by: xidorn
MozReview-Commit-ID: 3GAbjo1uQ34
2018-06-12 12:15:16 -07:00
Dan Glastonbury
5f74a15f38
style: Extract {animated,computed}::Color common parts.
Extract the common parts of `animated::Color` and `computed::Color` out
into `generics::color::Color<T>` that is generic over the type of
RGBA color.

Bug: 1465307
Reviewed-by: xidorn
MozReview-Commit-ID: EymSr7aqnAP
2018-06-12 12:15:15 -07:00
Dan Glastonbury
314b14d46e
style: Fix nsStyleBorder::mBorderColor for GCC.
GCC doesn't like StyleComplexColor with constructor in an anonymous
struct in an anonymous union.  Replace the use of a union to access
`mBorder[..]Color` fields as an array with an accessor methods.

Bug: 1465307
Reviewed-by: xidorn
MozReview-Commit-ID: 1Wulh1qKYCZ
2018-06-12 12:15:15 -07:00
Emilio Cobos Álvarez
cdbc409759
style: Trivially simplify a condition.
Bug: 1466963
Reviewed-by: xidorn
MozReview-Commit-ID: L9LzpPt4js4
2018-06-12 12:15:15 -07:00
Emilio Cobos Álvarez
3c7fb2a217
style: Add a before-change callback to remove_property.
Bug: 1466963
Reviewed-by: xidorn
MozReview-Commit-ID: 4vyN9iLT7e3
2018-06-12 12:15:14 -07:00
Emilio Cobos Álvarez
6ca324f8b5
style: Remove unused PropertyDeclarationBlock::set_importance.
Bug: 1466963
Reviewed-by: xidorn
MozReview-Commit-ID: 1YrlOvktag9
2018-06-12 12:15:14 -07:00
Emilio Cobos Álvarez
e052666153
style: Fix a typo.
Nobody looks at the result from parsing, but this is the right thing to return.

Bug: 1466963
Reviewed-by: xidorn
MozReview-Commit-ID: 9P5VARiPIAk
2018-06-12 12:15:13 -07:00
Emilio Cobos Álvarez
9c51d31b05
style: Inline some trivial bits.
Bug: 1466963
Reviewed-by: xidorn
MozReview-Commit-ID: A219QehiMqZ
2018-06-12 12:15:13 -07:00
Dan Glastonbury
255fe05d40
style: Extend StyleComplexColor to support additive blending.
Refactored StyleComplexColor to support "complex" blending between
background (numeric) color and foreground color (currentColor).
Made explicit the distinction between numeric, currentColor and a
complex blend in Gecko and Stylo.

This is to support SMIL animation, for example, of the form:

     <animate from="rgb(10,20,30)" by="currentColor" ... />

Bug: 1465307
Reviewed-by: hiro,xidorn
MozReview-Commit-ID: IUAK8P07gtm
2018-06-12 12:15:13 -07:00
Boris Zbarsky
3816143a1d
style: Use Atomic<bool> for the staticpref version of layout.css.font-variations.enabled.
Atomic<bool> is implemented in terms of AtomicBase<uint32_t>, because that way
you don't need to depend on atomic 1-byte operations.  That means that the rust
bindgen sees it as a u32, not a bool.

It's a bit concerning that the rust code seems to be doing an unsynchronized
read here, but given this is a RelaxedAtomic, that's probably ok.

Bug: 1467134
Reviewed-by: emilio
2018-06-12 12:15:12 -07:00
Emilio Cobos Álvarez
915c8725ae
style: Remove PropertyId::name.
It's only used for the error path in property parsing, so most of the time is
not useful.

Use the just-introduced NonCustomPropertyId::name to preserve the alias name,
which we were doing by passing the name around.

Bug: 1466645
Reviewed-by: xidorn
MozReview-Commit-ID: 46xxZKCoeBB
2018-06-12 12:15:12 -07:00
Emilio Cobos Álvarez
7529788375
style: Make getting a property name explicitly an indexing operation.
The six milliseconds spent in Olli's profile make me thing this is not getting
optimized and we expected.

Also move it to NonCustomPropertyId, so it works for aliases properly too.

Bug: 1466645
Reviewed-by: xidorn
MozReview-Commit-ID: 4d76Z55ZBEH
2018-06-12 12:15:12 -07:00
Emilio Cobos Álvarez
c6e43c0329
style: Avoid useless allocations in custom property name serialization.
And make transition-property more correct by serializing --0 unescaped instead
of escaped.

Bug: 1466645
Reviewed-by: xidorn
MozReview-Commit-ID: CCBSe5Frd0d
2018-06-12 12:15:11 -07:00
Emilio Cobos Álvarez
63ca2a803d
style: Make clearing atoms slightly more ergonomic.
I prefer to do it this way because Atom has inline paths for static atoms and
such.

Bug: 1466609
Reviewed-by: xidorn
MozReview-Commit-ID: CFsBHl80KDY
2018-06-12 12:15:11 -07:00
Emilio Cobos Álvarez
d461a7ddbe
style: Make the threadsafe refcounting macros more reusable.
Bug: 1466609
Reviewed-by: xidorn
MozReview-Commit-ID: IanxqRksGqE
2018-06-12 12:15:10 -07:00
Emilio Cobos Álvarez
2c0a19e517
style: Move some parsing-only attributes to use #[parse(..)] instead of #[css(..)].
I need to admit I'm ambivalent about this one :).

Bug: 1466609
Reviewed-by: xidorn
MozReview-Commit-ID: F1jlfnQKXwo
2018-06-12 12:15:10 -07:00
Emilio Cobos Álvarez
8821ad72f4
style: Make pseudo-elements work with :host.
Imported WebKit's test as a WPT.

Bug: 1465291
Reviewed-by: xidorn
MozReview-Commit-ID: 19ZThuoqKLW
2018-06-12 12:15:10 -07:00
Emilio Cobos Álvarez
8d069d127a
style: Work around a bindgen bug on Android.
Bug: 1466406
Reviewed-by: xidorn
MozReview-Commit-ID: 2lltjH7IoZu
2018-06-12 12:15:09 -07:00
Emilio Cobos Álvarez
f829300751
style: Don't look at the rule type from value parsing.
This would cause properties to change the value semantics between, e.g.,
@keyframes and non-@keyframes, which would be observable.

It happens not to be observable since the animation-* and transition-*
properties are not allowed in @keyframes, nor have bits in `contain`, and none
of the two properties are allowed in @page. But I think it's the right thing to
do.

This still causes a quirk like a property value in chrome / user origins being
potentially different if the value is specified via CSS var functions. But I
think that is fine.

Bug: 1466136
Reviewed-by: hiro
MozReview-Commit-ID: GhoPt0I34oO
2018-06-12 12:15:09 -07:00
Emilio Cobos Álvarez
710184b670
style: Sprinkle some #[inline] on methods that have inline fast-paths.
MozReview-Commit-ID: 5kOmctLTAX0
2018-06-12 12:15:09 -07:00
Emilio Cobos Álvarez
2baa794de6
style: Sprinkle some inline in methods that are just pointer-chasing or function calls.
MozReview-Commit-ID: 8G2NQPBVuXn
2018-06-12 12:15:08 -07:00
Emilio Cobos Álvarez
4b10b2a7f2
style: Update smallbitvec to v2.1.1.
Actual code changes reviewed upstream in:

  https://github.com/servo/smallbitvec/pull/12

Bug: 1466647
MozReview-Commit-ID: 3vKVPMovBj
2018-06-12 12:15:08 -07:00
Emilio Cobos Álvarez
0f1b79327f
style: Minor indentation cleanup.
MozReview-Commit-ID: JmilaCX3rNy
2018-06-12 12:15:07 -07:00
Emilio Cobos Álvarez
618eef77eb
style: Don't hide -moz-box / -moz-inline-box yet.
I'd really prefer to not land this patch, but...

Bug: 1288572
Reviewed-by: mats
MozReview-Commit-ID: HzmvhTd32gz
2018-06-12 12:15:07 -07:00
Emilio Cobos Álvarez
cf7b10a32d
style: Hide -moz- display values from content behind a pref.
Bug: 1288572
Reviewed-by: xidorn
MozReview-Commit-ID: HDQPub043H1
2018-06-12 12:15:07 -07:00
Emilio Cobos Álvarez
1da798e65b
style: Introduce css(parse_condition).
This will allow us to add a pref for this, and to parse it only on chrome easily.

Bug: 1288572
Reviewed-by: xidorn
MozReview-Commit-ID: L1rsyc2A2hu
2018-06-12 12:15:06 -07:00
Emilio Cobos Álvarez
ce5a85d6a1
style: Use custom_properties::Name in TransitionProperty.
Bug: 1419695
Reviewed-by: xidorn
MozReview-Commit-ID: BUSWrcA5hkw
2018-06-12 12:15:06 -07:00
Emilio Cobos Álvarez
90ef5607e4
style: Move TransitionProperty where it belongs.
Bug: 1419695
Reviewed-by: xidorn
MozReview-Commit-ID: 9PN6VfbDbLA
2018-06-12 12:15:05 -07:00
Emilio Cobos Álvarez
f6f421f5aa
style: Hide multiple -moz-window-* properties from content.
Bug: 1419695
Reviewed-by: xidorn
MozReview-Commit-ID: Jsqt3kqjPiq
2018-06-12 12:15:05 -07:00
Emilio Cobos Álvarez
6940787916
style: Make the transition-property code make more sense.
We were working around the lack of alias support during parsing in
TransitionProperty by doing a Gecko lookup. That's a hack and is now gone.

Bug: 1419695
Reviewed-by: xidorn
MozReview-Commit-ID: EptUvJNTrZr
2018-06-12 12:15:04 -07:00
Emilio Cobos Álvarez
35a1a30f6b
style: Remove invalid assertion.
We can look at stale styles while trying to figure out if we need any
invalidation, and that's ok.

Bug: 1449243
MozReview-Commit-ID: 4mBIFNm9qJv
2018-06-12 12:15:04 -07:00
Yusuf Sermet
ea5417b29c
style: Make contain:paint trigger clipping independent of the overflow property.
Bug: 1465250
Reviewed-by: mattwoodrow
MozReview-Commit-ID: 2QbfZD1jnWX
2018-06-12 12:15:03 -07:00
Anthony Ramine
c7603bd4ca Don't check for GL_OES_element_index_unit with desktop GL (fixes #20921) 2018-06-12 12:33:32 +02:00
Keith Yeung
43c87db3ca Implement getter for child BCs correctly 2018-06-10 20:12:16 -07:00
bors-servo
527d874bc1
Auto merge of #21028 - asajeffrey:script-dont-trace-parsers, r=Manishearth
Fixed panic due to GC while parsing

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

Don't trace the incomplete parsing contexts during GC, as parsing triggers GC while holding a mutable borrow of the context.

---
<!-- 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 #21020

<!-- Either: -->
- [X] These changes do not require tests because fixing a panic

<!-- 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/21028)
<!-- Reviewable:end -->
2018-06-08 12:50:22 -04:00
Alan Jeffrey
40ea4c4946 Fixed panic due to GC while parsing 2018-06-08 10:59:17 -05:00
cadubentzen
3a6679b3b5 Refactor draw_image and make draw_image_self call draw_image in canvas. 2018-06-08 00:15:10 -03:00
bors-servo
40f7da0aac
Auto merge of #20923 - jdm:canvas-source, r=avadacatavra
Respect the source rectangle when drawing a canvas to another canvas.

This allows us to run the three.js examples without panicking, since they use self-drawing canvases to scroll the FPS graph.

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

<!-- 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/20923)
<!-- Reviewable:end -->
2018-06-07 17:37:03 -04:00
bors-servo
d83dc8b968
Auto merge of #21019 - dwijnand:patch-1, r=jdm
Make a doc URL a clickable link

Made a URL in the docs of net::http_cache a clickable link.

---
<!-- 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
- [X] These changes do not require tests because it's just a doc fix.

<!-- 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/21019)
<!-- Reviewable:end -->
2018-06-07 13:10:17 -04:00