Commit graph

16155 commits

Author SHA1 Message Date
bors-servo
f6a42ed9c1 Auto merge of #18096 - glennw:update-wr-deinit, r=jdm
Update WR (new texture cache allocator, shader deinit path).

<!-- 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/18096)
<!-- Reviewable:end -->
2017-08-17 17:28:18 -05:00
Glenn Watson
e1b1bc7c96 Add key bindings for more WR debug / profiler options. 2017-08-18 06:41:28 +10:00
bors-servo
e23ae30489 Auto merge of #18127 - MortimerGoro:webgl_bind_tex2d, r=emilio
Fix bound textures and framebuffers when a WebGL Canvas is resized

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

Fix bound textures and framebuffers when a WebGL Canvas is resized. This causes some invisible textures in WebGL based games.

---
<!-- 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: -->
- [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/18127)
<!-- Reviewable:end -->
2017-08-17 14:06:10 -05:00
Martin Robinson
57704b0481 Improve containing block creation for position:absolute flows
Instead of only promoting flows with positioned fragments to containing
blocks, also do this for flows which have the transform, perspective or
filter properties set. This is what the spec requires and also fixes
some failing tests. It will allow us to stop creating stacking contexts
for overflow:hidden and overflow:scroll flows.

Fixes #18091.
2017-08-17 20:46:27 +02:00
bors-servo
6988c7424d Auto merge of #18028 - ferjm:performance.timeline, r=jdm
Performance Timeline API

[Performance Timeline API](https://www.w3.org/TR/performance-timeline-2/) implementation.

This API is required to allow DOM access to the [Paint Timing API](https://wicg.github.io/paint-timing/#example) metrics implemented in #17256. Unfortunately, I couldn't test it properly, as its usage depends on other APIs like the Paint Timing, User Timing, Resource Timing or Server Timing APIs. I'll work in the integration with the Paint Timing API next.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] There are [WPTs](https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/performance-timeline) for this API, however they depend on the implementation of the User Timing and the Resource Timing APIs, which I'll hopefully be implementing soon.

<!-- 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/18028)
<!-- Reviewable:end -->
2017-08-17 12:27:19 -05:00
bors-servo
cc86ca2bcd Auto merge of #18126 - servo:glow-fox, r=emilio
geckolib: Fix some warnings (treated as error) new in Rust Nigthly

<!-- 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/18126)
<!-- Reviewable:end -->
2017-08-17 11:05:32 -05:00
bors-servo
b6e0f4e952 Auto merge of #18113 - emilio:node-is-before, r=nox
script: Optimize CompareDocumentPosition.

I need this to compute the proper insertion point for a given stylesheet.

<!-- 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/18113)
<!-- Reviewable:end -->
2017-08-17 10:03:54 -05:00
Imanol Fernandez
712998b086 Fix bound textures and framebuffers when a WebGL Canvas is resized 2017-08-17 16:50:02 +02:00
Simon Sapin
35282042bc geckolib: Fix some warnings (treated as error) new in Rust Nigthly 2017-08-17 15:59:33 +02:00
Tom Tromey
7224a5617f Expose the source map URL on a style sheet
This changes Servo to track the source map URL of a style sheet.  This
parallels a change going in to Gecko:
https://bugzilla.mozilla.org/show_bug.cgi?id=1388855
2017-08-17 06:51:30 -06:00
Glenn Watson
26083b1dca Update WR (new texture cache allocator, shader deinit path). 2017-08-17 20:03:28 +10:00
Fernando Jiménez Moreno
52348f1fcc Performance Timeline API 2017-08-17 11:48:34 +02:00
Emilio Cobos Álvarez
f6bfd44ad6
script: Add a function to check whether a node is before another one in DOM order.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-17 10:31:04 +02:00
Emilio Cobos Álvarez
4304a1d054
script: Optimize CompareDocumentPosition.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-17 10:31:02 +02:00
Emilio Cobos Álvarez
ccd469ce61
script: Early return in CompareDocumentPosition to deindent most of the function.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-17 10:23:02 +02:00
Boris Chiou
e8fad236ef Implement ComputeSquaredDistance for Matrix and Perspective. 2017-08-17 13:53:25 +08:00
Boris Chiou
3a5cbfb769 Implement ComputeSquaredDistance for TransformList. 2017-08-17 13:53:20 +08:00
Boris Chiou
03e1794c12 Use f64 for Quaternion.
The unit of gfxQuaternion in Gecko is gfxFloat, which is "double", so
it's better to use f64 to match the precision of Gecko.
2017-08-17 13:53:15 +08:00
Boris Chiou
a5433ad68a Tweak CalcLengthOrPercentage to use pixel value.
We compute the distance for eCSSUnit_Calc by pixel value in Gecko,
so let's follow the same rules.
2017-08-17 13:53:07 +08:00
bors-servo
fbabcaf614 Auto merge of #18118 - servo:oops-webgl, r=emilio
Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"

