Commit graph

5398 commits

Author SHA1 Message Date
Simon Sapin
08066800cd Rename selector_matching.rs to stylist.rs 2016-11-20 15:29:09 +01:00
bors-servo
72e4c6dc21 Auto merge of #13418 - stshine:location-replace, r=KiChjang
Make document url mutable and implement location.replace()

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

<!-- Either: -->
- [X] There are tests for these changes OR

<!-- 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/13418)

<!-- Reviewable:end -->
2016-11-20 02:27:54 -06:00
Pu Xingyu
5287e70829 Minor fixes and update test expectations 2016-11-20 06:30:10 +08:00
bors-servo
fdcf510ac8 Auto merge of #14250 - nox:write, r=SimonSapin
Make ServoParser::pending_input hold onto a BufferQueue

<!-- 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/14250)
<!-- Reviewable:end -->
2016-11-18 19:46:15 -06:00
Nazım Can Altınova
fdbadcdce2 Implement ToCss serialization for CSSRules 2016-11-18 12:17:53 +03:00
Anthony Ramine
a3da819d10 Make ServoParser::pending_input hold onto a BufferQueue 2016-11-18 10:12:06 +01:00
Pu Xingyu
91f3d4f474 Remove redundant url clones
They are now redundant since now document.url() returns a struct rather
than a reference.
2016-11-18 12:39:22 +08:00
Pu Xingyu
fb6cc15208 Implement Location.replace 2016-11-18 12:38:12 +08:00
Pu Xingyu
9863149043 Move fragment navigation into Document object
Move the `check_and_scroll_fragment()` method into Document, make the
mothod set the fragment of url after navigation, and use the
`perform_a_scroll()` method to scroll rather than an individual
method. Also removes the broken `Window.fragment` fields.
2016-11-18 12:33:30 +08:00
Pu Xingyu
eca8f1d0b4 Make 'Document.url' field mutable
Use DOMRefCell as the type of the url field.
2016-11-18 12:29:02 +08:00
bors-servo
22aebdf5d4 Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon

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

Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.

Still wanted to get this in.

r? @SimonSapin

<!-- 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/14246)
<!-- Reviewable:end -->
2016-11-17 15:34:47 -06:00
bors-servo
e4a27c4d16 Auto merge of #14214 - bholley:dirtiness_overhaul, r=emilio
Overhaul dirtiness handling in Servo to prepare for the new incremental restyle architecture

<!-- 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/14214)
<!-- Reviewable:end -->
2016-11-17 12:25:52 -06:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Bobby Holley
95a49863c7 Prevent nodes from having DIRTY_DESCENDANTS set by default. 2016-11-17 09:31:44 -08:00
bors-servo
f70fc6644d Auto merge of #14096 - fflorent:11485-make-dom-methods-taking-mut-JSContent-unsafe, r=nox
11485 make dom methods taking mut js content unsafe

This is a rebased version of PR #11595

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

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

<!-- 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/14096)
<!-- Reviewable:end -->
2016-11-17 02:44:54 -06:00
bors-servo
afc60bee28 Auto merge of #14190 - Manishearth:cssom, r=SimonSapin
Immutable CSSOM

This PR is intended to add basic support for all CSSOM interfaces, with the ability to index `document.styleSheets` and css rule lists, and serializing individual css rules. Handling individual interface methods for CSSRule subclasses can probably be done with easy/medium bugs.

Mutation safety isn't dealt with here; if the css rule list is mutated the CSSOM will be in an inconsistent state. I intend to deal with this via zero sized tokens, see https://groups.google.com/forum/#!topic/mozilla.dev.servo/AnxJoVmtMXQ .  I'll handle that when I start making the CSSOM mutable. (Getting the immutable bit landed first opens this up for easy bugs)

This doesn't really change style aside from adding an extra arc in the CSS rule list as discussed in the linked thread. So far this same design can be used by stylo as well when the time comes.

f? @SimonSapin @emilio

cc @upsuper

