Commit graph

285 commits

Author SHA1 Message Date
Kuba Birecki
85f4da18a6 Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02:00
bors-servo
3011d4b450 Auto merge of #12404 - ConnorGBrewster:task_source_cleanup, r=asajeffrey
Clean up task sources and make all tasks cancellable

<!-- Please describe your changes on the following line: -->
This makes it so each task is a thin wrapper over a runnable and whenever a task is queued, it is automatically wrapped by the window's `runnable_wrapper`.

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

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

<!-- 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/12404)
<!-- Reviewable:end -->
2016-07-13 10:18:15 -07:00
Connor Brewster
5f7324a9a5 Make all task source runnables cancellable
Implement all Runnable methods on CancellableRunnable to redirect to their inner runnable
2016-07-13 09:59:51 -06:00
Simon Martin
ff4e07b6c4 Issue #12071: Don't submit forms when typing Tab on an input. 2016-07-12 23:50:00 +02:00
Zhen Zhang
5e051c08f6 Add ability to WPT-test file uploads and fetches, fixes #12322 2016-07-09 15:31:00 +08:00
Anthony Ramine
8ecb5962f3 Move util::str to style 2016-07-05 10:43:54 +02:00
bors-servo
36974f0746 Auto merge of #11875 - izgzhen:file-manager-backend, r=Manishearth
Integration and improvements of File API backends

Basically three major changes:

1. More complete origin check in `FileManagerThreadMsg`
2. Add reference counting logic to file manage store and script API
3. Integrate the support of slicing

