Commit graph

351 commits

Author SHA1 Message Date
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Josh Matthews
646d48a2a1 Split HTMLImageElement's loading code into smaller pieces with fewer runnables. 2017-02-22 14:19:35 -05:00
Josh Matthews
0d2ec852ac Send response for image requests progressively to image cache. 2017-02-22 14:19:35 -05:00
Josh Matthews
980eb5ac33 Avoid dropping image requests on the ground from non-script-initiated reflow. 2017-02-22 14:19:35 -05:00
Josh Matthews
c890c9143c Make script thread initiate requests for images needed by layout.
In support of this goal, the layout thread collects information about
CSS images that are missing image data and hands it off to the script
thread after layout completes. The script thread stores a list of
nodes that will need to be reflowed after the associated network
request is complete. The script thread ensures that the nodes are
not GCed while a request is ongoing, which the layout thread is
incapable of guaranteeing.

The image cache's API has also been redesigned in support of this
work. No network requests are made by the new image cache, since it
does not possess the document-specific information necessary to
initiate them. Instead, there is now a single, synchronous
query operation that optionally reserves a slot when a cache
entry for a URL cannot be found. This reserved slot is then
the responsibility of the queryer to populate with the contents
of the network response for the URL once it is complete. Any
subsequent queries for the same URL will be informed that the
response is pending until that occurs.

The changes to layout also remove the synchronous image loading
code path, which means that reftests now test the same code
that non-test binaries execute. The decision to take a screenshot
now considers whether there are any outstanding image
requests for layout in order to avoid intermittent failures in
reftests that use CSS images.
2017-02-22 14:19:35 -05:00
Emilio Cobos Álvarez
728ce16b9d
script: Properly implement the image width and height getter.
Per https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-width:

    The IDL attributes width and height must return the rendered width and
    height of the image, in CSS pixels, if the image is being rendered, and is
    being rendered to a visual medium; or else the density-corrected intrinsic
    width and height of the image, in CSS pixels, if the image has intrinsic
    dimensions and is available but not being rendered to a visual medium; or
    else 0, if the image is not available or does not have intrinsic dimensions.
2017-01-18 16:49:53 +01:00
Emilio Cobos Álvarez
bdd7cb9753
script: Rename bounding_content_box to bounding_content_box_or_zero.
And make bounding_content_box preserve whether the element is rendered.
2017-01-18 16:49:52 +01:00
mrnayak
3d9e44a8c4 Handle crossorigin in link and refactor crossorigin handling
Implemented Step three and handled step four of obtain the resource part
of 4.2.4 The link element.
Link to spec : https://html.spec.whatwg.org/multipage/semantics.html#concept-link-obtain