part of #11420
Todo:

 - [x] Stubs for rest of the CSSRule subclasses
 - [x] <s>ToCSS impls for CSSRules.</s> May make into easy bugs and stub out in this PR https://github.com/servo/servo/issues/14195
 - [x] Cache CSSStyleSheet on the relevant node

<!-- 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/14190)
<!-- Reviewable:end -->
2016-11-16 15:05:59 -06:00
Bobby Holley
b31ed2298c Eliminate HAS_CHANGED in favor of explicit RestyleDamage. 2016-11-16 12:09:49 -08:00
Bobby Holley
f1043f6305 Track all node damage with PendingRestyles. 2016-11-16 12:09:47 -08:00
Bobby Holley
0547a6b313 Expand the role of modified_elements to include explicit restyle hints and damage.
This will take the place of setting IS_DIRTY and HAS_CHANGED.
2016-11-15 10:51:14 -08:00
Manish Goregaokar
2fe390e237 Allow mutation of CssRules 2016-11-15 08:49:58 -08:00
Alan Jeffrey
c91ef86a20 Storage notifications routed via the constellation. 2016-11-15 09:57:12 -06:00
Manish Goregaokar
71a2b379c8 Unexpose CSSOM interfaces 2016-11-15 06:58:16 -08:00
Manish Goregaokar
177d6fa4ee Support basic immutable CSSOM 2016-11-15 06:56:18 -08:00
Manish Goregaokar
2220fcdc0b Arc all Vec<CSSRule>s, put in CSSRules type 2016-11-15 06:56:17 -08:00
Bobby Holley
dda2928386 Remove TDocument from the style and layout crates.
The style system never actually does anything with the document. This allows us
to remove a bunch of stubbing on the Gecko side and streamline some things on
the Servo side in future patches.
2016-11-14 13:04:13 -08:00
bors-servo
4f53626c23 Auto merge of #14205 - szeged:minor-fixes, r=jdm
Minor fixes for the WebBluetooth implementation

<!-- Please describe your changes on the following line: -->
1. Fix for a comment typo in `bluetooth.rs `.
2. Simplify caling `self.request_bluetooth_devices` in `bluetooth.rs` in `Step 2`.
We already have a check in `Step 1` to prevent calling `request_bluetooth_devices` with a `Some` value if `option.acceptAllDevices` is true, and `option.filters` is already an `Option`, so there is no need for the `None` in the else branch.
3. Updating the bluetooth extension in `Navigator.webidl `, to match the [specification](https://webbluetoothcg.github.io/web-bluetooth/#navigator-extensions).
4. Replace the `_` separating the characteristic property strings with `-` as described  [here](http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/gatt-api.txt#n142)

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

<!-- 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/14205)
<!-- Reviewable:end -->
2016-11-14 13:50:51 -06:00
bors-servo
0d22adfd42 Auto merge of #14201 - nox:write, r=SimonSapin
Reorganise ServoParser

<!-- 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/14201)
<!-- Reviewable:end -->
2016-11-14 10:22:25 -06:00
zakorgyula
997f9f67f0 Updating bluetooth in Navigator.webidl 2016-11-14 14:25:25 +01:00
Zakor Gyula
dd4b0cf620 Simplify RequestDevice function in bluetooth.rs 2016-11-14 13:21:14 +01:00
Zakor Gyula
30f924d8f6 Fix a typo in dom/bluetooth.rs 2016-11-14 13:21:13 +01:00
Abelardo E. Mendoza
b372e7c98f script creates methods taking '*mut JSContext' unsafe
rebase + marked the necessary new code as unsafe
2016-11-14 11:06:17 +01:00
Anthony Ramine
15e8e92540 Reorganise ServoParser
Free-standing fonctions parse_html and friends are now static methods
on ServoParser, and the HTML and XML tokenizers have been moved to private
submodules.
2016-11-14 10:21:07 +01:00
Takanori Ishibashi
72c83c9394 CSSRule -> CssRule 2016-11-14 16:41:25 +09:00
bors-servo
f04033a139 Auto merge of #14184 - jmcomets:tab-no-default-action, r=metajack
Return `KeyReaction::Nothing` for a Tab event