r? @Manishearth

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

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11875)
<!-- Reviewable:end -->
2016-07-04 09:15:23 -07:00
Zhen Zhang
14d68968ed Integration and improvements of File API backends
1. More complete origin check in FileManagerThreadMsg
2. Add reference counting logic to file manage store and script API
3. Integrate the support of slicing
2016-07-04 23:02:03 +08:00
Zhen Zhang
411b1b5ffa Emit change event when files are selected 2016-07-03 23:21:45 +08:00
Zhen Zhang
6ca531fb8f Fix file-type input element 2016-06-30 14:18:11 +08:00
Zhen Zhang
74eb80dbd8 Implement filter for file-type input's accept attribute 2016-06-20 20:58:53 +08:00
Zhen Zhang
256c7e894e filepicker 2016-06-14 20:22:51 +08:00
Ms2ger
684510bc94 Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
bors-servo
0f1f99a4bf Auto merge of #11572 - nox:placeholder-shown, r=SimonSapin
Implement :placeholder-shown (fixes #10561)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11572)
<!-- Reviewable:end -->
2016-06-06 23:44:16 -05:00
Rafael Quintero
80aad09ae4 delete suffixes
delete suffixes for variants SubmittedFrom, ResetFrom

delete suffixes

for variants SubmittedFrom, ResetFrom
2016-06-04 09:23:55 -04:00
Anthony Ramine
ff899dc703 Implement :placeholder-shown (fixes #10561) 2016-06-03 14:45:14 +02:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Keith Yeung
c93ed39f33 Parse HTMLInputElement attributes 2016-05-24 10:12:18 -04:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
bors-servo
de79f96775 Auto merge of #11333 - Manishearth:submit-submit-button, r=nox
Include <button type=submit> data whilst constructing the form dataset

This makes it possible to close things in github (see
https://github.com/Manishearth/mitochondria/issues/1)

- [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 OR
- [ ] These changes do not require tests because _____

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11333)
<!-- Reviewable:end -->
2016-05-23 04:18:09 -07:00
Manish Goregaokar
102cdaa7cc
Include <button type=submit> data whilst constructing the form dataset 2016-05-23 15:12:19 +05:30
Zhen Zhang
dd590d088b Implement file-type functionalities in htmlinputelement and related
Changes include:
- Implement file selection and other DOM behaviours in htmlinputelement
- Integrate IpcSender<FileManagerThreadMsg> into ResourceThreads
- Improve filemanager_thread, including adding type_string field to SelectedFile
- Improve interfaces in FileList/File/Blob to accommodate the above changes
2016-05-23 15:35:46 +08:00
Ms2ger
cc2b2b50a7 Remove ConstellationChan.
It's a pointless abstraction that propagates the obsolete chan terminology,
swaps the order in which the sender and receiver are returned, and hides a
source of panics.
2016-05-19 17:13:44 +02:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Keith Yeung
f60de52aae Fire 'select' event in SetSelectionRange 2016-05-12 10:44:04 -04:00
Keith Yeung
cc049515dc Implement user interaction task source 2016-05-11 10:12:25 -04:00
Prabhjyot Singh Sodhi
cfde40e225 Support form submission of multipart/form-data 2016-04-30 21:42:50 -04:00
bors-servo
ac8406f4ae Auto merge of #10834 - yoava333:master, r=SimonSapin
added support for :read-only and :read-write pseudo-classes

partial fix for https://github.com/servo/servo/issues/10732

It's not a full fix because:
1. there's a bug in wpt-test https://github.com/w3c/web-platform-tests/issues/2889#issuecomment-214144420
2. we don't fully support all input types (namely image, color, hidden and range), which are defaulted to input text. this means that :read-write which is applicable to input text is mis-handled in those cases.
3. we don't support contenteditable, which is also possibly :read-write

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10834)
<!-- Reviewable:end -->
2016-04-29 08:12:18 -07:00
Ms2ger
897be5f6ee Reduce channel cloning. 2016-04-29 14:55:52 +02:00
bors-servo
cf121ad8df Auto merge of #10895 - mbrubeck:byteindex, r=pcwalton
Use byte indices instead of char indices for text runs

Replace character indices with UTF-8 byte offsets throughout all code dealing with text runs.  This eliminates a lot of complexity when converting from one to the other, and interoperates better with the rest of the Rust ecosystem.

For most code this is just a simple replacement of char indices with byte indices.  In a few places like glyph storage and text fragment scanning, it also lets us get rid of code that existed only to map between bytes and chars.

Also includes some related fixes to text shaping, discovered while working on this conversion.  See the commit messages for details.

r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10895)
<!-- Reviewable:end -->
2016-04-28 20:22:09 -07:00
Matt Brubeck
c4872d9544 Replace range::Range with std::ops::Range in script 2016-04-28 14:54:07 -07:00
Matt Brubeck
659305fe0a Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout the code dealing
with text shaping and breaking.  This eliminates a lot of complexity when
converting from one to the other, and interoperates better with the rest of
the Rust ecosystem.
2016-04-28 14:32:14 -07:00
Keith Yeung
33acb1937c Remove extraneous script_chan parameter from Trusted::new 2016-04-28 10:52:44 +02:00
Yoav Alon
9bf909ac2f added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
2016-04-27 01:38:58 +03:00
Alberto Corona
5e863f2eb8
Implement HTMLTextArea.setSelectionRange 2016-04-17 17:27:26 +02:00
bors-servo
934ae41fc9 Auto merge of #10522 - KiChjang:input-cleanup, r=frewsxcv
Various cleanups in HTMLInputElement

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10522)
<!-- Reviewable:end -->
2016-04-12 07:56:38 +05:30
Arnaud Marant
9b8f183cba Issue #10491 add HTMLInputElement attributes that reflect content identically
it uses a new version of string-cache https://github.com/servo/string-cache/pull/148
2016-04-12 00:15:57 +02:00
Keith Yeung
c9193eaeca Remove get_ prefix for functions in LayoutHTMLInputElementHelpers 2016-04-11 09:17:04 -04:00
Keith Yeung
2d503c8281 Rename fn get_form_datum to form_datum 2016-04-11 08:56:47 -04:00
Keith Yeung
814afd6537 Move check for mutability up as a guard clause 2016-04-11 08:55:26 -04:00
Keith Yeung
916c035b57 Rename fn mutable to is_mutable 2016-04-11 08:54:50 -04:00
Keith Yeung
f54a8fc845 Use fn in_same_group where appropriate 2016-04-11 08:41:46 -04:00
Keith Yeung
0541a01924 Rename get_radio_group_name to radio_group_name 2016-04-11 08:20:30 -04:00
Keith Yeung
e4cd8044a5 Remove unused fn get_indeterminate_state 2016-04-11 08:18:53 -04:00
Keith Yeung
311d2c65b6 Rename get_value_mode to value_mode 2016-04-11 08:07:32 -04:00
Corey Farwell
11a3ce1257 Remove get_* on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis

https://github.com/servo/servo/issues/6224
2016-04-10 22:49:35 -04:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Matt Brubeck
776aae6399 Fix incremental reflow of text selection changes
Also replace force_relayout methods with direct Node::dirty calls, for
clarity.
2016-04-01 22:00:05 -07:00
bors-servo
80d903a897 Auto merge of #10019 - rebstar6:htmllabelclick, r=jdm
Fix htmllabelelement click to activate correct element

Address https://github.com/servo/servo/issues/9928

Pass on label click to the label element's labeled control

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10019)
<!-- Reviewable:end -->
2016-03-30 05:41:00 +05:30
Rebecca
3c7e6a4be8 Fix HtmlLabelElement activation to run on correct element
Also removes old code that caused radio button clicks on disabled elements
2016-03-29 18:48:07 -04:00