This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.

<!-- 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/18118)
<!-- Reviewable:end -->
2017-08-17 00:26:08 -05:00
Ting-Yu Lin
ede8a23986 style: Move functions related to anonymous element to GeckoElement (Bug 1390773)
MozReview-Commit-ID: 6LqAPM86MQC
2017-08-17 10:50:34 +08:00
bors-servo
575bcf3989 Auto merge of #18117 - servo:we-are-leaving-babylon, r=emilio
Move more CSS values to their own submodules

<!-- 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/18117)
<!-- Reviewable:end -->
2017-08-16 20:26:22 -05:00
bors-servo
7806784eb4 Auto merge of #18112 - mrobinson:containing-block-helper, r=mbrubeck
Use the is_absolute_containing_block method everywhere

This is a better approach than relying on
contains_positioned_fragments, because in the future other properties
will create absolute containing blocks.

<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they do not change behavior.

<!-- 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/18112)
<!-- Reviewable:end -->
2017-08-16 19:18:48 -05:00
bors-servo
846b6dcb07 Auto merge of #18102 - hiikezoe:compute-distance-for-shadow-list, r=boris
Implement distance for shadow list.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1387973
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/18102)
<!-- Reviewable:end -->
2017-08-16 18:17:18 -05:00
bors-servo
cdd4de9c06 Auto merge of #17250 - cbrewster:unwrap_constructor, r=jdm
Unwrap function before calling IsConstructor

`IsConstructor` returns true for all wrappers that are callable. Wrapped
arrow functions are callable and thus `IsConstructor` will return true
if given one; however, if we unwrap the arrow function, `IsConstructor`
will return false. The latter is the correct behavior here.

---
<!-- 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: -->
- [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/17250)
<!-- Reviewable:end -->
2017-08-16 17:09:37 -05:00
Anthony Ramine
4ebeaa599b Move specified and computed time values to submodules 2017-08-17 00:05:59 +02:00
Anthony Ramine
1bd12bf91a Move specified and computed angles to submodules 2017-08-17 00:01:23 +02:00
Anthony Ramine
676f2c8acf Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.
2017-08-16 23:23:18 +02:00
Nazım Can Altınova
46adb0f0a7 Update bindings 2017-08-16 13:23:15 -07:00
Nazım Can Altınova
6893446b71 Add a pref checking mechanism for alias properties 2017-08-16 13:23:14 -07:00
Emilio Cobos Álvarez
cfe22e3979
Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"
This reverts commit 90f55ea458, reversing
changes made to 2e60b27a21.
2017-08-16 16:42:13 +02:00
bors-servo
ee94e2b7c0 Auto merge of #18107 - mrobinson:remove-pseudo-scrolling-area, r=emilio
Remove unused StackingContextType

This hasn't been in use for quite some time.

<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they do not change behavior.