Do nothing instead of triggering the default action for a tab event.

Hitting the tab key in an html text input shouldn't submit the form, and for any text input, the tab key should have a particular action associated, not the default action.
This cleans up #12701.

- [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/14184)
<!-- Reviewable:end -->
2016-11-12 09:58:29 -06:00
Jean-Marie Comets
319153640c Return KeyReaction::Nothing for a Tab event
Hitting the tab key in an html text input shouldn't submit the form, and
for any text input, the tab key should have a particular action
associated, not the default action. This cleans up #12701.
2016-11-12 15:49:00 +01:00
bors-servo
579ab2d99c Auto merge of #13774 - KiChjang:event-source-constructor, r=jdm
Finish up the implementation of EventSource

Full implementation of EventSource, complete with closing and reopening streams.

Fixes #8925.

<!-- 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/13774)

<!-- Reviewable:end -->
2016-11-12 08:08:38 -06:00
bors-servo
6911a2f652 Auto merge of #14179 - emilio:racy-script, r=jdm
script: Ensure script is initialized before running script.

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

Fixes the race causing #14154. Service workers are ok because they contain explicit synchronization.

r? @asajeffrey or @jdm

<!-- 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/14179)
<!-- Reviewable:end -->
2016-11-11 23:02:17 -06:00
Emilio Cobos Álvarez
a7cee44f59
script: Ensure script is initialized before running script.
Fixes #14154
2016-11-12 02:27:51 +01:00
Keith Yeung
a5c2c0ba4b Use a timer callback when re-establishing a connection 2016-11-11 14:52:20 -08:00
Keith Yeung
0b32b624a7 Interpret event stream 2016-11-11 14:50:49 -08:00
Keith Yeung
c198bfa388 Add GenerationId to EventSource 2016-11-11 14:50:48 -08:00
Keith Yeung
2924726b0a Implement reestablishing the connection for EventSource
And remove unneeded fields in EventSourceContext
2016-11-11 14:50:47 -08:00
Keith Yeung
9afc17cd3a Remove preferences in EventSource.webidl 2016-11-11 14:50:45 -08:00
Keith Yeung
388c3bff7b Parse metadata in EventSource 2016-11-11 14:50:44 -08:00
Keith Yeung
72cb856e31 Properly implement TaskSource for NetworkingTaskSource 2016-11-11 14:50:42 -08:00
Keith Yeung
d99d26cf1f Implement the constructor for EventSource 2016-11-11 14:50:37 -08:00
bors-servo
4b9693cf81 Auto merge of #14120 - Manishearth:logical, r=emilio
Support logical properties in style

Adds support for the logical block-end/inline-start/etc properties. These properties (like `border-block-end-color`) map to "physical" properties (e.g. `border-top-color`) depending on the writing mode.

Todo:

 - [x] Handle shorthands
 - [x] Make geckolib setters work
 - [x] Handle padding/offset logical properties
 - [x] Perhaps handle `-block-size`, `-inline-size` type logical properties?
 - [x] Tests?

This will overall add 16 new longhands and 4 new shorthands, taking a big bite out of the [remaining properties work](https://manishearth.github.io/css-properties-list/?stylo=hide&servo=hide&firefox=only&chrome=show&mdn=false&alexa=false)

f? @emilio @SimonSapin

<!-- 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/14120)
<!-- Reviewable:end -->
2016-11-11 15:41:08 -06:00
Manish Goregaokar
5fad7b0ff6 Add support for inline-size, block-size, and max-*-size/min-*-size 2016-11-11 11:56:27 -08:00
Manish Goregaokar
f974719d9f Add logical padding, margin longhands and border shorthands 2016-11-11 11:55:59 -08:00
Manish Goregaokar
e34eb13d65 Support logical properties 2016-11-11 11:55:57 -08:00