Commit graph

19324 commits

Author SHA1 Message Date
bors-servo
e231a68acf
Auto merge of #21050 - jonathanKingston:fix-replacability-of-window-attrs, r=jdm
Allow supported window attributes to be replacable.

As seen in https://github.com/servo/servo/pull/21045 some Window attributes don't support JavaScript from being able to shadow and replace their values.

This PR adds all other attributes I could find that are supported by servo to be replaceable.

---
<!-- 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] There are tests for these changes

<!-- 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/21050)
<!-- Reviewable:end -->
2018-06-19 18:11:06 -04:00
bors-servo
0226a1a4ad
Auto merge of #21062 - tigercosmos:ggg, r=emilio
textarea minLength/maxLength

<!-- Please describe your changes on the following line: -->
 textarea minLength/maxLength

---
<!-- 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/21062)
<!-- Reviewable:end -->
2018-06-19 12:46:56 -04:00
Emilio Cobos Álvarez
083857a4b0
Fix Servo build. 2018-06-18 20:01:48 +02:00
Emilio Cobos Álvarez
d9d9fed7d5
style: Fix tidy. 2018-06-18 19:17:37 +02:00
Jonathan Watt
1face496a2
style: -webkit-appearance alias for -moz-appearance (behind a pref).
Bug: 1429713
Reviewed-by: emilio
2018-06-18 19:17:22 +02:00
Emilio Cobos Álvarez
63981e962a
style: Relax a bit an invalid assertion.
We may end up looking at a non-flushed AuthorStyles object when looking at
whether attribute changes and such may affect style.

Check the styles are clean to preserve the assertion, since if that happens
before the first flush, we may not have updated the quirks_mode field (and
that's fine).

Bug: 1468640
MozReview-Commit-ID: FgVpiTf4qMr
2018-06-18 19:17:12 +02:00
Emilio Cobos Álvarez
7230102eba
style: Minor indentation cleanup.
MozReview-Commit-ID: 7MAVnsjXx63
2018-06-18 19:17:04 +02:00
Emilio Cobos Álvarez
ba5be8d0eb
style: Move MediaQuery and friends to its own module.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 3FRMnIHFwR3
2018-06-18 19:16:51 +02:00
Emilio Cobos Álvarez
67d8bfb720
style: Introduce Qualifier::parse.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 4IOJpaS9ijI
2018-06-18 19:16:38 +02:00
Emilio Cobos Álvarez
c7b36fb43f
style: Move MediaList to its own module.
And move the parsing from a free function to MediaList::parse.

Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 75ES6I2EEOE
2018-06-18 19:16:23 +02:00
Emilio Cobos Álvarez
ddf386b02b
style: Move media_queries module to be a directory.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: 7H93L6f0bAl
2018-06-18 19:16:10 +02:00
Emilio Cobos Álvarez
9ca081c532
style: Unify some #[derive]s between Servo and Gecko.
Bug: 1468846
Reviewed-by: xidorn
MozReview-Commit-ID: FqoNCuLcdm7
2018-06-18 19:15:56 +02:00
Dan Glastonbury
4d255392f7
style: Change nscolor to StyleComplexColor in nsStyleGradientStop.
Bug: 1467379
Reviewed-by: xidorn
MozReview-Commit-ID: D9KQcv9uQ4S
2018-06-18 19:15:28 +02:00
Nazım Can Altınova
74189514fd
style: Merge ServoDocumentRule and CSSMozDocumentRule.
Bug: 1451289
Reviewed-by: emilio
MozReview-Commit-ID: BkMMXBWdsfz
2018-06-18 19:15:08 +02:00
Hiroyuki Ikezoe
238314e606
style: Double f64::EPSILON for calculation error.
It's possible that both this_weight and other_weght have calculation errors
which are approximately equal to f64::EPSILON.

Bug: 1468294
Reviewed-by: birtles
MozReview-Commit-ID: 8OddG9rI3qd
2018-06-18 19:14:46 +02:00
Gerald Squelart
9d679c9b20
style: Ignore case in media feature names inside media query expressions.
Media feature names are converted to lower case before being processed, making
them effectively case-insensitive.
Prefixes ("min-", etc.) and values are already treated in a case-insensitive
manner.

Bug: 1464091
Reviewed-by: heycam
MozReview-Commit-ID: JUeeEQEMIi4
2018-06-18 19:14:17 +02:00
bors-servo
1f562af418
Auto merge of #20699 - simartin:issue_20593, r=nox
Issue #20593: Implement proper checks in WebGLRenderingContext's getFramebufferAttachmentParameter().

Add missing input checks.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20593
- [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/20699)
<!-- Reviewable:end -->
2018-06-18 12:01:39 -04:00
bors-servo
d843a66300
Auto merge of #21064 - tigercosmos:yyy, r=jdm
Let the popstate and hashchange events not bubble

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

<!-- 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/21064)
<!-- Reviewable:end -->
2018-06-18 10:41:18 -04:00
tigercosmos
bdb6706f19 textarea minLength/maxLength 2018-06-18 02:01:59 -07:00
tigercosmos
ecb65474a7 Let the popstate and hashchange events not bubble 2018-06-17 11:13:36 -07:00
Simon Sapin
e39f741321 Remove components/nonzero, use std::num::NonZero instead 2018-06-16 00:14:41 +02:00
bors-servo
0c5b020163
Auto merge of #21052 - tigercosmos:rrr, r=jdm
add TextLength

<!-- Please describe your changes on the following line: -->
add TextLength in HTMLTextAreaElement

---
<!-- 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/21052)
<!-- Reviewable:end -->
2018-06-15 13:59:12 -04:00
tigercosmos
0907940db8 add TextLength 2018-06-15 09:47:37 -07:00
Jonathan Kingston
7dc7173a73 Allow supported window attributes to be replacable. 2018-06-14 10:58:40 -07:00
bors-servo
3279d1fe85
Auto merge of #21051 - jonathanKingston:window-length, r=jdm
Implement window.length DOM attribute.

Implements the `window.length` DOM attribute for enumerating frames on the document.

---
<!-- 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] There are tests for these changes

<!-- 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/21051)
<!-- Reviewable:end -->
2018-06-14 11:59:23 -04:00
Jonathan Kingston
ba9975e099 Implement window.length DOM attribute. 2018-06-14 05:56:16 -07:00
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