<!-- 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/18107)
<!-- Reviewable:end -->
2017-08-16 07:06:32 -05:00
Martin Robinson
0a24c2f03c Use the is_absolute_containing_block method everywhere
This is a better approach than relying on
contains_positioned_fragments, because in the future other properties
will create absolute containing blocks.
2017-08-16 13:32:48 +02:00
bors-servo
75cae28728 Auto merge of #18103 - birtles:drop-fill-none-interpolation, r=hiro
Don't allow interpolating 'fill:none' with 'fill:none'

From [Gecko bug 1390364](https://bugzilla.mozilla.org/show_bug.cgi?id=1390364).

In SMIL we don't expect the 'none' value of the 'fill' property to be additive and hence the following animation should have no effect:

```svg
  <rect width="100" height="100" y="100" fill="blue">
    <animate attributeName="fill" dur="3s" from="red" by="none"/>
  </rect>
```

Although SMIL doesn't make this entirely clear, [it says](https://www.w3.org/TR/smil-animation/#AnimFuncValues) that "by animation" and "from-by animation" may only be used "with attributes that support addition (e.g.  most numeric attributes)" and [SVG says](https://www.w3.org/TR/SVG11/animate.html#AnimationAttributesAndProperties) that `<paint>`s are "only additive if each value can be converted to an RGB color". As a result, the animation above should have no effect.

By extrapolation, animating from 'none' by 'none' should also have no effect:

```svg
  <rect width="100" height="100" y="100" fill="blue">
    <animate attributeName="fill" dur="3s" from="none" by="none"/>
  </rect>
```

However, in Servo's interpolation of `<paint>`s we special case the interpolation and addition of 'none' such that if both values are 'none' it is allowed.

We should disallow this in order to produce the expected behavior and in order to match Gecko's behavior.

<!-- 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/18103)
<!-- Reviewable:end -->
2017-08-16 05:46:56 -05:00
bors-servo
467316e35b Auto merge of #18097 - bholley:avoid_recursion_clear_descendant_data, r=emilio
Avoid recursion in clear_descendant_data

This will allow us to have a tight stack limit in https://bugzilla.mozilla.org/show_bug.cgi?id=1376883

<!-- 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/18097)
<!-- Reviewable:end -->
2017-08-16 04:22:23 -05:00
Martin Robinson
ee73cb618a Remove unused StackingContextType
This hasn't been in use for quite some time.
2017-08-16 11:08:54 +02:00
bors-servo
b300800b2c Auto merge of #18087 - emilio:stylist-clear-cleanup, r=heycam
style: Cleanup a bit Stylist and SelectorMap.

Bug: 1390255
Reviewed-by: heycam

<!-- 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/18087)
<!-- Reviewable:end -->
2017-08-16 02:56:13 -05:00
Emilio Cobos Álvarez
4c80cccbd2
stylo: Cleanup a bit of the Stylist clear setup.
This moves us to clear on rebuild, which allows us to remove yet another place
where we track stylist dirtiness.

Bug: 1390255
Reviewed-by: heycam
MozReview-Commit-ID: nihQbUAbh8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-16 08:49:41 +02:00
Emilio Cobos Álvarez
b040d79333
style: Avoid multiple selector walk-ups during SelectorMap insertion.
MozReview-Commit-ID: 5b2X0GL2753
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-16 08:49:39 +02:00
Ting-Yu Lin
0e82ca1d3a style: Skip matching :nth-child if element is the root of anonymous subtree
This implement the logic in Gecko's nsNthIndexCache::GetNthIndex().

MozReview-Commit-ID: 8lzK9iIbfzo
2017-08-16 14:25:01 +08:00
Bobby Holley
653107d6c4 Avoid recursion in clear_descendant_data.
MozReview-Commit-ID: LeMhhcKoLr9
2017-08-15 23:24:17 -07:00
Brian Birtles
9ecb0aa7fa Don't allow interpolating 'fill:none' with 'fill:none'
In SMIL we don't expect the 'none' value of the 'fill' property to be
additive and hence the following animation should have no effect:

  <rect width="100" height="100" y="100" fill="blue">
    <animate attributeName="fill" dur="3s" from="red" by="none"/>
  </rect>