Refactored crossOrigin handling in HTMLScriptElement, HTMLImageElement
2017-01-13 23:35:00 +05:30
bachar
980dde7e15 HTML image map support 2017-01-11 01:29:45 -08:00
Rohan Prinja
973f77c006 Make WebIDL constructors take a more specific global if possible (fixes #14071) 2016-11-30 23:23:41 +01:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Keith Yeung
72cb856e31 Properly implement TaskSource for NetworkingTaskSource 2016-11-11 14:50:42 -08:00
Corey Farwell
f447040ea9 Migrate EventTarget event firing functions to use Atoms.
This allows us to utilize more `atom` macros.
2016-11-03 17:04:30 -04:00
Corey Farwell
c3b279a4c3 Remove "fire a simple event" concept, refactor event firing API.
"fire a simple event" concept was removed in
https://github.com/whatwg/html/pull/1933.
2016-11-03 15:01:07 -04:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Corey Farwell
2944c8d964 Make make_enumerated_getter prettier again.
Fixes https://github.com/servo/servo/issues/4723.
2016-10-12 23:00:07 -04:00
Anthony Ramine
0b3ab875f4 Remove intrinsic Root::r() 2016-10-11 19:44:32 +02:00
Anthony Ramine
44ca9f3d71 Make TaskSource::queue take a &GlobalScope 2016-10-06 21:35:52 +02:00
Anthony Ramine
19108aa330 Pass a &GlobalScope to WebIDL static methods and constructors 2016-10-06 21:35:49 +02:00
Anthony Ramine
766010379e Introduce GlobalScope::as_window 2016-10-06 21:35:45 +02:00
bors-servo
19a5a30113 Auto merge of #13387 - emilio:debug-assertions, r=aneeshusa,jdm,pcwalton
Honor SERVO_ENABLE_DEBUG_ASSERTIONS on the build machines.

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

As part of #13127.

cc @aneeshusa

---
<!-- 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/13387)
<!-- Reviewable:end -->
2016-10-04 14:01:49 -05:00
Simon Sapin
aeb3efda1f Make script build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>.
The removal of this impl is not included in this commit.
CC https://github.com/servo/heapsize/issues/37#issuecomment-249861171
2016-10-04 13:45:58 +02:00
Emilio Cobos Álvarez
fdd8471310
script: Prevent an integer overflow that was hitting us on htmlimageelement.rs 2016-10-02 18:02:17 +02:00
Arthur Marble
883902bd97 Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
Paul Rouget
a48cf1d215 Trigger image.onerror 2016-08-23 07:51:47 +02:00
Josh Matthews
2aef518ce6 Make task queue API usable from non-main threads. 2016-07-14 13:27:41 -04:00
Kuba Birecki
85f4da18a6 Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02:00
Connor Brewster
ad30275d04 Move boxing to runnable initialization 2016-07-13 11:10:23 -06: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
Connor Brewster
afc0ccb48d Add event runnables
Make tasks a wrapper over runnables
2016-07-11 22:21:45 -06:00
Gabriel Poesia
502497fb1f Implement Runnable::name() for ImageResponseHandlerRunnable 2016-07-10 15:20:41 -03:00
Connor Brewster
d6f4dc06df Combined DOMManipulationTask runnable variants into a single variant 2016-07-06 10:46:56 -06:00
Manish Goregaokar
fe5ff70284
Don't crash when <img> fails to parse its src 2016-07-05 21:52:18 +05:30
Ms2ger
684510bc94 Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
Ms2ger
06a1d04ca6 Move LengthOrPercentageOrAuto to style::attr. 2016-06-06 08:54:34 +02: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
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Keith Yeung
33acb1937c Remove extraneous script_chan parameter from Trusted::new 2016-04-28 10:52:44 +02:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Arnaud Marant
77f52d2eab Issue #10574 Use the document base url in img
add a test with base path set to the resources path and an img with a cat and the reference directly to the image
2016-04-15 21:37:25 +02:00
akhan7
90359b1cba Implement image request concept for HTMLImageElement. Implement HTMLImageElement.currentSrc. 2016-04-12 14:11:31 -04:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Adrian Utrilla
bc1b8ef4c6 Inlined content_changed 2016-04-04 11:33:37 +02:00
Corey Farwell
bf4db405e4 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-03-31 21:12:38 -04:00
Eli Friedman
7b671d13a0 Use presentation hints correctly for the dimensions of <img>.
Mostly straightforward; includes some extra fixes to make `<canvas>`
work the same way as `<img>` for reflow.
2016-02-25 14:04:06 -05:00
Kamil Muszyński
076cc409e6 Issue #9561 Renamed *_thread_source to *_task_source and ThreadSource to TaskSource 2016-02-14 15:29:44 +01:00
Ms2ger
5317af1e19 Remove the global argument to EventTarget::{fire_event, fire_simple_event}. 2016-02-08 19:21:56 +01:00
jmr0
167ffa7a95 adding image metadata notification capabilities to image cache 2016-01-29 20:54:49 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Arthur Skobara
d38771e270 Implement EventTarget::fire_simple_event and EventTarget::fire_simple_event_params 2015-12-22 13:47:57 +06:00