Commit graph

312 commits

Author SHA1 Message Date
nupurbaghel
b1adf8ee8a correct failing tests 2018-09-01 08:49:50 +00:00
nupurbaghel
d7cb68cb84 correct currentSrc function 2018-09-01 08:49:49 +00:00
Gregory Terzian
7b8d903d57 fire error when placeholder image is loaded 2018-08-26 19:06:16 +08:00
bors-servo
076198fe80
Auto merge of #21111 - gterzian:implement_document_load_cancellation, r=jdm
Implement document load cancellation

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #19309 fix #21114 fix #21113 (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/21111)
<!-- Reviewable:end -->
2018-07-29 11:14:29 -04:00
Gregory Terzian
ff62ca7c01 implement window.stop, improve aborting document load 2018-07-29 16:42:54 +08:00
bors-servo
b539ae7fe5
Auto merge of #21219 - paavininanda:Update_the_image_data, r=jdm
Complete remaining algo update_the_image_data

<!-- 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 #11416.

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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/21219)
<!-- Reviewable:end -->
2018-07-23 14:54:50 -04:00
paavininanda
5b77926460 Step3,4,5 2018-07-21 15:13:43 +05:30
nupurbaghel
c881c2a0fb implement step 5 of select_image_source 2018-07-21 01:44:20 +05:30
nupurbaghel
8d06da8afd implement update_source_set, select_image_source 2018-07-19 09:20:46 +05:30
Gregory Terzian
671627e97e introduce "per task source" ignoring of tasks 2018-07-10 13:42:28 +08:00
Emilio Cobos Álvarez
36495d677f
Remove unused code for parsing a sizes attribute.
We have `SourceSizeList` in
components/style/values/specified/source_size_list.rs which does the job and is
tested via WPT in Gecko.
2018-07-01 10:53:42 +02:00
Emilio Cobos Álvarez
895946bb18
layout: script: Fix build. 2018-06-23 20:34:10 +02:00
bors-servo
dcd7d2fa32 Auto merge of #18981 - KiChjang:fold-type-destination, r=avadacatavra
Merge request type and destination

Fixes #18278.

<!-- 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/18981)
<!-- Reviewable:end -->
2017-10-24 17:02:18 -05:00
Keith Yeung
c6bb1cb9d5 Merge request type and destination 2017-10-23 11:19:35 -07:00
Matt Brubeck
2d45e9d2da Use try syntax for Option where appropriate 2017-10-20 08:25:35 -07:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
c7b1d3054f Change AttrValue::Url to AttrValue::ResolvedUrl
There is actually only one attribute that can use that, the one for
<body background>.
2017-10-15 11:03:20 +02:00
Anthony Ramine
605c679fee Fix URL attributes
URL attributes should always use AttrValue::Url, and the input should be
resolved against the document's base URL at setting time always.
2017-10-11 13:56:07 +02:00
Neha
1f1ca3ac8d Parse srcset attribute 2017-10-03 13:18:01 +02:00
bors-servo
77afc3f33a Auto merge of #18714 - jdm:sizes, r=jdm
Parse sizes attribute values

Squashed version of #17808.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (partially) #11416
- [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/18714)
<!-- Reviewable:end -->
2017-10-03 04:16:00 -05:00
Rakhi Sharma
c31b0e4bd2 Parse sizes attribute values. 2017-10-02 20:31:06 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
e2dac78d36 Rename LayoutJS<T> to LayoutDom<T> 2017-09-26 09:49:04 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Anthony Ramine
6c9fb5ae7a Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
2017-09-20 10:37:09 +02:00
Anthony Ramine
b3e27509b7 Use task! for step 11.4 of updating the image data 2017-09-18 02:47:21 +02:00
Anthony Ramine
5b41e66f27 Use task! to process image responses 2017-09-18 02:47:18 +02:00
Anthony Ramine
aa67ff30db Use task! for step 5.3.7 of updating the image data 2017-09-18 02:47:15 +02:00
Anthony Ramine
407af95db5 Use task! for step 9 of updating the image data 2017-09-18 02:47:14 +02:00
Anthony Ramine
fba54c7735 Use task! to fire a progress event when updating the image data 2017-09-18 02:47:12 +02:00
Anthony Ramine
46628fba05 Move Task to its own module 2017-09-18 02:47:04 +02:00
Anthony Ramine
56117d3185 Rename Runnable to Task
The changes are:
 * `*Runnable` -> `*Task`;
 * `RunnableMsg` -> `Task`;
 * `RunnableWrapper` -> `TaskCanceller`;
 * `MainThreadRunnable` -> `MainThreadTask`;
 * `wrap_runnable` -> `wrap_task`;
 * `get_runnable_wrapper` -> `task_canceller`;
 * `handler` -> `run`;
 * `main_thread_handler` -> `run_with_script_thread`.
2017-09-16 15:43:26 +02:00
toidiu
99e4504f85 move name implementation as default implementation to the trait and remove overrides. 2017-09-03 16:30:48 -04:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Omar Akkila
420a7878b9 Refactor HTMLImageElement::handle_event to be idiomatic
Clean up HTMLImageElement::handle_event

Area::hit_test now uses a reference instead of taking ownership

Fix trailing whitespace

Unalign => in match

Fix Area::hit_test tests to reflect updated function signature
2017-07-07 21:07:12 +04:00
Ellen Marie Dash
f2631c2010 Terminate current load blocker before reassignment
Fixes #17319.
2017-06-15 17:06:12 -04:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Gregory Terzian
5bf1105f02 fix double borrowing of image request 2017-06-01 10:25:34 +08:00
Gregory Terzian
71b0c10164 improve spec compliance of update the image data 2017-05-25 08:01:25 +08:00
SendilKumar N
5acee23f5d Use the origin of the actual image response when determining if a canvas is origin clean. 2017-05-19 09:38:50 -04:00
Christian Poveda
62821a6915 Solving merge conficts related to the html5ever_atoms -> html5ever change 2017-05-03 12:57:49 -05:00
Christian Poveda
875e422fe6 Changed all prefixes from DOMString to the atomic Prefix from html5ever 2017-05-03 10:17:42 -05:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
bors-servo
69eda6a60c Auto merge of #16063 - methyl:image-usemap-panics, r=nox
Avoid panics for empty or multibyte image usemap

<!-- Please describe your changes on the following line: -->
Some check were added to make sure we can call `split_at` with no risk of panics (when value is empty or the first char is multibyte).

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

<!-- 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/16063)
<!-- Reviewable:end -->
2017-04-12 07:34:27 -05:00
SendilKumar N
31dafcc5f3 making image element areas good at finding areas
linting errors

replaced with map

fixes comments

moving to document

added test cases

linting and updating manifest

changing test cases

linting fixes

manifest update

linting fixes

splitting the test cases into two
2017-04-04 23:11:44 +08:00