Although SMIL doesn't make this entirely clear, [1] says that "by
animation" and "from-by animation" may only be used "with attributes
that support addition (e.g.  most numeric attributes)" and [2] says that
<paint>s are "only additive if each value can be converted to an RGB
color". As a result, the animation above should have no effect.

By extrapolation, animating from 'none' by 'none' should also have no
effect:

  <rect width="100" height="100" y="100" fill="blue">
    <animate attributeName="fill" dur="3s" from="none" by="none"/>
  </rect>

However, in Servo's interpolation of <paint>s we special case the
interpolation and addition of 'none' such that if both values are 'none'
it is allowed.

We should disallow this in order to produce the expected behavior and in
order to match Gecko's behavior.

[1] https://www.w3.org/TR/smil-animation/#AnimFuncValues
[2] https://www.w3.org/TR/SVG11/animate.html#AnimationAttributesAndProperties
2017-08-16 15:01:44 +09:00
Hiroyuki Ikezoe
41cbd2fa62 Implement distance for shadow list. 2017-08-16 14:25:30 +09:00
bors-servo
dc654c9912 Auto merge of #18099 - KuoE0:make-empty-rule-can-be-inserted-into-rule-tree, r=emilio
Make emtpy rule can be inserted into rule tree

<!-- Please describe your changes on the following line: -->
We really want to ensure empty rule nodes appear in the rule tree for devtools, this condition ensures that if we find an empty rule node, we insert it at the normal level.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because of the test cases are in Gecko.

<!-- 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/18099)
<!-- Reviewable:end -->
2017-08-15 23:11:04 -05:00
J. Ryan Stinnett
711adba0ce Update Stylo bindings 2017-08-15 22:09:08 -05:00
KuoE0
a6ceafe3da Make emtpy rule can be inserted into rule tree 2017-08-16 11:08:49 +08:00
J. Ryan Stinnett
d4b364200a Fix up Gecko_CalcStyleDifference for Linux 32-bit ABI
Bindgen bitfield enums don't work as return values with the Linux 32-bit ABI at
the moment because they wrap the value in a struct.

This causes the Rust side to believe the callee expects space for the struct
return value, while C++ believes it's just an integer value.

MozReview-Commit-ID: FRBqlZuMiAR
2017-08-15 21:10:37 -05:00
bors-servo
eba896157e Auto merge of #18095 - emilio:unused, r=bholley
stylo: Remove some unused FFI functions.

Bug: 1390650
Reviewed-by: bholley
MozReview-Commit-ID: K9fXGRmgkr4

<!-- 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/18095)
<!-- Reviewable:end -->
2017-08-15 19:29:45 -05:00
bors-servo
1c4076a759 Auto merge of #18040 - atouchet:user-agent, r=jdm
Update Firefox version in user agent

<!-- Please describe your changes on the following line: -->
GitHub has started throwing warnings about using an outdated version of Firefox when loaded with Servo. I am assuming that this is due to Servo using Firefox 37.0 in its user agent which was set in 2015 and hasn't been updated since then. I don't know if updating this should cause any site compatibility issues or not.

---
<!-- 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
- [ ] 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/18040)
<!-- Reviewable:end -->
2017-08-15 18:21:51 -05:00
bors-servo
99b4b7e960 Auto merge of #18094 - bholley:ancestor_reconstruct, r=emilio
Avoid leaving stale ANCESTOR_WAS_RECONSTRUCTED bits in the tree

https://bugzilla.mozilla.org/show_bug.cgi?id=1390179

<!-- 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/18094)
<!-- Reviewable:end -->
2017-08-15 17:07:20 -05:00