aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules2
-rw-r--r--README.md3
-rw-r--r--cargo-nightly-build2
-rw-r--r--components/canvas/lib.rs3
-rw-r--r--components/compositing/compositor.rs46
-rw-r--r--components/compositing/compositor_layer.rs4
-rw-r--r--components/compositing/compositor_task.rs12
-rw-r--r--components/compositing/constellation.rs33
-rw-r--r--components/compositing/headless.rs4
-rw-r--r--components/compositing/lib.rs12
-rw-r--r--components/compositing/pipeline.rs10
-rw-r--r--components/compositing/scrolling.rs2
-rw-r--r--components/compositing/windowing.rs8
-rw-r--r--components/devtools/Cargo.toml3
-rw-r--r--components/devtools/actor.rs7
-rw-r--r--components/devtools/actors/console.rs14
-rw-r--r--components/devtools/actors/inspector.rs11
-rw-r--r--components/devtools/actors/root.rs4
-rw-r--r--components/devtools/actors/tab.rs12
-rw-r--r--components/devtools/lib.rs25
-rw-r--r--components/devtools/protocol.rs10
-rw-r--r--components/devtools_traits/Cargo.toml4
-rw-r--r--components/devtools_traits/lib.rs15
-rw-r--r--components/gfx/Cargo.toml2
-rw-r--r--components/gfx/color.rs7
-rw-r--r--components/gfx/display_list/mod.rs31
-rw-r--r--components/gfx/display_list/optimizer.rs4
-rw-r--r--components/gfx/font.rs5
-rw-r--r--components/gfx/font_cache_task.rs6
-rw-r--r--components/gfx/lib.rs23
-rw-r--r--components/gfx/paint_context.rs19
-rw-r--r--components/gfx/paint_task.rs54
-rw-r--r--components/gfx/platform/freetype/font_template.rs4
-rw-r--r--components/gfx/text/glyph.rs14
-rw-r--r--components/gfx/text/text_run.rs8
-rw-r--r--components/layout/Cargo.toml14
-rw-r--r--components/layout/block.rs30
-rw-r--r--components/layout/construct.rs4
-rw-r--r--components/layout/context.rs8
-rw-r--r--components/layout/css/matching.rs8
-rw-r--r--components/layout/display_list_builder.rs14
-rw-r--r--components/layout/floats.rs10
-rw-r--r--components/layout/flow.rs16
-rw-r--r--components/layout/fragment.rs20
-rw-r--r--components/layout/incremental.rs2
-rw-r--r--components/layout/inline.rs6
-rw-r--r--components/layout/layout_debug.rs18
-rw-r--r--components/layout/layout_task.rs24
-rw-r--r--components/layout/lib.rs25
-rw-r--r--components/layout/list_item.rs2
-rw-r--r--components/layout/model.rs4
-rw-r--r--components/layout/table.rs4
-rw-r--r--components/layout/table_caption.rs2
-rw-r--r--components/layout/table_cell.rs2
-rw-r--r--components/layout/table_colgroup.rs2
-rw-r--r--components/layout/table_row.rs2
-rw-r--r--components/layout/table_rowgroup.rs2
-rw-r--r--components/layout/table_wrapper.rs8
-rw-r--r--components/layout/text.rs4
-rw-r--r--components/layout/traversal.rs9
-rw-r--r--components/layout/util.rs5
-rw-r--r--components/layout/wrapper.rs2
-rw-r--r--components/layout_traits/lib.rs10
-rw-r--r--components/msg/Cargo.toml3
-rw-r--r--components/msg/compositor_msg.rs8
-rw-r--r--components/msg/constellation_msg.rs10
-rw-r--r--components/msg/lib.rs4
-rw-r--r--components/net/Cargo.toml10
-rw-r--r--components/net/about_loader.rs6
-rw-r--r--components/net/cookie.rs8
-rw-r--r--components/net/data_loader.rs6
-rw-r--r--components/net/fetch/request.rs2
-rw-r--r--components/net/file_loader.rs4
-rw-r--r--components/net/http_loader.rs12
-rw-r--r--components/net/lib.rs12
-rw-r--r--components/net/resource_task.rs26
-rw-r--r--components/plugins/casing.rs2
-rw-r--r--components/plugins/jstraceable.rs11
-rw-r--r--components/plugins/lib.rs3
-rw-r--r--components/plugins/utils.rs44
-rw-r--r--components/script/Cargo.toml7
-rw-r--r--components/script/build.rs18
-rw-r--r--components/script/cors.rs44
-rw-r--r--components/script/devtools.rs13
-rw-r--r--components/script/dom/bindings/DESIGN.md42
-rw-r--r--components/script/dom/bindings/cell.rs14
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py200
-rw-r--r--components/script/dom/bindings/conversions.rs22
-rw-r--r--components/script/dom/bindings/error.rs2
-rw-r--r--components/script/dom/bindings/global.rs2
-rw-r--r--components/script/dom/bindings/js.rs177
-rw-r--r--components/script/dom/bindings/refcounted.rs6
-rw-r--r--components/script/dom/bindings/str.rs7
-rw-r--r--components/script/dom/bindings/trace.rs18
-rw-r--r--components/script/dom/bindings/utils.rs19
-rw-r--r--components/script/dom/blob.rs2
-rw-r--r--components/script/dom/characterdata.rs6
-rw-r--r--components/script/dom/console.rs5
-rw-r--r--components/script/dom/cssstyledeclaration.rs7
-rw-r--r--components/script/dom/dedicatedworkerglobalscope.rs2
-rw-r--r--components/script/dom/document.rs2
-rw-r--r--components/script/dom/domexception.rs44
-rw-r--r--components/script/dom/domparser.rs2
-rw-r--r--components/script/dom/domrectlist.rs2
-rw-r--r--components/script/dom/domtokenlist.rs2
-rw-r--r--components/script/dom/element.rs24
-rw-r--r--components/script/dom/event.rs9
-rw-r--r--components/script/dom/formdata.rs4
-rw-r--r--components/script/dom/htmlbodyelement.rs2
-rw-r--r--components/script/dom/htmlcollection.rs9
-rw-r--r--components/script/dom/htmlelement.rs4
-rw-r--r--components/script/dom/htmlformelement.rs6
-rw-r--r--components/script/dom/htmliframeelement.rs6
-rw-r--r--components/script/dom/htmlimageelement.rs2
-rw-r--r--components/script/dom/htmlinputelement.rs2
-rw-r--r--components/script/dom/htmlmediaelement.rs2
-rw-r--r--components/script/dom/htmlobjectelement.rs4
-rw-r--r--components/script/dom/htmlscriptelement.rs2
-rw-r--r--components/script/dom/htmlserializer.rs2
-rw-r--r--components/script/dom/htmltablecellelement.rs2
-rw-r--r--components/script/dom/htmltitleelement.rs13
-rw-r--r--components/script/dom/keyboardevent.rs2
-rw-r--r--components/script/dom/mod.rs16
-rw-r--r--components/script/dom/node.rs9
-rw-r--r--components/script/dom/nodelist.rs4
-rw-r--r--components/script/dom/servohtmlparser.rs5
-rw-r--r--components/script/dom/storage.rs4
-rw-r--r--components/script/dom/webidls/XMLHttpRequestEventTarget.webidl2
-rw-r--r--components/script/dom/window.rs29
-rw-r--r--components/script/dom/worker.rs3
-rw-r--r--components/script/dom/workerglobalscope.rs2
-rw-r--r--components/script/dom/xmlhttprequest.rs15
-rw-r--r--components/script/layout_interface.rs4
-rw-r--r--components/script/lib.rs19
-rw-r--r--components/script/page.rs38
-rw-r--r--components/script/parse/html.rs9
-rw-r--r--components/script/script_task.rs86
-rw-r--r--components/script/textinput.rs4
-rw-r--r--components/script/timers.rs2
-rw-r--r--components/script_traits/Cargo.toml3
-rw-r--r--components/script_traits/lib.rs21
-rw-r--r--components/servo/Cargo.lock421
-rw-r--r--components/servo/Cargo.toml1
-rw-r--r--components/servo/lib.rs27
-rw-r--r--components/servo/main.rs14
-rw-r--r--components/style/Cargo.toml1
-rw-r--r--components/style/build.rs14
-rw-r--r--components/style/font_face.rs15
-rw-r--r--components/style/lib.rs8
-rw-r--r--components/style/media_queries.rs16
-rw-r--r--components/style/properties.mako.rs54
-rw-r--r--components/style/selector_matching.rs33
-rw-r--r--components/style/selectors.rs51
-rw-r--r--components/style/stylesheets.rs36
-rw-r--r--components/style/values.rs56
-rw-r--r--components/util/Cargo.toml9
-rw-r--r--components/util/cache.rs2
-rw-r--r--components/util/cursor.rs2
-rw-r--r--components/util/debug_utils.rs16
-rw-r--r--components/util/deque/mod.rs15
-rw-r--r--components/util/dlist.rs118
-rw-r--r--components/util/geometry.rs8
-rw-r--r--components/util/lib.rs21
-rw-r--r--components/util/logical_geometry.rs14
-rw-r--r--components/util/memory.rs52
-rw-r--r--components/util/opts.rs30
-rw-r--r--components/util/range.rs6
-rw-r--r--components/util/resource_files.rs19
-rw-r--r--components/util/smallvec.rs10
-rw-r--r--components/util/str.rs40
-rw-r--r--components/util/task_state.rs2
-rw-r--r--components/util/tid.rs4
-rw-r--r--components/util/time.rs4
-rw-r--r--components/util/vec.rs4
-rw-r--r--components/util/workqueue.rs3
-rw-r--r--ports/cef/Cargo.lock418
-rw-r--r--ports/cef/Cargo.toml13
-rw-r--r--ports/cef/browser.rs20
-rw-r--r--ports/cef/browser_host.rs2
-rw-r--r--ports/cef/command_line.rs6
-rw-r--r--ports/cef/core.rs23
-rw-r--r--ports/cef/eutil.rs2
-rw-r--r--ports/cef/lib.rs18
-rw-r--r--ports/cef/string.rs21
-rw-r--r--ports/cef/window.rs25
-rw-r--r--ports/cef/wrappers.rs34
-rw-r--r--ports/glutin/Cargo.toml2
-rw-r--r--ports/glutin/lib.rs7
-rw-r--r--ports/glutin/window.rs157
-rw-r--r--ports/gonk/Cargo.lock351
-rw-r--r--ports/gonk/Cargo.toml2
-rw-r--r--ports/gonk/build.rs2
-rw-r--r--ports/gonk/src/input.rs2
-rw-r--r--ports/gonk/src/lib.rs14
-rw-r--r--python/servo/build_commands.py7
-rw-r--r--python/servo/command_base.py1
-rw-r--r--python/servo/post_build_commands.py9
-rw-r--r--rust-snapshot-hash2
m---------support/android-rs-glue0
-rw-r--r--support/not-the-toml-you-re-looking-for.rs2
-rw-r--r--support/rust-task_info/Cargo.toml2
-rw-r--r--support/rust-task_info/build.rs21
-rw-r--r--support/rust-task_info/src/lib.rs2
-rw-r--r--tests/content/test_interfaces.html1
-rw-r--r--tests/contenttest.rs22
-rw-r--r--tests/ref/basic.list2
-rw-r--r--tests/ref/iframe/bg_color.html8
-rw-r--r--tests/ref/iframe/bg_color_ref.html6
-rw-r--r--tests/ref/percentage_height_root.html19
-rw-r--r--tests/ref/percentage_height_root_ref.html18
-rw-r--r--tests/reftest.rs22
-rw-r--r--tests/wpt/metadata/FileAPI/historical.html.ini5
-rw-r--r--tests/wpt/metadata/FileAPI/idlharness.html.ini15
-rw-r--r--tests/wpt/metadata/FileAPI/reading-data-section/FileReader-event-handler-attributes.html.ini20
-rw-r--r--tests/wpt/metadata/MANIFEST.json130
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini11
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-2.htm.ini2
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-3.htm.ini2
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-4.htm.ini1
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-5.htm.ini1
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/open-url-multi-window.htm.ini1
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/send-accept.htm.ini5
-rw-r--r--tests/wpt/metadata/XMLHttpRequest/send-entity-body-document.htm.ini4
-rw-r--r--tests/wpt/metadata/dom/interfaces.html.ini81
-rw-r--r--tests/wpt/metadata/dom/nodes/Document-URL.sub.html.ini6
-rw-r--r--tests/wpt/metadata/dom/nodes/Element-matches.html.ini3
-rw-r--r--tests/wpt/metadata/dom/nodes/Node-parentNode.html.ini3
-rw-r--r--tests/wpt/metadata/dom/nodes/ParentNode-querySelector-All.html.ini3
-rw-r--r--tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini8
-rw-r--r--tests/wpt/metadata/html/browsers/browsing-the-web/read-text/load-text-plain.html.ini7
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_hash.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_host.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_hostname.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_pathname.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_port.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_protocol.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_search.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html.ini16
-rw-r--r--tests/wpt/metadata/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html.ini1
-rw-r--r--tests/wpt/metadata/html/dom/interfaces.html.ini75
-rw-r--r--tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_multiple.html.ini3
-rw-r--r--tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html.ini3
-rw-r--r--tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini6
-rw-r--r--tests/wpt/metadata/html/semantics/forms/the-input-element/files.html.ini71
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-for-event.html.ini12
-rw-r--r--tests/wpt/metadata/workers/semantics/xhr/001.html.ini6
-rw-r--r--tests/wpt/metadata/workers/semantics/xhr/002.html.ini6
-rw-r--r--tests/wpt/metadata/workers/semantics/xhr/003.html.ini3
-rw-r--r--tests/wpt/metadata/workers/semantics/xhr/004.html.ini3
-rw-r--r--tests/wpt/metadata/workers/semantics/xhr/005.html.ini6
-rw-r--r--tests/wpt/metadata/workers/semantics/xhr/006.html.ini3
m---------tests/wpt/web-platform-tests0
255 files changed, 2800 insertions, 2043 deletions
diff --git a/.gitignore b/.gitignore
index 872af92f190..1d637c769db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
/Cargo.lock
/target
/components/servo/target
+/ports/gonk/target
/ports/cef/target
/ports/android/bin
/ports/android/libs
diff --git a/.gitmodules b/.gitmodules
index cbc43176bd7..5dc311b8701 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -3,4 +3,4 @@
url = https://github.com/servo/web-platform-tests.git
[submodule "support/android-rs-glue"]
path = support/android-rs-glue
- url = https://github.com/servo/android-rs-glue
+ url = https://github.com/tomaka/android-rs-glue
diff --git a/README.md b/README.md
index 93f8633131d..d7b7341ecc2 100644
--- a/README.md
+++ b/README.md
@@ -38,8 +38,7 @@ sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \
freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \
fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \
rpm-build openssl-devel cmake bzip2-devel libXcursor-devel
-pushd .
-cd /tmp
+pushd /tmp
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec
rpmbuild -bb msttcorefonts-2.5-1.spec
sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm
diff --git a/cargo-nightly-build b/cargo-nightly-build
index eba5c5f63b2..c267da5f4cc 100644
--- a/cargo-nightly-build
+++ b/cargo-nightly-build
@@ -1 +1 @@
-2015-01-09
+2015-02-07
diff --git a/components/canvas/lib.rs b/components/canvas/lib.rs
index 3e8350b8c37..af26c94d3ba 100644
--- a/components/canvas/lib.rs
+++ b/components/canvas/lib.rs
@@ -2,8 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#![feature(core)]
+
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
extern crate azure;
extern crate geom;
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index 7ece8277d61..3ed89b37604 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -21,7 +21,7 @@ use gfx::color;
use gfx::paint_task::Msg as PaintMsg;
use gfx::paint_task::PaintRequest;
use layers::geometry::{DevicePixel, LayerPixel};
-use layers::layers::{BufferRequest, Layer, LayerBufferSet};
+use layers::layers::{BufferRequest, Layer, LayerBuffer, LayerBufferSet};
use layers::rendergl;
use layers::rendergl::RenderContext;
use layers::scene::Scene;
@@ -29,12 +29,12 @@ use png;
use gleam::gl::types::{GLint, GLsizei};
use gleam::gl;
use script_traits::{ConstellationControlMsg, ScriptControlChan};
-use servo_msg::compositor_msg::{Epoch, LayerId};
-use servo_msg::compositor_msg::{ReadyState, PaintState, ScrollPolicy};
-use servo_msg::constellation_msg::{ConstellationChan, NavigationDirection};
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
-use servo_msg::constellation_msg::{PipelineId, WindowSizeData};
+use msg::compositor_msg::{Epoch, LayerId};
+use msg::compositor_msg::{ReadyState, PaintState, ScrollPolicy};
+use msg::constellation_msg::{ConstellationChan, NavigationDirection};
+use msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
+use msg::constellation_msg::{PipelineId, WindowSizeData};
use util::geometry::{PagePx, ScreenPx, ViewportPx};
use util::memory::MemoryProfilerChan;
use util::opts;
@@ -42,7 +42,7 @@ use util::time::{TimeProfilerCategory, profile, TimeProfilerChan};
use util::{memory, time};
use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
-use std::path::Path;
+use std::old_path::Path;
use std::num::Float;
use std::rc::Rc;
use std::slice::bytes::copy_memory;
@@ -142,7 +142,7 @@ enum CompositionRequest {
CompositeNow,
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
enum ShutdownState {
NotShuttingDown,
ShuttingDown,
@@ -1036,16 +1036,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
return results;
}
- fn send_back_unused_buffers(&mut self) {
- match self.root_pipeline {
- Some(ref pipeline) => {
- let unused_buffers = self.scene.collect_unused_buffers();
- if unused_buffers.len() != 0 {
- let message = PaintMsg::UnusedBuffer(unused_buffers);
- let _ = pipeline.paint_chan.send(message);
- }
- },
- None => {}
+ fn send_back_unused_buffers(&mut self,
+ unused_buffers: Vec<(Rc<Layer<CompositorData>>,
+ Vec<Box<LayerBuffer>>)>) {
+ for (layer, buffers) in unused_buffers.into_iter() {
+ let pipeline = self.get_pipeline(layer.get_pipeline_id());
+ let _ = pipeline.paint_chan.send_opt(PaintMsg::UnusedBuffer(buffers));
}
}
@@ -1073,11 +1069,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
/// Returns true if any buffer requests were sent or false otherwise.
fn send_buffer_requests_for_all_layers(&mut self) -> bool {
let mut layers_and_requests = Vec::new();
- self.scene.get_buffer_requests(&mut layers_and_requests,
- Rect(TypedPoint2D(0f32, 0f32), self.window_size.as_f32()));
+ let mut unused_buffers = Vec::new();
+ self.scene.get_buffer_requests(&mut layers_and_requests, &mut unused_buffers);
// Return unused tiles first, so that they can be reused by any new BufferRequests.
- self.send_back_unused_buffers();
+ self.send_back_unused_buffers(unused_buffers);
if layers_and_requests.len() == 0 {
return false;
@@ -1194,9 +1190,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {
for y in range(0, height) {
let dst_start = y * stride;
let src_start = (height - y - 1) * stride;
- let src_slice = orig_pixels.slice(src_start, src_start + stride);
- copy_memory(pixels.slice_mut(dst_start, dst_start + stride),
- src_slice.slice_to(stride));
+ let src_slice = &orig_pixels[src_start .. src_start + stride];
+ copy_memory(&mut pixels[dst_start .. dst_start + stride],
+ &src_slice[..stride]);
}
let mut img = png::Image {
width: width as u32,
diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs
index d9f5ba21ca2..2f5a9059423 100644
--- a/components/compositing/compositor_layer.rs
+++ b/components/compositing/compositor_layer.rs
@@ -18,8 +18,8 @@ use layers::geometry::LayerPixel;
use layers::layers::{Layer, LayerBufferSet};
use script_traits::CompositorEvent::{ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent};
use script_traits::{ScriptControlChan, ConstellationControlMsg};
-use servo_msg::compositor_msg::{Epoch, LayerId, ScrollPolicy};
-use servo_msg::constellation_msg::PipelineId;
+use msg::compositor_msg::{Epoch, LayerId, ScrollPolicy};
+use msg::constellation_msg::PipelineId;
use std::num::Float;
use std::rc::Rc;
diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs
index e2f21d0910e..f3504aa6704 100644
--- a/components/compositing/compositor_task.rs
+++ b/components/compositing/compositor_task.rs
@@ -18,16 +18,16 @@ use geom::size::Size2D;
use layers::platform::surface::{NativeCompositingGraphicsContext, NativeGraphicsMetadata};
use layers::layers::LayerBufferSet;
use pipeline::CompositionPipeline;
-use servo_msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState};
-use servo_msg::compositor_msg::{PaintListener, PaintState, ScriptListener, ScrollPolicy};
-use servo_msg::constellation_msg::{ConstellationChan, LoadData, PipelineId};
-use servo_msg::constellation_msg::{Key, KeyState, KeyModifiers};
+use msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState};
+use msg::compositor_msg::{PaintListener, PaintState, ScriptListener, ScrollPolicy};
+use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId};
+use msg::constellation_msg::{Key, KeyState, KeyModifiers};
use util::cursor::Cursor;
use util::geometry::PagePx;
use util::memory::MemoryProfilerChan;
use util::time::TimeProfilerChan;
use std::sync::mpsc::{channel, Sender, Receiver};
-use std::fmt::{Error, Formatter, Show};
+use std::fmt::{Error, Formatter, Debug};
use std::rc::Rc;
/// Sends messages to the compositor. This is a trait supplied by the port because the method used
@@ -223,7 +223,7 @@ pub enum Msg {
PaintTaskExited(PipelineId),
}
-impl Show for Msg {
+impl Debug for Msg {
fn fmt(&self, f: &mut Formatter) -> Result<(),Error> {
match *self {
Msg::Exit(..) => write!(f, "Exit"),
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs
index 31da0929b1a..dedf6e07b5e 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -6,8 +6,7 @@ use pipeline::{Pipeline, CompositionPipeline};
use compositor_task::CompositorProxy;
use compositor_task::Msg as CompositorMsg;
-use devtools_traits;
-use devtools_traits::DevtoolsControlChan;
+use devtools_traits::{DevtoolsControlChan, DevtoolsControlMsg};
use geom::rect::{Rect, TypedRect};
use geom::scale_factor::ScaleFactor;
use gfx::font_cache_task::FontCacheTask;
@@ -16,18 +15,18 @@ use layout_traits::LayoutTaskFactory;
use libc;
use script_traits::{CompositorEvent, ConstellationControlMsg};
use script_traits::{ScriptControlChan, ScriptTaskFactory};
-use servo_msg::compositor_msg::LayerId;
-use servo_msg::constellation_msg::{self, ConstellationChan, Failure};
-use servo_msg::constellation_msg::{IFrameSandboxState, NavigationDirection};
-use servo_msg::constellation_msg::{Key, KeyState, KeyModifiers};
-use servo_msg::constellation_msg::{LoadData, NavigationType};
-use servo_msg::constellation_msg::{PipelineExitType, PipelineId};
-use servo_msg::constellation_msg::{SubpageId, WindowSizeData};
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
-use servo_net::resource_task::ResourceTask;
-use servo_net::resource_task;
-use servo_net::storage_task::{StorageTask, StorageTaskMsg};
+use msg::compositor_msg::LayerId;
+use msg::constellation_msg::{self, ConstellationChan, Failure};
+use msg::constellation_msg::{IFrameSandboxState, NavigationDirection};
+use msg::constellation_msg::{Key, KeyState, KeyModifiers};
+use msg::constellation_msg::{LoadData, NavigationType};
+use msg::constellation_msg::{PipelineExitType, PipelineId};
+use msg::constellation_msg::{SubpageId, WindowSizeData};
+use msg::constellation_msg::Msg as ConstellationMsg;
+use net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
+use net::resource_task::ResourceTask;
+use net::resource_task;
+use net::storage_task::{StorageTask, StorageTaskMsg};
use util::cursor::Cursor;
use util::geometry::{PagePx, ViewportPx};
use util::opts;
@@ -36,7 +35,7 @@ use util::time::TimeProfilerChan;
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
use std::collections::{HashMap, HashSet};
-use std::io;
+use std::old_io as io;
use std::mem::replace;
use std::rc::Rc;
use std::sync::mpsc::{Receiver, channel};
@@ -521,7 +520,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
self.image_cache_task.exit();
self.resource_task.send(resource_task::ControlMsg::Exit).unwrap();
self.devtools_chan.as_ref().map(|chan| {
- chan.send(devtools_traits::ServerExitMsg).unwrap();
+ chan.send(DevtoolsControlMsg::ServerExitMsg).unwrap();
});
self.storage_task.send(StorageTaskMsg::Exit).unwrap();
self.font_cache_task.exit();
@@ -1084,7 +1083,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
return; // Our message has been discarded, probably shutting down.
}
- let mut iter = frame_tree.iter();
+ let iter = frame_tree.iter();
for frame in iter {
frame.has_compositor_layer.set(true);
frame.pipeline.borrow().grant_paint_permission();
diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs
index d374cb28e54..3c57b0e3b82 100644
--- a/components/compositing/headless.rs
+++ b/components/compositing/headless.rs
@@ -7,8 +7,8 @@ use windowing::WindowEvent;
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_msg::constellation_msg::{ConstellationChan, WindowSizeData};
+use msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::{ConstellationChan, WindowSizeData};
use util::memory::MemoryProfilerChan;
use util::memory;
use util::time::TimeProfilerChan;
diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs
index 206fbf185ca..2fcf680cbf4 100644
--- a/components/compositing/lib.rs
+++ b/components/compositing/lib.rs
@@ -2,11 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(box_syntax, plugin)]
+#![feature(box_syntax)]
+#![feature(core)]
#![feature(int_uint)]
+#![feature(io)]
+#![feature(libc)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;
@@ -19,8 +23,8 @@ extern crate layers;
extern crate layout_traits;
extern crate png;
extern crate script_traits;
-extern crate "msg" as servo_msg;
-extern crate "net" as servo_net;
+extern crate msg;
+extern crate net;
#[macro_use]
extern crate util;
extern crate gleam;
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs
index 73881b0206c..9bb29db622f 100644
--- a/components/compositing/pipeline.rs
+++ b/components/compositing/pipeline.rs
@@ -10,12 +10,12 @@ use script_traits::{NewLayoutInfo, ConstellationControlMsg};
use devtools_traits::DevtoolsControlChan;
use gfx::paint_task::Msg as PaintMsg;
use gfx::paint_task::{PaintChan, PaintTask};
-use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId, SubpageId};
-use servo_msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType};
-use servo_net::image_cache_task::ImageCacheTask;
use gfx::font_cache_task::FontCacheTask;
-use servo_net::resource_task::ResourceTask;
-use servo_net::storage_task::StorageTask;
+use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, SubpageId};
+use msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType};
+use net::image_cache_task::ImageCacheTask;
+use net::resource_task::ResourceTask;
+use net::storage_task::StorageTask;
use util::time::TimeProfilerChan;
use std::rc::Rc;
use std::sync::mpsc::{Receiver, channel};
diff --git a/components/compositing/scrolling.rs b/components/compositing/scrolling.rs
index 24b57f90449..71e58bcd94a 100644
--- a/components/compositing/scrolling.rs
+++ b/components/compositing/scrolling.rs
@@ -6,7 +6,7 @@
use compositor_task::{CompositorProxy, Msg};
-use std::io::timer;
+use std::old_io::timer;
use std::sync::mpsc::{Receiver, Sender, channel};
use std::thread::Builder;
use std::time::duration::Duration;
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs
index 0c5e6c00ed3..8c20aedd8e5 100644
--- a/components/compositing/windowing.rs
+++ b/components/compositing/windowing.rs
@@ -11,11 +11,11 @@ use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeGraphicsMetadata;
-use servo_msg::compositor_msg::{PaintState, ReadyState};
-use servo_msg::constellation_msg::{Key, KeyState, KeyModifiers, LoadData};
+use msg::compositor_msg::{PaintState, ReadyState};
+use msg::constellation_msg::{Key, KeyState, KeyModifiers, LoadData};
use util::cursor::Cursor;
use util::geometry::ScreenPx;
-use std::fmt::{Error, Formatter, Show};
+use std::fmt::{Error, Formatter, Debug};
use std::rc::Rc;
#[derive(Clone)]
@@ -70,7 +70,7 @@ pub enum WindowEvent {
KeyEvent(Key, KeyState, KeyModifiers),
}
-impl Show for WindowEvent {
+impl Debug for WindowEvent {
fn fmt(&self, f: &mut Formatter) -> Result<(),Error> {
match *self {
WindowEvent::Idle => write!(f, "Idle"),
diff --git a/components/devtools/Cargo.toml b/components/devtools/Cargo.toml
index 23b7bf5fec8..a97c9f1c4a9 100644
--- a/components/devtools/Cargo.toml
+++ b/components/devtools/Cargo.toml
@@ -17,4 +17,5 @@ path = "../msg"
path = "../util"
[dependencies]
-time = "*" \ No newline at end of file
+time = "*"
+rustc-serialize = "0.2"
diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs
index 8fc9eecd055..37c0a9c0482 100644
--- a/components/devtools/actor.rs
+++ b/components/devtools/actor.rs
@@ -4,14 +4,13 @@
/// General actor system infrastructure.
-use std::any::Any;
+use std::any::{Any, TypeId};
use std::collections::HashMap;
use std::cell::{Cell, RefCell};
-use std::intrinsics::TypeId;
-use std::io::TcpStream;
+use std::old_io::TcpStream;
use std::mem::{replace, transmute};
use std::raw::TraitObject;
-use serialize::json;
+use rustc_serialize::json;
/// A common trait for all devtools actors that encompasses an immutable name
/// and the ability to process messages that are directed to particular actors.
diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs
index 246357a4230..e7151b55068 100644
--- a/components/devtools/actors/console.rs
+++ b/components/devtools/actors/console.rs
@@ -9,14 +9,15 @@
use actor::{Actor, ActorRegistry};
use protocol::JsonPacketStream;
-use devtools_traits::{EvaluateJS, NullValue, VoidValue, NumberValue, StringValue, BooleanValue};
-use devtools_traits::{ActorValue, DevtoolScriptControlMsg};
-use servo_msg::constellation_msg::PipelineId;
+use devtools_traits::EvaluateJSReply::{NullValue, VoidValue, NumberValue};
+use devtools_traits::EvaluateJSReply::{StringValue, BooleanValue, ActorValue};
+use devtools_traits::DevtoolScriptControlMsg;
+use msg::constellation_msg::PipelineId;
use collections::BTreeMap;
use core::cell::RefCell;
-use serialize::json::{self, Json, ToJson};
-use std::io::TcpStream;
+use rustc_serialize::json::{self, Json, ToJson};
+use std::old_io::TcpStream;
use std::num::Float;
use std::sync::mpsc::{channel, Sender};
@@ -221,7 +222,8 @@ impl Actor for ConsoleActor {
"evaluateJS" => {
let input = msg.get(&"text".to_string()).unwrap().as_string().unwrap().to_string();
let (chan, port) = channel();
- self.script_chan.send(EvaluateJS(self.pipeline, input.clone(), chan)).unwrap();
+ self.script_chan.send(DevtoolScriptControlMsg::EvaluateJS(
+ self.pipeline, input.clone(), chan)).unwrap();
//TODO: extract conversion into protocol module or some other useful place
let result = match try!(port.recv().map_err(|_| ())) {
diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs
index 77ee81d1bce..8b8bfb41f97 100644
--- a/components/devtools/actors/inspector.rs
+++ b/components/devtools/actors/inspector.rs
@@ -4,17 +4,18 @@
/// Liberally derived from the [Firefox JS implementation](http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/inspector.js).
-use devtools_traits::{GetRootNode, GetDocumentElement, GetChildren, DevtoolScriptControlMsg};
-use devtools_traits::{GetLayout, NodeInfo, ModifyAttribute};
+use devtools_traits::{DevtoolScriptControlMsg, NodeInfo};
+use devtools_traits::DevtoolScriptControlMsg::{GetRootNode, GetDocumentElement, GetChildren};
+use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute};
use actor::{Actor, ActorRegistry};
use protocol::JsonPacketStream;
use collections::BTreeMap;
-use servo_msg::constellation_msg::PipelineId;
-use serialize::json::{self, Json, ToJson};
+use msg::constellation_msg::PipelineId;
+use rustc_serialize::json::{self, Json, ToJson};
use std::cell::RefCell;
-use std::io::TcpStream;
+use std::old_io::TcpStream;
use std::sync::mpsc::{channel, Sender};
use std::num::Float;
diff --git a/components/devtools/actors/root.rs b/components/devtools/actors/root.rs
index cd9084c0282..453b3dd8161 100644
--- a/components/devtools/actors/root.rs
+++ b/components/devtools/actors/root.rs
@@ -10,8 +10,8 @@ use actor::{Actor, ActorRegistry};
use actors::tab::{TabActor, TabActorMsg};
use protocol::JsonPacketStream;
-use serialize::json;
-use std::io::TcpStream;
+use rustc_serialize::json;
+use std::old_io::TcpStream;
#[derive(RustcEncodable)]
struct ActorTraits {
diff --git a/components/devtools/actors/tab.rs b/components/devtools/actors/tab.rs
index 005009ebcc2..cee5b122905 100644
--- a/components/devtools/actors/tab.rs
+++ b/components/devtools/actors/tab.rs
@@ -8,11 +8,11 @@
use actor::{Actor, ActorRegistry};
use actors::console::ConsoleActor;
-use devtools_traits::WantsLiveNotifications;
+use devtools_traits::DevtoolScriptControlMsg::WantsLiveNotifications;
use protocol::JsonPacketStream;
-use serialize::json;
-use std::io::TcpStream;
+use rustc_serialize::json;
+use std::old_io::TcpStream;
#[derive(RustcEncodable)]
struct TabTraits;
@@ -100,7 +100,8 @@ impl Actor for TabActor {
let console_actor = registry.find::<ConsoleActor>(self.console.as_slice());
console_actor.streams.borrow_mut().push(stream.clone());
stream.write_json_packet(&msg);
- console_actor.script_chan.send(WantsLiveNotifications(console_actor.pipeline, true)).unwrap();
+ console_actor.script_chan.send(
+ WantsLiveNotifications(console_actor.pipeline, true)).unwrap();
true
}
@@ -114,7 +115,8 @@ impl Actor for TabActor {
let console_actor = registry.find::<ConsoleActor>(self.console.as_slice());
console_actor.streams.borrow_mut().pop();
stream.write_json_packet(&msg);
- console_actor.script_chan.send(WantsLiveNotifications(console_actor.pipeline, false)).unwrap();
+ console_actor.script_chan.send(
+ WantsLiveNotifications(console_actor.pipeline, false)).unwrap();
true
}
diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs
index 20f58fd066a..1b31e5e7166 100644
--- a/components/devtools/lib.rs
+++ b/components/devtools/lib.rs
@@ -10,11 +10,11 @@
#![crate_name = "devtools"]
#![crate_type = "rlib"]
-#![feature(int_uint, box_syntax)]
+#![feature(int_uint, box_syntax, io, core, rustc_private)]
+#![feature(collections, std_misc)]
#![allow(non_snake_case)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;
@@ -22,9 +22,8 @@ extern crate log;
extern crate collections;
extern crate core;
extern crate devtools_traits;
-extern crate "serialize" as rustc_serialize;
-extern crate serialize;
-extern crate "msg" as servo_msg;
+extern crate "rustc-serialize" as rustc_serialize;
+extern crate msg;
extern crate time;
extern crate util;
@@ -35,9 +34,9 @@ use actors::root::RootActor;
use actors::tab::TabActor;
use protocol::JsonPacketStream;
-use devtools_traits::{ServerExitMsg, DevtoolsControlMsg, NewGlobal, DevtoolScriptControlMsg};
-use devtools_traits::{DevtoolsPageInfo, SendConsoleMessage, ConsoleMessage};
-use servo_msg::constellation_msg::PipelineId;
+use devtools_traits::{ConsoleMessage, DevtoolsControlMsg};
+use devtools_traits::{DevtoolsPageInfo, DevtoolScriptControlMsg};
+use msg::constellation_msg::PipelineId;
use util::task::spawn_named;
use std::borrow::ToOwned;
@@ -45,8 +44,8 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::mpsc::TryRecvError::{Disconnected, Empty};
-use std::io::{TcpListener, TcpStream};
-use std::io::{Acceptor, Listener, TimedOut};
+use std::old_io::{TcpListener, TcpStream};
+use std::old_io::{Acceptor, Listener, TimedOut};
use std::sync::{Arc, Mutex};
use time::precise_time_ns;
@@ -231,11 +230,11 @@ fn run_server(receiver: Receiver<DevtoolsControlMsg>, port: u16) {
match acceptor.accept() {
Err(ref e) if e.kind == TimedOut => {
match receiver.try_recv() {
- Ok(ServerExitMsg) | Err(Disconnected) => break,
- Ok(NewGlobal(id, sender, pageinfo)) =>
+ Ok(DevtoolsControlMsg::ServerExitMsg) | Err(Disconnected) => break,
+ Ok(DevtoolsControlMsg::NewGlobal(id, sender, pageinfo)) =>
handle_new_global(actors.clone(), id,sender, &mut actor_pipelines,
pageinfo),
- Ok(SendConsoleMessage(id, console_message)) =>
+ Ok(DevtoolsControlMsg::SendConsoleMessage(id, console_message)) =>
handle_console_message(actors.clone(), id, console_message,
&actor_pipelines),
Err(Empty) => acceptor.set_timeout(Some(POLL_TIMEOUT)),
diff --git a/components/devtools/protocol.rs b/components/devtools/protocol.rs
index 149c3a301d2..07534df139b 100644
--- a/components/devtools/protocol.rs
+++ b/components/devtools/protocol.rs
@@ -6,9 +6,9 @@
//! [JSON packets]
//! (https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport#JSON_Packets).
-use serialize::{json, Encodable};
-use serialize::json::Json;
-use std::io::{IoError, OtherIoError, EndOfFile, TcpStream, IoResult};
+use rustc_serialize::{json, Encodable};
+use rustc_serialize::json::Json;
+use std::old_io::{IoError, OtherIoError, EndOfFile, TcpStream, IoResult};
use std::num;
pub trait JsonPacketStream {
@@ -18,7 +18,7 @@ pub trait JsonPacketStream {
impl JsonPacketStream for TcpStream {
fn write_json_packet<'a, T: Encodable>(&mut self, obj: &T) {
- let s = json::encode(obj).replace("__type__", "type");
+ let s = json::encode(obj).unwrap().replace("__type__", "type");
println!("<- {}", s);
self.write_str(s.len().to_string().as_slice()).unwrap();
self.write_u8(':' as u8).unwrap();
@@ -39,7 +39,7 @@ impl JsonPacketStream for TcpStream {
let packet_buf = self.read_exact(packet_len).unwrap();
let packet = String::from_utf8(packet_buf).unwrap();
println!("{}", packet);
- return Ok(json::from_str(packet.as_slice()).unwrap())
+ return Ok(Json::from_str(packet.as_slice()).unwrap())
},
Err(ref e) if e.kind == EndOfFile =>
return Err(IoError { kind: EndOfFile, desc: "EOF", detail: None }),
diff --git a/components/devtools_traits/Cargo.toml b/components/devtools_traits/Cargo.toml
index 859ce0cff45..e263f2fa299 100644
--- a/components/devtools_traits/Cargo.toml
+++ b/components/devtools_traits/Cargo.toml
@@ -12,3 +12,7 @@ path = "../msg"
[dependencies.util]
path = "../util"
+
+[dependencies]
+url = "0.2.16"
+rustc-serialize = "0.2"
diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs
index 7ad368e2cd1..bb83117740e 100644
--- a/components/devtools_traits/lib.rs
+++ b/components/devtools_traits/lib.rs
@@ -13,19 +13,14 @@
#![allow(non_snake_case)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
-extern crate "msg" as servo_msg;
-extern crate serialize;
+extern crate msg;
+extern crate "rustc-serialize" as rustc_serialize;
extern crate url;
extern crate util;
-pub use self::DevtoolsControlMsg::*;
-pub use self::DevtoolScriptControlMsg::*;
-pub use self::EvaluateJSReply::*;
-
-use serialize::{Decodable, Decoder};
-use servo_msg::constellation_msg::PipelineId;
+use rustc_serialize::{Decodable, Decoder};
+use msg::constellation_msg::PipelineId;
use util::str::DOMString;
use url::Url;
@@ -105,7 +100,7 @@ pub enum ScriptDevtoolControlMsg {
ReportConsoleMsg(String),
}
-#[derive(Encodable)]
+#[derive(RustcEncodable)]
pub struct Modification{
pub attributeName: String,
pub newValue: Option<String>,
diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml
index 4f9395a68a4..0ae81eafeee 100644
--- a/components/gfx/Cargo.toml
+++ b/components/gfx/Cargo.toml
@@ -66,3 +66,5 @@ path = "../script_traits"
[dependencies]
url = "0.2.16"
time = "0.1.12"
+bitflags = "*"
+rustc-serialize = "0.2"
diff --git a/components/gfx/color.rs b/components/gfx/color.rs
index 0bf03bff6dc..a91c6818ee6 100644
--- a/components/gfx/color.rs
+++ b/components/gfx/color.rs
@@ -3,9 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use azure::AzFloat;
-use azure::azure_hl::Color as AzColor;
+use azure::azure::AzColor;
-pub type Color = AzColor;
+#[inline]
+pub fn new(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
+ AzColor { r: r, g: g, b: b, a: a }
+}
#[inline]
pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index b54d7a553b5..799810e4a70 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -16,7 +16,6 @@
#![deny(unsafe_blocks)]
-use color::Color;
use display_list::optimizer::DisplayListOptimizer;
use paint_context::{PaintContext, ToAzureRect};
use self::DisplayItem::*;
@@ -25,13 +24,15 @@ use text::glyph::CharIndex;
use text::TextRun;
use azure::azure::AzFloat;
+use azure::azure_hl::{Color};
+
use collections::dlist::{self, DList};
use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D};
use geom::num::Zero;
use libc::uintptr_t;
use paint_task::PaintLayer;
-use servo_msg::compositor_msg::LayerId;
-use servo_net::image::base::Image;
+use msg::compositor_msg::LayerId;
+use net::image::base::Image;
use util::cursor::Cursor;
use util::dlist as servo_dlist;
use util::geometry::{self, Au, MAX_RECT, ZERO_RECT};
@@ -109,14 +110,12 @@ impl DisplayList {
/// `other` in the process.
#[inline]
pub fn append_from(&mut self, other: &mut DisplayList) {
- servo_dlist::append_from(&mut self.background_and_borders,
- &mut other.background_and_borders);
- servo_dlist::append_from(&mut self.block_backgrounds_and_borders,
- &mut other.block_backgrounds_and_borders);
- servo_dlist::append_from(&mut self.floats, &mut other.floats);
- servo_dlist::append_from(&mut self.content, &mut other.content);
- servo_dlist::append_from(&mut self.outlines, &mut other.outlines);
- servo_dlist::append_from(&mut self.children, &mut other.children);
+ self.background_and_borders.append(&mut other.background_and_borders);
+ self.block_backgrounds_and_borders.append(&mut other.block_backgrounds_and_borders);
+ self.floats.append(&mut other.floats);
+ self.content.append(&mut other.content);
+ self.outlines.append(&mut other.outlines);
+ self.children.append(&mut other.children);
}
/// Merges all display items from all non-float stacking levels to the `float` stacking level.
@@ -355,7 +354,7 @@ impl StackingContext {
fn hit_test_in_list<'a,I>(point: Point2D<Au>,
result: &mut Vec<DisplayItemMetadata>,
topmost_only: bool,
- mut iterator: I)
+ iterator: I)
where I: Iterator<Item=&'a DisplayItem> {
for item in iterator {
// TODO(pcwalton): Use a precise algorithm here. This will allow us to properly hit
@@ -512,7 +511,7 @@ impl BaseDisplayItem {
/// A clipping region for a display item. Currently, this can describe rectangles, rounded
/// rectangles (for `border-radius`), or arbitrary intersections of the two. Arbitrary transforms
/// are not supported because those are handled by the higher-level `StackingContext` abstraction.
-#[derive(Clone, PartialEq, Show)]
+#[derive(Clone, PartialEq, Debug)]
pub struct ClippingRegion {
/// The main rectangular region. This does not include any corners.
pub main: Rect<Au>,
@@ -526,7 +525,7 @@ pub struct ClippingRegion {
/// A complex clipping region. These don't as easily admit arbitrary intersection operations, so
/// they're stored in a list over to the side. Currently a complex clipping region is just a
/// rounded rectangle, but the CSS WGs will probably make us throw more stuff in here eventually.
-#[derive(Clone, PartialEq, Show)]
+#[derive(Clone, PartialEq, Debug)]
pub struct ComplexClippingRegion {
/// The boundaries of the rectangle.
pub rect: Rect<Au>,
@@ -750,7 +749,7 @@ pub struct BorderDisplayItem {
/// Information about the border radii.
///
/// TODO(pcwalton): Elliptical radii.
-#[derive(Clone, Default, PartialEq, Show, Copy)]
+#[derive(Clone, Default, PartialEq, Debug, Copy)]
pub struct BorderRadii<T> {
pub top_left: T,
pub top_right: T,
@@ -931,7 +930,7 @@ impl DisplayItem {
}
}
-impl fmt::Show for DisplayItem {
+impl fmt::Debug for DisplayItem {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{} @ {:?} ({:x})",
match *self {
diff --git a/components/gfx/display_list/optimizer.rs b/components/gfx/display_list/optimizer.rs
index 485cc1816a6..f14ff8a74a8 100644
--- a/components/gfx/display_list/optimizer.rs
+++ b/components/gfx/display_list/optimizer.rs
@@ -43,7 +43,7 @@ impl DisplayListOptimizer {
/// Adds display items that intersect the visible rect to `result_list`.
fn add_in_bounds_display_items<'a,I>(&self,
result_list: &mut DList<DisplayItem>,
- mut display_items: I)
+ display_items: I)
where I: Iterator<Item=&'a DisplayItem> {
for display_item in display_items {
if self.visible_rect.intersects(&display_item.base().bounds) &&
@@ -56,7 +56,7 @@ impl DisplayListOptimizer {
/// Adds child stacking contexts whose boundaries intersect the visible rect to `result_list`.
fn add_in_bounds_stacking_contexts<'a,I>(&self,
result_list: &mut DList<Arc<StackingContext>>,
- mut stacking_contexts: I)
+ stacking_contexts: I)
where I: Iterator<Item=&'a Arc<StackingContext>> {
for stacking_context in stacking_contexts {
let overflow = stacking_context.overflow.translate(&stacking_context.bounds.origin);
diff --git a/components/gfx/font.rs b/components/gfx/font.rs
index 15eebedbc09..21ab30ca0af 100644
--- a/components/gfx/font.rs
+++ b/components/gfx/font.rs
@@ -14,7 +14,6 @@ use style::computed_values::{font_stretch, font_variant, font_weight};
use style::properties::style_structs::Font as FontStyle;
use std::sync::Arc;
-use std::hash::Hash;
use platform::font_context::FontContextHandle;
use platform::font::{FontHandle, FontTable};
use util::geometry::Au;
@@ -59,7 +58,7 @@ impl FontTableTagConversions for FontTableTag {
fn tag_to_str(&self) -> String {
unsafe {
let pointer = mem::transmute::<&u32, *const u8>(self);
- let mut bytes = slice::from_raw_buf(&pointer, 4).to_vec();
+ let mut bytes = slice::from_raw_parts(pointer, 4).to_vec();
bytes.reverse();
String::from_utf8_unchecked(bytes)
}
@@ -70,7 +69,7 @@ pub trait FontTableMethods {
fn with_buffer<F>(&self, F) where F: FnOnce(*const u8, uint);
}
-#[derive(Clone, Show)]
+#[derive(Clone, Debug)]
pub struct FontMetrics {
pub underline_size: Au,
pub underline_offset: Au,
diff --git a/components/gfx/font_cache_task.rs b/components/gfx/font_cache_task.rs
index 5e48eabb409..8a87ed9fdb0 100644
--- a/components/gfx/font_cache_task.rs
+++ b/components/gfx/font_cache_task.rs
@@ -15,7 +15,7 @@ use std::sync::Arc;
use std::sync::mpsc::{Sender, Receiver, channel};
use font_template::{FontTemplate, FontTemplateDescriptor};
use platform::font_template::FontTemplateData;
-use servo_net::resource_task::{ResourceTask, load_whole_resource};
+use net::resource_task::{ResourceTask, load_whole_resource};
use util::task::spawn_named;
use util::str::LowercaseString;
use style::font_face::Source;
@@ -149,7 +149,7 @@ impl FontCache {
}
Source::Local(ref local_family_name) => {
let family = &mut self.web_families[family_name];
- get_variations_for_family(local_family_name.as_slice(), |&mut:path| {
+ get_variations_for_family(local_family_name.as_slice(), |path| {
family.add_template(path.as_slice(), None);
});
}
@@ -191,7 +191,7 @@ impl FontCache {
let s = &mut self.local_families[*family_name];
if s.templates.len() == 0 {
- get_variations_for_family(family_name.as_slice(), |&mut:path| {
+ get_variations_for_family(family_name.as_slice(), |path| {
s.add_template(path.as_slice(), None);
});
}
diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs
index 6985cb1d6b1..fcb57c2f807 100644
--- a/components/gfx/lib.rs
+++ b/components/gfx/lib.rs
@@ -2,15 +2,28 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(unsafe_destructor, int_uint, plugin, box_syntax)]
+#![feature(alloc)]
+#![feature(box_syntax)]
+#![feature(collections)]
+#![feature(core)]
+#![feature(hash)]
+#![feature(int_uint)]
+#![cfg_attr(any(target_os="linux", target_os = "android"), feature(io))]
+#![feature(libc)]
+#![cfg_attr(any(target_os="linux", target_os = "android"), feature(path))]
+#![feature(plugin)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
+#![feature(unicode)]
+#![feature(unsafe_destructor)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;
extern crate azure;
+#[macro_use] extern crate bitflags;
extern crate collections;
extern crate geom;
extern crate layers;
@@ -18,14 +31,14 @@ extern crate libc;
extern crate stb_image;
extern crate png;
extern crate script_traits;
-extern crate "serialize" as rustc_serialize;
+extern crate "rustc-serialize" as rustc_serialize;
extern crate unicode;
#[no_link] #[plugin]
extern crate "plugins" as servo_plugins;
-extern crate "net" as servo_net;
+extern crate net;
#[macro_use]
extern crate util;
-extern crate "msg" as servo_msg;
+extern crate msg;
extern crate style;
extern crate skia;
extern crate time;
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs
index 64495418ffe..566dd48b030 100644
--- a/components/gfx/paint_context.rs
+++ b/components/gfx/paint_context.rs
@@ -26,7 +26,7 @@ use geom::size::Size2D;
use libc::size_t;
use libc::types::common::c99::{uint16_t, uint32_t};
use png::PixelsByColorType;
-use servo_net::image::base::Image;
+use net::image::base::Image;
use util::geometry::{Au, MAX_RECT};
use util::opts;
use util::range::Range;
@@ -687,7 +687,10 @@ impl<'a> PaintContext<'a> {
}
fn scale_color(&self, color: Color, scale_factor: f32) -> Color {
- return Color::new(color.r * scale_factor, color.g * scale_factor, color.b * scale_factor, color.a);
+ return color::new(color.r * scale_factor,
+ color.g * scale_factor,
+ color.b * scale_factor,
+ color.a);
}
fn draw_double_border_segment(&self,
@@ -735,8 +738,8 @@ impl<'a> PaintContext<'a> {
lighter_color = color;
} else {
// You can't scale black color (i.e. 'scaled = 0 * scale', equals black).
- darker_color = Color::new(0.3, 0.3, 0.3, color.a);
- lighter_color = Color::new(0.7, 0.7, 0.7, color.a);
+ darker_color = color::new(0.3, 0.3, 0.3, color.a);
+ lighter_color = color::new(0.7, 0.7, 0.7, color.a);
}
let (outer_color, inner_color) = match (direction, is_groove) {
@@ -787,16 +790,16 @@ impl<'a> PaintContext<'a> {
scaled_color = match direction {
Direction::Top | Direction::Left => {
if is_inset {
- Color::new(0.3, 0.3, 0.3, color.a)
+ color::new(0.3, 0.3, 0.3, color.a)
} else {
- Color::new(0.7, 0.7, 0.7, color.a)
+ color::new(0.7, 0.7, 0.7, color.a)
}
}
Direction::Right | Direction::Bottom => {
if is_inset {
- Color::new(0.7, 0.7, 0.7, color.a)
+ color::new(0.7, 0.7, 0.7, color.a)
} else {
- Color::new(0.3, 0.3, 0.3, color.a)
+ color::new(0.3, 0.3, 0.3, color.a)
}
}
};
diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs
index 9331b4ce53e..bab531c3a0e 100644
--- a/components/gfx/paint_task.rs
+++ b/components/gfx/paint_task.rs
@@ -20,11 +20,11 @@ use layers::platform::surface::{NativeGraphicsMetadata, NativePaintingGraphicsCo
use layers::platform::surface::NativeSurface;
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
use layers;
-use servo_msg::compositor_msg::{Epoch, PaintState, LayerId};
-use servo_msg::compositor_msg::{LayerMetadata, PaintListener, ScrollPolicy};
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
-use servo_msg::constellation_msg::PipelineExitType;
+use msg::compositor_msg::{Epoch, PaintState, LayerId};
+use msg::compositor_msg::{LayerMetadata, PaintListener, ScrollPolicy};
+use msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
+use msg::constellation_msg::PipelineExitType;
use skia::SkiaGrGLNativeContextRef;
use util::geometry::{Au, ZERO_POINT};
use util::opts;
@@ -144,7 +144,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
time_profiler_chan: TimeProfilerChan,
shutdown_chan: Sender<()>) {
let ConstellationChan(c) = constellation_chan.clone();
- spawn_named_with_send_on_failure("PaintTask", task_state::PAINT, move |:| {
+ spawn_named_with_send_on_failure("PaintTask", task_state::PAINT, move || {
{
// Ensures that the paint task and graphics context are destroyed before the
// shutdown message.
@@ -336,7 +336,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
mut tiles: Vec<BufferRequest>,
scale: f32,
layer_id: LayerId) {
- profile(TimeProfilerCategory::Painting, None, self.time_profiler_chan.clone(), |:| {
+ profile(TimeProfilerCategory::Painting, None, self.time_profiler_chan.clone(), || {
// Bail out if there is no appropriate stacking context.
let stacking_context = if let Some(ref stacking_context) = self.root_stacking_context {
match display_list::find_stacking_context_with_layer_id(stacking_context,
@@ -355,12 +355,13 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
for (i, tile) in tiles.into_iter().enumerate() {
let thread_id = i % self.worker_threads.len();
let layer_buffer = self.find_or_create_layer_buffer_for_tile(&tile, scale);
- self.worker_threads[thread_id].paint_tile(tile,
+ self.worker_threads[thread_id].paint_tile(thread_id,
+ tile,
layer_buffer,
stacking_context.clone(),
scale);
}
- let new_buffers = (0..tile_count).map(|&mut :i| {
+ let new_buffers = (0..tile_count).map(|i| {
let thread_id = i % self.worker_threads.len();
self.worker_threads[thread_id].get_painted_tile_buffer()
}).collect();
@@ -423,9 +424,9 @@ impl WorkerThreadProxy {
let thread_count = if opts::get().gpu_painting {
1
} else {
- opts::get().layout_threads
+ opts::get().paint_threads
};
- (0..thread_count).map(|&:_| {
+ (0..thread_count).map(|_| {
let (from_worker_sender, from_worker_receiver) = channel();
let (to_worker_sender, to_worker_receiver) = channel();
let native_graphics_metadata = native_graphics_metadata.clone();
@@ -447,11 +448,12 @@ impl WorkerThreadProxy {
}
fn paint_tile(&mut self,
+ thread_id: usize,
tile: BufferRequest,
layer_buffer: Option<Box<LayerBuffer>>,
stacking_context: Arc<StackingContext>,
scale: f32) {
- self.sender.send(MsgToWorkerThread::PaintTile(tile, layer_buffer, stacking_context, scale)).unwrap()
+ self.sender.send(MsgToWorkerThread::PaintTile(thread_id, tile, layer_buffer, stacking_context, scale)).unwrap()
}
fn get_painted_tile_buffer(&mut self) -> Box<LayerBuffer> {
@@ -495,8 +497,8 @@ impl WorkerThread {
loop {
match self.receiver.recv().unwrap() {
MsgToWorkerThread::Exit => break,
- MsgToWorkerThread::PaintTile(tile, layer_buffer, stacking_context, scale) => {
- let draw_target = self.optimize_and_paint_tile(&tile, stacking_context, scale);
+ MsgToWorkerThread::PaintTile(thread_id, tile, layer_buffer, stacking_context, scale) => {
+ let draw_target = self.optimize_and_paint_tile(thread_id, &tile, stacking_context, scale);
let buffer = self.create_layer_buffer_for_painted_tile(&tile,
layer_buffer,
draw_target,
@@ -508,6 +510,7 @@ impl WorkerThread {
}
fn optimize_and_paint_tile(&mut self,
+ thread_id: usize,
tile: &BufferRequest,
stacking_context: Arc<StackingContext>,
scale: f32)
@@ -563,7 +566,24 @@ impl WorkerThread {
&matrix,
None);
paint_context.draw_target.flush();
- });
+ });
+
+ if opts::get().show_debug_parallel_paint {
+ // Overlay a transparent solid color to identify the thread that
+ // painted this tile.
+ let colors = [Color { r: 6.0/255.0, g: 153.0/255.0, b: 198.0/255.0, a: 0.7 },
+ Color { r: 255.0/255.0, g: 212.0/255.0, b: 83.0/255.0, a: 0.7 },
+ Color { r: 116.0/255.0, g: 29.0/255.0, b: 109.0/255.0, a: 0.7 },
+ Color { r: 204.0/255.0, g: 158.0/255.0, b: 199.0/255.0, a: 0.7 },
+ Color { r: 242.0/255.0, g: 46.0/255.0, b: 121.0/255.0, a: 0.7 },
+ Color { r: 116.0/255.0, g: 203.0/255.0, b: 196.0/255.0, a: 0.7 },
+ Color { r: 255.0/255.0, g: 249.0/255.0, b: 201.0/255.0, a: 0.7 },
+ Color { r: 137.0/255.0, g: 196.0/255.0, b: 78.0/255.0, a: 0.7 }];
+ paint_context.draw_solid_color(&Rect(Point2D(Au(0), Au(0)),
+ Size2D(Au::from_px(size.width as isize),
+ Au::from_px(size.height as isize))),
+ colors[thread_id % colors.len()]);
+ }
}
draw_target
@@ -582,7 +602,7 @@ impl WorkerThread {
// GPU painting mode, so that it doesn't have to recreate it.
if !opts::get().gpu_painting {
let mut buffer = layer_buffer.unwrap();
- draw_target.snapshot().get_data_surface().with_data(|&mut:data| {
+ draw_target.snapshot().get_data_surface().with_data(|data| {
buffer.native_surface.upload(native_graphics_context!(self), data);
debug!("painting worker thread uploading to native surface {}",
buffer.native_surface.get_id());
@@ -613,7 +633,7 @@ impl WorkerThread {
enum MsgToWorkerThread {
Exit,
- PaintTile(BufferRequest, Option<Box<LayerBuffer>>, Arc<StackingContext>, f32),
+ PaintTile(usize, BufferRequest, Option<Box<LayerBuffer>>, Arc<StackingContext>, f32),
}
enum MsgFromWorkerThread {
diff --git a/components/gfx/platform/freetype/font_template.rs b/components/gfx/platform/freetype/font_template.rs
index f2be1ad6d14..b41a5f0d7e6 100644
--- a/components/gfx/platform/freetype/font_template.rs
+++ b/components/gfx/platform/freetype/font_template.rs
@@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::borrow::ToOwned;
-use std::io;
-use std::io::File;
+use std::old_io as io;
+use std::old_io::File;
/// Platform specific font representation for Linux.
/// The identifier is an absolute path, and the bytes
diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs
index 37da641fde7..7341036e6d3 100644
--- a/components/gfx/text/glyph.rs
+++ b/components/gfx/text/glyph.rs
@@ -22,7 +22,7 @@ use util::vec::*;
/// In the uncommon case (multiple glyphs per unicode character, large glyph index/advance, or
/// glyph offsets), we pack the glyph count into GlyphEntry, and store the other glyph information
/// in DetailedGlyphStore.
-#[derive(Clone, Show, Copy)]
+#[derive(Clone, Debug, Copy)]
struct GlyphEntry {
value: u32,
}
@@ -251,7 +251,7 @@ impl GlyphEntry {
// Stores data for a detailed glyph, in the case that several glyphs
// correspond to one character, or the glyph's data couldn't be packed.
-#[derive(Clone, Show, Copy)]
+#[derive(Clone, Debug, Copy)]
struct DetailedGlyph {
id: GlyphId,
// glyph's advance, in the text's direction (LTR or RTL)
@@ -270,7 +270,7 @@ impl DetailedGlyph {
}
}
-#[derive(PartialEq, Clone, Eq, Show, Copy)]
+#[derive(PartialEq, Clone, Eq, Debug, Copy)]
struct DetailedGlyphRecord {
// source string offset/GlyphEntry offset in the TextRun
entry_offset: CharIndex,
@@ -345,7 +345,7 @@ impl<'a> DetailedGlyphStore {
// FIXME: Is this right? --pcwalton
// TODO: should fix this somewhere else
if count == 0 {
- return self.detail_buffer.slice(0, 0);
+ return &self.detail_buffer[0..0];
}
assert!((count as uint) <= self.detail_buffer.len());
@@ -361,7 +361,7 @@ impl<'a> DetailedGlyphStore {
assert!(i + (count as uint) <= self.detail_buffer.len());
// return a slice into the buffer
- self.detail_buffer.slice(i, i + count as uint)
+ &self.detail_buffer[i .. i + count as uint]
}
fn get_detailed_glyph_with_index(&'a self,
@@ -594,7 +594,7 @@ impl<'a> GlyphStore {
let entry = match first_glyph_data.is_missing {
true => GlyphEntry::missing(glyph_count),
false => {
- let glyphs_vec: Vec<DetailedGlyph> = (0..glyph_count as uint).map(|&:i| {
+ let glyphs_vec: Vec<DetailedGlyph> = (0..glyph_count as uint).map(|i| {
DetailedGlyph::new(data_for_glyphs[i].id,
data_for_glyphs[i].advance,
data_for_glyphs[i].offset)
@@ -786,7 +786,7 @@ impl<'a> Iterator for GlyphIterator<'a> {
self.next_glyph_range()
} else {
// No glyph range. Look at next character.
- self.char_range.next().and_then(|:i| {
+ self.char_range.next().and_then(|i| {
self.char_index = i;
assert!(i < self.store.char_len());
let entry = self.store.entry_buffer[i.to_uint()];
diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs
index 20429079c7e..9c28462411e 100644
--- a/components/gfx/text/text_run.rs
+++ b/components/gfx/text/text_run.rs
@@ -231,7 +231,7 @@ impl<'a> TextRun {
// Create a glyph store for this slice if it's nonempty.
if can_break_before && byte_i > byte_last_boundary {
- let slice = text.slice(byte_last_boundary, byte_i);
+ let slice = &text[byte_last_boundary .. byte_i];
debug!("creating glyph store for slice {} (ws? {}), {} - {} in run {}",
slice, !cur_slice_is_whitespace, byte_last_boundary, byte_i, text);
@@ -254,7 +254,7 @@ impl<'a> TextRun {
// Create a glyph store for the final slice if it's nonempty.
if byte_i > byte_last_boundary {
- let slice = text.slice_from(byte_last_boundary);
+ let slice = &text[byte_last_boundary..];
debug!("creating glyph store for final slice {} (ws? {}), {} - {} in run {}",
slice, cur_slice_is_whitespace, byte_last_boundary, text.len(), text);
@@ -343,7 +343,7 @@ impl<'a> TextRun {
Some(index) => index,
};
NaturalWordSliceIterator {
- glyph_iter: self.glyphs.slice_from(index).iter(),
+ glyph_iter: self.glyphs[index..].iter(),
range: *range,
}
}
@@ -356,7 +356,7 @@ impl<'a> TextRun {
None => self.glyphs.len(),
Some(index) => index,
};
- let mut glyph_run_iter = self.glyphs.slice_from(index).iter();
+ let mut glyph_run_iter = self.glyphs[index..].iter();
let first_glyph_run = glyph_run_iter.next();
CharacterSliceIterator {
glyph_run: first_glyph_run,
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index 8e7dadd144f..b24e2c2562c 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -7,12 +7,18 @@ authors = ["The Servo Project Developers"]
name = "layout"
path = "lib.rs"
+[dependencies.azure]
+git = "https://github.com/servo/rust-azure"
+
[dependencies.canvas]
path = "../canvas"
[dependencies.gfx]
path = "../gfx"
+[dependencies.msg]
+path = "../msg"
+
[dependencies.script]
path = "../script"
@@ -46,6 +52,12 @@ git = "https://github.com/servo/string-cache"
[dependencies.string_cache_macros]
git = "https://github.com/servo/string-cache"
+[dependencies.png]
+git = "https://github.com/servo/rust-png"
+
[dependencies]
encoding = "0.2"
-url = "0.2.16" \ No newline at end of file
+url = "0.2.16"
+bitflags = "*"
+rustc-serialize = "0.2"
+libc = "*"
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 167e3d99ddc..64e1372de2e 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -50,8 +50,8 @@ use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect, Size2D};
use gfx::display_list::{ClippingRegion, DisplayList};
-use serialize::{Encoder, Encodable};
-use servo_msg::compositor_msg::LayerId;
+use rustc_serialize::{Encoder, Encodable};
+use msg::compositor_msg::LayerId;
use servo_util::geometry::{Au, MAX_AU};
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
use servo_util::opts;
@@ -63,7 +63,7 @@ use style::computed_values::{overflow, position, box_sizing, display, float};
use std::sync::Arc;
/// Information specific to floated blocks.
-#[derive(Clone, Encodable)]
+#[derive(Clone, RustcEncodable)]
pub struct FloatedBlockInfo {
/// The amount of inline size that is available for the float.
pub containing_inline_size: Au,
@@ -735,7 +735,7 @@ impl BlockFlow {
traversal.process(flow);
let cb_block_start_edge_offset = flow.generated_containing_block_rect().start.b;
- let mut descendant_offset_iter = mut_base(flow).abs_descendants.iter_with_offset();
+ let descendant_offset_iter = mut_base(flow).abs_descendants.iter_with_offset();
// Pass in the respective static y offset for each descendant.
for (ref mut descendant_link, ref y_offset) in descendant_offset_iter {
let block = descendant_link.as_block();
@@ -1299,8 +1299,16 @@ impl BlockFlow {
// Calculate non-auto block size to pass to children.
let content_block_size = self.fragment.style().content_block_size();
- let explicit_content_size = match (content_block_size,
- self.base.block_container_explicit_block_size) {
+
+ let parent_container_size = if self.is_root() {
+ let screen_size = LogicalSize::from_physical(self.fragment.style.writing_mode,
+ layout_context.shared.screen_size);
+ Some(screen_size.block)
+ } else {
+ self.base.block_container_explicit_block_size
+ };
+
+ let explicit_content_size = match (content_block_size, parent_container_size) {
(LengthOrPercentageOrAuto::Percentage(percent), Some(container_size)) => {
Some(container_size.scale_by(percent))
}
@@ -1688,10 +1696,10 @@ impl Flow for BlockFlow {
}
} else if self.is_root() || self.base.flags.is_float() || self.is_inline_block() {
// Root element margins should never be collapsed according to CSS § 8.3.1.
- debug!("assign_block_size: assigning block_size for root flow");
+ debug!("assign_block_size: assigning block_size for root flow {:?}", flow::base(self).debug_id());
self.assign_block_size_block_base(ctx, MarginsMayCollapseFlag::MarginsMayNotCollapse);
} else {
- debug!("assign_block_size: assigning block_size for block");
+ debug!("assign_block_size: assigning block_size for block {:?}", flow::base(self).debug_id());
self.assign_block_size_block_base(ctx, MarginsMayCollapseFlag::MarginsMayCollapse);
}
}
@@ -1902,7 +1910,7 @@ impl Flow for BlockFlow {
}
}
-impl fmt::Show for BlockFlow {
+impl fmt::Debug for BlockFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"{:?} - {:x}: frag={:?} ({:?})",
@@ -1914,7 +1922,7 @@ impl fmt::Show for BlockFlow {
}
/// The inputs for the inline-sizes-and-margins constraint equation.
-#[derive(Show, Copy)]
+#[derive(Debug, Copy)]
pub struct ISizeConstraintInput {
pub computed_inline_size: MaybeAuto,
pub inline_start_margin: MaybeAuto,
@@ -1947,7 +1955,7 @@ impl ISizeConstraintInput {
}
/// The solutions for the inline-size-and-margins constraint equation.
-#[derive(Copy, Show)]
+#[derive(Copy, Debug)]
pub struct ISizeConstraintSolution {
pub inline_start: Au,
pub inline_end: Au,
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index c94ec8e9296..2d031d4f922 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -182,12 +182,12 @@ impl InlineFragmentsAccumulator {
}
}
- fn push_all(&mut self, fragments: DList<Fragment>) {
+ fn push_all(&mut self, mut fragments: DList<Fragment>) {
if fragments.len() == 0 {
return
}
- self.fragments.append(fragments)
+ self.fragments.append(&mut fragments)
}
fn to_dlist(self) -> DList<Fragment> {
diff --git a/components/layout/context.rs b/components/layout/context.rs
index 96925bbc55a..edf5c5177b2 100644
--- a/components/layout/context.rs
+++ b/components/layout/context.rs
@@ -14,11 +14,11 @@ use gfx::font_context::FontContext;
use gfx::font_cache_task::FontCacheTask;
use script::layout_interface::LayoutChan;
use script_traits::UntrustedNodeAddress;
-use servo_msg::constellation_msg::ConstellationChan;
-use servo_net::local_image_cache::LocalImageCache;
+use msg::constellation_msg::ConstellationChan;
+use net::local_image_cache::LocalImageCache;
use servo_util::geometry::Au;
+use std::boxed;
use std::cell::Cell;
-use std::mem;
use std::ptr;
use std::sync::{Arc, Mutex};
use style::selector_matching::Stylist;
@@ -40,7 +40,7 @@ fn create_or_get_local_context(shared_layout_context: &SharedLayoutContext) -> *
applicable_declarations_cache: ApplicableDeclarationsCache::new(),
style_sharing_candidate_cache: StyleSharingCandidateCache::new(),
};
- r.set(unsafe { mem::transmute(context) });
+ r.set(unsafe { boxed::into_raw(context) });
}
r.get()
diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs
index bc096e7728d..31c14804d6b 100644
--- a/components/layout/css/matching.rs
+++ b/components/layout/css/matching.rs
@@ -71,7 +71,7 @@ impl ApplicableDeclarationsCacheEntry {
impl PartialEq for ApplicableDeclarationsCacheEntry {
fn eq(&self, other: &ApplicableDeclarationsCacheEntry) -> bool {
- let this_as_query = ApplicableDeclarationsCacheQuery::new(self.declarations.as_slice());
+ let this_as_query = ApplicableDeclarationsCacheQuery::new(&*self.declarations);
this_as_query.eq(other)
}
}
@@ -79,7 +79,7 @@ impl Eq for ApplicableDeclarationsCacheEntry {}
impl<H: Hasher+Writer> Hash<H> for ApplicableDeclarationsCacheEntry {
fn hash(&self, state: &mut H) {
- let tmp = ApplicableDeclarationsCacheQuery::new(self.declarations.as_slice());
+ let tmp = ApplicableDeclarationsCacheQuery::new(&*self.declarations);
tmp.hash(state);
}
}
@@ -643,7 +643,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
if applicable_declarations.before.len() > 0 {
damage = damage | self.cascade_node_pseudo_element(
Some(layout_data.shared_data.style.as_ref().unwrap()),
- applicable_declarations.before.as_slice(),
+ &*applicable_declarations.before,
&mut layout_data.data.before_style,
applicable_declarations_cache,
false);
@@ -651,7 +651,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
if applicable_declarations.after.len() > 0 {
damage = damage | self.cascade_node_pseudo_element(
Some(layout_data.shared_data.style.as_ref().unwrap()),
- applicable_declarations.after.as_slice(),
+ &*applicable_declarations.after,
&mut layout_data.data.after_style,
applicable_declarations_cache,
false);
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index f8f7d3602c3..beea14abca0 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -35,10 +35,10 @@ use gfx::display_list::{StackingContext, TextDisplayItem};
use gfx::paint_task::PaintLayer;
use png;
use png::PixelsByColorType;
-use servo_msg::compositor_msg::ScrollPolicy;
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_msg::constellation_msg::ConstellationChan;
-use servo_net::image::holder::ImageHolder;
+use msg::compositor_msg::ScrollPolicy;
+use msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::ConstellationChan;
+use net::image::holder::ImageHolder;
use servo_util::cursor::Cursor;
use servo_util::geometry::{self, Au, to_px, to_frac_px};
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
@@ -468,9 +468,7 @@ impl FragmentDisplayListBuilding for Fragment {
position_to_offset(gradient.stops[i - 1].position.unwrap(), length)
};
let (end_index, end_offset) =
- match gradient.stops
- .as_slice()
- .slice_from(i)
+ match gradient.stops[i..]
.iter()
.enumerate()
.find(|&(_, ref stop)| stop.position.is_some()) {
@@ -1333,7 +1331,7 @@ fn position_to_offset(position: LengthOrPercentage, Au(total_length): Au) -> f32
}
/// "Steps" as defined by CSS 2.1 § E.2.
-#[derive(Clone, PartialEq, Show, Copy)]
+#[derive(Clone, PartialEq, Debug, Copy)]
pub enum StackingLevel {
/// The border and backgrounds for the root of this stacking context: steps 1 and 2.
BackgroundAndBorders,
diff --git a/components/layout/floats.rs b/components/layout/floats.rs
index 10a057f172e..7fb155800f9 100644
--- a/components/layout/floats.rs
+++ b/components/layout/floats.rs
@@ -12,7 +12,7 @@ use std::fmt;
use style::computed_values::float;
/// The kind of float: left or right.
-#[derive(Clone, RustcEncodable, Show, Copy)]
+#[derive(Clone, RustcEncodable, Debug, Copy)]
pub enum FloatKind {
Left,
Right
@@ -45,7 +45,7 @@ struct Float {
kind: FloatKind,
}
-impl fmt::Show for Float {
+impl fmt::Debug for Float {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "bounds={:?} kind={:?}", self.bounds, self.kind)
}
@@ -75,7 +75,7 @@ impl FloatList {
}
}
-impl fmt::Show for FloatList {
+impl fmt::Debug for FloatList {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "max_block_start={:?} floats={}", self.max_block_start, self.floats.len())
}
@@ -93,7 +93,7 @@ pub struct PlacementInfo {
pub kind: FloatKind
}
-impl fmt::Show for PlacementInfo {
+impl fmt::Debug for PlacementInfo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"size={:?} ceiling={:?} max_inline_size={:?} kind={:?}",
@@ -120,7 +120,7 @@ pub struct Floats {
pub writing_mode: WritingMode,
}
-impl fmt::Show for Floats {
+impl fmt::Debug for Floats {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if !self.list.is_present() {
write!(f, "[empty]")
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index cb1658879cd..a4f66437626 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -48,8 +48,8 @@ use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect, Size2D};
use gfx::display_list::ClippingRegion;
-use serialize::{Encoder, Encodable};
-use servo_msg::compositor_msg::LayerId;
+use rustc_serialize::{Encoder, Encodable};
+use msg::compositor_msg::LayerId;
use servo_util::geometry::{Au, ZERO_RECT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use std::mem;
@@ -67,7 +67,7 @@ use std::sync::Arc;
///
/// Note that virtual methods have a cost; we should not overuse them in Servo. Consider adding
/// methods to `ImmutableFlowUtils` or `MutableFlowUtils` before adding more methods here.
-pub trait Flow: fmt::Show + Sync {
+pub trait Flow: fmt::Debug + Sync {
// RTTI
//
// TODO(pcwalton): Use Rust's RTTI, once that works.
@@ -428,7 +428,7 @@ pub trait MutableOwnedFlowUtils {
fn set_absolute_descendants(&mut self, abs_descendants: AbsDescendants);
}
-#[derive(RustcEncodable, PartialEq, Show)]
+#[derive(RustcEncodable, PartialEq, Debug)]
pub enum FlowClass {
Block,
Inline,
@@ -638,16 +638,16 @@ impl Descendants {
/// Return an iterator over the descendant flows.
pub fn iter<'a>(&'a mut self) -> DescendantIter<'a> {
DescendantIter {
- iter: self.descendant_links.slice_from_mut(0).iter_mut(),
+ iter: self.descendant_links.iter_mut(),
}
}
/// Return an iterator over (descendant, static y offset).
pub fn iter_with_offset<'a>(&'a mut self) -> DescendantOffsetIter<'a> {
let descendant_iter = DescendantIter {
- iter: self.descendant_links.slice_from_mut(0).iter_mut(),
+ iter: self.descendant_links.iter_mut(),
};
- descendant_iter.zip(self.static_block_offsets.slice_from_mut(0).iter_mut())
+ descendant_iter.zip(self.static_block_offsets.iter_mut())
}
}
@@ -784,7 +784,7 @@ pub struct BaseFlow {
unsafe impl Send for BaseFlow {}
unsafe impl Sync for BaseFlow {}
-impl fmt::Show for BaseFlow {
+impl fmt::Debug for BaseFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"@ {:?}, CC {}, ADC {}",
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 06e824bb8de..46002c946ff 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -28,10 +28,10 @@ use gfx::display_list::{BOX_SHADOW_INFLATION_FACTOR, OpaqueNode};
use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
use script_traits::UntrustedNodeAddress;
-use serialize::{Encodable, Encoder};
-use servo_msg::constellation_msg::{PipelineId, SubpageId};
-use servo_net::image::holder::ImageHolder;
-use servo_net::local_image_cache::LocalImageCache;
+use rustc_serialize::{Encodable, Encoder};
+use msg::constellation_msg::{PipelineId, SubpageId};
+use net::image::holder::ImageHolder;
+use net::local_image_cache::LocalImageCache;
use servo_util::geometry::{self, Au, ZERO_POINT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin};
use servo_util::range::*;
@@ -290,7 +290,7 @@ impl ImageFragmentInfo {
fn convert_length(node: &ThreadSafeLayoutNode, name: &Atom) -> Option<Au> {
let element = node.as_element();
element.get_attr(&ns!(""), name).and_then(|string| {
- let n: Option<int> = FromStr::from_str(string);
+ let n: Option<int> = FromStr::from_str(string).ok();
n
}).and_then(|pixels| Some(Au::from_px(pixels)))
}
@@ -589,7 +589,7 @@ impl ScannedTextFragmentInfo {
/// Describes how to split a fragment. This is used during line breaking as part of the return
/// value of `find_split_info_for_inline_size()`.
-#[derive(Show, Clone)]
+#[derive(Debug, Clone)]
pub struct SplitInfo {
// TODO(bjz): this should only need to be a single character index, but both values are
// currently needed for splitting in the `inline::try_append_*` functions.
@@ -667,7 +667,7 @@ impl TableColumnFragmentInfo {
let span = {
let element = node.as_element();
element.get_attr(&ns!(""), &atom!("span")).and_then(|string| {
- let n: Option<int> = FromStr::from_str(string);
+ let n: Option<int> = FromStr::from_str(string).ok();
n
}).unwrap_or(0)
};
@@ -1484,7 +1484,7 @@ impl Fragment {
/// A helper method that uses the breaking strategy described by `slice_iterator` (at present,
/// either natural word breaking or character breaking) to split this fragment.
fn calculate_split_position_using_breaking_strategy<'a,I>(&self,
- mut slice_iterator: I,
+ slice_iterator: I,
max_inline_size: Au,
flags: SplitOptions)
-> Option<SplitResult>
@@ -2016,7 +2016,7 @@ impl Fragment {
}
}
-impl fmt::Show for Fragment {
+impl fmt::Debug for Fragment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "({} {} ", self.debug_id(), self.specific.get_type()));
try!(write!(f, "bp {:?}", self.border_padding));
@@ -2059,7 +2059,7 @@ pub trait FragmentBorderBoxIterator {
/// The coordinate system used in `stacking_relative_border_box()`. See the documentation of that
/// method for details.
-#[derive(Clone, PartialEq, Show)]
+#[derive(Clone, PartialEq, Debug)]
pub enum CoordinateSystem {
/// The border box returned is relative to the fragment's parent stacking context.
Parent,
diff --git a/components/layout/incremental.rs b/components/layout/incremental.rs
index 2ad6177c497..b163a8fbf29 100644
--- a/components/layout/incremental.rs
+++ b/components/layout/incremental.rs
@@ -86,7 +86,7 @@ impl RestyleDamage {
}
}
-impl fmt::Show for RestyleDamage {
+impl fmt::Debug for RestyleDamage {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
let mut first_elem = true;
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index 722acc51d15..e0abc733b5a 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -68,7 +68,7 @@ static FONT_SUPERSCRIPT_OFFSET_RATIO: f64 = 0.34;
/// with a float or a horizontal wall of the containing block. The block-start
/// inline-start corner of the green zone is the same as that of the line, but
/// the green zone can be taller and wider than the line itself.
-#[derive(RustcEncodable, Show, Copy)]
+#[derive(RustcEncodable, Debug, Copy)]
pub struct Line {
/// A range of line indices that describe line breaks.
///
@@ -712,7 +712,7 @@ pub struct InlineFragments {
pub fragments: Vec<Fragment>,
}
-impl fmt::Show for InlineFragments {
+impl fmt::Debug for InlineFragments {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self.fragments)
}
@@ -1392,7 +1392,7 @@ impl Flow for InlineFlow {
}
}
-impl fmt::Show for InlineFlow {
+impl fmt::Debug for InlineFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?} - {:x} - {:?}", self.class(), self.base.debug_id(), self.fragments)
}
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index a3a11a3d085..ed73a1c693e 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -9,16 +9,16 @@
use flow_ref::FlowRef;
use flow;
-use serialize::json;
+use rustc_serialize::json;
use std::borrow::ToOwned;
use std::cell::RefCell;
-use std::io::File;
-use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};
+use std::old_io::File;
+use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
-static mut DEBUG_ID_COUNTER: AtomicUint = ATOMIC_UINT_INIT;
+static mut DEBUG_ID_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
pub struct Scope;
@@ -64,7 +64,7 @@ impl Scope {
STATE_KEY.with(|ref r| {
match &mut *r.borrow_mut() {
&mut Some(ref mut state) => {
- let flow_trace = json::encode(&flow::base(&*state.flow_root));
+ let flow_trace = json::encode(&flow::base(&*state.flow_root)).unwrap();
let data = box ScopeData::new(name.clone(), flow_trace);
state.scope_stack.push(data);
}
@@ -82,7 +82,7 @@ impl Drop for Scope {
match &mut *r.borrow_mut() {
&mut Some(ref mut state) => {
let mut current_scope = state.scope_stack.pop().unwrap();
- current_scope.post = json::encode(&flow::base(&*state.flow_root));
+ current_scope.post = json::encode(&flow::base(&*state.flow_root)).unwrap();
let previous_scope = state.scope_stack.last_mut().unwrap();
previous_scope.children.push(current_scope);
}
@@ -106,7 +106,7 @@ pub fn begin_trace(flow_root: FlowRef) {
assert!(STATE_KEY.with(|ref r| r.borrow().is_none()));
STATE_KEY.with(|ref r| {
- let flow_trace = json::encode(&flow::base(&*flow_root));
+ let flow_trace = json::encode(&flow::base(&*flow_root)).unwrap();
let state = State {
scope_stack: vec![box ScopeData::new("root".to_owned(), flow_trace)],
flow_root: flow_root.clone(),
@@ -122,9 +122,9 @@ pub fn end_trace() {
let mut task_state = STATE_KEY.with(|ref r| r.borrow_mut().take().unwrap());
assert!(task_state.scope_stack.len() == 1);
let mut root_scope = task_state.scope_stack.pop().unwrap();
- root_scope.post = json::encode(&flow::base(&*task_state.flow_root));
+ root_scope.post = json::encode(&flow::base(&*task_state.flow_root)).unwrap();
- let result = json::encode(&root_scope);
+ let result = json::encode(&root_scope).unwrap();
let path = Path::new("layout_trace.json");
let mut file = File::create(&path).unwrap();
file.write_str(result.as_slice()).unwrap();
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index c0aa1f6fdb9..3d2bc463cdc 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -45,12 +45,12 @@ use script::layout_interface::{MouseOverResponse, Msg};
use script::layout_interface::{Reflow, ReflowGoal, ScriptLayoutChan, TrustedNodeAddress};
use script_traits::{ConstellationControlMsg, CompositorEvent, OpaqueScriptLayoutChannel};
use script_traits::{ScriptControlChan, UntrustedNodeAddress};
-use servo_msg::compositor_msg::ScrollPolicy;
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId};
-use servo_net::image_cache_task::{ImageCacheTask, ImageResponseMsg};
-use servo_net::local_image_cache::{ImageResponder, LocalImageCache};
-use servo_net::resource_task::{ResourceTask, load_bytes_iter};
+use msg::compositor_msg::ScrollPolicy;
+use msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId};
+use net::image_cache_task::{ImageCacheTask, ImageResponseMsg};
+use net::local_image_cache::{ImageResponder, LocalImageCache};
+use net::resource_task::{ResourceTask, load_bytes_iter};
use servo_util::cursor::Cursor;
use servo_util::geometry::Au;
use servo_util::logical_geometry::LogicalPoint;
@@ -666,7 +666,17 @@ impl LayoutTask {
// FIXME(pcwalton): This is really ugly and can't handle overflow: scroll. Refactor
// it with extreme prejudice.
- let mut color = color::white();
+
+ // The default computed value for background-color is transparent (see
+ // http://dev.w3.org/csswg/css-backgrounds/#background-color). However, we
+ // need to propagate the background color from the root HTML/Body
+ // element (http://dev.w3.org/csswg/css-backgrounds/#special-backgrounds) if
+ // it is non-transparent. The phrase in the spec "If the canvas background
+ // is not opaque, what shows through is UA-dependent." is handled by rust-layers
+ // clearing the frame buffer to white. This ensures that setting a background
+ // color on an iframe element, while the iframe content itself has a default
+ // transparent background color is handled correctly.
+ let mut color = color::transparent_black();
for child in node.traverse_preorder() {
if child.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHtmlElement))) ||
child.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBodyElement))) {
diff --git a/components/layout/lib.rs b/components/layout/lib.rs
index a3d00e635b0..44f8f49c056 100644
--- a/components/layout/lib.rs
+++ b/components/layout/lib.rs
@@ -2,16 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(thread_local, unsafe_destructor, box_syntax, plugin, int_uint)]
+#![feature(alloc)]
+#![feature(box_syntax)]
+#![feature(collections)]
+#![feature(core)]
+#![feature(hash)]
+#![feature(int_uint)]
+#![feature(io)]
+#![feature(path)]
+#![feature(plugin)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
+#![feature(thread_local)]
+#![feature(unicode)]
+#![feature(unsafe_destructor)]
#![deny(unsafe_blocks)]
#![allow(unrooted_must_root)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;
+#[macro_use]extern crate bitflags;
+extern crate azure;
extern crate cssparser;
extern crate canvas;
extern crate geom;
@@ -19,15 +33,14 @@ extern crate gfx;
extern crate layout_traits;
extern crate script;
extern crate script_traits;
-extern crate "serialize" as rustc_serialize;
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
extern crate png;
extern crate style;
#[macro_use]
#[no_link] #[plugin]
extern crate "plugins" as servo_plugins;
-extern crate "net" as servo_net;
-extern crate "msg" as servo_msg;
+extern crate net;
+extern crate msg;
#[macro_use]
extern crate "util" as servo_util;
diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs
index c14588c3d02..eedb2d3b6b6 100644
--- a/components/layout/list_item.rs
+++ b/components/layout/list_item.rs
@@ -26,7 +26,7 @@ use style::computed_values::list_style_type;
use std::sync::Arc;
/// A block with the CSS `display` property equal to `list-item`.
-#[derive(Show)]
+#[derive(Debug)]
pub struct ListItemFlow {
/// Data common to all block flows.
pub block_flow: BlockFlow,
diff --git a/components/layout/model.rs b/components/layout/model.rs
index 1cbb54aa99a..d62a8390351 100644
--- a/components/layout/model.rs
+++ b/components/layout/model.rs
@@ -253,7 +253,7 @@ pub struct IntrinsicISizes {
pub preferred_inline_size: Au,
}
-impl fmt::Show for IntrinsicISizes {
+impl fmt::Debug for IntrinsicISizes {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "min={:?}, pref={:?}", self.minimum_inline_size, self.preferred_inline_size)
}
@@ -324,7 +324,7 @@ impl IntrinsicISizesContribution {
}
/// Useful helper data type when computing values for blocks and positioned elements.
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
pub enum MaybeAuto {
Auto,
Specified(Au),
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 791ce834ccd..270143a21da 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -398,7 +398,7 @@ impl Flow for TableFlow {
}
}
-impl fmt::Show for TableFlow {
+impl fmt::Debug for TableFlow {
/// Outputs a debugging string describing this table flow.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TableFlow: {:?}", self.block_flow)
@@ -443,7 +443,7 @@ impl ISizeAndMarginsComputer for InternalTable {
/// maximum of 100 pixels and 20% of the table), the preceding constraint means that we must
/// potentially store both a specified width *and* a specified percentage, so that the inline-size
/// assignment phase of layout will know which one to pick.
-#[derive(Clone, RustcEncodable, Show, Copy)]
+#[derive(Clone, RustcEncodable, Debug, Copy)]
pub struct ColumnIntrinsicInlineSize {
/// The preferred intrinsic inline size.
pub preferred: Au,
diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs
index d539d1b6c6f..43eaacf9384 100644
--- a/components/layout/table_caption.rs
+++ b/components/layout/table_caption.rs
@@ -98,7 +98,7 @@ impl Flow for TableCaptionFlow {
}
}
-impl fmt::Show for TableCaptionFlow {
+impl fmt::Debug for TableCaptionFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TableCaptionFlow: {:?}", self.block_flow)
}
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index 5a11243dd38..670dcf7b344 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -180,7 +180,7 @@ impl Flow for TableCellFlow {
}
}
-impl fmt::Show for TableCellFlow {
+impl fmt::Debug for TableCellFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TableCellFlow: {:?}", self.block_flow)
}
diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs
index 8dfe070da03..6d19a0c5778 100644
--- a/components/layout/table_colgroup.rs
+++ b/components/layout/table_colgroup.rs
@@ -106,7 +106,7 @@ impl Flow for TableColGroupFlow {
_: &Point2D<Au>) {}
}
-impl fmt::Show for TableColGroupFlow {
+impl fmt::Debug for TableColGroupFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.fragment {
Some(ref rb) => write!(f, "TableColGroupFlow: {:?}", rb),
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index 317e0909735..0d93dfc9a4b 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -332,7 +332,7 @@ impl Flow for TableRowFlow {
}
}
-impl fmt::Show for TableRowFlow {
+impl fmt::Debug for TableRowFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TableRowFlow: {:?}", self.block_flow.fragment)
}
diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs
index 377684b6917..9728fde36a8 100644
--- a/components/layout/table_rowgroup.rs
+++ b/components/layout/table_rowgroup.rs
@@ -167,7 +167,7 @@ impl Flow for TableRowGroupFlow {
}
}
-impl fmt::Show for TableRowGroupFlow {
+impl fmt::Debug for TableRowGroupFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TableRowGroupFlow: {:?}", self.block_flow.fragment)
}
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index 99f10710ff8..b66addae4b4 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -34,7 +34,7 @@ use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;
use std::sync::Arc;
-#[derive(Copy, RustcEncodable, Show)]
+#[derive(Copy, RustcEncodable, Debug)]
pub enum TableLayout {
Fixed,
Auto
@@ -147,7 +147,7 @@ impl TableWrapperFlow {
// Compute all the guesses for the column sizes, and sum them.
let mut total_guess = AutoLayoutCandidateGuess::new();
let guesses: Vec<AutoLayoutCandidateGuess> =
- self.column_intrinsic_inline_sizes.iter().map(|&mut:column_intrinsic_inline_size| {
+ self.column_intrinsic_inline_sizes.iter().map(|column_intrinsic_inline_size| {
let guess = AutoLayoutCandidateGuess::from_column_intrinsic_inline_size(
column_intrinsic_inline_size,
available_inline_size);
@@ -383,7 +383,7 @@ impl Flow for TableWrapperFlow {
}
}
-impl fmt::Show for TableWrapperFlow {
+impl fmt::Debug for TableWrapperFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if self.block_flow.base.flags.is_float() {
write!(f, "TableWrapperFlow(Float): {:?}", self.block_flow.fragment)
@@ -501,7 +501,7 @@ impl<'a> Add for &'a AutoLayoutCandidateGuess {
/// The `CSSFloat` member specifies the weight of the smaller of the two guesses, on a scale from
/// 0.0 to 1.0.
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
enum SelectedAutoLayoutCandidateGuess {
UseMinimumGuess,
InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat),
diff --git a/components/layout/text.rs b/components/layout/text.rs
index 4c900b01449..697b2301738 100644
--- a/components/layout/text.rs
+++ b/components/layout/text.rs
@@ -50,13 +50,13 @@ impl TextRunScanner {
let mut last_whitespace = true;
while !fragments.is_empty() {
// Create a clump.
- self.clump.append(dlist::split(&mut fragments));
+ self.clump.append(&mut dlist::split_off_head(&mut fragments));
while !fragments.is_empty() && self.clump
.back()
.unwrap()
.can_merge_with_fragment(fragments.front()
.unwrap()) {
- self.clump.append(dlist::split(&mut fragments));
+ self.clump.append(&mut dlist::split_off_head(&mut fragments));
}
// Flush that clump to the list of fragments we're building up.
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index c31d4dcde1a..3ec4aa1bb53 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -55,7 +55,7 @@ thread_local!(static STYLE_BLOOM: RefCell<Option<(Box<BloomFilter>, UnsafeLayout
/// Returns the task local bloom filter.
///
/// If one does not exist, a new one will be made for you. If it is out of date,
-/// it will be thrown out and a new one will be made for you.
+/// it will be cleared and reused.
fn take_task_local_bloom_filter(parent_node: Option<LayoutNode>, layout_context: &LayoutContext)
-> Box<BloomFilter> {
STYLE_BLOOM.with(|style_bloom| {
@@ -73,18 +73,17 @@ fn take_task_local_bloom_filter(parent_node: Option<LayoutNode>, layout_context:
}
// Found cached bloom filter.
(Some(parent), Some((mut bloom_filter, old_node, old_generation))) => {
- // Hey, the cached parent is our parent! We can reuse the bloom filter.
if old_node == layout_node_to_unsafe_layout_node(&parent) &&
old_generation == layout_context.shared.generation {
+ // Hey, the cached parent is our parent! We can reuse the bloom filter.
debug!("[{}] Parent matches (={}). Reusing bloom filter.", tid(), old_node.0);
- bloom_filter.clone()
} else {
// Oh no. the cached parent is stale. I guess we need a new one. Reuse the existing
// allocation to avoid malloc churn.
- *bloom_filter = BloomFilter::new();
+ bloom_filter.clear();
insert_ancestors_into_bloom_filter(&mut bloom_filter, parent, layout_context);
- bloom_filter
}
+ bloom_filter
},
}
})
diff --git a/components/layout/util.rs b/components/layout/util.rs
index a5e8328118f..481adb895c7 100644
--- a/components/layout/util.rs
+++ b/components/layout/util.rs
@@ -9,6 +9,7 @@ use incremental::RestyleDamage;
use parallel::DomParallelInfo;
use wrapper::{LayoutNode, TLayoutNode, ThreadSafeLayoutNode};
+use azure::azure_hl::{Color};
use gfx::display_list::OpaqueNode;
use gfx;
use libc::{c_void, uintptr_t};
@@ -169,11 +170,11 @@ impl OpaqueNodeMethods for OpaqueNode {
/// Allows a CSS color to be converted into a graphics color.
pub trait ToGfxColor {
/// Converts a CSS color to a graphics color.
- fn to_gfx_color(&self) -> gfx::color::Color;
+ fn to_gfx_color(&self) -> Color;
}
impl ToGfxColor for style::values::RGBA {
- fn to_gfx_color(&self) -> gfx::color::Color {
+ fn to_gfx_color(&self) -> Color {
gfx::color::rgba(self.red, self.green, self.blue, self.alpha)
}
}
diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs
index 6f7d1059264..102dfb15f79 100644
--- a/components/layout/wrapper.rs
+++ b/components/layout/wrapper.rs
@@ -59,7 +59,7 @@ use script::dom::node::{LayoutNodeHelpers, RawLayoutNodeHelpers, SharedLayoutDat
use script::dom::node::{HAS_CHANGED, IS_DIRTY, HAS_DIRTY_SIBLINGS, HAS_DIRTY_DESCENDANTS};
use script::dom::text::Text;
use script::layout_interface::LayoutChan;
-use servo_msg::constellation_msg::{PipelineId, SubpageId};
+use msg::constellation_msg::{PipelineId, SubpageId};
use servo_util::str::{LengthOrPercentageOrAuto, is_whitespace};
use std::borrow::ToOwned;
use std::cell::{Ref, RefMut};
diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs
index 9acf2c42f06..788032169be 100644
--- a/components/layout_traits/lib.rs
+++ b/components/layout_traits/lib.rs
@@ -6,8 +6,8 @@
extern crate gfx;
extern crate script_traits;
-extern crate "msg" as servo_msg;
-extern crate "net" as servo_net;
+extern crate msg;
+extern crate net;
extern crate util;
// This module contains traits in layout used generically
@@ -17,9 +17,9 @@ extern crate util;
use gfx::font_cache_task::FontCacheTask;
use gfx::paint_task::PaintChan;
-use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId, PipelineExitType};
-use servo_net::image_cache_task::ImageCacheTask;
-use servo_net::resource_task::ResourceTask;
+use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, PipelineExitType};
+use net::image_cache_task::ImageCacheTask;
+use net::resource_task::ResourceTask;
use util::time::TimeProfilerChan;
use script_traits::{ScriptControlChan, OpaqueScriptLayoutChannel};
use std::sync::mpsc::{Sender, Receiver};
diff --git a/components/msg/Cargo.toml b/components/msg/Cargo.toml
index 289c65edd52..82b3c97d1f3 100644
--- a/components/msg/Cargo.toml
+++ b/components/msg/Cargo.toml
@@ -22,7 +22,7 @@ git = "https://github.com/servo/rust-geom"
[dependencies.hyper]
git = "https://github.com/servo/hyper"
-branch = "old_servo_new_cookies"
+branch = "servo"
[dependencies.layers]
git = "https://github.com/servo/rust-layers"
@@ -35,3 +35,4 @@ git = "https://github.com/servo/rust-io-surface"
[dependencies]
url = "0.2.16"
+bitflags = "*"
diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs
index 111636c349c..54dc125f589 100644
--- a/components/msg/compositor_msg.rs
+++ b/components/msg/compositor_msg.rs
@@ -8,7 +8,7 @@ use geom::point::Point2D;
use geom::rect::Rect;
use layers::platform::surface::NativeGraphicsMetadata;
use layers::layers::LayerBufferSet;
-use std::fmt::{Formatter, Show};
+use std::fmt::{Formatter, Debug};
use std::fmt;
use constellation_msg::PipelineId;
@@ -20,7 +20,7 @@ pub enum PaintState {
Painting,
}
-#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Copy)]
+#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Debug, Copy)]
pub enum ReadyState {
/// Informs the compositor that nothing has been done yet. Used for setting status
Blank,
@@ -33,7 +33,7 @@ pub enum ReadyState {
}
/// A newtype struct for denoting the age of messages; prevents race conditions.
-#[derive(PartialEq, Eq, Show, Copy)]
+#[derive(PartialEq, Eq, Debug, Copy)]
pub struct Epoch(pub uint);
impl Epoch {
@@ -46,7 +46,7 @@ impl Epoch {
#[derive(Clone, PartialEq, Eq, Copy)]
pub struct LayerId(pub uint, pub uint);
-impl Show for LayerId {
+impl Debug for LayerId {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
let LayerId(a, b) = *self;
write!(f, "Layer({}, {})", a, b)
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs
index 67449d4d9ec..27a187edfde 100644
--- a/components/msg/constellation_msg.rs
+++ b/components/msg/constellation_msg.rs
@@ -60,7 +60,7 @@ pub enum KeyState {
}
//N.B. Based on the glutin key enum
-#[derive(Show, PartialEq, Eq, Copy, Clone)]
+#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum Key {
Space,
Apostrophe,
@@ -237,22 +237,22 @@ impl LoadData {
}
/// Represents the two different ways to which a page can be navigated
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)]
+#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)]
pub enum NavigationType {
Load, // entered or clicked on a url
Navigate, // browser forward/back buttons
}
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)]
+#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)]
pub enum NavigationDirection {
Forward,
Back,
}
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)]
+#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)]
pub struct PipelineId(pub uint);
-#[derive(Clone, PartialEq, Eq, Copy, Hash, Show)]
+#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug)]
pub struct SubpageId(pub uint);
// The type of pipeline exit. During complete shutdowns, pipelines do not have to
diff --git a/components/msg/lib.rs b/components/msg/lib.rs
index 2567bf9ced0..8741de21f75 100644
--- a/components/msg/lib.rs
+++ b/components/msg/lib.rs
@@ -2,16 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#![feature(hash)]
#![feature(int_uint)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
extern crate azure;
+#[macro_use] extern crate bitflags;
extern crate geom;
extern crate hyper;
extern crate layers;
-extern crate serialize;
extern crate util;
extern crate url;
diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml
index 8e31f9b5cfa..1cf05766926 100644
--- a/components/net/Cargo.toml
+++ b/components/net/Cargo.toml
@@ -15,11 +15,7 @@ git = "https://github.com/servo/rust-geom"
[dependencies.hyper]
git = "https://github.com/servo/hyper"
-branch = "old_servo_new_cookies"
-
-[dependencies.cookie]
-git = "https://github.com/servo/cookie-rs"
-branch = "lenientparse_backport"
+branch = "servo"
[dependencies.png]
git = "https://github.com/servo/rust-png"
@@ -30,4 +26,6 @@ git = "https://github.com/servo/rust-stb-image"
[dependencies]
url = "0.2.16"
time = "0.1.12"
-openssl="0.2.15"
+openssl="0.3.1"
+rustc-serialize = "0.2"
+cookie="*"
diff --git a/components/net/about_loader.rs b/components/net/about_loader.rs
index b7935bf72e8..37f11466a5f 100644
--- a/components/net/about_loader.rs
+++ b/components/net/about_loader.rs
@@ -10,8 +10,8 @@ use url::Url;
use hyper::http::RawStatus;
use util::resource_files::resources_dir_path;
-use std::borrow::ToOwned;
-use std::io::fs::PathExtensions;
+use std::borrow::IntoCow;
+use std::old_io::fs::PathExtensions;
use std::sync::mpsc::Sender;
pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
@@ -26,7 +26,7 @@ pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>
content_type: Some(("text".to_string(), "html".to_string())),
charset: Some("utf-8".to_string()),
headers: None,
- status: Some(RawStatus(200, "OK".to_owned())),
+ status: Some(RawStatus(200, "OK".into_cow())),
});
chan.send(Done(Ok(()))).unwrap();
return
diff --git a/components/net/cookie.rs b/components/net/cookie.rs
index eb3c1a61a97..dfca6912c94 100644
--- a/components/net/cookie.rs
+++ b/components/net/cookie.rs
@@ -13,13 +13,13 @@ use time::{Tm, now, at, Timespec};
use url::Url;
use std::borrow::ToOwned;
use std::i64;
-use std::io::net::ip::IpAddr;
+use std::old_io::net::ip::IpAddr;
use std::time::Duration;
/// A stored cookie that wraps the definition in cookie-rs. This is used to implement
/// various behaviours defined in the spec that rely on an associated request URL,
/// which cookie-rs and hyper's header parsing do not support.
-#[derive(Clone, Show)]
+#[derive(Clone, Debug)]
pub struct Cookie {
pub cookie: cookie_rs::Cookie,
pub host_only: bool,
@@ -100,7 +100,7 @@ impl Cookie {
request_path.chars().filter(|&c| c == '/').count() == 1 {
"/".to_owned()
} else if request_path.ends_with("/") {
- request_path.slice_to(request_path.len()-1).to_owned()
+ request_path[..request_path.len() - 1].to_owned()
} else {
request_path.to_owned()
}
@@ -121,7 +121,7 @@ impl Cookie {
}
if string.ends_with(domain_string)
&& string.char_at(string.len()-domain_string.len()-1) == '.'
- && string.parse::<IpAddr>().is_none() {
+ && string.parse::<IpAddr>().is_err() {
return true;
}
false
diff --git a/components/net/data_loader.rs b/components/net/data_loader.rs
index 0fce067d0de..d430e3e4eb4 100644
--- a/components/net/data_loader.rs
+++ b/components/net/data_loader.rs
@@ -5,7 +5,7 @@
use resource_task::{Metadata, LoadData, TargetedLoadResponse, start_sending, ResponseSenders};
use resource_task::ProgressMsg::{Payload, Done};
-use serialize::base64::FromBase64;
+use rustc_serialize::base64::FromBase64;
use hyper::mime::Mime;
use url::{percent_decode, SchemeData};
@@ -55,12 +55,12 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
let mut ct_str = parts[0];
if ct_str.ends_with(";base64") {
is_base64 = true;
- ct_str = ct_str.slice_to(ct_str.as_bytes().len() - 7);
+ ct_str = &ct_str[..ct_str.as_bytes().len() - 7];
}
// Parse the content type using rust-http.
// FIXME: this can go into an infinite loop! (rust-http #25)
- let content_type: Option<Mime> = ct_str.parse();
+ let content_type: Option<Mime> = ct_str.parse().ok();
metadata.set_content_type(content_type.as_ref());
let progress_chan = start_sending(senders, metadata);
diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs
index 1c7b51566ad..7134b054e98 100644
--- a/components/net/fetch/request.rs
+++ b/components/net/fetch/request.rs
@@ -6,7 +6,7 @@ use url::Url;
use hyper::method::Method;
use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
use hyper::header::Headers;
-use hyper::header::common::ContentType;
+use hyper::header::ContentType;
use fetch::cors_cache::CORSCache;
use fetch::response::Response;
diff --git a/components/net/file_loader.rs b/components/net/file_loader.rs
index b2b701cb939..72f222a2c4a 100644
--- a/components/net/file_loader.rs
+++ b/components/net/file_loader.rs
@@ -6,8 +6,8 @@ use resource_task::{ProgressMsg, Metadata, LoadData, start_sending, TargetedLoad
use resource_task::ProgressMsg::{Payload, Done};
use std::borrow::ToOwned;
-use std::io;
-use std::io::File;
+use std::old_io as io;
+use std::old_io::File;
use std::sync::mpsc::Sender;
use util::task::spawn_named;
diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs
index f06323ac348..9cb33763866 100644
--- a/components/net/http_loader.rs
+++ b/components/net/http_loader.rs
@@ -11,14 +11,14 @@ use log;
use std::collections::HashSet;
use file_loader;
use hyper::client::Request;
-use hyper::header::common::{ContentLength, ContentType, Host, Location};
+use hyper::header::{ContentLength, ContentType, Host, Location};
use hyper::HttpError;
use hyper::method::Method;
use hyper::net::HttpConnector;
use hyper::status::{StatusCode, StatusClass};
use std::error::Error;
use openssl::ssl::{SslContext, SslVerifyMode};
-use std::io::{IoError, IoErrorKind, Reader};
+use std::old_io::{IoError, IoErrorKind, Reader};
use std::sync::mpsc::{Sender, channel};
use std::thunk::Invoke;
use util::task::spawn_named;
@@ -29,7 +29,7 @@ use std::borrow::ToOwned;
pub fn factory(cookies_chan: Sender<ControlMsg>)
-> Box<Invoke<(LoadData, Sender<TargetedLoadResponse>)> + Send> {
- box move |:(load_data, start_chan)| {
+ box move |(load_data, start_chan)| {
spawn_named("http_loader".to_owned(), move || load(load_data, start_chan, cookies_chan))
}
}
@@ -126,7 +126,7 @@ reason: \"certificate verify failed\" }]";
req.headers_mut().set(host);
let (tx, rx) = channel();
- cookies_chan.send(ControlMsg::GetCookiesForUrl(url.clone(), tx, CookieSource::HTTP));
+ cookies_chan.send(ControlMsg::GetCookiesForUrl(url.clone(), tx, CookieSource::HTTP)).unwrap();
if let Some(cookie_list) = rx.recv().unwrap() {
let mut v = Vec::new();
v.push(cookie_list.into_bytes());
@@ -157,7 +157,7 @@ reason: \"certificate verify failed\" }]";
return;
}
};
- match writer.write(data.as_slice()) {
+ match writer.write_all(&*data) {
Err(e) => {
send_error(url, e.desc.to_string(), senders);
return;
@@ -201,7 +201,7 @@ reason: \"certificate verify failed\" }]";
if let Ok(cookies) = String::from_utf8(cookie.clone()) {
cookies_chan.send(ControlMsg::SetCookiesForUrl(url.clone(),
cookies,
- CookieSource::HTTP));
+ CookieSource::HTTP)).unwrap();
}
}
}
diff --git a/components/net/lib.rs b/components/net/lib.rs
index 2cc0fdf8ae4..706af1a5347 100644
--- a/components/net/lib.rs
+++ b/components/net/lib.rs
@@ -2,12 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#![feature(box_syntax)]
+#![feature(collections)]
+#![feature(core)]
+#![feature(env)]
#![feature(int_uint)]
+#![feature(io)]
+#![feature(path)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
#![feature(unboxed_closures)]
-#![feature(box_syntax)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
extern crate "cookie" as cookie_rs;
extern crate collections;
@@ -17,7 +23,7 @@ extern crate png;
#[macro_use]
extern crate log;
extern crate openssl;
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
extern crate util;
extern crate stb_image;
extern crate time;
diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs
index 70d871eebe6..c6f6414f125 100644
--- a/components/net/resource_task.rs
+++ b/components/net/resource_task.rs
@@ -15,30 +15,30 @@ use cookie;
use util::task::spawn_named;
-use hyper::header::common::UserAgent;
+use hyper::header::UserAgent;
use hyper::header::{Headers, Header, SetCookie};
use hyper::http::RawStatus;
use hyper::method::Method;
use hyper::mime::{Mime, Attr};
use url::Url;
-use std::borrow::ToOwned;
-use std::sync::mpsc::{channel, Receiver, Sender};
-use std::thunk::Invoke;
+use std::borrow::{ToOwned, IntoCow};
use std::collections::HashMap;
-use std::io::{BufferedReader, File};
+use std::env;
use std::mem;
-use std::os;
+use std::old_io::{BufferedReader, File};
+use std::sync::mpsc::{channel, Receiver, Sender};
+use std::thunk::Invoke;
#[cfg(test)]
-use std::io::{Listener, Acceptor, TimedOut};
+use std::old_io::{Listener, Acceptor, TimedOut};
#[cfg(test)]
-use std::io::net::tcp::TcpListener;
+use std::old_io::net::tcp::TcpListener;
static mut HOST_TABLE: Option<*mut HashMap<String, String>> = None;
pub fn global_init() {
- if let Some(host_file_path) = os::getenv("HOST_FILE") {
+ if let Ok(host_file_path) = env::var_string("HOST_FILE") {
//TODO: handle bad file path and corrupted file
let path = Path::new(host_file_path);
let mut file = BufferedReader::new(File::open(&path));
@@ -97,7 +97,7 @@ pub struct ResourceCORSData {
}
/// Metadata about a loaded resource, such as is obtained from HTTP headers.
-#[deriving(Clone)]
+#[derive(Clone)]
pub struct Metadata {
/// Final URL after redirects.
pub final_url: Url,
@@ -124,7 +124,7 @@ impl Metadata {
charset: None,
headers: None,
// http://fetch.spec.whatwg.org/#concept-response-status-message
- status: Some(RawStatus(200, "OK".to_owned())),
+ status: Some(RawStatus(200, "OK".into_cow())),
}
}
@@ -168,7 +168,7 @@ pub struct ResponseSenders {
}
/// Messages sent in response to a `Load` message
-#[derive(PartialEq,Show)]
+#[derive(PartialEq,Debug)]
pub enum ProgressMsg {
/// Binary data - there may be multiple of these
Payload(Vec<u8>),
@@ -291,7 +291,7 @@ impl ResourceManager {
}
}
ControlMsg::GetCookiesForUrl(url, consumer, source) => {
- consumer.send(self.cookie_storage.cookies_for_url(&url, source));
+ consumer.send(self.cookie_storage.cookies_for_url(&url, source)).unwrap();
}
ControlMsg::Exit => {
break
diff --git a/components/plugins/casing.rs b/components/plugins/casing.rs
index 374290f3cbb..b7b002b21a4 100644
--- a/components/plugins/casing.rs
+++ b/components/plugins/casing.rs
@@ -47,7 +47,7 @@ fn expand_cased<'cx, T>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree],
};
match (res, it.count()) {
(Some((s, span)), 0) => {
- let new_s = s.get().chars().map(transform).collect::<String>();
+ let new_s = s.chars().map(transform).collect::<String>();
base::MacExpr::new(cx.expr_str(span, token::intern_and_get_ident(new_s.as_slice())))
}
(_, rest) => {
diff --git a/components/plugins/jstraceable.rs b/components/plugins/jstraceable.rs
index 47f2c99d274..046881c079e 100644
--- a/components/plugins/jstraceable.rs
+++ b/components/plugins/jstraceable.rs
@@ -15,7 +15,7 @@ use syntax::parse::token::InternedString;
pub fn expand_dom_struct(_: &mut ExtCtxt, _: Span, _: &MetaItem, item: P<Item>) -> P<Item> {
let mut item2 = (*item).clone();
{
- let mut add_attr = |&mut :s| {
+ let mut add_attr = |s| {
item2.attrs.push(attr::mk_attr_outer(attr::mk_attr_id(), attr::mk_word_item(InternedString::new(s))));
};
add_attr("must_root");
@@ -41,7 +41,7 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
path: ty::Path::new(vec!("dom","bindings","trace","JSTraceable")),
additional_bounds: Vec::new(),
generics: ty::LifetimeBounds::empty(),
- methods: vec!(
+ methods: vec![
MethodDef {
name: "trace",
generics: ty::LifetimeBounds::empty(),
@@ -53,9 +53,10 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
InternedString::new("always")))),
combine_substructure: combine_substructure(box jstraceable_substructure)
}
- )
+ ],
+ associated_types: vec![],
};
- trait_def.expand(cx, mitem, item, |:a| push(a))
+ trait_def.expand(cx, mitem, item, |a| push(a))
}
// Mostly copied from syntax::ext::deriving::hash
@@ -66,7 +67,7 @@ fn jstraceable_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substru
_ => cx.span_bug(trait_span, "incorrect number of arguments in `jstraceable`")
};
let trace_ident = substr.method_ident;
- let call_trace = |&:span, thing_expr| {
+ let call_trace = |span, thing_expr| {
let expr = cx.expr_method_call(span, thing_expr, trace_ident, vec!(state_expr.clone()));
cx.stmt_expr(expr)
};
diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs
index 1121d85d30c..da826cf68e7 100644
--- a/components/plugins/lib.rs
+++ b/components/plugins/lib.rs
@@ -12,10 +12,9 @@
//! - `#[dom_struct]` : Implies `#[privatize]`,`#[jstraceable]`, and `#[must_root]`.
//! Use this for structs that correspond to a DOM type
-#![feature(plugin_registrar, quote, plugin, box_syntax)]
+#![feature(plugin_registrar, quote, plugin, box_syntax, rustc_private, core, unicode)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[plugin]
#[macro_use]
diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs
index e9db633f2d4..0bc146186be 100644
--- a/components/plugins/utils.rs
+++ b/components/plugins/utils.rs
@@ -38,28 +38,30 @@ pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]>
/// Checks if a type has a #[servo_lang = "str"] attribute
pub fn match_lang_ty(cx: &Context, ty: &Ty, value: &str) -> bool {
- let mut found = false;
- if let TyPath(_, ty_id) = ty.node {
- if let Some(def::DefTy(def_id, _)) = cx.tcx.def_map.borrow().get(&ty_id).cloned() {
- // Iterating through attributes is hard because of cross-crate defs
- ty::each_attr(cx.tcx, def_id, |attr| {
- if let ast::MetaNameValue(ref name, ref val) = attr.node.value.node {
- if name.get() == "servo_lang" {
- if let ast::LitStr(ref v, _) = val.node {
- if v.get() == value {
- mark_used(attr);
- found = true;
- // We're done with the loop
- return false;
- }
- }
- }
+ let ty_id = match ty.node {
+ TyPath(_, ty_id) => ty_id,
+ _ => return false,
+ };
+
+ let def_id = match cx.tcx.def_map.borrow().get(&ty_id).cloned() {
+ Some(def::DefTy(def_id, _)) => def_id,
+ _ => return false,
+ };
+
+ ty::get_attrs(cx.tcx, def_id).iter().any(|attr| {
+ match attr.node.value.node {
+ ast::MetaNameValue(ref name, ref val) if &**name == "servo_lang" => {
+ match val.node {
+ ast::LitStr(ref v, _) if &**v == value => {
+ mark_used(attr);
+ true
+ },
+ _ => false,
}
- true
- });
- };
- }
- found
+ }
+ _ => false,
+ }
+ })
}
// Determines if a block is in an unsafe context so that an unhelpful
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index 8b4d56891be..f58356ff9f5 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -3,7 +3,7 @@ name = "script"
version = "0.0.1"
authors = ["The Servo Project Developers"]
-build = "make -f makefile.cargo"
+build = "build.rs"
[lib]
name = "script"
@@ -50,7 +50,7 @@ git = "https://github.com/servo/html5ever"
[dependencies.hyper]
git = "https://github.com/servo/hyper"
-branch = "old_servo_new_cookies"
+branch = "servo"
[dependencies.js]
git = "https://github.com/servo/rust-mozjs"
@@ -68,3 +68,6 @@ git = "https://github.com/servo/string-cache"
encoding = "0.2"
url = "0.2.16"
time = "0.1.12"
+bitflags = "*"
+rustc-serialize = "*"
+libc = "*"
diff --git a/components/script/build.rs b/components/script/build.rs
new file mode 100644
index 00000000000..ca5ecaf9369
--- /dev/null
+++ b/components/script/build.rs
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#![feature(io)]
+
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
+
+
+fn main() {
+ let result = Command::new("make")
+ .args(&["-f", "makefile.cargo"])
+ .stdout(StdioContainer::InheritFd(1))
+ .stderr(StdioContainer::InheritFd(2))
+ .status()
+ .unwrap();
+ assert_eq!(result, ProcessExit::ExitStatus(0));
+}
diff --git a/components/script/cors.rs b/components/script/cors.rs
index ebc2af7ec76..e326e891765 100644
--- a/components/script/cors.rs
+++ b/components/script/cors.rs
@@ -10,16 +10,16 @@
//! with CORSRequest being expanded into FetchRequest (etc)
use std::ascii::AsciiExt;
-use std::fmt::{self, Show};
+use std::fmt::{self, Display};
use std::str::from_utf8;
use time;
use time::{now, Timespec};
use hyper::header::{Headers, Header, HeaderFormat, HeaderView};
-use hyper::header::shared::util as header_util;
+use hyper::header::parsing as header_parsing;
use hyper::client::Request;
use hyper::mime::{Mime, TopLevel, SubLevel};
-use hyper::header::common::{ContentType, Host};
+use hyper::header::{ContentType, Host};
use hyper::method::Method;
use hyper::status::StatusClass::Success;
@@ -160,6 +160,7 @@ impl CORSRequest {
}
cors_response.headers = response.headers.clone();
// Substeps 1-3 (parsing rules: http://fetch.spec.whatwg.org/#http-new-header-syntax)
+ let methods_substep4 = [self.method.clone()];
let mut methods = match response.headers.get() {
Some(&AccessControlAllowMethods(ref v)) => v.as_slice(),
_ => return error
@@ -169,7 +170,6 @@ impl CORSRequest {
_ => return error
};
// Substep 4
- let methods_substep4 = [self.method.clone()];
if methods.len() == 0 || preflight.mode == RequestMode::ForcedPreflight {
methods = methods_substep4.as_slice();
}
@@ -388,19 +388,19 @@ struct AccessControlRequestMethod(pub Method);
impl Header for AccessControlRequestMethod {
#[inline]
- fn header_name(_: Option<AccessControlRequestMethod>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Request-Method"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlRequestMethod> {
- header_util::from_one_raw_str(raw).map(AccessControlRequestMethod)
+ header_parsing::from_one_raw_str(raw).map(AccessControlRequestMethod)
}
}
impl HeaderFormat for AccessControlRequestMethod {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlRequestMethod(ref method) = *self;
- method.fmt(f)
+ <_ as Display>::fmt(method, f)
}
}
@@ -409,19 +409,19 @@ struct AccessControlRequestHeaders(pub Vec<String>);
impl Header for AccessControlRequestHeaders {
#[inline]
- fn header_name(_: Option<AccessControlRequestHeaders>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Request-Headers"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlRequestHeaders> {
- header_util::from_comma_delimited(raw).map(AccessControlRequestHeaders)
+ header_parsing::from_comma_delimited(raw).map(AccessControlRequestHeaders)
}
}
impl HeaderFormat for AccessControlRequestHeaders {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlRequestHeaders(ref parts) = *self;
- header_util::fmt_comma_delimited(f, parts.as_slice())
+ header_parsing::fmt_comma_delimited(f, parts.as_slice())
}
}
@@ -430,19 +430,19 @@ struct AccessControlAllowMethods(pub Vec<Method>);
impl Header for AccessControlAllowMethods {
#[inline]
- fn header_name(_: Option<AccessControlAllowMethods>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Allow-Methods"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlAllowMethods> {
- header_util::from_comma_delimited(raw).map(AccessControlAllowMethods)
+ header_parsing::from_comma_delimited(raw).map(AccessControlAllowMethods)
}
}
impl HeaderFormat for AccessControlAllowMethods {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlAllowMethods(ref parts) = *self;
- header_util::fmt_comma_delimited(f, parts.as_slice())
+ header_parsing::fmt_comma_delimited(f, parts.as_slice())
}
}
@@ -451,19 +451,19 @@ struct AccessControlAllowHeaders(pub Vec<String>);
impl Header for AccessControlAllowHeaders {
#[inline]
- fn header_name(_: Option<AccessControlAllowHeaders>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Allow-Headers"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlAllowHeaders> {
- header_util::from_comma_delimited(raw).map(AccessControlAllowHeaders)
+ header_parsing::from_comma_delimited(raw).map(AccessControlAllowHeaders)
}
}
impl HeaderFormat for AccessControlAllowHeaders {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlAllowHeaders(ref parts) = *self;
- header_util::fmt_comma_delimited(f, parts.as_slice())
+ header_parsing::fmt_comma_delimited(f, parts.as_slice())
}
}
@@ -476,7 +476,7 @@ enum AccessControlAllowOrigin {
impl Header for AccessControlAllowOrigin {
#[inline]
- fn header_name(_: Option<AccessControlAllowOrigin>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Allow-Origin"
}
@@ -498,8 +498,8 @@ impl Header for AccessControlAllowOrigin {
impl HeaderFormat for AccessControlAllowOrigin {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
- AccessControlAllowOrigin::AllowStar => "*".fmt(f),
- AccessControlAllowOrigin::AllowOrigin(ref url) => url.fmt(f)
+ AccessControlAllowOrigin::AllowStar => <_ as Display>::fmt("*", f),
+ AccessControlAllowOrigin::AllowOrigin(ref url) => <_ as Display>::fmt(url, f)
}
}
}
@@ -509,19 +509,19 @@ struct AccessControlMaxAge(pub u32);
impl Header for AccessControlMaxAge {
#[inline]
- fn header_name(_: Option<AccessControlMaxAge>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Max-Age"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlMaxAge> {
- header_util::from_one_raw_str(raw).map(AccessControlMaxAge)
+ header_parsing::from_one_raw_str(raw).map(AccessControlMaxAge)
}
}
impl HeaderFormat for AccessControlMaxAge {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlMaxAge(ref num) = *self;
- num.fmt(f)
+ <_ as Display>::fmt(num, f)
}
}
diff --git a/components/script/devtools.rs b/components/script/devtools.rs
index 6c29223af63..5333b9a4cee 100644
--- a/components/script/devtools.rs
+++ b/components/script/devtools.rs
@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use devtools_traits;
use devtools_traits::{EvaluateJSReply, NodeInfo, Modification};
use dom::bindings::conversions::FromJSValConvertible;
use dom::bindings::conversions::StringificationBehavior;
@@ -16,7 +15,7 @@ use dom::window::{ScriptHelpers};
use dom::element::Element;
use dom::document::DocumentHelpers;
use page::Page;
-use servo_msg::constellation_msg::PipelineId;
+use msg::constellation_msg::PipelineId;
use script_task::get_page;
use std::sync::mpsc::Sender;
@@ -31,16 +30,16 @@ pub fn handle_evaluate_js(page: &Rc<Page>, pipeline: PipelineId, eval: String, r
let rval = window.r().evaluate_js_on_global_with_result(eval.as_slice());
reply.send(if rval.is_undefined() {
- devtools_traits::VoidValue
+ EvaluateJSReply::VoidValue
} else if rval.is_boolean() {
- devtools_traits::BooleanValue(rval.to_boolean())
+ EvaluateJSReply::BooleanValue(rval.to_boolean())
} else if rval.is_double() {
- devtools_traits::NumberValue(FromJSValConvertible::from_jsval(cx, rval, ()).unwrap())
+ EvaluateJSReply::NumberValue(FromJSValConvertible::from_jsval(cx, rval, ()).unwrap())
} else if rval.is_string() {
//FIXME: use jsstring_to_str when jsval grows to_jsstring
- devtools_traits::StringValue(FromJSValConvertible::from_jsval(cx, rval, StringificationBehavior::Default).unwrap())
+ EvaluateJSReply::StringValue(FromJSValConvertible::from_jsval(cx, rval, StringificationBehavior::Default).unwrap())
} else if rval.is_null() {
- devtools_traits::NullValue
+ EvaluateJSReply::NullValue
} else {
//FIXME: jsvals don't have an is_int32/is_number yet
assert!(rval.is_object());
diff --git a/components/script/dom/bindings/DESIGN.md b/components/script/dom/bindings/DESIGN.md
deleted file mode 100644
index 9ee7a50a7ac..00000000000
--- a/components/script/dom/bindings/DESIGN.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# The design of Garbage collected DOM
-
-This is how Servo provides an object graph to SpiderMonkey's Garbage Collector.
-
-## Construct
-When Servo creates a Rusty DOM object the binding code creates a corresponding wrapper `JSObject` with SpiderMonkey. It’s produced and set to the Rusty object in `FooBinding::Wrap`.
-
-In `FooBinding::Wrap`, the wrapper `JSObject` gets the pointer for the Rusty object to itself. At the same time the wrapper `JSObject` is set to the Rusty object’s `Reflector` field (all Rusty DOM objects have `dom::bindings::utils::Reflector` in their most basic fields). These steps are the “binding” work necessary to create the relationship between both objects.
-
-
-## Trace object graph from SpiderMonkey GC
-This is a tricky mechanism done with the help of the Rust compiler.
-The outline is:
-
-1. SpiderMonkey's GC calls `JSClass.trace` defined in `FooBinding` during the marking phase. This `JSClass` is the basis of each wrapper `JSObject`.
-2. `JSClass.trace` calls `Foo::trace()` (an implementation of `JSTraceable`).
- This is typically derived via a #[jstraceable] annotation.
-3. For all fields, `Foo::trace()`
- calls `trace()` on the field. For example, for fields of type `JS<T>`, `JS<T>::trace()` calls
- `trace_reflector()`. Non-JS-managed types have an empty inline `trace()` method, achieved via `no_jsmanaged_fields!` or similar.
-4. `trace_reflector()` fetches the reflector that is reachable from a Rust object and notifies it to the GC using JSTracer.
-5. This operation continues for the rest of the graph.
-6. Finally, the GC checks whether the Rust object lives or not from `JSObject`s which are held by Rust object.
-
-
-## Destruct
-When destructing DOM objects (wrapper JSObjects), SpiderMonkey calls the `JSClass.finalize()` which is basis of each wrapper `JSObject`. This method refers to `FooBinding::_finalize()`.
-
-In the `_finalize()` function the pointer of the Rusty DOM object that is contained in the JSObject is unwrapped. It is then cast to a Rust owned pointer and assigned to an empty local variable. Thus we can destruct the Rusty object afterwards.
-
-
-## Interact with Exact GC’s rooting
-For supporting SpiderMonkey’s exact GC rooting, we introduce [some types](https://github.com/mozilla/servo/wiki/Using-DOM-types):
-
-- `JS<T>` is used for the DOM typed field in a DOM type structure. The GC can trace them recursively while the enclosing DOM object (maybe root) is alive.
- - `LayoutJS<T>` is specialized `JS<T>` to use in layout. `Layout*Helper` must be implemented on this type to prevent calling methods from non layout code.
-- `Unrooted<T>` is used to wrap raw pointers to DOM objects extracted from their reflectors.
-- `Temporary<T>` is used as a return value for functions returning a DOM type. They are rooted for the duration of their lifetime. But a retun value gets moved around which can break the LIFO ordering constraint. Thus we need to introduce `Root<T>`.
-- `Root<T>` contains the pointer to `JSObject` which the represented DOM type has. SpiderMonkey's conservative stack scanner scans it's pointers and marks a pointed `JSObject` as GC root.
-- `JSRef` is just a reference to the value rooted by `Root<T>`.
-- `RootCollection` is used to dynamically check if rooting satisfies LIFO ordering, because SpiderMonkey's GC requires LIFO order (See also: [Exact Stack Rooting - Storing a GCPointer on the CStack](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting)).
- - `MutHeap<T>` is a version of `Cell<T>` that is safe to use for internal mutability of Spidermonkey heap objects like `JSVal` and `JS<T>`
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs
index fc0a845b748..81085256821 100644
--- a/components/script/dom/bindings/cell.rs
+++ b/components/script/dom/bindings/cell.rs
@@ -10,7 +10,7 @@ use js::jsapi::{JSTracer};
use util::task_state;
use util::task_state::{SCRIPT, IN_GC};
-use std::cell::{RefCell, Ref, RefMut};
+use std::cell::{BorrowState, RefCell, Ref, RefMut};
/// A mutable field in the DOM.
///
@@ -52,7 +52,7 @@ impl<T> DOMRefCell<T> {
///
/// For safety checks in debug builds only.
pub fn is_mutably_borrowed(&self) -> bool {
- self.value.try_borrow().is_some()
+ self.value.borrow_state() == BorrowState::Writing
}
/// Attempts to immutably borrow the wrapped value.
@@ -67,7 +67,10 @@ impl<T> DOMRefCell<T> {
/// Panics if this is called off the script thread.
pub fn try_borrow<'a>(&'a self) -> Option<Ref<'a, T>> {
debug_assert!(task_state::get().is_script());
- self.value.try_borrow()
+ match self.value.borrow_state() {
+ BorrowState::Writing => None,
+ _ => Some(self.value.borrow()),
+ }
}
/// Mutably borrows the wrapped value.
@@ -82,7 +85,10 @@ impl<T> DOMRefCell<T> {
/// Panics if this is called off the script thread.
pub fn try_borrow_mut<'a>(&'a self) -> Option<RefMut<'a, T>> {
debug_assert!(task_state::get().is_script());
- self.value.try_borrow_mut()
+ match self.value.borrow_state() {
+ BorrowState::Unused => Some(self.value.borrow_mut()),
+ _ => None,
+ }
}
}
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 5d2aad2139e..29a81f771af 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -302,8 +302,11 @@ class CGMethodCall(CGThing):
# The argument at index distinguishingIndex can't possibly
# be unset here, because we've already checked that argc is
# large enough that we can examine this argument.
- template, _, declType, needsRooting = getJSToNativeConversionTemplate(
+ info = getJSToNativeConversionInfo(
type, descriptor, failureCode="break;", isDefinitelyObject=True)
+ template = info.template
+ declType = info.declType
+ needsRooting = info.needsRooting
testCode = instantiateJSToNativeConversionTemplate(
template,
@@ -431,19 +434,48 @@ def union_native_type(t):
return 'UnionTypes::%s' % name
-def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
- isDefinitelyObject=False,
- isMember=False,
- isArgument=False,
- invalidEnumValueFatal=True,
- defaultValue=None,
- treatNullAs="Default",
- isEnforceRange=False,
- isClamp=False,
- exceptionCode=None,
- allowTreatNonObjectAsNull=False,
- isCallbackReturnValue=False,
- sourceDescription="value"):
+class JSToNativeConversionInfo():
+ """
+ An object representing information about a JS-to-native conversion.
+ """
+ def __init__(self, template, default=None, declType=None,
+ needsRooting=False):
+ """
+ template: A string representing the conversion code. This will have
+ template substitution performed on it as follows:
+
+ ${val} is a handle to the JS::Value in question
+
+ default: A string or None representing rust code for default value(if any).
+
+ declType: A CGThing representing the native C++ type we're converting
+ to. This is allowed to be None if the conversion code is
+ supposed to be used as-is.
+
+ needsRooting: A boolean indicating whether the caller has to root
+ the result
+ """
+ assert isinstance(template, str)
+ assert declType is None or isinstance(declType, CGThing)
+ self.template = template
+ self.default = default
+ self.declType = declType
+ self.needsRooting = needsRooting
+
+
+def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
+ isDefinitelyObject=False,
+ isMember=False,
+ isArgument=False,
+ invalidEnumValueFatal=True,
+ defaultValue=None,
+ treatNullAs="Default",
+ isEnforceRange=False,
+ isClamp=False,
+ exceptionCode=None,
+ allowTreatNonObjectAsNull=False,
+ isCallbackReturnValue=False,
+ sourceDescription="value"):
"""
Get a template for converting a JS value to a native object based on the
given type and descriptor. If failureCode is given, then we're actually
@@ -478,7 +510,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
If allowTreatNonObjectAsNull is true, then [TreatNonObjectAsNull]
extended attributes on nullable callback functions will be honored.
- The return value from this function is a tuple consisting of four things:
+ The return value from this function is an object of JSToNativeConversionInfo consisting of four things:
1) A string representing the conversion code. This will have template
substitution performed on it as follows:
@@ -508,7 +540,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
def handleOptional(template, declType, default):
assert (defaultValue is None) == (default is None)
- return (template, default, declType, needsRooting)
+ return JSToNativeConversionInfo(template, default, declType, needsRooting=needsRooting)
# Unfortunately, .capitalize() on a string will lowercase things inside the
# string, which we do not want.
@@ -786,7 +818,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
else:
default = None
- return (template, default, declType, needsRooting)
+ return JSToNativeConversionInfo(template, default, declType, needsRooting=needsRooting)
if type.isAny():
assert not isEnforceRange and not isClamp
@@ -825,7 +857,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
if type.isVoid():
# This one only happens for return values, and its easy: Just
# ignore the jsval.
- return ("", None, None, False)
+ return JSToNativeConversionInfo("", None, None, needsRooting=False)
if not type.isPrimitive():
raise TypeError("Need conversion for argument type '%s'" % str(type))
@@ -869,7 +901,7 @@ def instantiateJSToNativeConversionTemplate(templateBody, replacements,
declType, declName, needsRooting):
"""
Take the templateBody and declType as returned by
- getJSToNativeConversionTemplate, a set of replacements as required by the
+ getJSToNativeConversionInfo, a set of replacements as required by the
strings in such a templateBody, and a declName, and generate code to
convert into a stack Rust binding with that name.
"""
@@ -943,7 +975,7 @@ class CGArgumentConverter(CGThing):
"val": string.Template("(*${argv}.offset(${index}))").substitute(replacer),
}
- template, default, declType, needsRooting = getJSToNativeConversionTemplate(
+ info = getJSToNativeConversionInfo(
argument.type,
descriptorProvider,
invalidEnumValueFatal=invalidEnumValueFatal,
@@ -953,6 +985,10 @@ class CGArgumentConverter(CGThing):
isClamp=argument.clamp,
isMember="Variadic" if argument.variadic else False,
allowTreatNonObjectAsNull=argument.allowTreatNonCallableAsNull())
+ template = info.template
+ default = info.default
+ declType = info.declType
+ needsRooting = info.needsRooting
if not argument.variadic:
if argument.optional:
@@ -985,7 +1021,7 @@ class CGArgumentConverter(CGThing):
seqType = CGTemplatedType("Vec", declType)
variadicConversion = string.Template(
- "let mut vector: ${seqType} = Vec::with_capacity((${argc} - ${index}) as uint);\n"
+ "let mut vector: ${seqType} = Vec::with_capacity((${argc} - ${index}) as usize);\n"
"for variadicArg in range(${index}, ${argc}) {\n"
"${inner}\n"
" vector.push(slot);\n"
@@ -1467,7 +1503,7 @@ const Class_name: [u8; %i] = %s;
static Class: DOMJSClass = DOMJSClass {
base: js::Class {
name: &Class_name as *const u8 as *const libc::c_char,
- flags: JSCLASS_IS_DOMJSCLASS | %s | (((%s) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT as uint), //JSCLASS_HAS_RESERVED_SLOTS(%s),
+ flags: JSCLASS_IS_DOMJSCLASS | %s | (((%s) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT), //JSCLASS_HAS_RESERVED_SLOTS(%s),
addProperty: Some(JS_PropertyStub),
delProperty: Some(JS_PropertyStub),
getProperty: Some(JS_PropertyStub),
@@ -1550,7 +1586,7 @@ class CGPrototypeJSClass(CGThing):
const PrototypeClassName__: [u8; %s] = %s;
static PrototypeClass: JSClass = JSClass {
name: &PrototypeClassName__ as *const u8 as *const libc::c_char,
- flags: (1 & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT as uint, //JSCLASS_HAS_RESERVED_SLOTS(1)
+ flags: (1 & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT, //JSCLASS_HAS_RESERVED_SLOTS(1)
addProperty: Some(JS_PropertyStub),
delProperty: Some(JS_PropertyStub),
getProperty: Some(JS_PropertyStub),
@@ -1818,8 +1854,8 @@ def CreateBindingJSObject(descriptor, parent=None):
if descriptor.proxy:
assert not descriptor.isGlobal()
create += """
-let handler = RegisterBindings::proxy_handlers[PrototypeList::Proxies::%s as uint];
-let mut private = PrivateValue(squirrel_away_unique(object) as *const libc::c_void);
+let handler = RegisterBindings::proxy_handlers[PrototypeList::Proxies::%s as usize];
+let mut private = PrivateValue(boxed::into_raw(object) as *const libc::c_void);
let obj = with_compartment(cx, proto, || {
NewProxyObject(cx, handler,
&private,
@@ -1838,8 +1874,8 @@ assert!(!obj.is_null());\
create += """\
assert!(!obj.is_null());
-JS_SetReservedSlot(obj, DOM_OBJECT_SLOT as u32,
- PrivateValue(squirrel_away_unique(object) as *const libc::c_void));"""
+JS_SetReservedSlot(obj, DOM_OBJECT_SLOT,
+ PrivateValue(boxed::into_raw(object) as *const libc::c_void));"""
return create
class CGWrapMethod(CGAbstractMethod):
@@ -1903,10 +1939,10 @@ class CGIDLInterface(CGThing):
}
return string.Template("""\
impl IDLInterface for ${type} {
- fn get_prototype_id(_: Option<${type}>) -> PrototypeList::ID {
+ fn get_prototype_id() -> PrototypeList::ID {
PrototypeList::ID::${type}
}
- fn get_prototype_depth(_: Option<${type}>) -> uint {
+ fn get_prototype_depth() -> usize {
${depth}
}
}
@@ -2054,11 +2090,11 @@ assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0);
/* Check to see whether the interface objects are already installed */
let proto_or_iface_array = get_proto_or_iface_array(global);
-let cached_object: *mut JSObject = *proto_or_iface_array.offset(%s as int);
+let cached_object: *mut JSObject = *proto_or_iface_array.offset(%s as isize);
if cached_object.is_null() {
let tmp: *mut JSObject = CreateInterfaceObjects(cx, global, receiver);
assert!(!tmp.is_null());
- *proto_or_iface_array.offset(%s as int) = tmp;
+ *proto_or_iface_array.offset(%s as isize) = tmp;
tmp
} else {
cached_object
@@ -2783,7 +2819,7 @@ class CGEnum(CGThing):
CGThing.__init__(self)
decl = """\
-#[repr(uint)]
+#[repr(usize)]
#[derive(PartialEq, Copy)]
#[jstraceable]
pub enum %s {
@@ -2802,7 +2838,7 @@ pub const strings: &'static [&'static str] = &[
impl ToJSValConvertible for super::%s {
fn to_jsval(&self, cx: *mut JSContext) -> JSVal {
- strings[*self as uint].to_jsval(cx)
+ strings[*self as usize].to_jsval(cx)
}
}
""" % (",\n ".join(['"%s"' % val for val in enum.values()]), enum.identifier.name)
@@ -2846,7 +2882,7 @@ class CGConstant(CGThing):
def getUnionTypeTemplateVars(type, descriptorProvider):
# For dictionaries and sequences we need to pass None as the failureCode
- # for getJSToNativeConversionTemplate.
+ # for getJSToNativeConversionInfo.
# Also, for dictionaries we would need to handle conversion of
# null/undefined to the dictionary correctly.
if type.isDictionary() or type.isSequence():
@@ -2872,10 +2908,11 @@ def getUnionTypeTemplateVars(type, descriptorProvider):
name = type.name
typeName = "/*" + type.name + "*/"
- template, _, _, _ = getJSToNativeConversionTemplate(
+ info = getJSToNativeConversionInfo(
type, descriptorProvider, failureCode="return Ok(None);",
exceptionCode='return Err(());',
isDefinitelyObject=True)
+ template = info.template
assert not type.isObject()
jsConversion = string.Template(template).substitute({
@@ -3034,8 +3071,11 @@ class CGUnionConversionStruct(CGThing):
pre="fn from_jsval(cx: *mut JSContext, value: JSVal, _option: ()) -> Result<%s, ()> {\n" % self.type,
post="\n}")
return CGWrapper(
- CGIndenter(method),
- pre="impl FromJSValConvertible for %s {\ntype Config = ();\n" % self.type,
+ CGIndenter(CGList([
+ CGGeneric("type Config = ();"),
+ method,
+ ], "\n")),
+ pre="impl FromJSValConvertible for %s {\n" % self.type,
post="\n}")
def try_method(self, t):
@@ -3545,9 +3585,13 @@ class CGProxySpecialOperation(CGPerSignatureCall):
if operation.isSetter() or operation.isCreator():
# arguments[0] is the index or name of the item that we're setting.
argument = arguments[1]
- template, _, declType, needsRooting = getJSToNativeConversionTemplate(
+ info = getJSToNativeConversionInfo(
argument.type, descriptor, treatNullAs=argument.treatNullAs,
exceptionCode="return false;")
+ template = info.template
+ declType = info.declType
+ needsRooting = info.needsRooting
+
templateValues = {
"val": "(*desc).value",
}
@@ -3997,7 +4041,7 @@ let this: *const %s = unwrap::<%s>(obj);
def finalizeHook(descriptor, hookName, context):
release = """\
let value = unwrap::<%s>(obj);
-let _: Box<%s> = mem::transmute(value);
+let _ = Box::from_raw(value as *mut %s);
debug!("%s finalize: {:p}", this);\
""" % (descriptor.concreteType, descriptor.concreteType, descriptor.concreteType)
return release
@@ -4309,14 +4353,15 @@ class CGDictionary(CGThing):
self.generatable = False
# Nothing else to do here
return
+
self.memberInfo = [
(member,
- getJSToNativeConversionTemplate(member.type,
- descriptorProvider,
- isMember="Dictionary",
- defaultValue=member.defaultValue,
- failureCode="return Err(());",
- exceptionCode="return Err(());"))
+ getJSToNativeConversionInfo(member.type,
+ descriptorProvider,
+ isMember="Dictionary",
+ defaultValue=member.defaultValue,
+ failureCode="return Err(());",
+ exceptionCode="return Err(());"))
for member in dictionary.members ]
def define(self):
@@ -4345,11 +4390,9 @@ class CGDictionary(CGThing):
def impl(self):
d = self.dictionary
if d.parent:
- initParent = ("parent: match %s::%s::new(cx, val) {\n"
- " Ok(parent) => parent,\n"
- " Err(_) => return Err(()),\n"
- "},\n") % (self.makeModuleName(d.parent),
- self.makeClassName(d.parent))
+ initParent = "parent: try!(%s::%s::new(cx, val)),\n" % (
+ self.makeModuleName(d.parent),
+ self.makeClassName(d.parent))
else:
initParent = ""
@@ -4398,16 +4441,20 @@ class CGDictionary(CGThing):
return dictionary.module()
def getMemberType(self, memberInfo):
- member, (_, _, declType, _) = memberInfo
+ member, info = memberInfo
+ declType = info.declType
if not member.defaultValue:
- declType = CGWrapper(declType, pre="Option<", post=">")
+ declType = CGWrapper(info.declType, pre="Option<", post=">")
return declType.define()
def getMemberConversion(self, memberInfo):
def indent(s):
return CGIndenter(CGGeneric(s), 8).define()
- member, (templateBody, default, declType, _) = memberInfo
+ member, info = memberInfo
+ templateBody = info.template
+ default = info.default
+ declType = info.declType
replacements = { "val": "value" }
conversion = string.Template(templateBody).substitute(replacements)
@@ -4417,12 +4464,11 @@ class CGDictionary(CGThing):
conversion = "Some(%s)" % conversion
conversion = (
- "match get_dictionary_property(cx, object, \"%s\") {\n"
- " Err(()) => return Err(()),\n"
- " Ok(Some(value)) => {\n"
+ "match try!(get_dictionary_property(cx, object, \"%s\")) {\n"
+ " Some(value) => {\n"
"%s\n"
" },\n"
- " Ok(None) => {\n"
+ " None => {\n"
"%s\n"
" },\n"
"}") % (member.identifier.name, indent(conversion), indent(default))
@@ -4475,7 +4521,7 @@ class CGRegisterProxyHandlersMethod(CGAbstractMethod):
def definition_body(self):
return CGList([
- CGGeneric("proxy_handlers[Proxies::%s as uint] = codegen::Bindings::%sBinding::DefineProxyHandler();" % (desc.name, desc.name))
+ CGGeneric("proxy_handlers[Proxies::%s as usize] = codegen::Bindings::%sBinding::DefineProxyHandler();" % (desc.name, desc.name))
for desc in self.descriptors
], "\n")
@@ -4582,7 +4628,6 @@ class CGBindingRoot(CGThing):
'dom::bindings::utils::has_property_on_prototype',
'dom::bindings::utils::is_platform_object',
'dom::bindings::utils::{Reflectable}',
- 'dom::bindings::utils::{squirrel_away_unique}',
'dom::bindings::utils::throwing_constructor',
'dom::bindings::utils::get_dictionary_property',
'dom::bindings::utils::{NativeProperties, NativePropertyHooks}',
@@ -4612,6 +4657,7 @@ class CGBindingRoot(CGThing):
'libc',
'util::str::DOMString',
'std::borrow::ToOwned',
+ 'std::boxed',
'std::cmp',
'std::iter::repeat',
'std::mem',
@@ -4630,8 +4676,9 @@ class CGBindingRoot(CGThing):
return stripTrailingWhitespace(self.root.define())
def argument_type(descriptorProvdider, ty, optional=False, defaultValue=None, variadic=False):
- _, _, declType, _ = getJSToNativeConversionTemplate(
+ info = getJSToNativeConversionInfo(
ty, descriptorProvdider, isArgument=True)
+ declType = info.declType
if variadic:
declType = CGWrapper(declType, pre="Vec<", post=">")
@@ -4941,13 +4988,16 @@ class CallbackMember(CGNativeMember):
"val": "rval",
}
- template, _, declType, needsRooting = getJSToNativeConversionTemplate(
+ info = getJSToNativeConversionInfo(
self.retvalType,
self.descriptorProvider,
exceptionCode=self.exceptionCode,
isCallbackReturnValue="Callback",
# XXXbz we should try to do better here
sourceDescription="return value")
+ template = info.template
+ declType = info.declType
+ needsRooting = info.needsRooting
convertType = instantiateJSToNativeConversionTemplate(
template, replacements, declType, "rvalDecl", needsRooting)
@@ -5200,7 +5250,7 @@ class GlobalGenRoots():
return CGList([
CGGeneric(AUTOGENERATED_WARNING_COMMENT),
- CGGeneric("pub const MAX_PROTO_CHAIN_LENGTH: uint = %d;\n\n" % config.maxProtoChainLength),
+ CGGeneric("pub const MAX_PROTO_CHAIN_LENGTH: usize = %d;\n\n" % config.maxProtoChainLength),
CGNonNamespacedEnum('ID', protos, [0], deriving="PartialEq, Copy"),
CGNonNamespacedEnum('Proxies', proxies, [0], deriving="PartialEq, Copy"),
])
@@ -5264,10 +5314,10 @@ class GlobalGenRoots():
impl ${selfName} for ${baseName} {
#[inline]
fn ${fname}(&self) -> bool {
-let base: &${parentName} = ${parentName}Cast::from_actual(self);
+ let base: &${parentName} = ${parentName}Cast::from_actual(self);
base.${fname}()
}
-}\
+}
""").substitute({'fname': 'is_' + name.lower(),
'selfName': name + 'Derived',
'baseName': protoDescriptor.concreteType,
@@ -5276,9 +5326,10 @@ let base: &${parentName} = ${parentName}Cast::from_actual(self);
derived += [CGGeneric('\n')]
cast = [CGGeneric(string.Template("""\
-pub trait ${castTraitName} : Sized {
+pub struct ${name}Cast;
+impl ${name}Cast {
#[inline(always)]
- fn to_ref<'a, T: ${toBound}+Reflectable>(base: JSRef<'a, T>) -> Option<JSRef<'a, Self>> {
+ pub fn to_ref<'a, T: ${toBound}+Reflectable>(base: JSRef<'a, T>) -> Option<JSRef<'a, ${name}>> {
match base.${checkFn}() {
true => unsafe { Some(base.transmute()) },
false => None
@@ -5286,7 +5337,7 @@ pub trait ${castTraitName} : Sized {
}
#[inline(always)]
- fn to_borrowed_ref<'a, 'b, T: ${toBound}+Reflectable>(base: &'a JSRef<'b, T>) -> Option<&'a JSRef<'b, Self>> {
+ pub fn to_borrowed_ref<'a, 'b, T: ${toBound}+Reflectable>(base: &'a JSRef<'b, T>) -> Option<&'a JSRef<'b, ${name}>> {
match base.${checkFn}() {
true => unsafe { Some(base.transmute_borrowed()) },
false => None
@@ -5295,7 +5346,7 @@ pub trait ${castTraitName} : Sized {
#[inline(always)]
#[allow(unrooted_must_root)]
- fn to_layout_js<T: ${toBound}+Reflectable>(base: &LayoutJS<T>) -> Option<LayoutJS<Self>> {
+ pub fn to_layout_js<T: ${toBound}+Reflectable>(base: &LayoutJS<T>) -> Option<LayoutJS<${name}>> {
unsafe {
match (*base.unsafe_get()).${checkFn}() {
true => Some(base.transmute_copy()),
@@ -5305,30 +5356,29 @@ pub trait ${castTraitName} : Sized {
}
#[inline(always)]
- fn from_ref<'a, T: ${fromBound}+Reflectable>(derived: JSRef<'a, T>) -> JSRef<'a, Self> {
+ pub fn from_ref<'a, T: ${fromBound}+Reflectable>(derived: JSRef<'a, T>) -> JSRef<'a, ${name}> {
unsafe { derived.transmute() }
}
#[inline(always)]
- fn from_borrowed_ref<'a, 'b, T: ${fromBound}+Reflectable>(derived: &'a JSRef<'b, T>) -> &'a JSRef<'b, Self> {
+ pub fn from_borrowed_ref<'a, 'b, T: ${fromBound}+Reflectable>(derived: &'a JSRef<'b, T>) -> &'a JSRef<'b, ${name}> {
unsafe { derived.transmute_borrowed() }
}
#[inline(always)]
- fn from_temporary<T: ${fromBound}+Reflectable>(derived: Temporary<T>) -> Temporary<Self> {
+ pub fn from_temporary<T: ${fromBound}+Reflectable>(derived: Temporary<T>) -> Temporary<${name}> {
unsafe { derived.transmute() }
}
#[inline(always)]
- fn from_actual<'a, T: ${fromBound}+Reflectable>(derived: &T) -> &'a Self {
+ pub fn from_actual<'a, T: ${fromBound}+Reflectable>(derived: &T) -> &'a ${name} {
unsafe { mem::transmute(derived) }
}
}
""").substitute({'checkFn': 'is_' + name.lower(),
- 'castTraitName': name + 'Cast',
+ 'name': name,
'fromBound': name + 'Base',
- 'toBound': name + 'Derived'})),
- CGGeneric("impl %s for %s {}\n\n" % (name + 'Cast', name))]
+ 'toBound': name + 'Derived'}))]
allprotos += protos + derived + cast
diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs
index 529c24ac2d6..dfcb9b71d3f 100644
--- a/components/script/dom/bindings/conversions.rs
+++ b/components/script/dom/bindings/conversions.rs
@@ -57,14 +57,12 @@ use std::slice;
/// A trait to retrieve the constants necessary to check if a `JSObject`
/// implements a given interface.
-// FIXME (https://github.com/rust-lang/rfcs/pull/4)
-// remove Option<Self> arguments.
pub trait IDLInterface {
/// Returns the prototype ID.
- fn get_prototype_id(_: Option<Self>) -> PrototypeList::ID;
+ fn get_prototype_id() -> PrototypeList::ID;
/// Returns the prototype depth, i.e., the number of interfaces this
/// interface inherits from.
- fn get_prototype_depth(_: Option<Self>) -> uint;
+ fn get_prototype_depth() -> usize;
}
/// A trait to convert Rust types to `JSVal`s.
@@ -308,7 +306,7 @@ pub fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
unsafe {
let mut length = 0;
let chars = JS_GetStringCharsAndLength(cx, s, &mut length);
- let char_vec = slice::from_raw_buf(&chars, length as uint);
+ let char_vec = slice::from_raw_parts(chars, length as usize);
String::from_utf16(char_vec).unwrap()
}
}
@@ -367,7 +365,7 @@ impl FromJSValConvertible for ByteString {
let mut length = 0;
let chars = JS_GetStringCharsAndLength(cx, string, &mut length);
- let char_vec = slice::from_raw_buf(&chars, length as uint);
+ let char_vec = slice::from_raw_parts(chars, length as usize);
if char_vec.iter().any(|&c| c > 0xFF) {
// XXX Throw
@@ -412,8 +410,8 @@ pub fn is_dom_proxy(obj: *mut JSObject) -> bool {
/// stored for non-proxy bindings.
// We use slot 0 for holding the raw object. This is safe for both
// globals and non-globals.
-pub const DOM_OBJECT_SLOT: uint = 0;
-const DOM_PROXY_OBJECT_SLOT: uint = js::JSSLOT_PROXY_PRIVATE as uint;
+pub const DOM_OBJECT_SLOT: u32 = 0;
+const DOM_PROXY_OBJECT_SLOT: u32 = js::JSSLOT_PROXY_PRIVATE;
/// Returns the index of the slot wherein a pointer to the reflected DOM object
/// is stored.
@@ -422,10 +420,10 @@ const DOM_PROXY_OBJECT_SLOT: uint = js::JSSLOT_PROXY_PRIVATE as uint;
pub unsafe fn dom_object_slot(obj: *mut JSObject) -> u32 {
let clasp = JS_GetClass(obj);
if is_dom_class(&*clasp) {
- DOM_OBJECT_SLOT as u32
+ DOM_OBJECT_SLOT
} else {
assert!(is_dom_proxy(obj));
- DOM_PROXY_OBJECT_SLOT as u32
+ DOM_PROXY_OBJECT_SLOT
}
}
@@ -489,8 +487,8 @@ pub fn unwrap_jsmanaged<T>(mut obj: *mut JSObject) -> Result<Unrooted<T>, ()>
}
}));
- let proto_id = IDLInterface::get_prototype_id(None::<T>);
- let proto_depth = IDLInterface::get_prototype_depth(None::<T>);
+ let proto_id = <T as IDLInterface>::get_prototype_id();
+ let proto_depth = <T as IDLInterface>::get_prototype_depth();
if dom_class.interface_chain[proto_depth] == proto_id {
debug!("good prototype");
Ok(Unrooted::from_raw(unwrap(obj)))
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs
index bed13bcc32d..806e3c21ffe 100644
--- a/components/script/dom/bindings/error.rs
+++ b/components/script/dom/bindings/error.rs
@@ -20,7 +20,7 @@ use std::ffi::CString;
use std::ptr;
/// DOM exceptions that can be thrown by a native DOM method.
-#[derive(Show, Clone)]
+#[derive(Debug, Clone)]
pub enum Error {
/// IndexSizeError
IndexSize,
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs
index f706d175a39..dc42d0da6e0 100644
--- a/components/script/dom/bindings/global.rs
+++ b/components/script/dom/bindings/global.rs
@@ -14,7 +14,7 @@ use dom::workerglobalscope::{WorkerGlobalScope, WorkerGlobalScopeHelpers};
use dom::window;
use script_task::ScriptChan;
-use servo_net::resource_task::ResourceTask;
+use net::resource_task::ResourceTask;
use js::{JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS};
use js::glue::{GetGlobalForObjectCrossCompartment};
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs
index bfc8f9cae29..622368af6d2 100644
--- a/components/script/dom/bindings/js.rs
+++ b/components/script/dom/bindings/js.rs
@@ -4,45 +4,50 @@
//! Smart pointers for the JS-managed DOM objects.
//!
-//! The DOM is made up of Rust types whose lifetime is entirely controlled by the whims of
-//! the SpiderMonkey garbage collector. The types in this module are designed to ensure
-//! that any interactions with said Rust types only occur on values that will remain alive
-//! the entire time.
+//! The DOM is made up of DOM objects whose lifetime is entirely controlled by
+//! the whims of the SpiderMonkey garbage collector. The types in this module
+//! are designed to ensure that any interactions with said Rust types only
+//! occur on values that will remain alive the entire time.
//!
//! Here is a brief overview of the important types:
//!
-//! - `JSRef<T>`: a freely-copyable reference to a rooted value.
-//! - `Root<T>`: a stack-based reference to a rooted value.
-//! - `JS<T>`: a pointer to JS-owned memory that can automatically be traced by the GC when
-//! encountered as a field of a Rust structure.
-//! - `Temporary<T>`: a value that will remain rooted for the duration of its lifetime.
+//! - `JSRef<T>`: a freely-copyable reference to a rooted DOM object.
+//! - `Root<T>`: a stack-based reference to a rooted DOM object.
+//! - `JS<T>`: a reference to a DOM object that can automatically be traced by
+//! the GC when encountered as a field of a Rust structure.
+//! - `Temporary<T>`: a reference to a DOM object that will remain rooted for
+//! the duration of its lifetime.
//!
//! The rule of thumb is as follows:
//!
-//! - All methods return `Temporary<T>`, to ensure the value remains alive until it is stored
-//! somewhere that is reachable by the GC.
-//! - All functions take `JSRef<T>` arguments, to ensure that they will remain uncollected for
-//! the duration of their usage.
-//! - All types contain `JS<T>` fields and derive the `Encodable` trait, to ensure that they are
-//! transitively marked as reachable by the GC if the enclosing value is reachable.
-//! - All methods for type `T` are implemented for `JSRef<T>`, to ensure that the self value
-//! will not be collected for the duration of the method call.
+//! - All methods return `Temporary<T>`, to ensure the value remains alive
+//! until it is stored somewhere that is reachable by the GC.
+//! - All functions take `JSRef<T>` arguments, to ensure that they will remain
+//! uncollected for the duration of their usage.
+//! - All DOM structs contain `JS<T>` fields and derive the `JSTraceable`
+//! trait, to ensure that they are transitively marked as reachable by the GC
+//! if the enclosing value is reachable.
+//! - All methods for type `T` are implemented for `JSRef<T>`, to ensure that
+//! the self value will not be collected for the duration of the method call.
//!
-//! Both `Temporary<T>` and `JS<T>` do not allow access to their inner value without explicitly
-//! creating a stack-based root via the `root` method. This returns a `Root<T>`, which causes
-//! the JS-owned value to be uncollectable for the duration of the `Root` object's lifetime.
-//! A `JSRef<T>` can be obtained from a `Root<T>` by calling the `r` method. (Dereferencing the
-//! object is still supported, but as it is unsafe, this is deprecated.) These `JSRef<T>` values
-//! are not allowed to outlive their originating `Root<T>`, to ensure that all interactions with
-//! the enclosed value only occur when said value is uncollectable, and will cause static lifetime
-//! errors if misused.
+//! Both `Temporary<T>` and `JS<T>` do not allow access to their inner value
+//! without explicitly creating a stack-based root via the `root` method. This
+//! returns a `Root<T>`, which causes the JS-owned value to be uncollectable
+//! for the duration of the `Root` object's lifetime. A `JSRef<T>` can be
+//! obtained from a `Root<T>` by calling the `r` method. These `JSRef<T>`
+//! values are not allowed to outlive their originating `Root<T>`, to ensure
+//! that all interactions with the enclosed value only occur when said value is
+//! uncollectable, and will cause static lifetime errors if misused.
//!
//! Other miscellaneous helper traits:
//!
-//! - `OptionalRootable` and `OptionalRootedRootable`: make rooting `Option` values easy via a `root` method
+//! - `OptionalRootable` and `OptionalRootedRootable`: make rooting `Option`
+//! values easy via a `root` method
//! - `ResultRootable`: make rooting successful `Result` values easy
-//! - `TemporaryPushable`: allows mutating vectors of `JS<T>` with new elements of `JSRef`/`Temporary`
-//! - `RootedReference`: makes obtaining an `Option<JSRef<T>>` from an `Option<Root<T>>` easy
+//! - `TemporaryPushable`: allows mutating vectors of `JS<T>` with new elements
+//! of `JSRef`/`Temporary`
+//! - `RootedReference`: makes obtaining an `Option<JSRef<T>>` from an
+//! `Option<Root<T>>` easy
use dom::bindings::trace::JSTraceable;
use dom::bindings::utils::{Reflector, Reflectable};
@@ -62,6 +67,8 @@ use std::mem;
use std::ops::Deref;
/// An unrooted, JS-owned value. Must not be held across a GC.
+///
+/// This is used in particular to wrap pointers extracted from a reflector.
#[must_root]
pub struct Unrooted<T> {
ptr: NonZero<*const T>
@@ -76,6 +83,14 @@ impl<T: Reflectable> Unrooted<T> {
}
}
+ /// Create a new unrooted value from a `JS<T>`.
+ #[allow(unrooted_must_root)]
+ pub fn from_js(ptr: JS<T>) -> Unrooted<T> {
+ Unrooted {
+ ptr: ptr.ptr
+ }
+ }
+
/// Get the `Reflector` for this pointer.
pub fn reflector<'a>(&'a self) -> &'a Reflector {
unsafe {
@@ -101,10 +116,11 @@ impl<T: Reflectable> Unrooted<T> {
impl<T> Copy for Unrooted<T> {}
-/// A type that represents a JS-owned value that is rooted for the lifetime of this value.
-/// Importantly, it requires explicit rooting in order to interact with the inner value.
-/// Can be assigned into JS-owned member fields (i.e. `JS<T>` types) safely via the
-/// `JS<T>::assign` method or `OptionalSettable::assign` (for `Option<JS<T>>` fields).
+/// A type that represents a JS-owned value that is rooted for the lifetime of
+/// this value. Importantly, it requires explicit rooting in order to interact
+/// with the inner value. Can be assigned into JS-owned member fields (i.e.
+/// `JS<T>` types) safely via the `JS<T>::assign` method or
+/// `OptionalSettable::assign` (for `Option<JS<T>>` fields).
#[allow(unrooted_must_root)]
pub struct Temporary<T> {
inner: JS<T>,
@@ -172,7 +188,8 @@ impl<T: Reflectable> Temporary<T> {
}
}
-/// A rooted, JS-owned value. Must only be used as a field in other JS-owned types.
+/// A traced reference to a DOM object. Must only be used as a field in other
+/// DOM objects.
#[must_root]
pub struct JS<T> {
ptr: NonZero<*const T>
@@ -180,15 +197,15 @@ pub struct JS<T> {
impl<T> JS<T> {
/// Returns `LayoutJS<T>` containing the same pointer.
- fn to_layout(self) -> LayoutJS<T> {
+ pub unsafe fn to_layout(self) -> LayoutJS<T> {
LayoutJS {
ptr: self.ptr.clone()
}
}
}
-/// This is specialized `JS<T>` to use in under `layout` crate.
-/// `Layout*Helpers` traits must be implemented on this.
+/// An unrooted reference to a DOM object for use in layout. `Layout*Helpers`
+/// traits must be implemented on this.
pub struct LayoutJS<T> {
ptr: NonZero<*const T>
}
@@ -237,8 +254,10 @@ impl <T> Clone for LayoutJS<T> {
}
impl LayoutJS<Node> {
- /// Create a new JS-owned value wrapped from an address known to be a `Node` pointer.
- pub unsafe fn from_trusted_node_address(inner: TrustedNodeAddress) -> LayoutJS<Node> {
+ /// Create a new JS-owned value wrapped from an address known to be a
+ /// `Node` pointer.
+ pub unsafe fn from_trusted_node_address(inner: TrustedNodeAddress)
+ -> LayoutJS<Node> {
let TrustedNodeAddress(addr) = inner;
LayoutJS {
ptr: NonZero::new(addr as *const Node)
@@ -272,7 +291,7 @@ impl<U: Reflectable> JS<U> {
impl<T: Reflectable> Reflectable for JS<T> {
fn reflector<'a>(&'a self) -> &'a Reflector {
unsafe {
- (*self.unsafe_get()).reflector()
+ (**self.ptr).reflector()
}
}
}
@@ -290,7 +309,9 @@ impl HeapGCValue for JSVal {
impl<T: Reflectable> HeapGCValue for JS<T> {
}
-/// A mutable holder for a GC-owned SpiderMonkey value stored on the heap.
+/// A holder that provides interior mutability for GC-managed values such as
+/// `JSVal` and `JS<T>`.
+///
/// Must be used in place of traditional interior mutability to ensure proper
/// GC barriers are enforced.
#[must_root]
@@ -369,16 +390,10 @@ impl<T: Reflectable> MutNullableJS<T> {
self.ptr.get().map(Temporary::new)
}
- /// Retrieve a copy of the inner optional `JS<T>`. For use by layout, which
- /// can't use safe types like Temporary.
- pub unsafe fn get_inner(&self) -> Option<JS<T>> {
- self.ptr.get()
- }
-
/// Retrieve a copy of the inner optional `JS<T>` as `LayoutJS<T>`.
/// For use by layout, which can't use safe types like Temporary.
pub unsafe fn get_inner_as_layout(&self) -> Option<LayoutJS<T>> {
- self.get_inner().map(|js| js.to_layout())
+ self.ptr.get().map(|js| js.to_layout())
}
/// Retrieve a copy of the current inner value. If it is `None`, it is
@@ -398,24 +413,19 @@ impl<T: Reflectable> MutNullableJS<T> {
}
impl<T: Reflectable> JS<T> {
- /// Returns an unsafe pointer to the interior of this object.
- /// This should only be used by the DOM bindings.
- pub unsafe fn unsafe_get(&self) -> *const T {
- *self.ptr
- }
-
- /// Store an unrooted value in this field. This is safe under the assumption that JS<T>
- /// values are only used as fields in DOM types that are reachable in the GC graph,
- /// so this unrooted value becomes transitively rooted for the lifetime of its new owner.
+ /// Store an unrooted value in this field. This is safe under the
+ /// assumption that JS<T> values are only used as fields in DOM types that
+ /// are reachable in the GC graph, so this unrooted value becomes
+ /// transitively rooted for the lifetime of its new owner.
pub fn assign(&mut self, val: Temporary<T>) {
*self = unsafe { val.inner() };
}
}
impl<T: Reflectable> LayoutJS<T> {
- /// Returns an unsafe pointer to the interior of this JS object without touching the borrow
- /// flags. This is the only method that be safely accessed from layout. (The fact that this
- /// is unsafe is what necessitates the layout wrappers.)
+ /// Returns an unsafe pointer to the interior of this JS object. This is
+ /// the only method that be safely accessed from layout. (The fact that
+ /// this is unsafe is what necessitates the layout wrappers.)
pub unsafe fn unsafe_get(&self) -> *const T {
*self.ptr
}
@@ -461,9 +471,9 @@ impl<T: Reflectable> OptionalRootedReference<T> for Option<Option<Root<T>>> {
}
}
-/// Trait that allows extracting a `JS<T>` value from a variety of rooting-related containers,
-/// which in general is an unsafe operation since they can outlive the rooted lifetime of the
-/// original value.
+/// Trait that allows extracting a `JS<T>` value from a variety of
+/// rooting-related containers, which in general is an unsafe operation since
+/// they can outlive the rooted lifetime of the original value.
pub trait Assignable<T> {
/// Extract an unrooted `JS<T>`.
unsafe fn get_js(&self) -> JS<T>;
@@ -567,14 +577,15 @@ impl<T: Reflectable, U> ResultRootable<T, U> for Result<JS<T>, U> {
}
}
-/// Provides a facility to push unrooted values onto lists of rooted values. This is safe
-/// under the assumption that said lists are reachable via the GC graph, and therefore the
-/// new values are transitively rooted for the lifetime of their new owner.
+/// Provides a facility to push unrooted values onto lists of rooted values.
+/// This is safe under the assumption that said lists are reachable via the GC
+/// graph, and therefore the new values are transitively rooted for the
+/// lifetime of their new owner.
pub trait TemporaryPushable<T> {
/// Push a new value onto this container.
fn push_unrooted(&mut self, val: &T);
/// Insert a new value into this container.
- fn insert_unrooted(&mut self, index: uint, val: &T);
+ fn insert_unrooted(&mut self, index: usize, val: &T);
}
impl<T: Assignable<U>, U: Reflectable> TemporaryPushable<T> for Vec<JS<U>> {
@@ -582,12 +593,16 @@ impl<T: Assignable<U>, U: Reflectable> TemporaryPushable<T> for Vec<JS<U>> {
self.push(unsafe { val.get_js() });
}
- fn insert_unrooted(&mut self, index: uint, val: &T) {
+ fn insert_unrooted(&mut self, index: usize, val: &T) {
self.insert(index, unsafe { val.get_js() });
}
}
-/// An opaque, LIFO rooting mechanism.
+/// An opaque, LIFO rooting mechanism. This tracks roots and ensures that they
+/// are destructed in a LIFO order.
+///
+/// See also [*Exact Stack Rooting - Storing a GCPointer on the CStack*]
+/// (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting).
pub struct RootCollection {
roots: UnsafeCell<SmallVec16<*mut JSObject>>,
}
@@ -614,7 +629,8 @@ impl RootCollection {
}
}
- /// Stop tracking a stack-based root, asserting if LIFO root ordering has been violated
+ /// Stop tracking a stack-based root, asserting if LIFO root ordering has
+ /// been violated
fn unroot<'b, T: Reflectable>(&self, rooted: &Root<T>) {
unsafe {
let roots = self.roots.get();
@@ -627,11 +643,13 @@ impl RootCollection {
}
}
-/// A rooted JS value. The JS value is pinned for the duration of this object's lifetime;
-/// roots are additive, so this object's destruction will not invalidate other roots
-/// for the same JS value. `Root`s cannot outlive the associated `RootCollection` object.
-/// Attempts to transfer ownership of a `Root` via moving will trigger dynamic unrooting
-/// failures due to incorrect ordering.
+/// A rooted reference to a DOM object.
+///
+/// The JS value is pinned for the duration of this object's lifetime; roots
+/// are additive, so this object's destruction will not invalidate other roots
+/// for the same JS value. `Root`s cannot outlive the associated
+/// `RootCollection` object. Attempts to transfer ownership of a `Root` via
+/// moving will trigger dynamic unrooting failures due to incorrect ordering.
pub struct Root<T> {
/// List that ensures correct dynamic root ordering
root_list: &'static RootCollection,
@@ -643,8 +661,8 @@ pub struct Root<T> {
impl<T: Reflectable> Root<T> {
/// Create a new stack-bounded root for the provided JS-owned value.
- /// It cannot not outlive its associated `RootCollection`, and it contains a `JSRef`
- /// which cannot outlive this new `Root`.
+ /// It cannot not outlive its associated `RootCollection`, and it contains
+ /// a `JSRef` which cannot outlive this new `Root`.
fn new(roots: &'static RootCollection, unrooted: NonZero<*const T>)
-> Root<T> {
let root = Root {
@@ -656,8 +674,8 @@ impl<T: Reflectable> Root<T> {
root
}
- /// Obtain a safe reference to the wrapped JS owned-value that cannot outlive
- /// the lifetime of this root.
+ /// Obtain a safe reference to the wrapped JS owned-value that cannot
+ /// outlive the lifetime of this root.
pub fn r<'b>(&'b self) -> JSRef<'b, T> {
JSRef {
ptr: self.ptr,
@@ -693,7 +711,8 @@ impl<'a, T: Reflectable> Deref for JSRef<'a, T> {
}
}
-/// Encapsulates a reference to something that is guaranteed to be alive. This is freely copyable.
+/// A reference to a DOM object that is guaranteed to be alive. This is freely
+/// copyable.
pub struct JSRef<'a, T> {
ptr: NonZero<*const T>,
chain: ContravariantLifetime<'a>,
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs
index 56e681e41dd..a0183aac59c 100644
--- a/components/script/dom/bindings/refcounted.rs
+++ b/components/script/dom/bindings/refcounted.rs
@@ -50,7 +50,7 @@ pub struct Trusted<T> {
/// A pointer to the Rust DOM object of type T, but void to allow
/// sending `Trusted<T>` between tasks, regardless of T's sendability.
ptr: *const libc::c_void,
- refcount: Arc<Mutex<uint>>,
+ refcount: Arc<Mutex<usize>>,
script_chan: Box<ScriptChan + Send>,
owner_thread: *const libc::c_void,
}
@@ -123,7 +123,7 @@ impl<T: Reflectable> Drop for Trusted<T> {
/// from being garbage collected due to outstanding references.
pub struct LiveDOMReferences {
// keyed on pointer to Rust DOM object
- table: RefCell<HashMap<*const libc::c_void, Arc<Mutex<uint>>>>
+ table: RefCell<HashMap<*const libc::c_void, Arc<Mutex<usize>>>>
}
impl LiveDOMReferences {
@@ -136,7 +136,7 @@ impl LiveDOMReferences {
});
}
- fn addref<T: Reflectable>(&self, cx: *mut JSContext, ptr: *const T) -> Arc<Mutex<uint>> {
+ fn addref<T: Reflectable>(&self, cx: *mut JSContext, ptr: *const T) -> Arc<Mutex<usize>> {
let mut table = self.table.borrow_mut();
match table.entry(ptr as *const libc::c_void) {
Occupied(mut entry) => {
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index f9ac9947af8..3c47826b023 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -34,7 +34,7 @@ impl ByteString {
}
/// Returns the length.
- pub fn len(&self) -> uint {
+ pub fn len(&self) -> usize {
let ByteString(ref vector) = *self;
vector.len()
}
@@ -152,7 +152,8 @@ impl Hash<SipHasher> for ByteString {
}
impl FromStr for ByteString {
- fn from_str(s: &str) -> Option<ByteString> {
- Some(ByteString::new(s.to_owned().into_bytes()))
+ type Err = ();
+ fn from_str(s: &str) -> Result<ByteString, ()> {
+ Ok(ByteString::new(s.to_owned().into_bytes()))
}
}
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 0eca6f00a14..ebac215ec9f 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -12,7 +12,9 @@
//! phase. (This happens through `JSClass.trace` for non-proxy bindings, and
//! through `ProxyTraps.trace` otherwise.)
//! 2. `_trace` calls `Foo::trace()` (an implementation of `JSTraceable`).
-//! This is typically derived via a #[jstraceable] annotation
+//! This is typically derived via a `#[dom_struct]` (implies `#[jstraceable]`) annotation.
+//! Non-JS-managed types have an empty inline `trace()` method,
+//! achieved via `no_jsmanaged_fields!` or similar.
//! 3. For all fields, `Foo::trace()`
//! calls `trace()` on the field.
//! For example, for fields of type `JS<T>`, `JS<T>::trace()` calls
@@ -21,8 +23,10 @@
//! reflector.
//! 5. `trace_object()` calls `JS_CallTracer()` to notify the GC, which will
//! add the object to the graph, and will trace that object as well.
+//! 6. When the GC finishes tracing, it [`finalizes`](../index.html#destruction)
+//! any reflectors that were not reachable.
//!
-//! The no_jsmanaged_fields!() macro adds an empty implementation of JSTraceable to
+//! The `no_jsmanaged_fields!()` macro adds an empty implementation of `JSTraceable` to
//! a datatype.
use dom::bindings::js::JS;
@@ -44,8 +48,8 @@ use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
use net::image_cache_task::ImageCacheTask;
use script_traits::ScriptControlChan;
use script_traits::UntrustedNodeAddress;
-use servo_msg::compositor_msg::ScriptListener;
-use servo_msg::constellation_msg::ConstellationChan;
+use msg::compositor_msg::ScriptListener;
+use msg::constellation_msg::ConstellationChan;
use util::smallvec::{SmallVec1, SmallVec};
use util::str::{LengthOrPercentageOrAuto};
use std::cell::{Cell, RefCell};
@@ -53,7 +57,7 @@ use std::collections::HashMap;
use std::collections::hash_state::HashState;
use std::ffi::CString;
use std::hash::{Hash, Hasher};
-use std::io::timer::Timer;
+use std::old_io::timer::Timer;
use std::rc::Rc;
use std::sync::mpsc::{Receiver, Sender};
use string_cache::{Atom, Namespace};
@@ -200,8 +204,8 @@ impl<A: JSTraceable, B: JSTraceable> JSTraceable for (A, B) {
no_jsmanaged_fields!(bool, f32, f64, String, Url);
-no_jsmanaged_fields!(uint, u8, u16, u32, u64);
-no_jsmanaged_fields!(int, i8, i16, i32, i64);
+no_jsmanaged_fields!(usize, u8, u16, u32, u64);
+no_jsmanaged_fields!(isize, i8, i16, i32, i64);
no_jsmanaged_fields!(Sender<T>);
no_jsmanaged_fields!(Receiver<T>);
no_jsmanaged_fields!(Rect<T>);
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs
index 5c68dfce33d..56c9b58288d 100644
--- a/components/script/dom/bindings/utils.rs
+++ b/components/script/dom/bindings/utils.rs
@@ -15,9 +15,9 @@ use dom::window;
use libc;
use libc::c_uint;
+use std::boxed;
use std::cell::Cell;
use std::ffi::CString;
-use std::mem;
use std::ptr;
use js::glue::UnwrapObject;
use js::glue::{IsWrapper, RUST_JSID_IS_INT, RUST_JSID_TO_INT};
@@ -64,11 +64,6 @@ impl GlobalStaticData {
}
}
-/// Leak the given pointer.
-pub unsafe fn squirrel_away_unique<T>(x: Box<T>) -> *const T {
- mem::transmute(x)
-}
-
// NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and
// LSetDOMProperty. Those constants need to be changed accordingly if this value
// changes.
@@ -340,10 +335,10 @@ pub unsafe extern fn throwing_constructor(cx: *mut JSContext, _argc: c_uint,
/// Fails if the argument is not a DOM global.
pub fn initialize_global(global: *mut JSObject) {
let proto_array = box ()
- ([0 as *mut JSObject; PrototypeList::ID::Count as uint]);
+ ([0 as *mut JSObject; PrototypeList::ID::Count as usize]);
unsafe {
assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0);
- let box_ = squirrel_away_unique(proto_array);
+ let box_ = boxed::into_raw(proto_array);
JS_SetReservedSlot(global,
DOM_PROTOTYPE_SLOT,
PrivateValue(box_ as *const libc::c_void));
@@ -465,7 +460,7 @@ pub fn get_array_index_from_id(_cx: *mut JSContext, id: jsid) -> Option<u32> {
pub fn find_enum_string_index(cx: *mut JSContext,
v: JSVal,
values: &[&'static str])
- -> Result<Option<uint>, ()> {
+ -> Result<Option<usize>, ()> {
unsafe {
let jsstr = JS_ValueToString(cx, v);
if jsstr.is_null() {
@@ -479,9 +474,9 @@ pub fn find_enum_string_index(cx: *mut JSContext,
}
Ok(values.iter().position(|value| {
- value.len() == length as uint &&
- range(0, length as uint).all(|j| {
- value.as_bytes()[j] as u16 == *chars.offset(j as int)
+ value.len() == length as usize &&
+ range(0, length as usize).all(|j| {
+ value.as_bytes()[j] as u16 == *chars.offset(j as isize)
})
}))
}
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index e76ab04d92b..103fc2a1f78 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -129,7 +129,7 @@ impl<'a> BlobMethods for JSRef<'a, Blob> {
let start = relativeStart.to_uint().unwrap();
let end = (relativeStart + span).to_uint().unwrap();
let mut bytes: Vec<u8> = Vec::new();
- bytes.push_all(vec.slice(start, end));
+ bytes.push_all(&vec[start..end]);
Blob::new(global.r(), Some(bytes), relativeContentType.as_slice())
}
}
diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs
index 0ea9ef1e0cd..9fc2f5ec0ff 100644
--- a/components/script/dom/characterdata.rs
+++ b/components/script/dom/characterdata.rs
@@ -81,7 +81,7 @@ impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
}
fn SubstringData(self, offset: u32, count: u32) -> Fallible<DOMString> {
- Ok(self.data.borrow().as_slice().slice(offset as uint, count as uint).to_owned())
+ Ok(self.data.borrow()[offset as usize .. count as usize].to_owned())
}
fn AppendData(self, arg: DOMString) -> ErrorResult {
@@ -107,9 +107,9 @@ impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
} else {
count
};
- let mut data = self.data.borrow().as_slice().slice(0, offset as uint).to_owned();
+ let mut data = self.data.borrow()[..offset as usize].to_owned();
data.push_str(arg.as_slice());
- data.push_str(self.data.borrow().as_slice().slice((offset + count) as uint, length as uint));
+ data.push_str(&self.data.borrow()[(offset + count) as usize..]);
*self.data.borrow_mut() = data;
// FIXME: Once we have `Range`, we should implement step7 to step11
Ok(())
diff --git a/components/script/dom/console.rs b/components/script/dom/console.rs
index cff30395d2a..4dec1c3bd45 100644
--- a/components/script/dom/console.rs
+++ b/components/script/dom/console.rs
@@ -7,7 +7,7 @@ use dom::bindings::codegen::Bindings::ConsoleBinding::ConsoleMethods;
use dom::bindings::global::{GlobalRef, GlobalField};
use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflector, reflect_dom_object};
-use devtools_traits::{SendConsoleMessage, ConsoleMessage};
+use devtools_traits::{DevtoolsControlMsg, ConsoleMessage};
use util::str::DOMString;
#[dom_struct]
@@ -68,7 +68,8 @@ fn propagate_console_msg(console: &JSRef<Console>, console_message: ConsoleMessa
GlobalRef::Window(window_ref) => {
let pipelineId = window_ref.page().id;
console.global.root().r().as_window().page().devtools_chan.as_ref().map(|chan| {
- chan.send(SendConsoleMessage(pipelineId, console_message.clone())).unwrap();
+ chan.send(DevtoolsControlMsg::SendConsoleMessage(
+ pipelineId, console_message.clone())).unwrap();
});
},
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index 2de0942f968..2337e6c061a 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -109,17 +109,18 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> {
}
fn Item(self, index: u32) -> DOMString {
+ let index = index as usize;
let owner = self.owner.root();
let elem: JSRef<Element> = ElementCast::from_ref(owner.r());
let style_attribute = elem.style_attribute().borrow();
let result = style_attribute.as_ref().and_then(|declarations| {
- if index as uint > declarations.normal.len() {
+ if index > declarations.normal.len() {
declarations.important
- .get(index as uint - declarations.normal.len())
+ .get(index - declarations.normal.len())
.map(|decl| format!("{:?} !important", decl))
} else {
declarations.normal
- .get(index as uint)
+ .get(index)
.map(|decl| format!("{:?}", decl))
}
});
diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs
index d906e570ece..d7b68f933b6 100644
--- a/components/script/dom/dedicatedworkerglobalscope.rs
+++ b/components/script/dom/dedicatedworkerglobalscope.rs
@@ -25,7 +25,7 @@ use script_task::{ScriptTask, ScriptChan, ScriptMsg, TimerSource};
use script_task::ScriptMsg::WorkerDispatchErrorEvent;
use script_task::StackRootTLS;
-use servo_net::resource_task::{ResourceTask, load_whole_resource};
+use net::resource_task::{ResourceTask, load_whole_resource};
use util::task::spawn_named;
use util::task_state;
use util::task_state::{SCRIPT, IN_WORKER};
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index c38cd80dd20..c6304d08d20 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -775,7 +775,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
root.traverse_preorder()
.find(|node| node.type_id() == NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTitleElement)))
.map(|title_elem| {
- let mut children = title_elem.children().filter_map(|n| {
+ let children = title_elem.children().filter_map(|n| {
let t: Option<JSRef<Text>> = TextCast::to_ref(n);
t
});
diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs
index 98a17d50d51..4509c0b5eaf 100644
--- a/components/script/dom/domexception.rs
+++ b/components/script/dom/domexception.rs
@@ -13,30 +13,30 @@ use util::str::DOMString;
use std::borrow::ToOwned;
-#[repr(uint)]
-#[derive(Copy, Show)]
+#[repr(u16)]
+#[derive(Copy, Debug)]
#[jstraceable]
pub enum DOMErrorName {
- IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR as uint,
- HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR as uint,
- WrongDocumentError = DOMExceptionConstants::WRONG_DOCUMENT_ERR as uint,
- InvalidCharacterError = DOMExceptionConstants::INVALID_CHARACTER_ERR as uint,
- NoModificationAllowedError = DOMExceptionConstants::NO_MODIFICATION_ALLOWED_ERR as uint,
- NotFoundError = DOMExceptionConstants::NOT_FOUND_ERR as uint,
- NotSupportedError = DOMExceptionConstants::NOT_SUPPORTED_ERR as uint,
- InvalidStateError = DOMExceptionConstants::INVALID_STATE_ERR as uint,
- SyntaxError = DOMExceptionConstants::SYNTAX_ERR as uint,
- InvalidModificationError = DOMExceptionConstants::INVALID_MODIFICATION_ERR as uint,
- NamespaceError = DOMExceptionConstants::NAMESPACE_ERR as uint,
- InvalidAccessError = DOMExceptionConstants::INVALID_ACCESS_ERR as uint,
- SecurityError = DOMExceptionConstants::SECURITY_ERR as uint,
- NetworkError = DOMExceptionConstants::NETWORK_ERR as uint,
- AbortError = DOMExceptionConstants::ABORT_ERR as uint,
- URLMismatchError = DOMExceptionConstants::URL_MISMATCH_ERR as uint,
- QuotaExceededError = DOMExceptionConstants::QUOTA_EXCEEDED_ERR as uint,
- TimeoutError = DOMExceptionConstants::TIMEOUT_ERR as uint,
- InvalidNodeTypeError = DOMExceptionConstants::INVALID_NODE_TYPE_ERR as uint,
- DataCloneError = DOMExceptionConstants::DATA_CLONE_ERR as uint,
+ IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR,
+ HierarchyRequestError = DOMExceptionConstants::HIERARCHY_REQUEST_ERR,
+ WrongDocumentError = DOMExceptionConstants::WRONG_DOCUMENT_ERR,
+ InvalidCharacterError = DOMExceptionConstants::INVALID_CHARACTER_ERR,
+ NoModificationAllowedError = DOMExceptionConstants::NO_MODIFICATION_ALLOWED_ERR,
+ NotFoundError = DOMExceptionConstants::NOT_FOUND_ERR,
+ NotSupportedError = DOMExceptionConstants::NOT_SUPPORTED_ERR,
+ InvalidStateError = DOMExceptionConstants::INVALID_STATE_ERR,
+ SyntaxError = DOMExceptionConstants::SYNTAX_ERR,
+ InvalidModificationError = DOMExceptionConstants::INVALID_MODIFICATION_ERR,
+ NamespaceError = DOMExceptionConstants::NAMESPACE_ERR,
+ InvalidAccessError = DOMExceptionConstants::INVALID_ACCESS_ERR,
+ SecurityError = DOMExceptionConstants::SECURITY_ERR,
+ NetworkError = DOMExceptionConstants::NETWORK_ERR,
+ AbortError = DOMExceptionConstants::ABORT_ERR,
+ URLMismatchError = DOMExceptionConstants::URL_MISMATCH_ERR,
+ QuotaExceededError = DOMExceptionConstants::QUOTA_EXCEEDED_ERR,
+ TimeoutError = DOMExceptionConstants::TIMEOUT_ERR,
+ InvalidNodeTypeError = DOMExceptionConstants::INVALID_NODE_TYPE_ERR,
+ DataCloneError = DOMExceptionConstants::DATA_CLONE_ERR,
EncodingError
}
diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs
index 5fe79f5156c..c33b151d9cf 100644
--- a/components/script/dom/domparser.rs
+++ b/components/script/dom/domparser.rs
@@ -51,7 +51,7 @@ impl<'a> DOMParserMethods for JSRef<'a, DOMParser> {
-> Fallible<Temporary<Document>> {
let window = self.window.root();
let url = window.r().get_url();
- let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as uint].to_owned();
+ let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as usize].to_owned();
match ty {
Text_html => {
let document = Document::new(window.r(), Some(url.clone()),
diff --git a/components/script/dom/domrectlist.rs b/components/script/dom/domrectlist.rs
index 86cb64c6454..8ef7b8fce52 100644
--- a/components/script/dom/domrectlist.rs
+++ b/components/script/dom/domrectlist.rs
@@ -43,7 +43,7 @@ impl<'a> DOMRectListMethods for JSRef<'a, DOMRectList> {
fn Item(self, index: u32) -> Option<Temporary<DOMRect>> {
let rects = &self.rects;
if index < rects.len() as u32 {
- Some(Temporary::new(rects[index as uint].clone()))
+ Some(Temporary::new(rects[index as usize].clone()))
} else {
None
}
diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs
index 59a7f0d3e0a..c0ba2e1ebd1 100644
--- a/components/script/dom/domtokenlist.rs
+++ b/components/script/dom/domtokenlist.rs
@@ -74,7 +74,7 @@ impl<'a> DOMTokenListMethods for JSRef<'a, DOMTokenList> {
// http://dom.spec.whatwg.org/#dom-domtokenlist-item
fn Item(self, index: u32) -> Option<DOMString> {
self.attribute().root().and_then(|attr| attr.r().value().tokens().and_then(|tokens| {
- tokens.get(index as uint).map(|token| token.as_slice().to_owned())
+ tokens.get(index as usize).map(|token| token.as_slice().to_owned())
}))
}
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 69eb3f2ee23..ad1e70b30d1 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -92,7 +92,7 @@ impl ElementDerived for EventTarget {
}
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum ElementTypeId {
HTMLElement(HTMLElementTypeId),
@@ -163,7 +163,7 @@ unsafe fn get_attr_for_layout<'a>(elem: &'a Element, namespace: &Namespace, name
// cast to point to T in RefCell<T> directly
let attrs = elem.attrs.borrow_for_layout();
attrs.iter().find(|attr: & &JS<Attr>| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
*name == (*attr).local_name_atom_forever() &&
(*attr).namespace() == namespace
})
@@ -174,7 +174,7 @@ impl RawLayoutElementHelpers for Element {
unsafe fn get_attr_val_for_layout<'a>(&'a self, namespace: &Namespace, name: &Atom)
-> Option<&'a str> {
get_attr_for_layout(self, namespace, name).map(|attr| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
(*attr).value_ref_forever()
})
}
@@ -183,7 +183,7 @@ impl RawLayoutElementHelpers for Element {
unsafe fn get_attr_vals_for_layout<'a>(&'a self, name: &Atom) -> Vec<&'a str> {
let attrs = self.attrs.borrow_for_layout();
(*attrs).iter().filter_map(|attr: &JS<Attr>| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
if *name == (*attr).local_name_atom_forever() {
Some((*attr).value_ref_forever())
} else {
@@ -197,11 +197,11 @@ impl RawLayoutElementHelpers for Element {
-> Option<Atom> {
let attrs = self.attrs.borrow_for_layout();
(*attrs).iter().find(|attr: & &JS<Attr>| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
*name == (*attr).local_name_atom_forever() &&
(*attr).namespace() == namespace
}).and_then(|attr| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
(*attr).value_atom_forever()
})
}
@@ -210,10 +210,10 @@ impl RawLayoutElementHelpers for Element {
unsafe fn has_class_for_layout(&self, name: &Atom) -> bool {
let attrs = self.attrs.borrow_for_layout();
(*attrs).iter().find(|attr: & &JS<Attr>| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
(*attr).local_name_atom_forever() == atom!("class")
}).map_or(false, |attr| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
(*attr).value_tokens_forever().map(|tokens| {
tokens.iter().any(|atom| atom == name)
})
@@ -224,10 +224,10 @@ impl RawLayoutElementHelpers for Element {
unsafe fn get_classes_for_layout(&self) -> Option<&'static [Atom]> {
let attrs = self.attrs.borrow_for_layout();
(*attrs).iter().find(|attr: & &JS<Attr>| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
(*attr).local_name_atom_forever() == atom!("class")
}).and_then(|attr| {
- let attr = attr.unsafe_get();
+ let attr = attr.to_layout().unsafe_get();
(*attr).value_tokens_forever()
})
}
@@ -1404,8 +1404,8 @@ impl<'a> style::node::TElement<'a> for JSRef<'a, Element> {
has_class(self, name)
}
- fn each_class<F>(self, callback: F)
- where F: Fn(&Atom)
+ fn each_class<F>(self, mut callback: F)
+ where F: FnMut(&Atom)
{
match self.get_attribute(ns!(""), &atom!("class")).root() {
None => {}
diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs
index 7c9d73675d1..eae43afe9c2 100644
--- a/components/script/dom/event.rs
+++ b/components/script/dom/event.rs
@@ -20,11 +20,12 @@ use time;
#[jstraceable]
#[derive(Copy)]
+#[repr(u16)]
pub enum EventPhase {
- None = EventConstants::NONE as int,
- Capturing = EventConstants::CAPTURING_PHASE as int,
- AtTarget = EventConstants::AT_TARGET as int,
- Bubbling = EventConstants::BUBBLING_PHASE as int,
+ None = EventConstants::NONE,
+ Capturing = EventConstants::CAPTURING_PHASE,
+ AtTarget = EventConstants::AT_TARGET,
+ Bubbling = EventConstants::BUBBLING_PHASE,
}
#[derive(PartialEq)]
diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs
index 85f3279aa9b..5d8e5a8f809 100644
--- a/components/script/dom/formdata.rs
+++ b/components/script/dom/formdata.rs
@@ -88,9 +88,7 @@ impl<'a> FormDataMethods for JSRef<'a, FormData> {
match (*self.data.borrow())[name][0].clone() {
FormDatum::StringData(ref s) => Some(eString(s.clone())),
FormDatum::FileData(ref f) => {
- Some(eFile(unsafe {
- Unrooted::from_raw(f.unsafe_get())
- }))
+ Some(eFile(Unrooted::from_js(*f)))
}
}
} else {
diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs
index 06a9456913c..e609169ff05 100644
--- a/components/script/dom/htmlbodyelement.rs
+++ b/components/script/dom/htmlbodyelement.rs
@@ -107,7 +107,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLBodyElement> {
EventTargetCast::from_ref(*self)
};
evtarget.set_event_handler_uncompiled(cx, url, reflector,
- name.slice_from(2),
+ &name[2..],
attr.value().as_slice().to_owned());
}
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 243c51e3b90..29cd1dfbb74 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -165,9 +165,7 @@ impl HTMLCollection {
}
fn traverse<'a>(root: JSRef<'a, Node>)
- -> FilterMap<JSRef<'a, Node>,
- JSRef<'a, Element>,
- Skip<TreeIterator<'a>>,
+ -> FilterMap<Skip<TreeIterator<'a>>,
fn(JSRef<Node>) -> Option<JSRef<Element>>> {
root.traverse_preorder()
.skip(1)
@@ -191,16 +189,17 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
// http://dom.spec.whatwg.org/#dom-htmlcollection-item
fn Item(self, index: u32) -> Option<Temporary<Element>> {
+ let index = index as usize;
match self.collection {
CollectionTypeId::Static(ref elems) => elems
.as_slice()
- .get(index as uint)
+ .get(index)
.map(|elem| Temporary::new(elem.clone())),
CollectionTypeId::Live(ref root, ref filter) => {
let root = root.root();
HTMLCollection::traverse(root.r())
.filter(|element| filter.filter(*element, root.r()))
- .nth(index as uint)
+ .nth(index)
.clone()
.map(Temporary::from_rooted)
}
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index c5a8249fc14..dd5cd1cb7e0 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -200,13 +200,13 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLElement> {
window.r().reflector().get_jsobject());
let evtarget: JSRef<EventTarget> = EventTargetCast::from_ref(*self);
evtarget.set_event_handler_uncompiled(cx, url, reflector,
- name.slice_from(2),
+ &name[2..],
attr.value().as_slice().to_owned());
}
}
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLElementTypeId {
HTMLElement,
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 74f789ab491..be6f1fc9fcb 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -23,9 +23,9 @@ use dom::htmlbuttonelement::{HTMLButtonElement};
use dom::htmltextareaelement::{HTMLTextAreaElement, HTMLTextAreaElementHelpers};
use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node};
use hyper::method::Method;
-use hyper::header::common::ContentType;
+use hyper::header::ContentType;
use hyper::mime;
-use servo_msg::constellation_msg::LoadData;
+use msg::constellation_msg::LoadData;
use util::str::DOMString;
use script_task::{ScriptChan, ScriptMsg};
use std::ascii::OwnedAsciiExt;
@@ -332,7 +332,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> {
// TODO: Handle `dirnames` (needs directionality support)
// https://html.spec.whatwg.org/multipage/dom.html#the-directionality
let mut ret: Vec<FormDatum> = data_set.collect();
- for mut datum in ret.iter_mut() {
+ for datum in ret.iter_mut() {
match datum.ty.as_slice() {
"file" | "textarea" => (),
_ => {
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index bb310607b1b..b4f9b577b7b 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -23,9 +23,9 @@ use dom::virtualmethods::VirtualMethods;
use dom::window::Window;
use page::{IterablePage, Page};
-use servo_msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan};
-use servo_msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan};
+use msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
+use msg::constellation_msg::Msg as ConstellationMsg;
use util::str::DOMString;
use string_cache::Atom;
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 913f69c0553..2f8d09bb759 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -17,7 +17,7 @@ use dom::element::ElementTypeId;
use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::node::{Node, NodeTypeId, NodeHelpers, NodeDamage, window_from_node};
use dom::virtualmethods::VirtualMethods;
-use servo_net::image_cache_task;
+use net::image_cache_task;
use util::geometry::to_px;
use util::str::DOMString;
use string_cache::Atom;
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index d8bfc492f42..73613b8fcee 100644
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -317,7 +317,7 @@ fn broadcast_radio_checked(broadcaster: JSRef<HTMLInputElement>, group: Option<&
fn do_broadcast<'a>(doc_node: JSRef<'a, Node>, broadcaster: JSRef<'a, HTMLInputElement>,
owner: Option<JSRef<'a, HTMLFormElement>>, group: Option<&str>) {
// There is no DOM tree manipulation here, so this is safe
- let mut iter = unsafe {
+ let iter = unsafe {
doc_node.query_selector_iter("input[type=radio]".to_owned()).unwrap()
.filter_map(|t| HTMLInputElementCast::to_ref(t))
.filter(|&r| in_same_group(r, owner, group) && broadcaster != r)
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 0105d08d226..331d43e8aba 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -38,7 +38,7 @@ impl HTMLMediaElement {
}
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLMediaElementTypeId {
HTMLAudioElement,
diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs
index 2a8c0c19818..927abe7e3c2 100644
--- a/components/script/dom/htmlobjectelement.rs
+++ b/components/script/dom/htmlobjectelement.rs
@@ -20,8 +20,8 @@ use dom::node::{Node, NodeTypeId, NodeHelpers, window_from_node};
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;
-use servo_net::image_cache_task;
-use servo_net::image_cache_task::ImageCacheTask;
+use net::image_cache_task;
+use net::image_cache_task::ImageCacheTask;
use util::str::DOMString;
use string_cache::Atom;
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 62a84450f9c..5ecdaa27903 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -29,7 +29,7 @@ use script_task::{ScriptMsg, Runnable};
use encoding::all::UTF_8;
use encoding::types::{Encoding, DecoderTrap};
-use servo_net::resource_task::load_whole_resource;
+use net::resource_task::load_whole_resource;
use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
use std::borrow::ToOwned;
use std::cell::Cell;
diff --git a/components/script/dom/htmlserializer.rs b/components/script/dom/htmlserializer.rs
index a0ab5b82d03..7d0cc77387c 100644
--- a/components/script/dom/htmlserializer.rs
+++ b/components/script/dom/htmlserializer.rs
@@ -22,7 +22,7 @@ pub fn serialize(iterator: &mut NodeIterator) -> String {
let mut html = String::new();
let mut open_elements: Vec<String> = vec!();
let depth = iterator.depth;
- for node in *iterator {
+ for node in iterator {
while open_elements.len() > depth {
html.push_str("</");
html.push_str(open_elements.pop().unwrap().as_slice());
diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs
index e847ba6afd0..6d9c20626da 100644
--- a/components/script/dom/htmltablecellelement.rs
+++ b/components/script/dom/htmltablecellelement.rs
@@ -16,7 +16,7 @@ use cssparser::RGBA;
use util::str::{self, DOMString, LengthOrPercentageOrAuto};
use std::cell::Cell;
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLTableCellElementTypeId {
HTMLTableDataCellElement,
diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs
index 9696e9ae7c0..76ef927f6e5 100644
--- a/components/script/dom/htmltitleelement.rs
+++ b/components/script/dom/htmltitleelement.rs
@@ -70,6 +70,19 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTitleElement> {
Some(htmlelement as &VirtualMethods)
}
+ fn child_inserted(&self, child: JSRef<Node>) {
+ match self.super_type() {
+ Some(ref s) => s.child_inserted(child),
+ _ => (),
+ }
+
+ let node: JSRef<Node> = NodeCast::from_ref(*self);
+ if node.is_in_doc() {
+ let document = node.owner_doc().root();
+ document.r().send_title_to_compositor();
+ }
+ }
+
fn bind_to_tree(&self, is_in_doc: bool) {
let node: JSRef<Node> = NodeCast::from_ref(*self);
if is_in_doc {
diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs
index f220f90a36a..8ff5fe27e63 100644
--- a/components/script/dom/keyboardevent.rs
+++ b/components/script/dom/keyboardevent.rs
@@ -13,7 +13,7 @@ use dom::bindings::utils::{Reflectable, reflect_dom_object};
use dom::event::{Event, EventTypeId};
use dom::uievent::UIEvent;
use dom::window::Window;
-use servo_msg::constellation_msg;
+use msg::constellation_msg;
use util::str::DOMString;
use std::borrow::ToOwned;
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index f53ef704e48..d5446e525b4 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -67,10 +67,10 @@
//! (The result of either method can be wrapped in `Result`, if that is
//! appropriate for the type in question.)
//!
-//! The latter calls the former, boxes the result, and creates a reflector for
-//! it by calling `dom::bindings::utils::reflect_dom_object` (which yields
-//! ownership of the object to the SpiderMonkey Garbage Collector). This is the
-//! API to use when creating a DOM object.
+//! The latter calls the former, boxes the result, and creates a reflector
+//! corresponding to it by calling `dom::bindings::utils::reflect_dom_object`
+//! (which yields ownership of the object to the SpiderMonkey Garbage Collector).
+//! This is the API to use when creating a DOM object.
//!
//! The former should only be called by the latter, and by subclasses'
//! `new_inherited` methods.
@@ -98,9 +98,11 @@
//! =============================
//!
//! Every DOM object has a `Reflector` as its first (transitive) member field.
-//! This contains a `*mut JSObject` that points to its reflector. This field
-//! is initialized by the `FooBinding::Wrap` method, called from
-//! `reflect_dom_object`.
+//! This contains a `*mut JSObject` that points to its reflector.
+//!
+//! The `FooBinding::Wrap` function creates the reflector, stores a pointer to
+//! the DOM object in the reflector, and initializes the pointer to the reflector
+//! in the `Reflector` field.
//!
//! The `Reflectable` trait provides a `reflector()` method that returns the
//! DOM object's `Reflector`. It is implemented automatically for DOM structs
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 5bb79e827f0..253e987e454 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -261,7 +261,7 @@ impl LayoutDataRef {
unsafe impl Send for LayoutDataRef {}
/// The different types of nodes.
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum NodeTypeId {
DocumentType,
@@ -1020,10 +1020,7 @@ impl RawLayoutNodeHelpers for Node {
//
pub type ChildElementIterator<'a> =
- Peekable<JSRef<'a, Element>,
- FilterMap<JSRef<'a, Node>,
- JSRef<'a, Element>,
- NodeChildrenIterator<'a>,
+ Peekable<FilterMap<NodeChildrenIterator<'a>,
fn(JSRef<Node>) -> Option<JSRef<Element>>>>;
pub struct NodeChildrenIterator<'a> {
@@ -1666,7 +1663,7 @@ impl Node {
}
}
- pub fn collect_text_contents<'a, T: Iterator<Item=JSRef<'a, Node>>>(mut iterator: T) -> String {
+ pub fn collect_text_contents<'a, T: Iterator<Item=JSRef<'a, Node>>>(iterator: T) -> String {
let mut content = String::new();
for node in iterator {
let text: Option<JSRef<Text>> = TextCast::to_ref(node);
diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs
index 7a1bcd8ecac..319004e4b46 100644
--- a/components/script/dom/nodelist.rs
+++ b/components/script/dom/nodelist.rs
@@ -60,10 +60,10 @@ impl<'a> NodeListMethods for JSRef<'a, NodeList> {
fn Item(self, index: u32) -> Option<Temporary<Node>> {
match self.list_type {
_ if index >= self.Length() => None,
- NodeListType::Simple(ref elems) => Some(Temporary::new(elems[index as uint].clone())),
+ NodeListType::Simple(ref elems) => Some(Temporary::new(elems[index as usize].clone())),
NodeListType::Children(ref node) => {
let node = node.root();
- node.r().children().nth(index as uint)
+ node.r().children().nth(index as usize)
.map(|child| Temporary::from_rooted(child))
}
}
diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs
index 1a2fd4fe564..c41cdcdd93c 100644
--- a/components/script/dom/servohtmlparser.rs
+++ b/components/script/dom/servohtmlparser.rs
@@ -92,7 +92,8 @@ struct Tracer {
trc: *mut JSTracer,
}
-impl tree_builder::Tracer<JS<Node>> for Tracer {
+impl tree_builder::Tracer for Tracer {
+ type Handle = JS<Node>;
#[allow(unrooted_must_root)]
fn trace_handle(&self, node: JS<Node>) {
node.trace(self.trc);
@@ -107,7 +108,7 @@ impl JSTraceable for ServoHTMLParser {
let tracer = Tracer {
trc: trc,
};
- let tracer = &tracer as &tree_builder::Tracer<JS<Node>>;
+ let tracer = &tracer as &tree_builder::Tracer<Handle=JS<Node>>;
unsafe {
// Assertion: If the parser is mutably borrowed, we're in the
diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs
index 7834781988d..2dedef9f132 100644
--- a/components/script/dom/storage.rs
+++ b/components/script/dom/storage.rs
@@ -9,8 +9,8 @@ use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::bindings::error::Fallible;
use util::str::DOMString;
-use servo_net::storage_task::StorageTask;
-use servo_net::storage_task::StorageTaskMsg;
+use net::storage_task::StorageTask;
+use net::storage_task::StorageTaskMsg;
use std::sync::mpsc::channel;
use url::Url;
diff --git a/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl b/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl
index 0d772edca0b..efe265ef115 100644
--- a/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl
+++ b/components/script/dom/webidls/XMLHttpRequestEventTarget.webidl
@@ -13,7 +13,7 @@
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
*/
-[NoInterfaceObject]
+//[Exposed=(Window,Worker)]
interface XMLHttpRequestEventTarget : EventTarget {
// event handlers
attribute EventHandler onloadstart;
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index ef4d6f14e2d..fcc56776c8d 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -33,10 +33,10 @@ use script_task::ScriptMsg;
use script_traits::ScriptControlChan;
use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
-use servo_msg::compositor_msg::ScriptListener;
-use servo_msg::constellation_msg::LoadData;
-use servo_net::image_cache_task::ImageCacheTask;
-use servo_net::storage_task::StorageTask;
+use msg::compositor_msg::ScriptListener;
+use msg::constellation_msg::LoadData;
+use net::image_cache_task::ImageCacheTask;
+use net::storage_task::StorageTask;
use util::str::{DOMString,HTML_SPACE_CHARACTERS};
use js::jsapi::JS_EvaluateUCScript;
@@ -47,7 +47,7 @@ use js::rust::with_compartment;
use url::{Url, UrlParser};
use libc;
-use serialize::base64::{FromBase64, ToBase64, STANDARD};
+use rustc_serialize::base64::{FromBase64, ToBase64, STANDARD};
use std::cell::{Ref, RefMut};
use std::default::Default;
use std::ffi::CString;
@@ -140,7 +140,7 @@ pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> {
// http://www.whatwg.org/html/#atob
pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
// "Let input be the string being parsed."
- let mut input = atob.as_slice();
+ let input = atob.as_slice();
// "Remove all space characters from input."
// serialize::base64::from_base64 ignores \r and \n,
@@ -152,16 +152,16 @@ pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
let without_spaces = input.chars()
.filter(|&c| ! is_html_space(c))
.collect::<String>();
- input = without_spaces.as_slice();
+ let mut input = without_spaces.as_slice();
// "If the length of input divides by 4 leaving no remainder, then:
// if input ends with one or two U+003D EQUALS SIGN (=) characters,
// remove them from input."
if input.len() % 4 == 0 {
if input.ends_with("==") {
- input = input.slice_to(input.len() - 2)
+ input = &input[..input.len() - 2]
} else if input.ends_with("=") {
- input = input.slice_to(input.len() - 1)
+ input = &input[..input.len() - 1]
}
}
@@ -385,10 +385,13 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
let url = UrlParser::new().base_url(&base_url).parse(href.as_slice());
// FIXME: handle URL parse errors more gracefully.
let url = url.unwrap();
- if href.as_slice().starts_with("#") {
- self.script_chan.send(ScriptMsg::TriggerFragment(self.page.id, url));
- } else {
- self.script_chan.send(ScriptMsg::TriggerLoad(self.page.id, LoadData::new(url)));
+ match url.fragment {
+ Some(fragment) => {
+ self.script_chan.send(ScriptMsg::TriggerFragment(self.page.id, fragment));
+ },
+ None => {
+ self.script_chan.send(ScriptMsg::TriggerLoad(self.page.id, LoadData::new(url)));
+ }
}
}
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 530d34683f3..709b8f73d7c 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -28,7 +28,6 @@ use js::jsval::{JSVal, UndefinedValue};
use url::UrlParser;
use std::borrow::ToOwned;
-use std::cell::Cell;
use std::sync::mpsc::{channel, Sender};
pub type TrustedWorkerAddress = Trusted<Worker>;
@@ -36,7 +35,6 @@ pub type TrustedWorkerAddress = Trusted<Worker>;
#[dom_struct]
pub struct Worker {
eventtarget: EventTarget,
- refcount: Cell<uint>,
global: GlobalField,
/// Sender to the Receiver associated with the DedicatedWorkerGlobalScope
/// this Worker created.
@@ -47,7 +45,6 @@ impl Worker {
fn new_inherited(global: GlobalRef, sender: Sender<(TrustedWorkerAddress, ScriptMsg)>) -> Worker {
Worker {
eventtarget: EventTarget::new_inherited(EventTargetTypeId::Worker),
- refcount: Cell::new(0),
global: GlobalField::from_rooted(&global),
sender: sender,
}
diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs
index 24dd5c2b0f5..5b2ff2c971e 100644
--- a/components/script/dom/workerglobalscope.rs
+++ b/components/script/dom/workerglobalscope.rs
@@ -19,7 +19,7 @@ use dom::window::{base64_atob, base64_btoa};
use script_task::{ScriptChan, TimerSource};
use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
-use servo_net::resource_task::{ResourceTask, load_whole_resource};
+use net::resource_task::{ResourceTask, load_whole_resource};
use util::str::DOMString;
use js::jsapi::JSContext;
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index f9f75fbbf7e..5bef26a7c84 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -33,8 +33,7 @@ use encoding::label::encoding_from_whatwg_label;
use encoding::types::{DecoderTrap, Encoding, EncodingRef, EncoderTrap};
use hyper::header::Headers;
-use hyper::header::common::{Accept, ContentLength, ContentType};
-use hyper::header::quality_item::QualityItem;
+use hyper::header::{Accept, ContentLength, ContentType, QualityItem};
use hyper::http::RawStatus;
use hyper::mime::{self, Mime};
use hyper::method::Method;
@@ -55,7 +54,7 @@ use std::borrow::ToOwned;
use std::cell::Cell;
use std::sync::mpsc::{Sender, Receiver, channel};
use std::default::Default;
-use std::io::Timer;
+use std::old_io::Timer;
use std::str::FromStr;
use std::time::duration::Duration;
use time;
@@ -361,8 +360,8 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
match upper.as_slice() {
"DELETE" | "GET" | "HEAD" | "OPTIONS" |
"POST" | "PUT" | "CONNECT" | "TRACE" |
- "TRACK" => upper.parse(),
- _ => s.parse()
+ "TRACK" => upper.parse().ok(),
+ _ => s.parse().ok()
}
});
// Step 2
@@ -830,7 +829,7 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
// Substep 2
status.map(|RawStatus(code, reason)| {
self.status.set(code);
- *self.status_text.borrow_mut() = ByteString::new(reason.into_bytes());
+ *self.status_text.borrow_mut() = ByteString::new(reason.into_owned().into_bytes());
});
headers.as_ref().map(|h| *self.response_headers.borrow_mut() = h.clone());
@@ -990,13 +989,13 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
// http://fetch.spec.whatwg.org/#concept-response-header-list
use std::fmt;
use hyper::header::{Header, HeaderFormat};
- use hyper::header::common::SetCookie;
+ use hyper::header::SetCookie;
// a dummy header so we can use headers.remove::<SetCookie2>()
#[derive(Clone)]
struct SetCookie2;
impl Header for SetCookie2 {
- fn header_name(_: Option<SetCookie2>) -> &'static str {
+ fn header_name() -> &'static str {
"set-cookie2"
}
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs
index 416b9c8bee7..c82370207cf 100644
--- a/components/script/layout_interface.rs
+++ b/components/script/layout_interface.rs
@@ -11,7 +11,7 @@ use dom::node::LayoutDataRef;
use geom::point::Point2D;
use geom::rect::Rect;
use script_traits::{ScriptControlChan, OpaqueScriptLayoutChannel, UntrustedNodeAddress};
-use servo_msg::constellation_msg::{PipelineExitType, WindowSizeData};
+use msg::constellation_msg::{PipelineExitType, WindowSizeData};
use util::geometry::Au;
use std::any::Any;
use std::sync::mpsc::{channel, Receiver, Sender};
@@ -77,7 +77,7 @@ pub struct HitTestResponse(pub UntrustedNodeAddress);
pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>);
/// Why we're doing reflow.
-#[derive(PartialEq, Show)]
+#[derive(PartialEq, Debug)]
pub enum ReflowGoal {
/// We're reflowing in order to send a display list to the screen.
ForDisplay,
diff --git a/components/script/lib.rs b/components/script/lib.rs
index d5a4c72f9cb..35d481d5b76 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -2,18 +2,29 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(unsafe_destructor, plugin, box_syntax, int_uint)]
+#![feature(alloc)]
+#![feature(box_syntax)]
+#![feature(collections)]
+#![feature(core)]
+#![feature(hash)]
+#![feature(int_uint)]
+#![feature(io)]
+#![feature(plugin)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
+#![feature(unicode)]
+#![feature(unsafe_destructor)]
#![deny(unsafe_blocks)]
#![allow(non_snake_case)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#![doc="The script crate contains all matters DOM."]
#[macro_use]
extern crate log;
+#[macro_use] extern crate bitflags;
extern crate core;
extern crate devtools_traits;
extern crate cssparser;
@@ -26,17 +37,15 @@ extern crate js;
extern crate libc;
extern crate msg;
extern crate net;
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
extern crate time;
extern crate canvas;
extern crate script_traits;
#[no_link] #[plugin] #[macro_use]
extern crate "plugins" as servo_plugins;
-extern crate "net" as servo_net;
extern crate util;
#[macro_use]
extern crate style;
-extern crate "msg" as servo_msg;
extern crate url;
extern crate uuid;
extern crate string_cache;
diff --git a/components/script/page.rs b/components/script/page.rs
index 61de79ff038..b369a5e3337 100644
--- a/components/script/page.rs
+++ b/components/script/page.rs
@@ -22,11 +22,11 @@ use script_traits::{UntrustedNodeAddress, ScriptControlChan};
use geom::{Point2D, Rect, Size2D};
use js::rust::Cx;
-use servo_msg::compositor_msg::ScriptListener;
-use servo_msg::constellation_msg::{ConstellationChan, WindowSizeData};
-use servo_msg::constellation_msg::{PipelineId, SubpageId};
-use servo_net::resource_task::ResourceTask;
-use servo_net::storage_task::StorageTask;
+use msg::compositor_msg::ScriptListener;
+use msg::constellation_msg::{ConstellationChan, WindowSizeData};
+use msg::constellation_msg::{PipelineId, SubpageId};
+use net::resource_task::ResourceTask;
+use net::storage_task::StorageTask;
use util::geometry::{Au, MAX_RECT};
use util::geometry;
use util::str::DOMString;
@@ -327,25 +327,19 @@ impl Page {
/// layout task has finished any pending request messages.
fn join_layout(&self) {
let mut layout_join_port = self.layout_join_port.borrow_mut();
- if layout_join_port.is_some() {
- let join_port = replace(&mut *layout_join_port, None);
- match join_port {
- Some(ref join_port) => {
- match join_port.try_recv() {
- Err(Empty) => {
- info!("script: waiting on layout");
- join_port.recv().unwrap();
- }
- Ok(_) => {}
- Err(Disconnected) => {
- panic!("Layout task failed while script was waiting for a result.");
- }
- }
-
- debug!("script: layout joined")
+ if let Some(join_port) = replace(&mut *layout_join_port, None) {
+ match join_port.try_recv() {
+ Err(Empty) => {
+ info!("script: waiting on layout");
+ join_port.recv().unwrap();
+ }
+ Ok(_) => {}
+ Err(Disconnected) => {
+ panic!("Layout task failed while script was waiting for a result.");
}
- None => panic!("reader forked but no join port?"),
}
+
+ debug!("script: layout joined")
}
}
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs
index d846f0bc792..6da3dac1ec8 100644
--- a/components/script/parse/html.rs
+++ b/components/script/parse/html.rs
@@ -23,7 +23,7 @@ use parse::Parser;
use encoding::all::UTF_8;
use encoding::types::{Encoding, DecoderTrap};
-use servo_net::resource_task::{ProgressMsg, LoadResponse};
+use net::resource_task::{ProgressMsg, LoadResponse};
use util::task_state;
use util::task_state::IN_HTML_PARSER;
use std::ascii::AsciiExt;
@@ -55,7 +55,8 @@ impl SinkHelpers for servohtmlparser::Sink {
}
}
-impl<'a> TreeSink<JS<Node>> for servohtmlparser::Sink {
+impl<'a> TreeSink for servohtmlparser::Sink {
+ type Handle = JS<Node>;
fn get_document(&mut self) -> JS<Node> {
let doc = self.document.root();
let node: JSRef<Node> = NodeCast::from_ref(doc.r());
@@ -162,6 +163,10 @@ impl<'a> TreeSink<JS<Node>> for servohtmlparser::Sink {
let script: Option<JSRef<HTMLScriptElement>> = HTMLScriptElementCast::to_ref(node.r());
script.map(|script| script.prepare());
}
+
+ fn reparent_children(&mut self, _node: JS<Node>, _new_parent: JS<Node>) {
+ panic!("unimplemented")
+ }
}
pub fn parse_html(document: JSRef<Document>,
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 0f3f5c1b564..8573efa9d3f 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -31,7 +31,7 @@ use dom::htmlelement::HTMLElementTypeId;
use dom::htmliframeelement::HTMLIFrameElement;
use dom::keyboardevent::KeyboardEvent;
use dom::mouseevent::MouseEvent;
-use dom::node::{self, Node, NodeHelpers, NodeDamage, NodeTypeId};
+use dom::node::{self, Node, NodeHelpers, NodeDamage, NodeTypeId, window_from_node};
use dom::window::{Window, WindowHelpers, ScriptHelpers};
use dom::worker::{Worker, TrustedWorkerAddress};
use parse::html::{HTMLInput, parse_html};
@@ -41,9 +41,8 @@ use page::{Page, IterablePage, Frame};
use timers::TimerId;
use devtools;
-use devtools_traits::{DevtoolsControlChan, DevtoolsControlPort, NewGlobal, GetRootNode, DevtoolsPageInfo};
-use devtools_traits::{DevtoolScriptControlMsg, EvaluateJS, GetDocumentElement};
-use devtools_traits::{GetChildren, GetLayout, ModifyAttribute, WantsLiveNotifications};
+use devtools_traits::{DevtoolsControlChan, DevtoolsControlPort, DevtoolsPageInfo};
+use devtools_traits::{DevtoolsControlMsg, DevtoolScriptControlMsg};
use script_traits::CompositorEvent;
use script_traits::CompositorEvent::{ResizeEvent, ReflowEvent, ClickEvent};
use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent};
@@ -51,18 +50,18 @@ use script_traits::CompositorEvent::{MouseMoveEvent, KeyEvent};
use script_traits::{NewLayoutInfo, OpaqueScriptLayoutChannel};
use script_traits::{ConstellationControlMsg, ScriptControlChan};
use script_traits::ScriptTaskFactory;
-use servo_msg::compositor_msg::ReadyState::{FinishedLoading, Loading, PerformingLayout};
-use servo_msg::compositor_msg::{LayerId, ScriptListener};
-use servo_msg::constellation_msg::{ConstellationChan};
-use servo_msg::constellation_msg::{LoadData, NavigationDirection, PipelineId, SubpageId};
-use servo_msg::constellation_msg::{Failure, Msg, WindowSizeData, Key, KeyState};
-use servo_msg::constellation_msg::{KeyModifiers, SUPER, SHIFT, CONTROL, ALT};
-use servo_msg::constellation_msg::{PipelineExitType};
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
-use servo_net::image_cache_task::ImageCacheTask;
-use servo_net::resource_task::{ResourceTask, ControlMsg};
-use servo_net::resource_task::LoadData as NetLoadData;
-use servo_net::storage_task::StorageTask;
+use msg::compositor_msg::ReadyState::{FinishedLoading, Loading, PerformingLayout};
+use msg::compositor_msg::{LayerId, ScriptListener};
+use msg::constellation_msg::{ConstellationChan};
+use msg::constellation_msg::{LoadData, NavigationDirection, PipelineId, SubpageId};
+use msg::constellation_msg::{Failure, Msg, WindowSizeData, Key, KeyState};
+use msg::constellation_msg::{KeyModifiers, SUPER, SHIFT, CONTROL, ALT};
+use msg::constellation_msg::{PipelineExitType};
+use msg::constellation_msg::Msg as ConstellationMsg;
+use net::image_cache_task::ImageCacheTask;
+use net::resource_task::{ResourceTask, ControlMsg};
+use net::resource_task::LoadData as NetLoadData;
+use net::storage_task::StorageTask;
use util::geometry::to_frac_px;
use util::smallvec::SmallVec;
use util::str::DOMString;
@@ -71,7 +70,7 @@ use util::task_state;
use geom::point::Point2D;
use hyper::header::{Header, Headers, HeaderFormat};
-use hyper::header::shared::util as header_util;
+use hyper::header::parsing as header_parsing;
use js::jsapi::{JS_SetWrapObjectCallbacks, JS_SetGCZeal, JS_DEFAULT_ZEAL_FREQ, JS_GC};
use js::jsapi::{JSContext, JSRuntime, JSObject};
use js::jsapi::{JS_SetGCParameter, JSGC_MAX_BYTES};
@@ -84,7 +83,7 @@ use libc;
use std::any::Any;
use std::borrow::ToOwned;
use std::cell::Cell;
-use std::fmt::{self, Show};
+use std::fmt::{self, Display};
use std::mem::replace;
use std::num::ToPrimitive;
use std::rc::Rc;
@@ -109,7 +108,7 @@ pub trait Runnable {
pub enum ScriptMsg {
/// Acts on a fragment URL load on the specified pipeline (only dispatched
/// to ScriptTask).
- TriggerFragment(PipelineId, Url),
+ TriggerFragment(PipelineId, String),
/// Begins a content-initiated load on the specified pipeline (only
/// dispatched to ScriptTask).
TriggerLoad(PipelineId, LoadData),
@@ -610,8 +609,8 @@ impl ScriptTask {
match msg {
ScriptMsg::TriggerLoad(id, load_data) =>
self.trigger_load(id, load_data),
- ScriptMsg::TriggerFragment(id, url) =>
- self.trigger_fragment(id, url),
+ ScriptMsg::TriggerFragment(id, fragment) =>
+ self.trigger_fragment(id, fragment),
ScriptMsg::FireTimer(TimerSource::FromWindow(id), timer_id) =>
self.handle_fire_timer_msg(id, timer_id),
ScriptMsg::FireTimer(TimerSource::FromWorker, _) =>
@@ -633,19 +632,19 @@ impl ScriptTask {
fn handle_msg_from_devtools(&self, msg: DevtoolScriptControlMsg) {
match msg {
- EvaluateJS(id, s, reply) =>
+ DevtoolScriptControlMsg::EvaluateJS(id, s, reply) =>
devtools::handle_evaluate_js(&*self.page.borrow(), id, s, reply),
- GetRootNode(id, reply) =>
+ DevtoolScriptControlMsg::GetRootNode(id, reply) =>
devtools::handle_get_root_node(&*self.page.borrow(), id, reply),
- GetDocumentElement(id, reply) =>
+ DevtoolScriptControlMsg::GetDocumentElement(id, reply) =>
devtools::handle_get_document_element(&*self.page.borrow(), id, reply),
- GetChildren(id, node_id, reply) =>
+ DevtoolScriptControlMsg::GetChildren(id, node_id, reply) =>
devtools::handle_get_children(&*self.page.borrow(), id, node_id, reply),
- GetLayout(id, node_id, reply) =>
+ DevtoolScriptControlMsg::GetLayout(id, node_id, reply) =>
devtools::handle_get_layout(&*self.page.borrow(), id, node_id, reply),
- ModifyAttribute(id, node_id, modifications) =>
+ DevtoolScriptControlMsg::ModifyAttribute(id, node_id, modifications) =>
devtools::handle_modify_attribute(&*self.page.borrow(), id, node_id, modifications),
- WantsLiveNotifications(pipeline_id, to_send) =>
+ DevtoolScriptControlMsg::WantsLiveNotifications(pipeline_id, to_send) =>
devtools::handle_wants_live_notifications(&*self.page.borrow(), pipeline_id, to_send),
}
}
@@ -947,8 +946,9 @@ impl ScriptTask {
title: document.r().Title(),
url: final_url
};
- chan.send(NewGlobal(pipeline_id, self.devtools_sender.clone(),
- page_info)).unwrap();
+ chan.send(DevtoolsControlMsg::NewGlobal(pipeline_id,
+ self.devtools_sender.clone(),
+ page_info)).unwrap();
}
}
}
@@ -1113,9 +1113,9 @@ impl ScriptTask {
/// The entry point for content to notify that a fragment url has been requested
/// for the given pipeline.
- fn trigger_fragment(&self, pipeline_id: PipelineId, url: Url) {
+ fn trigger_fragment(&self, pipeline_id: PipelineId, fragment: String) {
let page = get_page(&*self.page.borrow(), pipeline_id);
- match page.find_fragment_node(url.fragment.unwrap()).root() {
+ match page.find_fragment_node(fragment).root() {
Some(node) => {
self.scroll_fragment_point(pipeline_id, node.r());
}
@@ -1363,13 +1363,13 @@ struct LastModified(pub Tm);
impl Header for LastModified {
#[inline]
- fn header_name(_: Option<LastModified>) -> &'static str {
+ fn header_name() -> &'static str {
"Last-Modified"
}
// Parses an RFC 2616 compliant date/time string,
fn parse_header(raw: &[Vec<u8>]) -> Option<LastModified> {
- header_util::from_one_raw_str(raw).and_then(|s: String| {
+ header_parsing::from_one_raw_str(raw).and_then(|s: String| {
let s = s.as_slice();
strptime(s, "%a, %d %b %Y %T %Z").or_else(|_| {
strptime(s, "%A, %d-%b-%y %T %Z")
@@ -1386,8 +1386,8 @@ impl HeaderFormat for LastModified {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let LastModified(ref tm) = *self;
match tm.tm_utcoff {
- 0 => tm.rfc822().fmt(f),
- _ => tm.to_utc().rfc822().fmt(f)
+ 0 => <_ as Display>::fmt(&tm.rfc822(), f),
+ _ => <_ as Display>::fmt(&tm.to_utc().rfc822(), f)
}
}
}
@@ -1432,6 +1432,20 @@ impl DocumentProgressHandler {
let doctarget: JSRef<EventTarget> = EventTargetCast::from_ref(document.r());
event.r().set_trusted(true);
let _ = wintarget.dispatch_event_with_target(doctarget, event.r());
+
+ let window_ref = window.r();
+ let browser_context = window_ref.browser_context();
+ let browser_context = browser_context.as_ref().unwrap();
+
+ browser_context.frame_element().map(|frame_element| {
+ let frame_element = frame_element.root();
+ let frame_window = window_from_node(frame_element.r()).root();
+ let event = Event::new(GlobalRef::Window(frame_window.r()), "load".to_owned(),
+ EventBubbles::DoesNotBubble,
+ EventCancelable::NotCancelable).root();
+ let target: JSRef<EventTarget> = EventTargetCast::from_ref(frame_element.r());
+ event.r().fire(target);
+ });
}
}
diff --git a/components/script/textinput.rs b/components/script/textinput.rs
index f741ff03b21..8c1a6214098 100644
--- a/components/script/textinput.rs
+++ b/components/script/textinput.rs
@@ -136,8 +136,8 @@ impl TextInput {
let new_lines = {
let prefix = self.lines[begin.line].slice_chars(0, begin.index);
let suffix = self.lines[end.line].slice_chars(end.index, self.lines[end.line].chars().count());
- let lines_prefix = self.lines.slice(0, begin.line);
- let lines_suffix = self.lines.slice(end.line + 1, self.lines.len());
+ let lines_prefix = &self.lines[..begin.line];
+ let lines_suffix = &self.lines[end.line + 1..];
let mut insert_lines = if self.multiline {
insert.as_slice().split('\n').map(|s| s.to_owned()).collect()
diff --git a/components/script/timers.rs b/components/script/timers.rs
index a5e0c5bf312..8f361ebcb7b 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -24,7 +24,7 @@ use std::collections::HashMap;
use std::sync::mpsc::{channel, Sender};
use std::sync::mpsc::Select;
use std::hash::{Hash, Hasher, Writer};
-use std::io::timer::Timer;
+use std::old_io::timer::Timer;
use std::time::duration::Duration;
#[derive(PartialEq, Eq)]
diff --git a/components/script_traits/Cargo.toml b/components/script_traits/Cargo.toml
index 3779a3eb52a..f8de04e4a69 100644
--- a/components/script_traits/Cargo.toml
+++ b/components/script_traits/Cargo.toml
@@ -23,4 +23,5 @@ path = "../devtools_traits"
git = "https://github.com/servo/rust-geom"
[dependencies]
-url = "0.2.16" \ No newline at end of file
+url = "0.2.16"
+libc = "*"
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index c8468ce4925..cf5c63779be 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -2,19 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#![feature(core)]
#![feature(int_uint)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
extern crate devtools_traits;
extern crate geom;
extern crate libc;
-extern crate "msg" as servo_msg;
-extern crate "net" as servo_net;
+extern crate msg;
+extern crate net;
extern crate util;
extern crate url;
-extern crate serialize;
// This module contains traits in script used generically
// in the rest of Servo.
@@ -23,13 +22,13 @@ extern crate serialize;
use devtools_traits::DevtoolsControlChan;
use libc::c_void;
-use servo_msg::constellation_msg::{ConstellationChan, PipelineId, Failure, WindowSizeData};
-use servo_msg::constellation_msg::{LoadData, SubpageId, Key, KeyState, KeyModifiers};
-use servo_msg::constellation_msg::PipelineExitType;
-use servo_msg::compositor_msg::ScriptListener;
-use servo_net::image_cache_task::ImageCacheTask;
-use servo_net::resource_task::ResourceTask;
-use servo_net::storage_task::StorageTask;
+use msg::constellation_msg::{ConstellationChan, PipelineId, Failure, WindowSizeData};
+use msg::constellation_msg::{LoadData, SubpageId, Key, KeyState, KeyModifiers};
+use msg::constellation_msg::PipelineExitType;
+use msg::compositor_msg::ScriptListener;
+use net::image_cache_task::ImageCacheTask;
+use net::resource_task::ResourceTask;
+use net::storage_task::StorageTask;
use util::smallvec::SmallVec1;
use std::any::Any;
use std::sync::mpsc::{Sender, Receiver};
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index 5764e27cd5f..1efd7d91ba9 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -3,6 +3,7 @@ name = "servo"
version = "0.0.1"
dependencies = [
"android_glue 0.0.1",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compositing 0.0.1",
"devtools 0.0.1",
"gfx 0.0.1",
@@ -12,8 +13,8 @@ dependencies = [
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"script 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -21,21 +22,21 @@ dependencies = [
name = "android_glue"
version = "0.0.1"
dependencies = [
- "compile_msg 0.1.1 (git+https://github.com/huonw/compile_msg)",
+ "compile_msg 0.1.5 (git+https://github.com/huonw/compile_msg)",
]
[[package]]
name = "android_glue"
version = "0.0.1"
-source = "git+https://github.com/tomaka/android-rs-glue#8fc770e4c1412293e459bc12ca4fcf57780e2186"
+source = "git+https://github.com/tomaka/android-rs-glue#f9da46ed02736508d75333008d54506eec87a33b"
dependencies = [
- "compile_msg 0.1.1 (git+https://github.com/huonw/compile_msg)",
+ "compile_msg 0.1.5 (git+https://github.com/huonw/compile_msg)",
]
[[package]]
name = "azure"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-azure#779233af589e797f07e9e2f3f45017fb55c33c68"
+source = "git+https://github.com/servo/rust-azure#ec5fddfe96f889e35cc83abd2255f8325f2ec147"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -43,11 +44,17 @@ dependencies = [
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
]
[[package]]
+name = "bitflags"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "canvas"
version = "0.0.1"
dependencies = [
@@ -68,12 +75,16 @@ dependencies = [
[[package]]
name = "cocoa"
version = "0.1.1"
-source = "git+https://github.com/servo/rust-cocoa#84a405ba9ff2a79d507dc6ee1ea3cf9bf48706d1"
+source = "git+https://github.com/servo/rust-cocoa#7768a8f6af73d132b68e5cad6a0d81ec54102abe"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "compile_msg"
-version = "0.1.1"
-source = "git+https://github.com/huonw/compile_msg#32a98df61c600ca5487487d2b5e8c55f4bc7a91a"
+version = "0.1.5"
+source = "git+https://github.com/huonw/compile_msg#9b01f38964c227a012b4c8196407db63d415ac89"
[[package]]
name = "compositing"
@@ -92,26 +103,26 @@ dependencies = [
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"script_traits 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "cookie"
-version = "0.1.8"
-source = "git+https://github.com/servo/cookie-rs?branch=lenientparse_backport#47ffa4d3c6f85d28f222d6e1d54635fff5622ea3"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core_foundation"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-core-foundation#ce3d852765827b64a0d5fb2aadd77da39665b0b0"
+source = "git+https://github.com/servo/rust-core-foundation#da9a52655fce4727dcf261d6ed9a49eeddc7b131"
[[package]]
name = "core_graphics"
@@ -124,7 +135,7 @@ dependencies = [
[[package]]
name = "core_text"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-core-text#b5cb33905350e99b2a19f5a22f7b1efea7ad48c2"
+source = "git+https://github.com/servo/rust-core-text#e769be9cb3366f9d403ddbee040e031ce03d32bb"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -133,9 +144,9 @@ dependencies = [
[[package]]
name = "cssparser"
version = "0.2.0"
-source = "git+https://github.com/servo/rust-cssparser#d7d50ae2a7da4aca1b2c4d248139510c8e9a25c6"
+source = "git+https://github.com/servo/rust-cssparser#cf59a4cf55b6386db255d6205b9804d8d74efd35"
dependencies = [
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -146,7 +157,8 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"msg 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -155,29 +167,31 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "egl"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-egl#cd74c82a8537090edb6c16478e2261db2a8c0b4f"
+source = "git+https://github.com/servo/rust-egl#328e79b6256dea346f1821ccc4215e95fd1d58bc"
[[package]]
name = "encoding"
-version = "0.2.18"
+version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "encoding-index-japanese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-korean 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-simpchinese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-singlebyte 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-tradchinese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-japanese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-korean 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-simpchinese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-singlebyte 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-tradchinese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-japanese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -185,7 +199,7 @@ dependencies = [
[[package]]
name = "encoding-index-korean"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -193,7 +207,7 @@ dependencies = [
[[package]]
name = "encoding-index-simpchinese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -201,7 +215,7 @@ dependencies = [
[[package]]
name = "encoding-index-singlebyte"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -209,7 +223,7 @@ dependencies = [
[[package]]
name = "encoding-index-tradchinese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -223,12 +237,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "expat-sys"
version = "2.1.0"
-source = "git+https://github.com/servo/libexpat#da2ddaf78cbef836b8790807bb76b357c58df3a1"
+source = "git+https://github.com/servo/libexpat#fe8c3222efdd486b95ef198ef4eee0506e37a809"
[[package]]
name = "fontconfig"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-fontconfig#f42ff5cbd0404fe4d2cd64e8d9bb6307bad8fd7c"
+source = "git+https://github.com/servo/rust-fontconfig#91195bd29daa9280680bb28ba556821d504a17c6"
dependencies = [
"fontconfig-sys 2.11.1 (git+https://github.com/servo/libfontconfig)",
]
@@ -236,7 +250,7 @@ dependencies = [
[[package]]
name = "fontconfig-sys"
version = "2.11.1"
-source = "git+https://github.com/servo/libfontconfig#fcc324d2c8175d2e8e8c0aab032c03a404809f6d"
+source = "git+https://github.com/servo/libfontconfig#adc60cacbca697123f4535ce2ff07619ec013cec"
dependencies = [
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
@@ -245,33 +259,45 @@ dependencies = [
[[package]]
name = "freetype"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-freetype#ec0231343a3ad360d86846c12895a0a0cbb19f79"
+source = "git+https://github.com/servo/rust-freetype#f65e8d82550b5d5b06a7785a13a008e125c30b7a"
[[package]]
name = "freetype-sys"
version = "2.4.11"
-source = "git+https://github.com/servo/libfreetype2#f5c49c0da1d5bc6b206c4176344012ac37524243"
+source = "git+https://github.com/servo/libfreetype2#7b9d112c0a93574b4bf518922d16b8879c7aadae"
[[package]]
name = "gcc"
-version = "0.1.4"
-source = "git+https://github.com/alexcrichton/gcc-rs#f5c52d956e0742a66e40c8301e634e136c3ae287"
+version = "0.1.7"
+source = "git+https://github.com/alexcrichton/gcc-rs#016cc1597bbe52c26e41cf687476ba93f27fec41"
[[package]]
name = "gcc"
-version = "0.1.4"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
+name = "gdi32-sys"
+version = "0.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "geom"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-geom#a4a4a03aa024412bf3f4e093c0198b433c6ad63f"
+source = "git+https://github.com/servo/rust-geom#6b079ba2738ed15bac2b6ec66850494afb9f2b4c"
+dependencies = [
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "gfx"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
@@ -284,134 +310,131 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"style 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "gl_common"
-version = "0.0.3"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
-
-[[package]]
-name = "gl_common"
-version = "0.0.3"
+version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "gl_generator"
-version = "0.0.12"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "khronos_api 0.0.5 (git+https://github.com/bjz/gl-rs.git)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "xml-rs 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gl_generator"
-version = "0.0.12"
+version = "0.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gl_common 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "khronos_api 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "xml-rs 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "xml-rs 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gleam"
version = "0.0.1"
-source = "git+https://github.com/servo/gleam#375779e0e8e1eaa8ff1a732c81fa91808a7f6c63"
+source = "git+https://github.com/servo/gleam#1a85194298997cf602270d4c1aeb0a043ce339e7"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "gl_generator 0.0.12 (git+https://github.com/bjz/gl-rs.git)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glutin"
-version = "0.0.4-pre"
-source = "git+https://github.com/servo/glutin?branch=servo#3814e0cadc85f558b7a417c9d4b97337382aeb36"
+version = "0.0.4"
+source = "git+https://github.com/servo/glutin?branch=servo#40591806dc7382ddb75d90f2289127f5f28f9825"
dependencies = [
"android_glue 0.0.1 (git+https://github.com/tomaka/android-rs-glue)",
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
- "gl_common 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "gl_generator 0.0.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "khronos_api 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gdi32-sys 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "user32-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glutin_app"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"compositing 0.0.1",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
- "glutin 0.0.4-pre (git+https://github.com/servo/glutin?branch=servo)",
+ "glutin 0.0.4 (git+https://github.com/servo/glutin?branch=servo)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "glx"
version = "0.0.1"
-source = "git+https://github.com/servo/rust-glx#f056a8998987f6f081f9ad7fa396beb1b2988c02"
+source = "git+https://github.com/servo/rust-glx#d8a3329d1f68dc4cf72509daca7ef837b8ce94d6"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "gl_generator 0.0.12 (git+https://github.com/bjz/gl-rs.git)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "harfbuzz"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-harfbuzz#59b5b18087418404d661784934c3d864386024b5"
+source = "git+https://github.com/servo/rust-harfbuzz#d5833511875673aa994ca194922acb3b1ea3ec61"
[[package]]
name = "html5ever"
version = "0.0.0"
-source = "git+https://github.com/servo/html5ever#d35dfaaf0d85007057a299afc370d07e92538944"
+source = "git+https://github.com/servo/html5ever#1c8c09934657fa8edb8ac94070a9061bc040621d"
dependencies = [
"html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)",
- "phf 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_mac 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_macros 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "html5ever_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/html5ever#d35dfaaf0d85007057a299afc370d07e92538944"
+source = "git+https://github.com/servo/html5ever#1c8c09934657fa8edb8ac94070a9061bc040621d"
[[package]]
name = "hyper"
-version = "0.1.1"
-source = "git+https://github.com/servo/hyper?branch=old_servo_new_cookies#7a346f481d683705709526594aa5f13b5c923bc1"
+version = "0.1.10"
+source = "git+https://github.com/servo/hyper?branch=servo#1f5547c4b7fd29781426f82dd857a96f1478b01c"
dependencies = [
- "cookie 0.1.8 (git+https://github.com/servo/cookie-rs?branch=lenientparse_backport)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "mime 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "mucell 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicase 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "unsafe-any 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cookie 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mime 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mucell 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicase 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unsafe-any 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -428,25 +451,29 @@ dependencies = [
[[package]]
name = "js"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-mozjs#6cabb12f858f27d23fc3d2d9f0c334b80eb56573"
+source = "git+https://github.com/servo/rust-mozjs#db08a4eacdb3d92df9a38c8a5d7ad1e1ee0fef4e"
dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs-sys 0.0.0 (git+https://github.com/servo/mozjs)",
]
[[package]]
-name = "khronos_api"
-version = "0.0.4"
+name = "kernel32-sys"
+version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "khronos_api"
version = "0.0.5"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "layers"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-layers#253fd0eb7e49b356393e14abdf34c76152cba10f"
+source = "git+https://github.com/servo/rust-layers#62870a30b06fb8776e01140167e55d1f2370b503"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
@@ -456,6 +483,7 @@ dependencies = [
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
]
@@ -464,20 +492,26 @@ dependencies = [
name = "layout"
version = "0.0.1"
dependencies = [
+ "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"layout_traits 0.0.1",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
+ "png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -494,24 +528,26 @@ dependencies = [
[[package]]
name = "lazy_static"
-version = "0.1.6"
-source = "git+https://github.com/Kimundi/lazy-static.rs#31a7aa0176ecd70b4aab274a40d1e2cd78c1fbf8"
+version = "0.1.7"
+source = "git+https://github.com/Kimundi/lazy-static.rs#b48b0c551087af9d598a0452f4e3973d98d4419b"
+
+[[package]]
+name = "libc"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libressl-pnacl-sys"
-version = "2.1.0"
+version = "2.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "pnacl-build-helper 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pnacl-build-helper 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
-version = "0.1.9"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "regex 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "matches"
@@ -520,98 +556,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mime"
-version = "0.0.6"
+version = "0.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mod_path"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mozjs-sys"
version = "0.0.0"
-source = "git+https://github.com/servo/mozjs#58ee8869c7e589244ab2eb3a3ad15e2b64498428"
+source = "git+https://github.com/servo/mozjs#2267d10685f101438e4f9e8bdfeb9964214dbeeb"
[[package]]
name = "msg"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"style 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "mucell"
-version = "0.1.10"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "net"
version = "0.0.1"
dependencies = [
- "cookie 0.1.8 (git+https://github.com/servo/cookie-rs?branch=lenientparse_backport)",
+ "cookie 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "openssl"
-version = "0.2.15"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
-version = "0.2.16"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libressl-pnacl-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf"
-version = "0.4.9"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
-name = "phf_mac"
-version = "0.4.9"
+name = "phf_macros"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf_shared"
-version = "0.4.9"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
-version = "0.1.1"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -620,57 +660,64 @@ version = "0.0.1"
[[package]]
name = "pnacl-build-helper"
-version = "1.0.0"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "png"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-png#ade2143c96641abdaedd8bc556f45935d18c35df"
+source = "git+https://github.com/servo/rust-png#687f103498654815682d2a750f26bbefc46d9da4"
dependencies = [
- "gcc 0.1.4 (git+https://github.com/alexcrichton/gcc-rs)",
+ "gcc 0.1.7 (git+https://github.com/alexcrichton/gcc-rs)",
"png-sys 1.6.16 (git+https://github.com/servo/rust-png)",
]
[[package]]
name = "png-sys"
version = "1.6.16"
-source = "git+https://github.com/servo/rust-png#ade2143c96641abdaedd8bc556f45935d18c35df"
+source = "git+https://github.com/servo/rust-png#687f103498654815682d2a750f26bbefc46d9da4"
[[package]]
-name = "regex"
-version = "0.1.10"
+name = "rand"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "rustc-serialize"
-version = "0.2.7"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "script"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"devtools_traits 0.0.1",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"html5ever 0.0.0 (git+https://github.com/servo/html5ever)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"js 0.1.0 (git+https://github.com/servo/rust-mozjs)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
- "uuid 0.1.7 (git+https://github.com/rust-lang/uuid)",
+ "uuid 0.1.9 (git+https://github.com/rust-lang/uuid)",
]
[[package]]
@@ -679,16 +726,17 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "skia"
version = "0.0.20130412"
-source = "git+https://github.com/servo/skia?branch=upstream-2014-06-16#387777643df6df6ce8fb61ce069c7c60b32ab38c"
+source = "git+https://github.com/servo/skia?branch=upstream-2014-06-16#76b626df0d6cfb32eb1ee5ba3c7b52aadd5a42e3"
dependencies = [
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
@@ -697,16 +745,16 @@ dependencies = [
[[package]]
name = "stb_image"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-stb-image#2ba03a447b9ef101c25e07bb7f8876416e5fcd71"
+source = "git+https://github.com/servo/rust-stb-image#8fb5031333ea142802724719ce20bfa132bc4802"
[[package]]
name = "string_cache"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#43a1e5d0d0f2a45e2b96160c8fbe6e1d9602cfa9"
+source = "git+https://github.com/servo/string-cache#12b84faff894d358a546bf064b0daf5f04f2a96b"
dependencies = [
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
- "phf 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_mac 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "phf 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_macros 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"xxhash 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -714,26 +762,27 @@ dependencies = [
[[package]]
name = "string_cache_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#43a1e5d0d0f2a45e2b96160c8fbe6e1d9602cfa9"
+source = "git+https://github.com/servo/string-cache#12b84faff894d358a546bf064b0daf5f04f2a96b"
dependencies = [
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
]
[[package]]
name = "style"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "mod_path 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mod_path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -748,69 +797,91 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "time"
-version = "0.1.12"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicase"
-version = "0.0.2"
+version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unsafe-any"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "url"
-version = "0.2.16"
+version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "user32-sys"
+version = "0.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "util"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "uuid"
-version = "0.1.7"
-source = "git+https://github.com/rust-lang/uuid#3ea51ffa0682c820e8c8b505de078e3bc93e2cb3"
+version = "0.1.9"
+source = "git+https://github.com/rust-lang/uuid#3128649cde7c4ba390b31298093d6c181a23eb61"
dependencies = [
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi"
-version = "0.0.5"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "xlib"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-xlib#138b0e281b9fd64f7d2e17080fa9a2d4a8554313"
+source = "git+https://github.com/servo/rust-xlib#4f1bfc476256c37a152980d42213116a62629599"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "xml-rs"
-version = "0.1.12"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "xxhash"
diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml
index 40615055534..89d9c8277ed 100644
--- a/components/servo/Cargo.toml
+++ b/components/servo/Cargo.toml
@@ -69,3 +69,4 @@ optional = true
[dependencies]
url = "0.2.16"
time = "0.1.12"
+bitflags = "*"
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index fb11dde6717..903beab52f3 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -2,18 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(thread_local)]
+#![feature(core, env, libc, path, rustc_private, std_misc, thread_local)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;
extern crate compositing;
extern crate devtools;
-extern crate "net" as servo_net;
-extern crate "msg" as servo_msg;
+extern crate net;
+extern crate msg;
#[macro_use]
extern crate util;
extern crate script;
@@ -28,18 +27,18 @@ use compositing::windowing::{WindowEvent, WindowMethods};
#[cfg(not(test))]
use compositing::{CompositorProxy, CompositorTask, Constellation};
#[cfg(not(test))]
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::Msg as ConstellationMsg;
#[cfg(not(test))]
-use servo_msg::constellation_msg::ConstellationChan;
+use msg::constellation_msg::ConstellationChan;
#[cfg(not(test))]
use script::dom::bindings::codegen::RegisterBindings;
#[cfg(not(test))]
-use servo_net::image_cache_task::ImageCacheTask;
+use net::image_cache_task::ImageCacheTask;
#[cfg(not(test))]
-use servo_net::resource_task::new_resource_task;
+use net::resource_task::new_resource_task;
#[cfg(not(test))]
-use servo_net::storage_task::{StorageTaskFactory, StorageTask};
+use net::storage_task::{StorageTaskFactory, StorageTask};
#[cfg(not(test))]
use gfx::font_cache_task::FontCacheTask;
#[cfg(not(test))]
@@ -52,8 +51,6 @@ use util::opts;
use util::taskpool::TaskPool;
#[cfg(not(test))]
-use std::os;
-#[cfg(not(test))]
use std::rc::Rc;
#[cfg(not(test))]
use std::sync::mpsc::channel;
@@ -67,6 +64,8 @@ pub struct Browser<Window> {
impl<Window> Browser<Window> where Window: WindowMethods + 'static {
#[cfg(not(test))]
pub fn new(window: Option<Rc<Window>>) -> Browser<Window> {
+ use std::env;
+
::util::opts::set_experimental_enabled(opts::get().enable_experimental);
let opts = opts::get();
RegisterBindings::RegisterProxyHandlers();
@@ -112,12 +111,12 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
storage_task);
// Send the URL command to the constellation.
- let cwd = os::getcwd().unwrap();
+ let cwd = env::current_dir().unwrap();
for url in opts.urls.iter() {
- let url = match url::Url::parse(url.as_slice()) {
+ let url = match url::Url::parse(&*url) {
Ok(url) => url,
Err(url::ParseError::RelativeUrlWithoutBase)
- => url::Url::from_file_path(&cwd.join(url.as_slice())).unwrap(),
+ => url::Url::from_file_path(&cwd.join(&*url)).unwrap(),
Err(_) => panic!("URL parsing failed"),
};
diff --git a/components/servo/main.rs b/components/servo/main.rs
index 1597dc37f76..1e7683a9e06 100644
--- a/components/servo/main.rs
+++ b/components/servo/main.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![allow(unstable)]
+#![feature(env, os)]
#[cfg(target_os="android")]
extern crate libc;
@@ -10,7 +10,7 @@ extern crate libc;
extern crate servo;
extern crate time;
extern crate util;
-extern crate "net" as servo_net;
+extern crate net;
#[cfg(not(test))]
extern crate "glutin_app" as app;
@@ -29,7 +29,7 @@ use libc::c_int;
use util::opts;
#[cfg(not(test))]
-use servo_net::resource_task;
+use net::resource_task;
#[cfg(not(test))]
use servo::Browser;
@@ -39,9 +39,6 @@ use compositing::windowing::WindowEvent;
#[cfg(target_os="android")]
use std::borrow::ToOwned;
-#[cfg(not(any(test,target_os="android")))]
-use std::os;
-
#[cfg(not(test))]
struct BrowserWrapper {
browser: Browser<app::window::Window>,
@@ -60,7 +57,8 @@ fn get_args() -> Vec<String> {
#[cfg(not(target_os="android"))]
fn get_args() -> Vec<String> {
- os::args()
+ use std::env;
+ env::args().map(|s| s.into_string().unwrap()).collect()
}
#[cfg(target_os="android")]
@@ -113,7 +111,7 @@ fn setup_logging() {
}
fn main() {
- if opts::from_cmdline_args(get_args().as_slice()) {
+ if opts::from_cmdline_args(&*get_args()) {
setup_logging();
resource_task::global_init();
diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml
index 1da078be801..89e814ffd00 100644
--- a/components/style/Cargo.toml
+++ b/components/style/Cargo.toml
@@ -36,3 +36,4 @@ encoding = "0.2"
matches = "0.1"
url = "0.2.16"
mod_path = "0.1"
+bitflags = "*"
diff --git a/components/style/build.rs b/components/style/build.rs
index 27c71469e4c..908bd3a4414 100644
--- a/components/style/build.rs
+++ b/components/style/build.rs
@@ -2,10 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use std::os;
-use std::path::Path;
-use std::io::process::{Command, ProcessExit, StdioContainer};
-use std::io::File;
+#![feature(path, io, env)]
+
+use std::env;
+use std::old_path::Path;
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
+use std::old_io::File;
fn main() {
@@ -26,6 +28,6 @@ fn main() {
.output()
.unwrap();
assert_eq!(result.status, ProcessExit::ExitStatus(0));
- let out = Path::new(os::getenv("OUT_DIR").unwrap());
- File::create(&out.join("properties.rs")).unwrap().write(&*result.output).unwrap();
+ let out = Path::new(env::var_string("OUT_DIR").unwrap());
+ File::create(&out.join("properties.rs")).unwrap().write_all(&*result.output).unwrap();
}
diff --git a/components/style/font_face.rs b/components/style/font_face.rs
index 6012e0618ea..f10d2a4fa95 100644
--- a/components/style/font_face.rs
+++ b/components/style/font_face.rs
@@ -20,30 +20,30 @@ pub fn iter_font_face_rules_inner<F>(rules: &[CSSRule], device: &Device,
CSSRule::Charset(..) |
CSSRule::Namespace(..) => {},
CSSRule::Media(ref rule) => if rule.media_queries.evaluate(device) {
- iter_font_face_rules_inner(rule.rules.as_slice(), device, callback)
+ iter_font_face_rules_inner(&rule.rules, device, callback)
},
CSSRule::FontFace(ref rule) => {
for source in rule.sources.iter() {
- callback(rule.family.as_slice(), source)
+ callback(&rule.family, source)
}
},
}
}
}
-#[derive(Clone, Show, PartialEq, Eq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Source {
Url(UrlSource),
Local(String),
}
-#[derive(Clone, Show, PartialEq, Eq)]
+#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UrlSource {
pub url: Url,
pub format_hints: Vec<String>,
}
-#[derive(Show, PartialEq, Eq)]
+#[derive(Debug, PartialEq, Eq)]
pub struct FontFaceRule {
pub family: String,
pub sources: Vec<Source>,
@@ -58,9 +58,10 @@ pub fn parse_font_face_block(context: &ParserContext, input: &mut Parser)
while let Some(declaration) = iter.next() {
match declaration {
Err(range) => {
+ let pos = range.start;
let message = format!("Unsupported @font-face descriptor declaration: '{}'",
iter.input.slice(range));
- log_css_error(iter.input, range.start, &*message);
+ log_css_error(iter.input, pos, &*message);
}
Ok(FontFaceDescriptorDeclaration::Family(value)) => {
family = Some(value);
@@ -129,7 +130,7 @@ fn parse_one_src(context: &ParserContext, input: &mut Parser) -> Result<Source,
let url = match input.next() {
// Parsing url()
Ok(Token::Url(url)) => {
- UrlParser::new().base_url(context.base_url).parse(url.as_slice()).unwrap_or_else(
+ UrlParser::new().base_url(context.base_url).parse(&url).unwrap_or_else(
|_error| Url::parse("about:invalid").unwrap())
},
// Parsing local() with early return
diff --git a/components/style/lib.rs b/components/style/lib.rs
index ef194a39bf7..9912133f44c 100644
--- a/components/style/lib.rs
+++ b/components/style/lib.rs
@@ -5,16 +5,20 @@
#![feature(plugin)]
#![feature(int_uint)]
#![feature(box_syntax)]
+#![feature(core)]
+#![feature(std_misc)]
+#![feature(hash)]
+#![feature(collections)]
+#![feature(rustc_private)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use] extern crate log;
+#[macro_use] extern crate bitflags;
#[no_link] #[macro_use] #[plugin] extern crate string_cache_macros;
extern crate collections;
extern crate geom;
-extern crate serialize;
extern crate text_writer;
extern crate url;
diff --git a/components/style/media_queries.rs b/components/style/media_queries.rs
index 37269fac18b..e7c25bccf7d 100644
--- a/components/style/media_queries.rs
+++ b/components/style/media_queries.rs
@@ -11,12 +11,12 @@ use util::geometry::{Au, ViewportPx};
use values::{computed, specified};
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub struct MediaQueryList {
media_queries: Vec<MediaQuery>
}
-#[derive(PartialEq, Eq, Copy, Show)]
+#[derive(PartialEq, Eq, Copy, Debug)]
pub enum Range<T> {
Min(T),
Max(T),
@@ -33,18 +33,18 @@ impl<T: Ord> Range<T> {
}
}
-#[derive(PartialEq, Eq, Copy, Show)]
+#[derive(PartialEq, Eq, Copy, Debug)]
pub enum Expression {
Width(Range<Au>),
}
-#[derive(PartialEq, Eq, Copy, Show)]
+#[derive(PartialEq, Eq, Copy, Debug)]
pub enum Qualifier {
Only,
Not,
}
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub struct MediaQuery {
qualifier: Option<Qualifier>,
media_type: MediaQueryType,
@@ -62,13 +62,13 @@ impl MediaQuery {
}
}
-#[derive(PartialEq, Eq, Copy, Show)]
+#[derive(PartialEq, Eq, Copy, Debug)]
pub enum MediaQueryType {
All, // Always true
MediaType(MediaType),
}
-#[derive(PartialEq, Eq, Copy, Show)]
+#[derive(PartialEq, Eq, Copy, Debug)]
pub enum MediaType {
Screen,
Print,
@@ -76,7 +76,7 @@ pub enum MediaType {
}
#[allow(missing_copy_implementations)]
-#[derive(Show)]
+#[derive(Debug)]
pub struct Device {
pub media_type: MediaType,
pub viewport_size: TypedSize2D<ViewportPx, f32>,
diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs
index b15bb8a28ec..e64e7e84b15 100644
--- a/components/style/properties.mako.rs
+++ b/components/style/properties.mako.rs
@@ -9,7 +9,7 @@
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::fmt;
-use std::fmt::Show;
+use std::fmt::Debug;
use std::sync::Arc;
use util::logical_geometry::{WritingMode, LogicalMargin};
@@ -487,10 +487,10 @@ pub mod longhands {
Ok(SpecifiedValue::Percentage(value.unit_value))
}
Token::Dimension(ref value, ref unit) if value.value >= 0. => {
- specified::Length::parse_dimension(value.value, unit.as_slice())
+ specified::Length::parse_dimension(value.value, unit)
.map(SpecifiedValue::Length)
}
- Token::Ident(ref value) if value.as_slice().eq_ignore_ascii_case("normal") => {
+ Token::Ident(ref value) if value.eq_ignore_ascii_case("normal") => {
Ok(SpecifiedValue::Normal)
}
_ => Err(()),
@@ -506,7 +506,7 @@ pub mod longhands {
Length(Au),
Number(CSSFloat),
}
- impl fmt::Show for T {
+ impl fmt::Debug for T {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
&T::Normal => write!(f, "normal"),
@@ -594,7 +594,7 @@ pub mod longhands {
Length(Au),
Percentage(CSSFloat),
}
- impl fmt::Show for T {
+ impl fmt::Debug for T {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
% for keyword in vertical_align_keywords:
@@ -781,7 +781,7 @@ pub mod longhands {
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
Ok(SpecifiedValue::None)
} else {
- Ok(SpecifiedValue::Url(context.parse_url(try!(input.expect_url()).as_slice())))
+ Ok(SpecifiedValue::Url(context.parse_url(&*try!(input.expect_url()))))
}
}
#[inline]
@@ -988,7 +988,7 @@ pub mod longhands {
impl FontFamily {
pub fn name(&self) -> &str {
match *self {
- FontFamily::FamilyName(ref name) => name.as_slice(),
+ FontFamily::FamilyName(ref name) => name,
}
}
}
@@ -1040,7 +1040,7 @@ pub mod longhands {
let mut value = first_ident.into_owned();
while let Ok(ident) = input.try(|input| input.expect_ident()) {
value.push_str(" ");
- value.push_str(ident.as_slice());
+ value.push_str(&ident);
}
Ok(FontFamily::FamilyName(value))
}
@@ -1107,7 +1107,7 @@ pub mod longhands {
Weight${weight},
% endfor
}
- impl fmt::Show for T {
+ impl fmt::Debug for T {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
% for weight in range(100, 901, 100):
@@ -1529,7 +1529,7 @@ pub mod longhands {
use text_writer::{self, TextWriter};
use util::cursor::Cursor;
- #[derive(Clone, PartialEq, Eq, Copy, Show)]
+ #[derive(Clone, PartialEq, Eq, Copy, Debug)]
pub enum T {
AutoCursor,
SpecifiedCursor(Cursor),
@@ -1555,7 +1555,7 @@ pub mod longhands {
if ident.eq_ignore_ascii_case("auto") {
Ok(SpecifiedValue::AutoCursor)
} else {
- util_cursor::Cursor::from_css_keyword(ident.as_slice())
+ util_cursor::Cursor::from_css_keyword(&ident)
.map(SpecifiedValue::SpecifiedCursor)
}
}
@@ -1667,7 +1667,7 @@ pub mod longhands {
pub inset: bool,
}
- impl fmt::Show for BoxShadow {
+ impl fmt::Debug for BoxShadow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if self.inset {
let _ = write!(f, "inset ");
@@ -1781,7 +1781,7 @@ pub mod longhands {
pub mod computed_value {
use util::geometry::Au;
- #[derive(Clone, PartialEq, Eq, Copy, Show)]
+ #[derive(Clone, PartialEq, Eq, Copy, Debug)]
pub struct ClipRect {
pub top: Au,
pub right: Option<Au>,
@@ -1792,7 +1792,7 @@ pub mod longhands {
pub type T = Option<ClipRect>;
}
- #[derive(Clone, Show, PartialEq, Copy)]
+ #[derive(Clone, Debug, PartialEq, Copy)]
pub struct SpecifiedClipRect {
pub top: specified::Length,
pub right: Option<specified::Length>,
@@ -1901,7 +1901,7 @@ pub mod longhands {
use text_writer::{self, TextWriter};
// TODO(pcwalton): `blur`, `drop-shadow`
- #[derive(Clone, PartialEq, Show)]
+ #[derive(Clone, PartialEq, Debug)]
pub enum Filter {
Brightness(CSSFloat),
Contrast(CSSFloat),
@@ -1933,7 +1933,7 @@ pub mod longhands {
}
}
- #[derive(Clone, PartialEq, Show)]
+ #[derive(Clone, PartialEq, Debug)]
pub struct T {
pub filters: Vec<Filter>,
}
@@ -2548,7 +2548,7 @@ mod property_bit_field {
/// Declarations are stored in reverse order.
/// Overridden declarations are skipped.
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub struct PropertyDeclarationBlock {
pub important: Arc<Vec<PropertyDeclaration>>,
pub normal: Arc<Vec<PropertyDeclaration>>,
@@ -2600,15 +2600,16 @@ pub fn parse_property_declaration_list(context: &ParserContext, input: &mut Pars
match declaration {
Ok((results, important)) => {
if important {
- important_declarations.push_all(results.as_slice());
+ important_declarations.push_all(&results);
} else {
- normal_declarations.push_all(results.as_slice());
+ normal_declarations.push_all(&results);
}
}
Err(range) => {
+ let pos = range.start;
let message = format!("Unsupported property declaration: '{}'",
iter.input.slice(range));
- log_css_error(iter.input, range.start, &*message);
+ log_css_error(iter.input, pos, &*message);
}
}
}
@@ -2646,7 +2647,7 @@ fn deduplicate_property_declarations(declarations: Vec<PropertyDeclaration>)
}
-#[derive(Copy, PartialEq, Eq, Show)]
+#[derive(Copy, PartialEq, Eq, Debug)]
pub enum CSSWideKeyword {
InitialKeyword,
InheritKeyword,
@@ -2665,7 +2666,7 @@ impl CSSWideKeyword {
}
-#[derive(Clone, PartialEq, Eq, Copy, Show)]
+#[derive(Clone, PartialEq, Eq, Copy, Debug)]
pub enum DeclaredValue<T> {
SpecifiedValue(T),
Initial,
@@ -2726,11 +2727,12 @@ impl PropertyDeclaration {
}
pub fn matches(&self, name: &str) -> bool {
- let name_lower = name.as_slice().to_ascii_lowercase();
- match (self, name_lower.as_slice()) {
+ match *self {
% for property in LONGHANDS:
% if property.derived_from is None:
- (&PropertyDeclaration::${property.camel_case}(..), "${property.name}") => true,
+ PropertyDeclaration::${property.camel_case}(..) => {
+ name.eq_ignore_ascii_case("${property.name}")
+ }
% endif
% endfor
_ => false,
@@ -2813,7 +2815,7 @@ impl PropertyDeclaration {
}
}
-impl Show for PropertyDeclaration {
+impl Debug for PropertyDeclaration {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}: {}", self.name(), self.value())
}
diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs
index f1c96e2ec95..bf780ac6f0a 100644
--- a/components/style/selector_matching.rs
+++ b/components/style/selector_matching.rs
@@ -5,7 +5,6 @@
use std::ascii::AsciiExt;
use std::cmp::Ordering;
use std::collections::HashMap;
-use std::hash::Hash;
use std::sync::Arc;
use url::Url;
@@ -127,7 +126,7 @@ impl SelectorMap {
SelectorMap::get_matching_rules(node,
parent_bf,
- self.universal_rules.as_slice(),
+ &self.universal_rules,
matching_rules_list,
shareable);
@@ -152,7 +151,7 @@ impl SelectorMap {
Some(rules) => {
SelectorMap::get_matching_rules(node,
parent_bf,
- rules.as_slice(),
+ rules,
matching_rules,
shareable)
}
@@ -293,8 +292,8 @@ impl Stylist {
// (Does it make a difference?)
for &filename in ["user-agent.css", "servo.css", "presentational-hints.css"].iter() {
let ua_stylesheet = Stylesheet::from_bytes(
- read_resource_file(&[filename]).unwrap().as_slice(),
- Url::parse(format!("chrome:///{:?}", filename).as_slice()).unwrap(),
+ &read_resource_file(&[filename]).unwrap(),
+ Url::parse(&format!("chrome:///{:?}", filename)).unwrap(),
None,
None,
Origin::UserAgent);
@@ -385,7 +384,7 @@ impl Stylist {
pub fn add_quirks_mode_stylesheet(&mut self) {
self.add_stylesheet(Stylesheet::from_bytes(
- read_resource_file(&["quirks-mode.css"]).unwrap().as_slice(),
+ &read_resource_file(&["quirks-mode.css"]).unwrap(),
Url::parse("chrome:///quirks-mode.css").unwrap(),
None,
None,
@@ -523,7 +522,7 @@ struct Rule {
/// A property declaration together with its precedence among rules of equal specificity so that
/// we can sort them.
-#[derive(Clone, Show)]
+#[derive(Clone, Debug)]
pub struct DeclarationBlock {
pub declarations: Arc<Vec<PropertyDeclaration>>,
source_order: uint,
@@ -863,10 +862,10 @@ pub fn matches_simple_selector<'a,E,N>(selector: &SimpleSelector,
element.match_attr(attr, |_| true)
}
SimpleSelector::AttrEqual(ref attr, ref value, case_sensitivity) => {
- if value.as_slice() != "DIR" &&
+ if *value != "DIR" &&
common_style_affecting_attributes().iter().all(|common_attr_info| {
!(common_attr_info.atom == attr.name && match common_attr_info.mode {
- CommonStyleAffectingAttributeMode::IsEqual(target_value, _) => target_value == value.as_slice(),
+ CommonStyleAffectingAttributeMode::IsEqual(target_value, _) => *value == target_value,
CommonStyleAffectingAttributeMode::IsPresent(_) => false,
})
}) {
@@ -876,40 +875,40 @@ pub fn matches_simple_selector<'a,E,N>(selector: &SimpleSelector,
}
element.match_attr(attr, |attr_value| {
match case_sensitivity {
- CaseSensitivity::CaseSensitive => attr_value == value.as_slice(),
- CaseSensitivity::CaseInsensitive => attr_value.eq_ignore_ascii_case(value.as_slice()),
+ CaseSensitivity::CaseSensitive => attr_value == *value,
+ CaseSensitivity::CaseInsensitive => attr_value.eq_ignore_ascii_case(value),
}
})
}
SimpleSelector::AttrIncludes(ref attr, ref value) => {
*shareable = false;
element.match_attr(attr, |attr_value| {
- attr_value.split(SELECTOR_WHITESPACE).any(|v| v == value.as_slice())
+ attr_value.split(SELECTOR_WHITESPACE).any(|v| v == *value)
})
}
SimpleSelector::AttrDashMatch(ref attr, ref value, ref dashing_value) => {
*shareable = false;
element.match_attr(attr, |attr_value| {
- attr_value == value.as_slice() ||
- attr_value.starts_with(dashing_value.as_slice())
+ attr_value == *value ||
+ attr_value.starts_with(dashing_value)
})
}
SimpleSelector::AttrPrefixMatch(ref attr, ref value) => {
*shareable = false;
element.match_attr(attr, |attr_value| {
- attr_value.starts_with(value.as_slice())
+ attr_value.starts_with(value)
})
}
SimpleSelector::AttrSubstringMatch(ref attr, ref value) => {
*shareable = false;
element.match_attr(attr, |attr_value| {
- attr_value.contains(value.as_slice())
+ attr_value.contains(value)
})
}
SimpleSelector::AttrSuffixMatch(ref attr, ref value) => {
*shareable = false;
element.match_attr(attr, |attr_value| {
- attr_value.ends_with(value.as_slice())
+ attr_value.ends_with(value)
})
}
diff --git a/components/style/selectors.rs b/components/style/selectors.rs
index 1ab50f943e4..93428c120de 100644
--- a/components/style/selectors.rs
+++ b/components/style/selectors.rs
@@ -15,14 +15,14 @@ use parser::ParserContext;
use stylesheets::Origin;
-#[derive(PartialEq, Clone, Show)]
+#[derive(PartialEq, Clone, Debug)]
pub struct Selector {
pub compound_selectors: Arc<CompoundSelector>,
pub pseudo_element: Option<PseudoElement>,
pub specificity: u32,
}
-#[derive(Eq, PartialEq, Clone, Hash, Copy, Show)]
+#[derive(Eq, PartialEq, Clone, Hash, Copy, Debug)]
pub enum PseudoElement {
Before,
After,
@@ -30,13 +30,13 @@ pub enum PseudoElement {
}
-#[derive(PartialEq, Clone, Show)]
+#[derive(PartialEq, Clone, Debug)]
pub struct CompoundSelector {
pub simple_selectors: Vec<SimpleSelector>,
pub next: Option<(Box<CompoundSelector>, Combinator)>, // c.next is left of c
}
-#[derive(PartialEq, Clone, Copy, Show)]
+#[derive(PartialEq, Clone, Copy, Debug)]
pub enum Combinator {
Child, // >
Descendant, // space
@@ -44,7 +44,7 @@ pub enum Combinator {
LaterSibling, // ~
}
-#[derive(Eq, PartialEq, Clone, Hash, Show)]
+#[derive(Eq, PartialEq, Clone, Hash, Debug)]
pub enum SimpleSelector {
ID(Atom),
Class(Atom),
@@ -84,27 +84,27 @@ pub enum SimpleSelector {
}
-#[derive(Eq, PartialEq, Clone, Hash, Copy, Show)]
+#[derive(Eq, PartialEq, Clone, Hash, Copy, Debug)]
pub enum CaseSensitivity {
CaseSensitive, // Selectors spec says language-defined, but HTML says sensitive.
CaseInsensitive,
}
-#[derive(Eq, PartialEq, Clone, Hash, Show)]
+#[derive(Eq, PartialEq, Clone, Hash, Debug)]
pub struct LocalName {
pub name: Atom,
pub lower_name: Atom,
}
-#[derive(Eq, PartialEq, Clone, Hash, Show)]
+#[derive(Eq, PartialEq, Clone, Hash, Debug)]
pub struct AttrSelector {
pub name: Atom,
pub lower_name: Atom,
pub namespace: NamespaceConstraint,
}
-#[derive(Eq, PartialEq, Clone, Hash, Show)]
+#[derive(Eq, PartialEq, Clone, Hash, Debug)]
pub enum NamespaceConstraint {
Any,
Specific(Namespace),
@@ -125,13 +125,13 @@ fn compute_specificity(mut selector: &CompoundSelector,
};
if pseudo_element.is_some() { specificity.element_selectors += 1 }
- simple_selectors_specificity(selector.simple_selectors.as_slice(), &mut specificity);
+ simple_selectors_specificity(&selector.simple_selectors, &mut specificity);
loop {
match selector.next {
None => break,
Some((ref next_selector, _)) => {
selector = &**next_selector;
- simple_selectors_specificity(selector.simple_selectors.as_slice(), &mut specificity)
+ simple_selectors_specificity(&selector.simple_selectors, &mut specificity)
}
}
}
@@ -169,7 +169,7 @@ fn compute_specificity(mut selector: &CompoundSelector,
specificity.class_like_selectors += 1,
&SimpleSelector::Namespace(..) => (),
&SimpleSelector::Negation(ref negated) =>
- simple_selectors_specificity(negated.as_slice(), specificity),
+ simple_selectors_specificity(negated, specificity),
}
}
}
@@ -270,8 +270,8 @@ fn parse_type_selector(context: &ParserContext, input: &mut Parser)
match local_name {
Some(name) => {
simple_selectors.push(SimpleSelector::LocalName(LocalName {
- name: Atom::from_slice(name.as_slice()),
- lower_name: Atom::from_slice(name.into_owned().into_ascii_lowercase().as_slice())
+ name: Atom::from_slice(&name),
+ lower_name: Atom::from_slice(&name.into_owned().into_ascii_lowercase())
}))
}
None => (),
@@ -282,7 +282,7 @@ fn parse_type_selector(context: &ParserContext, input: &mut Parser)
}
-#[derive(Show)]
+#[derive(Debug)]
enum SimpleSelectorParseResult {
SimpleSelector(SimpleSelector),
PseudoElement(PseudoElement),
@@ -296,7 +296,7 @@ fn parse_qualified_name<'i, 't>
(context: &ParserContext, input: &mut Parser<'i, 't>,
in_attr_selector: bool)
-> Result<Option<(NamespaceConstraint, Option<CowString<'i>>)>, ()> {
- let default_namespace = |:local_name| {
+ let default_namespace = |local_name| {
let namespace = match context.namespaces.default {
Some(ref ns) => NamespaceConstraint::Specific(ns.clone()),
None => NamespaceConstraint::Any,
@@ -304,7 +304,7 @@ fn parse_qualified_name<'i, 't>
Ok(Some((namespace, local_name)))
};
- let explicit_namespace = |&: input: &mut Parser<'i, 't>, namespace| {
+ let explicit_namespace = |input: &mut Parser<'i, 't>, namespace| {
match input.next_including_whitespace() {
Ok(Token::Delim('*')) if !in_attr_selector => {
Ok(Some((namespace, None)))
@@ -322,7 +322,7 @@ fn parse_qualified_name<'i, 't>
let position = input.position();
match input.next_including_whitespace() {
Ok(Token::Delim('|')) => {
- let result = context.namespaces.prefix_map.get(value.as_slice());
+ let result = context.namespaces.prefix_map.get(&*value);
let namespace = try!(result.ok_or(()));
explicit_namespace(input, NamespaceConstraint::Specific(namespace.clone()))
},
@@ -366,8 +366,8 @@ fn parse_attribute_selector(context: &ParserContext, input: &mut Parser)
Some((_, None)) => unreachable!(),
Some((namespace, Some(local_name))) => AttrSelector {
namespace: namespace,
- lower_name: Atom::from_slice(local_name.as_slice().to_ascii_lowercase().as_slice()),
- name: Atom::from_slice(local_name.as_slice()),
+ lower_name: Atom::from_slice(&local_name.to_ascii_lowercase()),
+ name: Atom::from_slice(&local_name),
},
};
@@ -526,13 +526,13 @@ fn parse_one_simple_selector(context: &ParserContext,
let start_position = input.position();
match input.next_including_whitespace() {
Ok(Token::IDHash(id)) => {
- let id = SimpleSelector::ID(Atom::from_slice(id.as_slice()));
+ let id = SimpleSelector::ID(Atom::from_slice(&id));
Ok(Some(SimpleSelectorParseResult::SimpleSelector(id)))
}
Ok(Token::Delim('.')) => {
match input.next_including_whitespace() {
Ok(Token::Ident(class)) => {
- let class = SimpleSelector::Class(Atom::from_slice(class.as_slice()));
+ let class = SimpleSelector::Class(Atom::from_slice(&class));
Ok(Some(SimpleSelectorParseResult::SimpleSelector(class)))
}
_ => Err(()),
@@ -547,7 +547,7 @@ fn parse_one_simple_selector(context: &ParserContext,
Ok(Token::Colon) => {
match input.next_including_whitespace() {
Ok(Token::Ident(name)) => {
- match parse_simple_pseudo_class(context, name.as_slice()) {
+ match parse_simple_pseudo_class(context, &name) {
Err(()) => {
let pseudo_element = match_ignore_ascii_case! { name,
// Supported CSS 2.1 pseudo-elements only.
@@ -564,16 +564,15 @@ fn parse_one_simple_selector(context: &ParserContext,
}
}
Ok(Token::Function(name)) => {
- let name = name.as_slice();
let pseudo = try!(input.parse_nested_block(|input| {
- parse_functional_pseudo_class(context, input, name, inside_negation)
+ parse_functional_pseudo_class(context, input, &name, inside_negation)
}));
Ok(Some(SimpleSelectorParseResult::SimpleSelector(pseudo)))
}
Ok(Token::Colon) => {
match input.next() {
Ok(Token::Ident(name)) => {
- let pseudo = try!(parse_pseudo_element(name.as_slice()));
+ let pseudo = try!(parse_pseudo_element(&name));
Ok(Some(SimpleSelectorParseResult::PseudoElement(pseudo)))
}
_ => Err(())
diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs
index 1eaa8e838f7..05bef7c87ba 100644
--- a/components/style/stylesheets.rs
+++ b/components/style/stylesheets.rs
@@ -19,7 +19,7 @@ use media_queries::{self, Device, MediaQueryList, parse_media_query_list};
use font_face::{FontFaceRule, Source, parse_font_face_block, iter_font_face_rules_inner};
-#[derive(Clone, PartialEq, Eq, Copy, Show)]
+#[derive(Clone, PartialEq, Eq, Copy, Debug)]
pub enum Origin {
UserAgent,
Author,
@@ -27,7 +27,7 @@ pub enum Origin {
}
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub struct Stylesheet {
/// List of rules in the order they were found (important for
/// cascading order)
@@ -36,7 +36,7 @@ pub struct Stylesheet {
}
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub enum CSSRule {
Charset(String),
Namespace(Option<String>, Namespace),
@@ -45,14 +45,14 @@ pub enum CSSRule {
FontFace(FontFaceRule),
}
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub struct MediaRule {
pub media_queries: MediaQueryList,
pub rules: Vec<CSSRule>,
}
-#[derive(Show, PartialEq)]
+#[derive(Debug, PartialEq)]
pub struct StyleRule {
pub selectors: Vec<Selector>,
pub declarations: PropertyDeclarationBlock,
@@ -61,14 +61,14 @@ pub struct StyleRule {
impl Stylesheet {
pub fn from_bytes_iter<I: Iterator<Item=Vec<u8>>>(
- mut input: I, base_url: Url, protocol_encoding_label: Option<&str>,
+ input: I, base_url: Url, protocol_encoding_label: Option<&str>,
environment_encoding: Option<EncodingRef>, origin: Origin) -> Stylesheet {
- let mut bytes = vec!();
+ let mut bytes = vec![];
// TODO: incremental decoding and tokenization/parsing
for chunk in input {
- bytes.push_all(chunk.as_slice())
+ bytes.push_all(&chunk)
}
- Stylesheet::from_bytes(bytes.as_slice(), base_url, protocol_encoding_label,
+ Stylesheet::from_bytes(&bytes, base_url, protocol_encoding_label,
environment_encoding, origin)
}
@@ -80,8 +80,8 @@ impl Stylesheet {
-> Stylesheet {
// TODO: bytes.as_slice could be bytes.container_as_bytes()
let (string, _) = decode_stylesheet_bytes(
- bytes.as_slice(), protocol_encoding_label, environment_encoding);
- Stylesheet::from_str(string.as_slice(), base_url, origin)
+ bytes, protocol_encoding_label, environment_encoding);
+ Stylesheet::from_str(&string, base_url, origin)
}
pub fn from_str<'i>(css: &'i str, base_url: Url, origin: Origin) -> Stylesheet {
@@ -106,8 +106,9 @@ impl Stylesheet {
rules.push(rule);
}
Err(range) => {
+ let pos = range.start;
let message = format!("Invalid rule: '{}'", iter.input.slice(range));
- log_css_error(iter.input, range.start, &*message);
+ log_css_error(iter.input, pos, &*message);
}
}
}
@@ -126,8 +127,9 @@ fn parse_nested_rules(context: &ParserContext, input: &mut Parser) -> Vec<CSSRul
match result {
Ok(rule) => rules.push(rule),
Err(range) => {
+ let pos = range.start;
let message = format!("Unsupported rule: '{}'", iter.input.slice(range));
- log_css_error(iter.input, range.start, &*message);
+ log_css_error(iter.input, pos, &*message);
}
}
}
@@ -186,7 +188,7 @@ impl<'a> AtRuleParser for TopLevelRuleParser<'a> {
self.state.set(State::Namespaces);
let prefix = input.try(|input| input.expect_ident()).ok().map(|p| p.into_owned());
- let url = Namespace(Atom::from_slice(try!(input.expect_url_or_string()).as_slice()));
+ let url = Namespace(Atom::from_slice(&*try!(input.expect_url_or_string())));
return Ok(AtRuleType::WithoutBlock(CSSRule::Namespace(prefix, url)))
} else {
return Err(()) // "@namespace must be before any rule but @charset and @import"
@@ -286,7 +288,7 @@ pub fn iter_style_rules<'a, F>(rules: &[CSSRule], device: &media_queries::Device
match *rule {
CSSRule::Style(ref rule) => callback(rule),
CSSRule::Media(ref rule) => if rule.media_queries.evaluate(device) {
- iter_style_rules(rule.rules.as_slice(), device, callback)
+ iter_style_rules(&rule.rules, device, callback)
},
CSSRule::FontFace(..) |
CSSRule::Charset(..) |
@@ -310,14 +312,14 @@ pub fn iter_stylesheet_media_rules<F>(stylesheet: &Stylesheet, mut callback: F)
#[inline]
pub fn iter_stylesheet_style_rules<F>(stylesheet: &Stylesheet, device: &media_queries::Device,
mut callback: F) where F: FnMut(&StyleRule) {
- iter_style_rules(stylesheet.rules.as_slice(), device, &mut callback)
+ iter_style_rules(&stylesheet.rules, device, &mut callback)
}
#[inline]
pub fn iter_font_face_rules<F>(stylesheet: &Stylesheet, device: &Device,
callback: &F) where F: Fn(&str, &Source) {
- iter_font_face_rules_inner(stylesheet.rules.as_slice(), device, callback)
+ iter_font_face_rules_inner(&stylesheet.rules, device, callback)
}
diff --git a/components/style/values.rs b/components/style/values.rs
index 82e7a543f6e..fd9dafcb639 100644
--- a/components/style/values.rs
+++ b/components/style/values.rs
@@ -27,7 +27,7 @@ macro_rules! define_css_keyword_enum {
}
}
- impl ::std::fmt::Show for $name {
+ impl ::std::fmt::Debug for $name {
#[inline]
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
use cssparser::ToCss;
@@ -53,7 +53,7 @@ pub mod specified {
use std::ascii::AsciiExt;
use std::f64::consts::PI;
use std::fmt;
- use std::fmt::{Formatter, Show};
+ use std::fmt::{Formatter, Debug};
use url::Url;
use cssparser::{self, Token, Parser, ToCss, CssStringWriter};
use parser::ParserContext;
@@ -82,14 +82,14 @@ pub mod specified {
}
}
- impl fmt::Show for CSSColor {
+ impl fmt::Debug for CSSColor {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
impl ToCss for CSSColor {
fn to_css<W>(&self, dest: &mut W) -> text_writer::Result where W: TextWriter {
match self.authored {
- Some(ref s) => dest.write_str(s.as_slice()),
+ Some(ref s) => dest.write_str(s),
None => self.parsed.to_css(dest),
}
}
@@ -100,14 +100,14 @@ pub mod specified {
pub parsed: cssparser::RGBA,
pub authored: Option<String>,
}
- impl fmt::Show for CSSRGBA {
+ impl fmt::Debug for CSSRGBA {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
impl ToCss for CSSRGBA {
fn to_css<W>(&self, dest: &mut W) -> text_writer::Result where W: TextWriter {
match self.authored {
- Some(ref s) => dest.write_str(s.as_slice()),
+ Some(ref s) => dest.write_str(s),
None => self.parsed.to_css(dest),
}
}
@@ -116,7 +116,7 @@ pub mod specified {
#[derive(Clone, PartialEq)]
pub struct CSSImage(pub Option<Image>);
- impl fmt::Show for CSSImage {
+ impl fmt::Debug for CSSImage {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -143,7 +143,7 @@ pub mod specified {
ServoCharacterWidth(i32),
}
- impl fmt::Show for Length {
+ impl fmt::Debug for Length {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -171,7 +171,7 @@ pub mod specified {
fn parse_internal(input: &mut Parser, negative_ok: bool) -> Result<Length, ()> {
match try!(input.next()) {
Token::Dimension(ref value, ref unit) if negative_ok || value.value >= 0. => {
- Length::parse_dimension(value.value, unit.as_slice())
+ Length::parse_dimension(value.value, unit)
}
Token::Number(ref value) if value.value == 0. => Ok(Length::Au(Au(0))),
_ => Err(())
@@ -211,7 +211,7 @@ pub mod specified {
Percentage(CSSFloat), // [0 .. 100%] maps to [0.0 .. 1.0]
}
- impl fmt::Show for LengthOrPercentage {
+ impl fmt::Debug for LengthOrPercentage {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -229,7 +229,7 @@ pub mod specified {
-> Result<LengthOrPercentage, ()> {
match try!(input.next()) {
Token::Dimension(ref value, ref unit) if negative_ok || value.value >= 0. => {
- Length::parse_dimension(value.value, unit.as_slice())
+ Length::parse_dimension(value.value, unit)
.map(LengthOrPercentage::Length)
}
Token::Percentage(ref value) if negative_ok || value.unit_value >= 0. => {
@@ -259,7 +259,7 @@ pub mod specified {
Auto,
}
- impl fmt::Show for LengthOrPercentageOrAuto {
+ impl fmt::Debug for LengthOrPercentageOrAuto {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -278,7 +278,7 @@ pub mod specified {
-> Result<LengthOrPercentageOrAuto, ()> {
match try!(input.next()) {
Token::Dimension(ref value, ref unit) if negative_ok || value.value >= 0. => {
- Length::parse_dimension(value.value, unit.as_slice())
+ Length::parse_dimension(value.value, unit)
.map(LengthOrPercentageOrAuto::Length)
}
Token::Percentage(ref value) if negative_ok || value.unit_value >= 0. => {
@@ -310,7 +310,7 @@ pub mod specified {
None,
}
- impl fmt::Show for LengthOrPercentageOrNone {
+ impl fmt::Debug for LengthOrPercentageOrNone {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -329,7 +329,7 @@ pub mod specified {
-> Result<LengthOrPercentageOrNone, ()> {
match try!(input.next()) {
Token::Dimension(ref value, ref unit) if negative_ok || value.value >= 0. => {
- Length::parse_dimension(value.value, unit.as_slice())
+ Length::parse_dimension(value.value, unit)
.map(LengthOrPercentageOrNone::Length)
}
Token::Percentage(ref value) if negative_ok || value.unit_value >= 0. => {
@@ -370,7 +370,7 @@ pub mod specified {
pub fn parse(input: &mut Parser) -> Result<PositionComponent, ()> {
match try!(input.next()) {
Token::Dimension(ref value, ref unit) => {
- Length::parse_dimension(value.value, unit.as_slice())
+ Length::parse_dimension(value.value, unit)
.map(PositionComponent::Length)
}
Token::Percentage(ref value) => {
@@ -409,7 +409,7 @@ pub mod specified {
#[derive(Clone, PartialEq, PartialOrd, Copy)]
pub struct Angle(pub CSSFloat);
- impl fmt::Show for Angle {
+ impl fmt::Debug for Angle {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -457,7 +457,7 @@ pub mod specified {
LinearGradient(LinearGradient),
}
- impl fmt::Show for Image {
+ impl fmt::Debug for Image {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -479,7 +479,7 @@ pub mod specified {
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<Image, ()> {
match try!(input.next()) {
Token::Url(url) => {
- Ok(Image::Url(context.parse_url(url.as_slice())))
+ Ok(Image::Url(context.parse_url(&url)))
}
Token::Function(name) => {
match_ignore_ascii_case! { name,
@@ -515,7 +515,7 @@ pub mod specified {
pub stops: Vec<ColorStop>,
}
- impl fmt::Show for LinearGradient {
+ impl fmt::Debug for LinearGradient {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -539,7 +539,7 @@ pub mod specified {
Corner(HorizontalDirection, VerticalDirection),
}
- impl fmt::Show for AngleOrCorner {
+ impl fmt::Debug for AngleOrCorner {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -569,7 +569,7 @@ pub mod specified {
pub position: Option<LengthOrPercentage>,
}
- impl fmt::Show for ColorStop {
+ impl fmt::Debug for ColorStop {
#[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt_to_css(f) }
}
@@ -748,7 +748,7 @@ pub mod computed {
Length(Au),
Percentage(CSSFloat),
}
- impl fmt::Show for LengthOrPercentage {
+ impl fmt::Debug for LengthOrPercentage {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
&LengthOrPercentage::Length(length) => write!(f, "{:?}", length),
@@ -774,7 +774,7 @@ pub mod computed {
Percentage(CSSFloat),
Auto,
}
- impl fmt::Show for LengthOrPercentageOrAuto {
+ impl fmt::Debug for LengthOrPercentageOrAuto {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
&LengthOrPercentageOrAuto::Length(length) => write!(f, "{:?}", length),
@@ -802,7 +802,7 @@ pub mod computed {
Percentage(CSSFloat),
None,
}
- impl fmt::Show for LengthOrPercentageOrNone {
+ impl fmt::Debug for LengthOrPercentageOrNone {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
&LengthOrPercentageOrNone::Length(length) => write!(f, "{:?}", length),
@@ -831,7 +831,7 @@ pub mod computed {
LinearGradient(LinearGradient),
}
- impl fmt::Show for Image {
+ impl fmt::Debug for Image {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
&Image::Url(ref url) => write!(f, "url(\"{}\")", url),
@@ -850,7 +850,7 @@ pub mod computed {
pub stops: Vec<ColorStop>,
}
- impl fmt::Show for LinearGradient {
+ impl fmt::Debug for LinearGradient {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let _ = write!(f, "{:?}", self.angle_or_corner);
for stop in self.stops.iter() {
@@ -871,7 +871,7 @@ pub mod computed {
pub position: Option<LengthOrPercentage>,
}
- impl fmt::Show for ColorStop {
+ impl fmt::Debug for ColorStop {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let _ = write!(f, "{:?}", self.color);
self.position.map(|pos| {
diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml
index 6b640290596..1ce8a396942 100644
--- a/components/util/Cargo.toml
+++ b/components/util/Cargo.toml
@@ -36,7 +36,14 @@ git = "https://github.com/servo/string-cache"
[dependencies.string_cache_macros]
git = "https://github.com/servo/string-cache"
+[dependencies.lazy_static]
+git = "https://github.com/Kimundi/lazy-static.rs"
+
[dependencies]
text_writer = "0.1.1"
url = "0.2.16"
-time = "0.1.12" \ No newline at end of file
+time = "0.1.12"
+bitflags = "*"
+rand = "*"
+rustc-serialize = "0.2"
+libc = "*"
diff --git a/components/util/cache.rs b/components/util/cache.rs
index 8ab2ad690ef..b3f2aaf55c4 100644
--- a/components/util/cache.rs
+++ b/components/util/cache.rs
@@ -10,7 +10,7 @@ use std::collections::hash_state::DefaultState;
use rand::Rng;
use std::hash::{Hash, Hasher, SipHasher};
use std::iter::repeat;
-use std::rand;
+use rand;
use std::slice::Iter;
#[cfg(test)]
diff --git a/components/util/cursor.rs b/components/util/cursor.rs
index ff203f1a0e7..4c6b61b38fe 100644
--- a/components/util/cursor.rs
+++ b/components/util/cursor.rs
@@ -10,7 +10,7 @@ use text_writer::TextWriter;
macro_rules! define_cursor {
($( $css: expr => $variant: ident = $value: expr, )+) => {
- #[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Show)]
+ #[derive(Clone, Copy, PartialEq, Eq, FromPrimitive, Debug)]
#[repr(u8)]
pub enum Cursor {
$( $variant = $value ),+
diff --git a/components/util/debug_utils.rs b/components/util/debug_utils.rs
index e43b1d11363..8d9789de029 100644
--- a/components/util/debug_utils.rs
+++ b/components/util/debug_utils.rs
@@ -2,33 +2,33 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use std::io;
-use std::io::Writer;
+use std::old_io as io;
+use std::old_io::Writer;
use std::mem;
use std::mem::size_of;
use std::slice;
fn hexdump_slice(buf: &[u8]) {
let mut stderr = io::stderr();
- stderr.write(b" ").unwrap();
+ stderr.write_all(b" ").unwrap();
for (i, &v) in buf.iter().enumerate() {
let output = format!("{:02X} ", v as uint);
- stderr.write(output.as_bytes()).unwrap();
+ stderr.write_all(output.as_bytes()).unwrap();
match i % 16 {
- 15 => { stderr.write(b"\n ").unwrap(); },
- 7 => { stderr.write(b" ").unwrap(); },
+ 15 => { stderr.write_all(b"\n ").unwrap(); },
+ 7 => { stderr.write_all(b" ").unwrap(); },
_ => ()
}
stderr.flush().unwrap();
}
- stderr.write(b"\n").unwrap();
+ stderr.write_all(b"\n").unwrap();
}
pub fn hexdump<T>(obj: &T) {
unsafe {
let buf: *const u8 = mem::transmute(obj);
debug!("dumping at {:p}", buf);
- let from_buf = slice::from_raw_buf(&buf, size_of::<T>());
+ let from_buf = slice::from_raw_parts(buf, size_of::<T>());
hexdump_slice(from_buf);
}
}
diff --git a/components/util/deque/mod.rs b/components/util/deque/mod.rs
index 505b09ab021..6dce728679b 100644
--- a/components/util/deque/mod.rs
+++ b/components/util/deque/mod.rs
@@ -42,8 +42,6 @@
//! let mut stealer2 = stealer.clone();
//! stealer2.steal();
-#![experimental]
-
// NB: the "buffer pool" strategy is not done for speed, but rather for
// correctness. For more info, see the comment on `swap_buffer`
@@ -86,19 +84,21 @@ struct Deque<T> {
/// There may only be one worker per deque.
pub struct Worker<T> {
deque: Arc<Deque<T>>,
- _noshare: marker::NoSync,
}
+impl<T> !marker::Sync for Worker<T> {}
+
/// The stealing half of the work-stealing deque. Stealers have access to the
/// opposite end of the deque from the worker, and they only have access to the
/// `steal` method.
pub struct Stealer<T> {
deque: Arc<Deque<T>>,
- _noshare: marker::NoSync,
}
+impl<T> !marker::Sync for Stealer<T> {}
+
/// When stealing some data, this is an enumeration of the possible outcomes.
-#[derive(PartialEq, Show)]
+#[derive(PartialEq, Debug)]
pub enum Stolen<T> {
/// The deque was empty at the time of stealing
Empty,
@@ -156,8 +156,7 @@ impl<T: Send> BufferPool<T> {
pub fn deque(&self) -> (Worker<T>, Stealer<T>) {
let a = Arc::new(Deque::new(self.clone()));
let b = a.clone();
- (Worker { deque: a, _noshare: marker::NoSync },
- Stealer { deque: b, _noshare: marker::NoSync })
+ (Worker { deque: a }, Stealer { deque: b })
}
fn alloc(&mut self, bits: uint) -> Box<Buffer<T>> {
@@ -218,7 +217,7 @@ impl<T: Send> Stealer<T> {
impl<T: Send> Clone for Stealer<T> {
fn clone(&self) -> Stealer<T> {
- Stealer { deque: self.deque.clone(), _noshare: marker::NoSync }
+ Stealer { deque: self.deque.clone() }
}
}
diff --git a/components/util/dlist.rs b/components/util/dlist.rs
index f22c07268ba..ce55743f14b 100644
--- a/components/util/dlist.rs
+++ b/components/util/dlist.rs
@@ -6,120 +6,20 @@
use std::collections::DList;
use std::mem;
-use std::ptr;
-struct RawDList<T> {
- length: uint,
- head: *mut RawNode<T>,
- tail: *mut RawNode<T>,
-}
-
-#[allow(dead_code)]
-struct RawNode<T> {
- next: *mut RawNode<T>,
- prev: *mut RawNode<T>,
- value: T,
-}
-
-#[unsafe_destructor]
-impl<T> Drop for RawDList<T> {
- fn drop(&mut self) {
- panic!("shouldn't happen")
- }
-}
-
-/// Workaround for a missing method on Rust's `DList` type. Splits the head off a list in O(1)
-/// time.
-pub fn split<T>(list: &mut DList<T>) -> DList<T> {
- let list = unsafe {
- mem::transmute::<&mut DList<T>,&mut RawDList<T>>(list)
- };
-
- if list.length == 0 {
- panic!("split_dlist(): empty list")
- }
- let head_node = mem::replace(&mut list.head, ptr::null_mut());
- let head_list = RawDList {
- length: 1,
- head: head_node,
- tail: head_node,
- };
- debug_assert!(list.head.is_null());
-
- unsafe {
- mem::swap(&mut (*head_list.head).next, &mut list.head);
- debug_assert!((*head_list.head).next.is_null());
- debug_assert!((*head_list.head).prev.is_null());
- (*head_list.head).prev = ptr::null_mut();
- }
-
- list.length -= 1;
- if list.length == 0 {
- list.tail = ptr::null_mut()
- } else {
- if list.length == 1 {
- list.tail = list.head
- }
-
- unsafe {
- (*list.head).prev = ptr::null_mut()
- }
- }
-
- unsafe {
- mem::transmute::<RawDList<T>,DList<T>>(head_list)
- }
-}
-
-/// Appends the items in the other list to this one, leaving the other list empty.
-#[inline]
-pub fn append_from<T>(this: &mut DList<T>, other: &mut DList<T>) {
- unsafe {
- let this = mem::transmute::<&mut DList<T>,&mut RawDList<T>>(this);
- let other = mem::transmute::<&mut DList<T>,&mut RawDList<T>>(other);
- if this.length == 0 {
- this.head = mem::replace(&mut other.head, ptr::null_mut());
- this.tail = mem::replace(&mut other.tail, ptr::null_mut());
- this.length = mem::replace(&mut other.length, 0);
- return
- }
-
- let old_other_head = mem::replace(&mut other.head, ptr::null_mut());
- if old_other_head.is_null() {
- return
- }
- (*old_other_head).prev = this.tail;
- (*this.tail).next = old_other_head;
-
- this.tail = mem::replace(&mut other.tail, ptr::null_mut());
- this.length += other.length;
- other.length = 0;
+/// Splits the head off a list in O(1) time, and returns the head.
+pub fn split_off_head<T>(list: &mut DList<T>) -> DList<T> {
+ // FIXME: Work around https://github.com/rust-lang/rust/issues/22244
+ if list.len() == 1 {
+ return mem::replace(list, DList::new());
}
+ let tail = list.split_off(1);
+ mem::replace(list, tail)
}
/// Prepends the items in the other list to this one, leaving the other list empty.
#[inline]
pub fn prepend_from<T>(this: &mut DList<T>, other: &mut DList<T>) {
- unsafe {
- let this = mem::transmute::<&mut DList<T>,&mut RawDList<T>>(this);
- let other = mem::transmute::<&mut DList<T>,&mut RawDList<T>>(other);
- if this.length == 0 {
- this.head = mem::replace(&mut other.head, ptr::null_mut());
- this.tail = mem::replace(&mut other.tail, ptr::null_mut());
- this.length = mem::replace(&mut other.length, 0);
- return
- }
-
- let old_other_tail = mem::replace(&mut other.tail, ptr::null_mut());
- if old_other_tail.is_null() {
- return
- }
- (*old_other_tail).next = this.head;
- (*this.head).prev = old_other_tail;
-
- this.head = mem::replace(&mut other.head, ptr::null_mut());
- this.length += other.length;
- other.length = 0;
- }
+ other.append(this);
+ mem::swap(this, other);
}
-
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index a30849eaf5d..59f61c5afc0 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -31,7 +31,7 @@ use rustc_serialize::{Encoder, Encodable};
///
/// The ratio between ScreenPx and DevicePixel for a given display be found by calling
/// `servo::windowing::WindowMethods::hidpi_factor`.
-#[derive(Show, Copy)]
+#[derive(Debug, Copy)]
pub enum ScreenPx {}
/// One CSS "px" in the coordinate system of the "initial viewport":
@@ -43,7 +43,7 @@ pub enum ScreenPx {}
///
/// At the default zoom level of 100%, one PagePx is equal to one ScreenPx. However, if the
/// document is zoomed in or out then this scale may be larger or smaller.
-#[derive(RustcEncodable, Show, Copy)]
+#[derive(RustcEncodable, Debug, Copy)]
pub enum ViewportPx {}
/// One CSS "px" in the root coordinate system for the content document.
@@ -52,7 +52,7 @@ pub enum ViewportPx {}
/// This is the mobile-style "pinch zoom" that enlarges content without reflowing it. When the
/// viewport zoom is not equal to 1.0, then the layout viewport is no longer the same physical size
/// as the viewable area.
-#[derive(RustcEncodable, Show, Copy)]
+#[derive(RustcEncodable, Debug, Copy)]
pub enum PagePx {}
// In summary, the hierarchy of pixel units and the factors to convert from one to the next:
@@ -120,7 +120,7 @@ impl Encodable for Au {
}
}
-impl fmt::Show for Au {
+impl fmt::Debug for Au {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}px", to_frac_px(*self))
}}
diff --git a/components/util/lib.rs b/components/util/lib.rs
index a1d356a4645..b6c1f938e66 100644
--- a/components/util/lib.rs
+++ b/components/util/lib.rs
@@ -2,17 +2,28 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(unsafe_destructor)]
-#![feature(plugin)]
-#![feature(int_uint)]
+#![feature(alloc)]
#![feature(box_syntax)]
+#![feature(collections)]
+#![feature(core)]
+#![feature(env)]
+#![feature(hash)]
+#![feature(int_uint)]
+#![feature(io)]
+#![feature(optin_builtin_traits)]
+#![feature(path)]
+#![feature(plugin)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
+#![feature(unicode)]
+#![feature(unsafe_destructor)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use] extern crate log;
extern crate alloc;
+#[macro_use] extern crate bitflags;
extern crate collections;
extern crate cssparser;
extern crate geom;
@@ -21,7 +32,7 @@ extern crate layers;
extern crate libc;
#[no_link] #[macro_use] extern crate cssparser;
extern crate rand;
-extern crate "serialize" as rustc_serialize;
+extern crate "rustc-serialize" as rustc_serialize;
#[cfg(target_os="macos")]
extern crate task_info;
extern crate "time" as std_time;
diff --git a/components/util/logical_geometry.rs b/components/util/logical_geometry.rs
index a76bd1ca21e..f464412fb46 100644
--- a/components/util/logical_geometry.rs
+++ b/components/util/logical_geometry.rs
@@ -7,7 +7,7 @@
use geom::{Size2D, Point2D, SideOffsets2D, Rect};
use geom::num::Zero;
use std::cmp::{min, max};
-use std::fmt::{Show, Formatter, Error};
+use std::fmt::{Debug, Formatter, Error};
use std::ops::{Add, Sub};
bitflags!(
@@ -49,7 +49,7 @@ impl WritingMode {
}
}
-impl Show for WritingMode {
+impl Debug for WritingMode {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
if self.is_vertical() {
try!(write!(formatter, "V"));
@@ -121,7 +121,7 @@ impl DebugWritingMode {
}
}
-impl Show for DebugWritingMode {
+impl Debug for DebugWritingMode {
#[cfg(ndebug)]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter, "?")
@@ -142,7 +142,7 @@ pub struct LogicalSize<T> {
debug_writing_mode: DebugWritingMode,
}
-impl<T: Show> Show for LogicalSize<T> {
+impl<T: Debug> Debug for LogicalSize<T> {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter, "LogicalSize({:?}, i{:?}×b{:?})",
self.debug_writing_mode, self.inline, self.block)
@@ -278,7 +278,7 @@ pub struct LogicalPoint<T> {
debug_writing_mode: DebugWritingMode,
}
-impl<T: Show> Show for LogicalPoint<T> {
+impl<T: Debug> Debug for LogicalPoint<T> {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter, "LogicalPoint({:?} (i{:?}, b{:?}))",
self.debug_writing_mode, self.i, self.b)
@@ -452,7 +452,7 @@ pub struct LogicalMargin<T> {
debug_writing_mode: DebugWritingMode,
}
-impl<T: Show> Show for LogicalMargin<T> {
+impl<T: Debug> Debug for LogicalMargin<T> {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter,
"LogicalMargin({:?}, inline: {:?}..{:?} block: {:?}..{:?})",
@@ -738,7 +738,7 @@ pub struct LogicalRect<T> {
debug_writing_mode: DebugWritingMode,
}
-impl<T: Show> Show for LogicalRect<T> {
+impl<T: Debug> Debug for LogicalRect<T> {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter,
"LogicalRect({:?}, i{:?}×b{:?}, @ (i{:?},b{:?}))",
diff --git a/components/util/memory.rs b/components/util/memory.rs
index c555dc8af81..5249f3709aa 100644
--- a/components/util/memory.rs
+++ b/components/util/memory.rs
@@ -7,13 +7,12 @@
use libc::{c_char,c_int,c_void,size_t};
use std::borrow::ToOwned;
use std::ffi::CString;
-use std::io::timer::sleep;
+use std::old_io::timer::sleep;
#[cfg(target_os="linux")]
-use std::io::File;
-use std::mem;
+use std::old_io::File;
use std::mem::size_of;
#[cfg(target_os="linux")]
-use std::os::page_size;
+use std::env::page_size;
use std::ptr::null_mut;
use std::sync::mpsc::{Sender, channel, Receiver};
use std::time::duration::Duration;
@@ -198,17 +197,40 @@ extern {
newp: *mut c_void, newlen: size_t) -> c_int;
}
-fn get_jemalloc_stat(name: &'static str) -> Option<u64> {
- let mut old: size_t = 0;
- let c_name = CString::from_slice(name.as_bytes());
- let oldp = &mut old as *mut _ as *mut c_void;
- let mut oldlen = size_of::<size_t>() as size_t;
- let rv: c_int;
- unsafe {
- rv = je_mallctl(c_name.as_ptr(), oldp, &mut oldlen, null_mut(), 0);
- mem::forget(c_name); // XXX correct?
+fn get_jemalloc_stat(value_name: &str) -> Option<u64> {
+ // Before we request the measurement of interest, we first send an "epoch"
+ // request. Without that jemalloc gives cached statistics(!) which can be
+ // highly inaccurate.
+ let epoch_name = "epoch";
+ let epoch_c_name = CString::from_slice(epoch_name.as_bytes());
+ let mut epoch: u64 = 0;
+ let epoch_ptr = &mut epoch as *mut _ as *mut c_void;
+ let mut epoch_len = size_of::<u64>() as size_t;
+
+ let value_c_name = CString::from_slice(value_name.as_bytes());
+ let mut value: size_t = 0;
+ let value_ptr = &mut value as *mut _ as *mut c_void;
+ let mut value_len = size_of::<size_t>() as size_t;
+
+ // Using the same values for the `old` and `new` parameters is enough
+ // to get the statistics updated.
+ let rv = unsafe {
+ je_mallctl(epoch_c_name.as_ptr(), epoch_ptr, &mut epoch_len, epoch_ptr,
+ epoch_len)
+ };
+ if rv != 0 {
+ return None;
+ }
+
+ let rv = unsafe {
+ je_mallctl(value_c_name.as_ptr(), value_ptr, &mut value_len,
+ null_mut(), 0)
+ };
+ if rv != 0 {
+ return None;
}
- if rv == 0 { Some(old as u64) } else { None }
+
+ Some(value as u64)
}
// Like std::macros::try!, but for Option<>.
@@ -222,7 +244,7 @@ fn get_proc_self_statm_field(field: uint) -> Option<u64> {
match f.read_to_string() {
Ok(contents) => {
let s = option_try!(contents.as_slice().words().nth(field));
- let npages: u64 = option_try!(s.parse());
+ let npages: u64 = option_try!(s.parse().ok());
Some(npages * (page_size() as u64))
}
Err(_) => None
diff --git a/components/util/opts.rs b/components/util/opts.rs
index ae19723b975..d868d47dd92 100644
--- a/components/util/opts.rs
+++ b/components/util/opts.rs
@@ -13,9 +13,9 @@ use layers::geometry::DevicePixel;
use getopts;
use std::collections::HashSet;
use std::cmp;
-use std::io;
+use std::env;
+use std::old_io as io;
use std::mem;
-use std::os;
use std::ptr;
use std::rt;
@@ -27,8 +27,8 @@ pub struct Opts {
/// How many threads to use for CPU painting (`-t`).
///
- /// FIXME(pcwalton): This is not currently used. All painting is sequential.
- pub n_paint_threads: uint,
+ /// Note that painting is sequentialized when using GPU painting.
+ pub paint_threads: uint,
/// True to use GPU painting via Skia-GL, false to use CPU painting via Skia (`-g`). Note that
/// compositing is always done on the GPU.
@@ -75,6 +75,9 @@ pub struct Opts {
/// True if we should show borders on all fragments for debugging purposes (`--show-debug-fragment-borders`).
pub show_debug_fragment_borders: bool,
+ /// True if we should paint tiles with overlays based on which thread painted them.
+ pub show_debug_parallel_paint: bool,
+
/// If set with --disable-text-aa, disable antialiasing on fonts. This is primarily useful for reftests
/// where pixel perfect results are required when using fonts such as the Ahem
/// font for layout tests.
@@ -128,6 +131,7 @@ pub fn print_debug_usage(app: &str) {
print_option("profile-tasks", "Instrument each task, writing the output to a file.");
print_option("show-compositor-borders", "Paint borders along layer and tile boundaries.");
print_option("show-fragment-borders", "Paint borders along fragment boundaries.");
+ print_option("show-parallel-paint", "Overlay tiles with colors showing which thread painted them.");
print_option("trace-layout", "Write layout trace to an external file for debugging.");
print_option("validate-display-list-geometry",
"Display an error when display list geometry escapes overflow region.");
@@ -137,7 +141,7 @@ pub fn print_debug_usage(app: &str) {
fn args_fail(msg: &str) {
io::stderr().write_line(msg).unwrap();
- os::set_exit_status(1);
+ env::set_exit_status(1);
}
// Always use CPU painting on android.
@@ -151,7 +155,7 @@ static FORCE_CPU_PAINTING: bool = false;
pub fn default_opts() -> Opts {
Opts {
urls: vec!(),
- n_paint_threads: 1,
+ paint_threads: 1,
gpu_painting: false,
tile_size: 512,
device_pixels_per_px: None,
@@ -166,6 +170,7 @@ pub fn default_opts() -> Opts {
bubble_inline_sizes_separately: false,
show_debug_borders: false,
show_debug_fragment_borders: false,
+ show_debug_parallel_paint: false,
enable_text_antialiasing: false,
trace_layout: false,
devtools_port: None,
@@ -219,11 +224,11 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
return false;
};
- let mut debug_options = HashSet::new();
let debug_string = match opt_match.opt_str("Z") {
Some(string) => string,
None => String::new()
};
+ let mut debug_options = HashSet::new();
for split in debug_string.as_slice().split(',') {
debug_options.insert(split.clone());
}
@@ -249,9 +254,9 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
ScaleFactor(dppx_str.parse().unwrap())
);
- let mut n_paint_threads: uint = match opt_match.opt_str("t") {
- Some(n_paint_threads_str) => n_paint_threads_str.parse().unwrap(),
- None => 1, // FIXME: Number of cores.
+ let mut paint_threads: uint = match opt_match.opt_str("t") {
+ Some(paint_threads_str) => paint_threads_str.parse().unwrap(),
+ None => cmp::max(rt::default_sched_threads() * 3 / 4, 1),
};
// If only the flag is present, default to a 5 second period for both profilers.
@@ -274,7 +279,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
let mut bubble_inline_sizes_separately = debug_options.contains(&"bubble-widths");
let trace_layout = debug_options.contains(&"trace-layout");
if trace_layout {
- n_paint_threads = 1;
+ paint_threads = 1;
layout_threads = 1;
bubble_inline_sizes_separately = true;
}
@@ -295,7 +300,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
let opts = Opts {
urls: urls,
- n_paint_threads: n_paint_threads,
+ paint_threads: paint_threads,
gpu_painting: gpu_painting,
tile_size: tile_size,
device_pixels_per_px: device_pixels_per_px,
@@ -315,6 +320,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
user_agent: opt_match.opt_str("u"),
show_debug_borders: debug_options.contains(&"show-compositor-borders"),
show_debug_fragment_borders: debug_options.contains(&"show-fragment-borders"),
+ show_debug_parallel_paint: debug_options.contains(&"show-parallel-paint"),
enable_text_antialiasing: !debug_options.contains(&"disable-text-aa"),
dump_flow_tree: debug_options.contains(&"dump-flow-tree"),
validate_display_list_geometry: debug_options.contains(&"validate-display-list-geometry"),
diff --git a/components/util/range.rs b/components/util/range.rs
index 8c217beb218..dba80b458f2 100644
--- a/components/util/range.rs
+++ b/components/util/range.rs
@@ -9,7 +9,7 @@ use std::num;
use std::num::Int;
/// An index type to be used by a `Range`
-pub trait RangeIndex: Int + fmt::Show {
+pub trait RangeIndex: Int + fmt::Debug {
type Index;
fn new(x: Self::Index) -> Self;
fn get(self) -> Self::Index;
@@ -28,7 +28,7 @@ impl RangeIndex for int {
#[macro_export]
macro_rules! int_range_index {
($(#[$attr:meta])* struct $Self:ident($T:ty)) => (
- #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Show, Copy)]
+ #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Copy)]
$(#[$attr])*
pub struct $Self(pub $T);
@@ -194,7 +194,7 @@ pub struct Range<I> {
length: I,
}
-impl<I: RangeIndex> fmt::Show for Range<I> {
+impl<I: RangeIndex> fmt::Debug for Range<I> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[{:?} .. {:?})", self.begin(), self.end())
}
diff --git a/components/util/resource_files.rs b/components/util/resource_files.rs
index c5afbaeee56..c1defd887f0 100644
--- a/components/util/resource_files.rs
+++ b/components/util/resource_files.rs
@@ -2,16 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use std::io::{File, IoResult};
-use std::path::Path;
-
-#[cfg(not(target_os = "android"))]
-use opts;
-
-#[cfg(not(target_os = "android"))]
-use std::io::fs::PathExtensions;
-#[cfg(not(target_os = "android"))]
-use std::os;
+use std::old_io::{File, IoResult};
+use std::old_path::Path;
#[cfg(target_os = "android")]
pub fn resources_dir_path() -> Path {
@@ -20,13 +12,18 @@ pub fn resources_dir_path() -> Path {
#[cfg(not(target_os = "android"))]
pub fn resources_dir_path() -> Path {
+ use opts;
+ use std::env;
+ use std::old_io::fs::PathExtensions;
+
match opts::get().resources_path {
Some(ref path) => Path::new(path),
None => {
// FIXME: Find a way to not rely on the executable being
// under `<servo source>/components/servo/target`
// or `<servo source>/components/servo/target/release`.
- let mut path = os::self_exe_path().expect("can't get exe path");
+ let mut path = env::current_exe().ok().expect("can't get exe path");
+ path.pop();
path.pop();
path.pop();
path.pop();
diff --git a/components/util/smallvec.rs b/components/util/smallvec.rs
index efd1bfc7f35..14d983376e8 100644
--- a/components/util/smallvec.rs
+++ b/components/util/smallvec.rs
@@ -44,7 +44,7 @@ impl<T> VecLike<T> for Vec<T> {
#[inline]
fn vec_slice_mut<'a>(&'a mut self, start: uint, end: uint) -> &'a mut [T] {
- self.slice_mut(start, end)
+ &mut self[start..end]
}
}
@@ -325,7 +325,7 @@ impl<'a, T: 'a> Iterator for SmallVecMoveIterator<'a,T> {
impl<'a, T: 'a> Drop for SmallVecMoveIterator<'a,T> {
fn drop(&mut self) {
// Destroy the remaining elements.
- for _ in *self {}
+ for _ in self.by_ref() {}
match self.allocation {
None => {}
@@ -410,7 +410,7 @@ macro_rules! def_small_vector(
}
impl<T> FromIterator<T> for $name<T> {
- fn from_iter<I: Iterator<Item=T>>(mut iter: I) -> $name<T> {
+ fn from_iter<I: Iterator<Item=T>>(iter: I) -> $name<T> {
let mut v = $name::new();
let (lower_size_bound, _) = iter.size_hint();
@@ -428,7 +428,7 @@ macro_rules! def_small_vector(
}
impl<T> $name<T> {
- pub fn extend<I: Iterator<Item=T>>(&mut self, mut iter: I) {
+ pub fn extend<I: Iterator<Item=T>>(&mut self, iter: I) {
let (lower_size_bound, _) = iter.size_hint();
let target_len = self.len() + lower_size_bound;
@@ -443,7 +443,7 @@ macro_rules! def_small_vector(
}
}
- impl<T: fmt::Show> fmt::Show for $name<T> {
+ impl<T: fmt::Debug> fmt::Debug for $name<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self.as_slice())
}
diff --git a/components/util/str.rs b/components/util/str.rs
index e0642abdffe..80cdd1ae230 100644
--- a/components/util/str.rs
+++ b/components/util/str.rs
@@ -68,7 +68,7 @@ pub static HTML_SPACE_CHARACTERS: StaticCharVec = &[
];
pub fn split_html_space_chars<'a>(s: &'a str) ->
- Filter<&'a str, Split<'a, StaticCharVec>, fn(&&str) -> bool> {
+ Filter<Split<'a, StaticCharVec>, fn(&&str) -> bool> {
fn not_empty(&split: &&str) -> bool { !split.is_empty() }
s.split(HTML_SPACE_CHARACTERS).filter(not_empty as fn(&&str) -> bool)
}
@@ -149,7 +149,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
return LengthOrPercentageOrAuto::Auto
}
if value.starts_with("+") {
- value = value.slice_from(1)
+ value = &value[1..]
}
value = value.trim_left_matches('0');
if value.len() == 0 {
@@ -176,19 +176,19 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
}
}
}
- value = value.slice_to(end_index);
+ value = &value[..end_index];
if found_percent {
- let result: Option<f64> = FromStr::from_str(value);
+ let result: Result<f64, _> = FromStr::from_str(value);
match result {
- Some(number) => return LengthOrPercentageOrAuto::Percentage((number as f64) / 100.0),
- None => return LengthOrPercentageOrAuto::Auto,
+ Ok(number) => return LengthOrPercentageOrAuto::Percentage((number as f64) / 100.0),
+ Err(_) => return LengthOrPercentageOrAuto::Auto,
}
}
match FromStr::from_str(value) {
- Some(number) => LengthOrPercentageOrAuto::Length(Au::from_px(number)),
- None => LengthOrPercentageOrAuto::Auto,
+ Ok(number) => LengthOrPercentageOrAuto::Length(Au::from_px(number)),
+ Err(_) => LengthOrPercentageOrAuto::Auto,
}
}
@@ -245,14 +245,14 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
// Step 8.
for (char_count, (index, _)) in input.char_indices().enumerate() {
if char_count == 128 {
- input = input.slice_to(index);
+ input = &input[..index];
break
}
}
// Step 9.
if input.char_at(0) == '#' {
- input = input.slice_from(1)
+ input = &input[1..]
}
// Step 10.
@@ -273,23 +273,23 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
// Step 12.
let mut length = input.len() / 3;
- let (mut red, mut green, mut blue) = (input.slice_to(length),
- input.slice(length, length * 2),
- input.slice_from(length * 2));
+ let (mut red, mut green, mut blue) = (&input[..length],
+ &input[length..length * 2],
+ &input[length * 2..]);
// Step 13.
if length > 8 {
- red = red.slice_from(length - 8);
- green = green.slice_from(length - 8);
- blue = blue.slice_from(length - 8);
+ red = &red[length - 8..];
+ green = &green[length - 8..];
+ blue = &blue[length - 8..];
length = 8
}
// Step 14.
while length > 2 && red[0] == b'0' && green[0] == b'0' && blue[0] == b'0' {
- red = red.slice_from(1);
- green = green.slice_from(1);
- blue = blue.slice_from(1);
+ red = &red[1..];
+ green = &green[1..];
+ blue = &blue[1..];
length -= 1
}
@@ -324,7 +324,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
}
-#[derive(Clone, Eq, PartialEq, Hash, Show)]
+#[derive(Clone, Eq, PartialEq, Hash, Debug)]
pub struct LowercaseString {
inner: String,
}
diff --git a/components/util/task_state.rs b/components/util/task_state.rs
index ef1dbb2ed3e..290f2a08166 100644
--- a/components/util/task_state.rs
+++ b/components/util/task_state.rs
@@ -11,7 +11,7 @@
pub use self::imp::{initialize, get, enter, exit};
bitflags! {
- #[derive(Show)]
+ #[derive(Debug)]
flags TaskState: u32 {
const SCRIPT = 0x01,
const LAYOUT = 0x02,
diff --git a/components/util/tid.rs b/components/util/tid.rs
index e52dbf7fd61..7351f85f085 100644
--- a/components/util/tid.rs
+++ b/components/util/tid.rs
@@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
+use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use std::rc::Rc;
use std::cell::RefCell;
-static mut next_tid: AtomicUint = ATOMIC_UINT_INIT;
+static mut next_tid: AtomicUsize = ATOMIC_USIZE_INIT;
thread_local!(static TASK_LOCAL_TID: Rc<RefCell<Option<uint>>> = Rc::new(RefCell::new(None)));
diff --git a/components/util/time.rs b/components/util/time.rs
index 8165d316f9e..0a255f45bea 100644
--- a/components/util/time.rs
+++ b/components/util/time.rs
@@ -8,7 +8,7 @@ use collections::BTreeMap;
use std::borrow::ToOwned;
use std::cmp::Ordering;
use std::f64;
-use std::io::timer::sleep;
+use std::old_io::timer::sleep;
use std::iter::AdditiveIterator;
use std::num::Float;
use std::sync::mpsc::{Sender, channel, Receiver};
@@ -46,7 +46,7 @@ impl Formatable for Option<TimerMetadata> {
&Some(ref meta) => {
let url = meta.url.as_slice();
let url = if url.len() > 30 {
- url.slice_to(30)
+ &url[..30]
} else {
url
};
diff --git a/components/util/vec.rs b/components/util/vec.rs
index a902a3133df..f612726d129 100644
--- a/components/util/vec.rs
+++ b/components/util/vec.rs
@@ -5,7 +5,7 @@
use std::cmp::{PartialOrd, PartialEq, Ordering};
#[cfg(test)]
-use std::fmt::Show;
+use std::fmt::Debug;
/// FIXME(pcwalton): Workaround for lack of unboxed closures. This is called in
/// performance-critical code, so a closure is insufficient.
@@ -74,7 +74,7 @@ fn test_find_all_elems<T: PartialEq + PartialOrd + Eq + Ord>(arr: &[T]) {
}
#[cfg(test)]
-fn test_miss_all_elems<T: PartialEq + PartialOrd + Eq + Ord + Show>(arr: &[T], misses: &[T]) {
+fn test_miss_all_elems<T: PartialEq + PartialOrd + Eq + Ord + Debug>(arr: &[T], misses: &[T]) {
let mut i = 0;
while i < misses.len() {
let res = arr.binary_search_(&misses[i]);
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs
index 5cac6d71d70..69fbce97b7e 100644
--- a/components/util/workqueue.rs
+++ b/components/util/workqueue.rs
@@ -11,9 +11,8 @@ use task::spawn_named;
use task_state;
use libc::funcs::posix88::unistd::usleep;
-use rand::{Rng, XorShiftRng};
use std::mem;
-use std::rand::weak_rng;
+use rand::{Rng, weak_rng, XorShiftRng};
use std::sync::atomic::{AtomicUint, Ordering};
use std::sync::mpsc::{channel, Sender, Receiver};
use deque::{Abort, BufferPool, Data, Empty, Stealer, Worker};
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index 5bd80d94d98..10937d19430 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -3,15 +3,19 @@ name = "embedding"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
+ "compositing 0.0.1",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
"devtools 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
+ "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glutin_app 0.0.1",
"js 0.1.0 (git+https://github.com/servo/rust-mozjs)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
@@ -20,13 +24,14 @@ dependencies = [
"servo 0.0.1",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"style 0.0.1",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "android_glue"
version = "0.0.1"
-source = "git+https://github.com/tomaka/android-rs-glue#7e930d2822adb791a515c24dfefe6ae37493f40f"
+source = "git+https://github.com/tomaka/android-rs-glue#f9da46ed02736508d75333008d54506eec87a33b"
dependencies = [
"compile_msg 0.1.3 (git+https://github.com/huonw/compile_msg)",
]
@@ -34,7 +39,7 @@ dependencies = [
[[package]]
name = "azure"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-azure#779233af589e797f07e9e2f3f45017fb55c33c68"
+source = "git+https://github.com/servo/rust-azure#ec5fddfe96f889e35cc83abd2255f8325f2ec147"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -42,16 +47,23 @@ dependencies = [
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
]
[[package]]
+name = "bitflags"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "canvas"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "gfx 0.0.1",
"util 0.0.1",
]
@@ -66,7 +78,11 @@ dependencies = [
[[package]]
name = "cocoa"
version = "0.1.1"
-source = "git+https://github.com/servo/rust-cocoa#84a405ba9ff2a79d507dc6ee1ea3cf9bf48706d1"
+source = "git+https://github.com/servo/rust-cocoa#7768a8f6af73d132b68e5cad6a0d81ec54102abe"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "compile_msg"
@@ -80,7 +96,6 @@ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
- "devtools 0.0.1",
"devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
@@ -91,26 +106,26 @@ dependencies = [
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"script_traits 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "cookie"
-version = "0.1.8"
-source = "git+https://github.com/servo/cookie-rs?branch=lenientparse_backport#47ffa4d3c6f85d28f222d6e1d54635fff5622ea3"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core_foundation"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-core-foundation#ce3d852765827b64a0d5fb2aadd77da39665b0b0"
+source = "git+https://github.com/servo/rust-core-foundation#da9a52655fce4727dcf261d6ed9a49eeddc7b131"
[[package]]
name = "core_graphics"
@@ -123,7 +138,7 @@ dependencies = [
[[package]]
name = "core_text"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-core-text#b5cb33905350e99b2a19f5a22f7b1efea7ad48c2"
+source = "git+https://github.com/servo/rust-core-text#e769be9cb3366f9d403ddbee040e031ce03d32bb"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -132,9 +147,9 @@ dependencies = [
[[package]]
name = "cssparser"
version = "0.2.0"
-source = "git+https://github.com/servo/rust-cssparser#d7d50ae2a7da4aca1b2c4d248139510c8e9a25c6"
+source = "git+https://github.com/servo/rust-cssparser#cf59a4cf55b6386db255d6205b9804d8d74efd35"
dependencies = [
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -145,6 +160,8 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"msg 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -153,29 +170,31 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "egl"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-egl#cd74c82a8537090edb6c16478e2261db2a8c0b4f"
+source = "git+https://github.com/servo/rust-egl#328e79b6256dea346f1821ccc4215e95fd1d58bc"
[[package]]
name = "encoding"
-version = "0.2.18"
+version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "encoding-index-japanese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-korean 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-simpchinese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-singlebyte 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-tradchinese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-japanese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-korean 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-simpchinese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-singlebyte 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-tradchinese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-japanese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -183,7 +202,7 @@ dependencies = [
[[package]]
name = "encoding-index-korean"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -191,7 +210,7 @@ dependencies = [
[[package]]
name = "encoding-index-simpchinese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -199,7 +218,7 @@ dependencies = [
[[package]]
name = "encoding-index-singlebyte"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -207,7 +226,7 @@ dependencies = [
[[package]]
name = "encoding-index-tradchinese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -221,12 +240,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "expat-sys"
version = "2.1.0"
-source = "git+https://github.com/servo/libexpat#da2ddaf78cbef836b8790807bb76b357c58df3a1"
+source = "git+https://github.com/servo/libexpat#fe8c3222efdd486b95ef198ef4eee0506e37a809"
[[package]]
name = "fontconfig"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-fontconfig#f42ff5cbd0404fe4d2cd64e8d9bb6307bad8fd7c"
+source = "git+https://github.com/servo/rust-fontconfig#91195bd29daa9280680bb28ba556821d504a17c6"
dependencies = [
"fontconfig-sys 2.11.1 (git+https://github.com/servo/libfontconfig)",
]
@@ -234,7 +253,7 @@ dependencies = [
[[package]]
name = "fontconfig-sys"
version = "2.11.1"
-source = "git+https://github.com/servo/libfontconfig#fcc324d2c8175d2e8e8c0aab032c03a404809f6d"
+source = "git+https://github.com/servo/libfontconfig#adc60cacbca697123f4535ce2ff07619ec013cec"
dependencies = [
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
@@ -243,33 +262,45 @@ dependencies = [
[[package]]
name = "freetype"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-freetype#ec0231343a3ad360d86846c12895a0a0cbb19f79"
+source = "git+https://github.com/servo/rust-freetype#f65e8d82550b5d5b06a7785a13a008e125c30b7a"
[[package]]
name = "freetype-sys"
version = "2.4.11"
-source = "git+https://github.com/servo/libfreetype2#f5c49c0da1d5bc6b206c4176344012ac37524243"
+source = "git+https://github.com/servo/libfreetype2#7b9d112c0a93574b4bf518922d16b8879c7aadae"
[[package]]
name = "gcc"
-version = "0.1.4"
-source = "git+https://github.com/alexcrichton/gcc-rs#f5c52d956e0742a66e40c8301e634e136c3ae287"
+version = "0.1.7"
+source = "git+https://github.com/alexcrichton/gcc-rs#016cc1597bbe52c26e41cf687476ba93f27fec41"
[[package]]
name = "gcc"
-version = "0.1.4"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "gdi32-sys"
+version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "geom"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-geom#a4a4a03aa024412bf3f4e093c0198b433c6ad63f"
+source = "git+https://github.com/servo/rust-geom#6b079ba2738ed15bac2b6ec66850494afb9f2b4c"
+dependencies = [
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "gfx"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
@@ -282,134 +313,131 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"style 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "gl_common"
-version = "0.0.3"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
-
-[[package]]
-name = "gl_common"
-version = "0.0.3"
+version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "gl_generator"
-version = "0.0.12"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "khronos_api 0.0.5 (git+https://github.com/bjz/gl-rs.git)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "xml-rs 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gl_generator"
-version = "0.0.12"
+version = "0.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gl_common 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "xml-rs 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "xml-rs 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gleam"
version = "0.0.1"
-source = "git+https://github.com/servo/gleam#375779e0e8e1eaa8ff1a732c81fa91808a7f6c63"
+source = "git+https://github.com/servo/gleam#1a85194298997cf602270d4c1aeb0a043ce339e7"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "gl_generator 0.0.12 (git+https://github.com/bjz/gl-rs.git)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glutin"
-version = "0.0.4-pre"
-source = "git+https://github.com/servo/glutin?branch=servo#3814e0cadc85f558b7a417c9d4b97337382aeb36"
+version = "0.0.4"
+source = "git+https://github.com/servo/glutin?branch=servo#40591806dc7382ddb75d90f2289127f5f28f9825"
dependencies = [
"android_glue 0.0.1 (git+https://github.com/tomaka/android-rs-glue)",
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
- "gl_common 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "gl_generator 0.0.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "khronos_api 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gdi32-sys 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "user32-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glutin_app"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"compositing 0.0.1",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
- "glutin 0.0.4-pre (git+https://github.com/servo/glutin?branch=servo)",
+ "glutin 0.0.4 (git+https://github.com/servo/glutin?branch=servo)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "glx"
version = "0.0.1"
-source = "git+https://github.com/servo/rust-glx#f056a8998987f6f081f9ad7fa396beb1b2988c02"
+source = "git+https://github.com/servo/rust-glx#d8a3329d1f68dc4cf72509daca7ef837b8ce94d6"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "gl_generator 0.0.12 (git+https://github.com/bjz/gl-rs.git)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "harfbuzz"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-harfbuzz#59b5b18087418404d661784934c3d864386024b5"
+source = "git+https://github.com/servo/rust-harfbuzz#d5833511875673aa994ca194922acb3b1ea3ec61"
[[package]]
name = "html5ever"
version = "0.0.0"
-source = "git+https://github.com/servo/html5ever#d35dfaaf0d85007057a299afc370d07e92538944"
+source = "git+https://github.com/servo/html5ever#1c8c09934657fa8edb8ac94070a9061bc040621d"
dependencies = [
"html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)",
- "phf 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_mac 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_macros 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "html5ever_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/html5ever#d35dfaaf0d85007057a299afc370d07e92538944"
+source = "git+https://github.com/servo/html5ever#1c8c09934657fa8edb8ac94070a9061bc040621d"
[[package]]
name = "hyper"
-version = "0.1.1"
-source = "git+https://github.com/servo/hyper?branch=old_servo_new_cookies#7a346f481d683705709526594aa5f13b5c923bc1"
+version = "0.1.10"
+source = "git+https://github.com/servo/hyper?branch=servo#1f5547c4b7fd29781426f82dd857a96f1478b01c"
dependencies = [
- "cookie 0.1.8 (git+https://github.com/servo/cookie-rs?branch=lenientparse_backport)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "mime 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "mucell 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicase 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "unsafe-any 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cookie 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mime 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mucell 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicase 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unsafe-any 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -426,12 +454,21 @@ dependencies = [
[[package]]
name = "js"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-mozjs#6cabb12f858f27d23fc3d2d9f0c334b80eb56573"
+source = "git+https://github.com/servo/rust-mozjs#db08a4eacdb3d92df9a38c8a5d7ad1e1ee0fef4e"
dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs-sys 0.0.0 (git+https://github.com/servo/mozjs)",
]
[[package]]
+name = "kernel32-sys"
+version = "0.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "khronos_api"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -439,12 +476,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "khronos_api"
version = "0.0.5"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "layers"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-layers#253fd0eb7e49b356393e14abdf34c76152cba10f"
+source = "git+https://github.com/servo/rust-layers#62870a30b06fb8776e01140167e55d1f2370b503"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
@@ -454,6 +491,7 @@ dependencies = [
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
]
@@ -462,20 +500,26 @@ dependencies = [
name = "layout"
version = "0.0.1"
dependencies = [
+ "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"layout_traits 0.0.1",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
+ "png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -492,24 +536,26 @@ dependencies = [
[[package]]
name = "lazy_static"
-version = "0.1.6"
-source = "git+https://github.com/Kimundi/lazy-static.rs#31a7aa0176ecd70b4aab274a40d1e2cd78c1fbf8"
+version = "0.1.7"
+source = "git+https://github.com/Kimundi/lazy-static.rs#b48b0c551087af9d598a0452f4e3973d98d4419b"
+
+[[package]]
+name = "libc"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libressl-pnacl-sys"
-version = "2.1.0"
+version = "2.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "pnacl-build-helper 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pnacl-build-helper 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
-version = "0.1.9"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "regex 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "matches"
@@ -518,98 +564,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mime"
-version = "0.0.6"
+version = "0.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mod_path"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mozjs-sys"
version = "0.0.0"
-source = "git+https://github.com/servo/mozjs#58ee8869c7e589244ab2eb3a3ad15e2b64498428"
+source = "git+https://github.com/servo/mozjs#2267d10685f101438e4f9e8bdfeb9964214dbeeb"
[[package]]
name = "msg"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"style 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "mucell"
-version = "0.1.10"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "net"
version = "0.0.1"
dependencies = [
- "cookie 0.1.8 (git+https://github.com/servo/cookie-rs?branch=lenientparse_backport)",
+ "cookie 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "openssl"
-version = "0.2.15"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
-version = "0.2.16"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libressl-pnacl-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf"
-version = "0.4.9"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
-name = "phf_mac"
-version = "0.4.9"
+name = "phf_macros"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf_shared"
-version = "0.4.9"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
-version = "0.1.1"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -618,57 +668,64 @@ version = "0.0.1"
[[package]]
name = "pnacl-build-helper"
-version = "1.0.0"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "png"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-png#ade2143c96641abdaedd8bc556f45935d18c35df"
+source = "git+https://github.com/servo/rust-png#687f103498654815682d2a750f26bbefc46d9da4"
dependencies = [
- "gcc 0.1.4 (git+https://github.com/alexcrichton/gcc-rs)",
+ "gcc 0.1.7 (git+https://github.com/alexcrichton/gcc-rs)",
"png-sys 1.6.16 (git+https://github.com/servo/rust-png)",
]
[[package]]
name = "png-sys"
version = "1.6.16"
-source = "git+https://github.com/servo/rust-png#ade2143c96641abdaedd8bc556f45935d18c35df"
+source = "git+https://github.com/servo/rust-png#687f103498654815682d2a750f26bbefc46d9da4"
[[package]]
-name = "regex"
-version = "0.1.10"
+name = "rand"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "rustc-serialize"
-version = "0.2.7"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "script"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"devtools_traits 0.0.1",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"html5ever 0.0.0 (git+https://github.com/servo/html5ever)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"js 0.1.0 (git+https://github.com/servo/rust-mozjs)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
- "uuid 0.1.7 (git+https://github.com/rust-lang/uuid)",
+ "uuid 0.1.9 (git+https://github.com/rust-lang/uuid)",
]
[[package]]
@@ -677,9 +734,10 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -687,6 +745,7 @@ dependencies = [
name = "servo"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compositing 0.0.1",
"devtools 0.0.1",
"gfx 0.0.1",
@@ -696,15 +755,15 @@ dependencies = [
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"script 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "skia"
version = "0.0.20130412"
-source = "git+https://github.com/servo/skia?branch=upstream-2014-06-16#387777643df6df6ce8fb61ce069c7c60b32ab38c"
+source = "git+https://github.com/servo/skia?branch=upstream-2014-06-16#76b626df0d6cfb32eb1ee5ba3c7b52aadd5a42e3"
dependencies = [
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
@@ -713,16 +772,16 @@ dependencies = [
[[package]]
name = "stb_image"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-stb-image#2ba03a447b9ef101c25e07bb7f8876416e5fcd71"
+source = "git+https://github.com/servo/rust-stb-image#8fb5031333ea142802724719ce20bfa132bc4802"
[[package]]
name = "string_cache"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#43a1e5d0d0f2a45e2b96160c8fbe6e1d9602cfa9"
+source = "git+https://github.com/servo/string-cache#12b84faff894d358a546bf064b0daf5f04f2a96b"
dependencies = [
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
- "phf 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_mac 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "phf 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_macros 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"xxhash 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -730,26 +789,27 @@ dependencies = [
[[package]]
name = "string_cache_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#43a1e5d0d0f2a45e2b96160c8fbe6e1d9602cfa9"
+source = "git+https://github.com/servo/string-cache#12b84faff894d358a546bf064b0daf5f04f2a96b"
dependencies = [
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
]
[[package]]
name = "style"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "mod_path 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mod_path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -764,69 +824,91 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "time"
-version = "0.1.12"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicase"
-version = "0.0.2"
+version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unsafe-any"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "url"
-version = "0.2.16"
+version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "user32-sys"
+version = "0.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "util"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "uuid"
-version = "0.1.7"
-source = "git+https://github.com/rust-lang/uuid#3ea51ffa0682c820e8c8b505de078e3bc93e2cb3"
+version = "0.1.9"
+source = "git+https://github.com/rust-lang/uuid#3128649cde7c4ba390b31298093d6c181a23eb61"
dependencies = [
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi"
-version = "0.0.5"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "xlib"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-xlib#138b0e281b9fd64f7d2e17080fa9a2d4a8554313"
+source = "git+https://github.com/servo/rust-xlib#4f1bfc476256c37a152980d42213116a62629599"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "xml-rs"
-version = "0.1.12"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "xxhash"
diff --git a/ports/cef/Cargo.toml b/ports/cef/Cargo.toml
index 87d6c7c141e..2399c8c7088 100644
--- a/ports/cef/Cargo.toml
+++ b/ports/cef/Cargo.toml
@@ -17,6 +17,9 @@ path = "../glutin"
[dependencies.plugins]
path = "../../components/plugins"
+[dependencies.compositing]
+path = "../../components/compositing"
+
[dependencies.gfx]
path = "../../components/gfx"
@@ -64,3 +67,13 @@ git = "https://github.com/servo/rust-core-text"
[dependencies.cocoa]
git = "https://github.com/servo/rust-cocoa"
+
+[dependencies.gleam]
+git = "https://github.com/servo/gleam"
+
+[dependencies.cgl]
+git = "https://github.com/servo/rust-cgl"
+
+[dependencies]
+url = "*"
+libc = "*" \ No newline at end of file
diff --git a/ports/cef/browser.rs b/ports/cef/browser.rs
index 76f2c42f31b..f572ebe86c0 100644
--- a/ports/cef/browser.rs
+++ b/ports/cef/browser.rs
@@ -17,7 +17,7 @@ use glutin_app;
use libc::c_int;
use util::opts;
use std::borrow::ToOwned;
-use std::cell::{Cell, RefCell};
+use std::cell::{Cell, RefCell, BorrowState};
use std::sync::atomic::{AtomicInt, Ordering};
thread_local!(pub static ID_COUNTER: AtomicInt = AtomicInt::new(0));
@@ -144,19 +144,19 @@ impl ServoCefBrowserExtensions for CefBrowser {
self.downcast().message_queue.borrow_mut().push(event);
loop {
- match self.downcast().servo_browser.try_borrow_mut() {
- None => {
- // We're trying to send an event while processing another one. This will
- // cause general badness, so queue up that event instead of immediately
- // processing it.
- break
- }
- Some(ref mut browser) => {
+ match self.downcast().servo_browser.borrow_state() {
+ BorrowState::Unused => {
let event = match self.downcast().message_queue.borrow_mut().pop() {
None => return,
Some(event) => event,
};
- browser.handle_event(event);
+ self.downcast().servo_browser.borrow_mut().handle_event(event);
+ }
+ _ => {
+ // We're trying to send an event while processing another one. This will
+ // cause general badness, so queue up that event instead of immediately
+ // processing it.
+ break
}
}
}
diff --git a/ports/cef/browser_host.rs b/ports/cef/browser_host.rs
index 7b2d3f2c691..a12c0402da4 100644
--- a/ports/cef/browser_host.rs
+++ b/ports/cef/browser_host.rs
@@ -12,7 +12,7 @@ use compositing::windowing::{WindowEvent, MouseWindowEvent};
use geom::point::TypedPoint2D;
use geom::size::TypedSize2D;
use libc::{c_double, c_int};
-use servo_msg::constellation_msg::{self, KeyModifiers, KeyState};
+use msg::constellation_msg::{self, KeyModifiers, KeyState};
use std::cell::RefCell;
pub struct ServoCefBrowserHost {
diff --git a/ports/cef/command_line.rs b/ports/cef/command_line.rs
index 393b3d62004..6b0d91d4130 100644
--- a/ports/cef/command_line.rs
+++ b/ports/cef/command_line.rs
@@ -33,7 +33,7 @@ fn command_line_new() -> *mut command_line_t {
pub fn command_line_init(argc: c_int, argv: *const *const u8) {
unsafe {
let mut a: Vec<String> = vec!();
- for i in range(0u, argc as uint) {
+ for i in 0u..(argc as uint) {
let offset = *argv.offset(i as int) as *const c_char;
let slice = ffi::c_str_to_bytes(&offset);
let s = str::from_utf8(slice).unwrap();
@@ -58,7 +58,7 @@ pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, na
let cl: *mut command_line_t = mem::transmute(cmd);
let cs: *const cef_string_utf16_t = mem::transmute(name);
let buf = (*cs).str as *const _;
- let slice = slice::from_raw_buf(&buf, (*cs).length as usize);
+ let slice = slice::from_raw_parts(buf, (*cs).length as usize);
let opt = String::from_utf16(slice).unwrap();
//debug!("opt: {}", opt);
for s in (*cl).argv.iter() {
@@ -66,7 +66,7 @@ pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, na
//debug!("arg: {}", o);
if o.as_slice().starts_with(opt.as_slice()) {
let mut string = mem::uninitialized();
- let arg = o.slice_from(opt.len() + 1).as_bytes();
+ let arg = o[opt.len() + 1..].as_bytes();
let c_str = ffi::CString::from_slice(arg);
cef_string_utf16_set(c_str.as_bytes().as_ptr() as *const _,
arg.len() as size_t,
diff --git a/ports/cef/core.rs b/ports/cef/core.rs
index a5c22fc6faf..4db155b36b3 100644
--- a/ports/cef/core.rs
+++ b/ports/cef/core.rs
@@ -60,10 +60,20 @@ pub extern "C" fn cef_initialize(args: *const cef_main_args_t,
}
}
+ let rendering_threads = unsafe {
+ if ((*settings).rendering_threads as uint) < 1 {
+ 1
+ } else if (*settings).rendering_threads as uint > MAX_RENDERING_THREADS {
+ MAX_RENDERING_THREADS
+ } else {
+ (*settings).rendering_threads as uint
+ }
+ };
+
let urls = vec![HOME_URL.to_owned()];
opts::set_opts(opts::Opts {
urls: urls,
- n_paint_threads: 1,
+ paint_threads: rendering_threads,
gpu_painting: false,
tile_size: 512,
device_pixels_per_px: None,
@@ -71,21 +81,14 @@ pub extern "C" fn cef_initialize(args: *const cef_main_args_t,
memory_profiler_period: None,
enable_experimental: false,
nonincremental_layout: false,
- layout_threads: unsafe {
- if ((*settings).rendering_threads as uint) < 1 {
- 1
- } else if (*settings).rendering_threads as uint > MAX_RENDERING_THREADS {
- MAX_RENDERING_THREADS
- } else {
- (*settings).rendering_threads as uint
- }
- },
+ layout_threads: rendering_threads,
output_file: None,
headless: false,
hard_fail: false,
bubble_inline_sizes_separately: false,
show_debug_borders: false,
show_debug_fragment_borders: false,
+ show_debug_parallel_paint: false,
enable_text_antialiasing: true,
trace_layout: false,
devtools_port: None,
diff --git a/ports/cef/eutil.rs b/ports/cef/eutil.rs
index 9ba9852e051..d6bf20b780f 100644
--- a/ports/cef/eutil.rs
+++ b/ports/cef/eutil.rs
@@ -21,7 +21,7 @@ pub trait Downcast<Class> {
pub fn slice_to_str<F>(s: *const u8, l: uint, f: F) -> c_int where F: FnOnce(&str) -> c_int {
unsafe {
- let s = slice::from_raw_buf(&s, l);
+ let s = slice::from_raw_parts(s, l);
str::from_utf8(s).map(f).unwrap_or(0)
}
}
diff --git a/ports/cef/lib.rs b/ports/cef/lib.rs
index c2a9433ddac..cafeeefe71f 100644
--- a/ports/cef/lib.rs
+++ b/ports/cef/lib.rs
@@ -2,9 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(thread_local, link_args, plugin, box_syntax, int_uint)]
+#![feature(int_uint)]
+#![feature(box_syntax)]
+#![feature(plugin)]
+#![feature(link_args)]
+#![feature(thread_local)]
+#![feature(unicode)]
+#![feature(core)]
+#![feature(std_misc)]
+#![feature(rustc_private)]
+#![feature(collections)]
-#![allow(experimental, non_camel_case_types, unstable)]
+#![allow(non_camel_case_types)]
#[macro_use]
extern crate log;
@@ -23,9 +32,10 @@ extern crate js;
extern crate layers;
extern crate png;
extern crate script;
+extern crate unicode;
-extern crate "net" as servo_net;
-extern crate "msg" as servo_msg;
+extern crate net;
+extern crate msg;
extern crate util;
extern crate style;
extern crate stb_image;
diff --git a/ports/cef/string.rs b/ports/cef/string.rs
index efc35744434..4ad1d00a92a 100644
--- a/ports/cef/string.rs
+++ b/ports/cef/string.rs
@@ -18,6 +18,7 @@ use types::{cef_string_userfree_utf16_t, cef_string_userfree_utf8_t, cef_string_
//cef_string
#[no_mangle]
+#[allow(private_no_mangle_fns)]
extern "C" fn string_wide_dtor(str: *mut wchar_t) {
unsafe {
libc::free(str as *mut c_void)
@@ -25,6 +26,7 @@ extern "C" fn string_wide_dtor(str: *mut wchar_t) {
}
#[no_mangle]
+#[allow(private_no_mangle_fns)]
extern "C" fn string_utf8_dtor(str: *mut u8) {
unsafe {
libc::free(str as *mut c_void)
@@ -32,6 +34,7 @@ extern "C" fn string_utf8_dtor(str: *mut u8) {
}
#[no_mangle]
+#[allow(private_no_mangle_fns)]
extern "C" fn string_utf16_dtor(str: *mut c_ushort) {
unsafe {
libc::free(str as *mut c_void)
@@ -109,8 +112,8 @@ pub extern "C" fn cef_string_utf8_cmp(a: *const cef_string_utf8_t, b: *const cef
unsafe {
let astr = (*a).str as *const u8;
let bstr = (*b).str as *const u8;
- let astr = slice::from_raw_buf(&astr, (*a).length as uint);
- let bstr = slice::from_raw_buf(&bstr, (*b).length as uint);
+ let astr = slice::from_raw_parts(astr, (*a).length as uint);
+ let bstr = slice::from_raw_parts(bstr, (*b).length as uint);
match astr.cmp(bstr) {
Ordering::Less => -1,
Ordering::Equal => 0,
@@ -131,7 +134,7 @@ pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, outp
#[no_mangle]
pub extern "C" fn cef_string_utf16_to_utf8(src: *const u16, src_len: size_t, output: *mut cef_string_utf8_t) -> c_int {
unsafe {
- let ustr = slice::from_raw_buf(&src, src_len as uint);
+ let ustr = slice::from_raw_parts(src, src_len as uint);
match string::String::from_utf16(ustr) {
Ok(str) => {
cef_string_utf8_set(str.as_bytes().as_ptr(), str.len() as size_t, output, 1);
@@ -190,8 +193,8 @@ pub extern "C" fn cef_string_utf16_cmp(a: *const cef_string_utf16_t, b: *const c
unsafe {
let astr = (*a).str as *const _;
let bstr = (*b).str as *const _;
- let astr: &[u16] = slice::from_raw_buf(&astr, (*a).length as uint);
- let bstr: &[u16] = slice::from_raw_buf(&bstr, (*b).length as uint);
+ let astr: &[u16] = slice::from_raw_parts(astr, (*a).length as uint);
+ let bstr: &[u16] = slice::from_raw_parts(bstr, (*b).length as uint);
match astr.cmp(bstr) {
Ordering::Less => -1,
Ordering::Equal => 0,
@@ -248,8 +251,8 @@ pub extern "C" fn cef_string_wide_cmp(a: *const cef_string_wide_t, b: *const cef
unsafe {
let astr = (*a).str as *const wchar_t;
let bstr = (*b).str as *const wchar_t;
- let astr = slice::from_raw_buf(&astr, (*a).length as uint);
- let bstr = slice::from_raw_buf(&bstr, (*b).length as uint);
+ let astr = slice::from_raw_parts(astr, (*a).length as uint);
+ let bstr = slice::from_raw_parts(bstr, (*b).length as uint);
match astr.cmp(bstr) {
Ordering::Less => -1,
Ordering::Equal => 0,
@@ -275,7 +278,7 @@ pub extern "C" fn cef_string_wide_to_utf8(src: *const wchar_t, src_len: size_t,
return cef_string_utf16_to_utf8(src as *const u16, src_len, output);
}
unsafe {
- let ustr = slice::from_raw_buf(&src, src_len as uint);
+ let ustr = slice::from_raw_parts(src, src_len as uint);
let conv = ustr.iter().map(|&c| char::from_u32(c as u32).unwrap_or('\u{FFFD}')).collect::<String>();
cef_string_utf8_set(conv.as_bytes().as_ptr(), conv.len() as size_t, output, 1)
}
@@ -292,7 +295,7 @@ pub extern "C" fn cef_string_ascii_to_utf16(src: *const u8, src_len: size_t, out
#[no_mangle]
pub extern "C" fn cef_string_ascii_to_wide(src: *const u8, src_len: size_t, output: *mut cef_string_wide_t) -> c_int {
unsafe {
- let ustr = slice::from_raw_buf(&src, src_len as uint);
+ let ustr = slice::from_raw_parts(src, src_len as uint);
let conv = ustr.iter().map(|&c| c as u8).collect::<Vec<u8>>();
cef_string_wide_set(conv.as_ptr() as *const wchar_t, conv.len() as size_t, output, 1)
}
diff --git a/ports/cef/window.rs b/ports/cef/window.rs
index 8b4a29e24e8..1b133e14d27 100644
--- a/ports/cef/window.rs
+++ b/ports/cef/window.rs
@@ -11,7 +11,7 @@ use eutil::Downcast;
use interfaces::CefBrowser;
use render_handler::CefRenderHandlerExtensions;
use types::{cef_cursor_handle_t, cef_rect_t};
-use wrappers::Utf16Encoder;
+use unicode::str::Utf16Encoder;
use compositing::compositor_task::{self, CompositorProxy, CompositorReceiver};
use compositing::windowing::{WindowEvent, WindowMethods};
@@ -21,9 +21,9 @@ use gleam::gl;
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeGraphicsMetadata;
use libc::{c_char, c_void};
-use servo_msg::constellation_msg::{Key, KeyModifiers};
-use servo_msg::compositor_msg::{ReadyState, PaintState};
-use servo_msg::constellation_msg::LoadData;
+use msg::constellation_msg::{Key, KeyModifiers};
+use msg::compositor_msg::{ReadyState, PaintState};
+use msg::constellation_msg::LoadData;
use util::cursor::Cursor;
use util::geometry::ScreenPx;
use std::cell::RefCell;
@@ -31,9 +31,6 @@ use std::ffi::CString;
use std::rc::Rc;
use std::sync::mpsc::{Sender, channel};
-#[cfg(target_os="macos")]
-use std::ptr;
-
/// The type of an off-screen window.
#[derive(Clone)]
pub struct Window {
@@ -327,27 +324,27 @@ impl CompositorProxy for CefCompositorProxy {
#[cfg(target_os="macos")]
fn send(&mut self, msg: compositor_task::Msg) {
use cocoa::appkit::{NSApp, NSApplication, NSApplicationDefined, NSAutoreleasePool};
- use cocoa::appkit::{NSEvent, NSPoint};
+ use cocoa::appkit::{NSEvent, NSEventModifierFlags, NSEventSubtype, NSPoint};
use cocoa::base::nil;
// Send a message and kick the OS event loop awake.
- self.sender.send(msg);
+ self.sender.send(msg).unwrap();
unsafe {
let pool = NSAutoreleasePool::new(nil);
let event =
- NSEvent::otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2(
+ NSEvent::otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(
nil,
NSApplicationDefined,
NSPoint::new(0.0, 0.0),
- 0,
+ NSEventModifierFlags::empty(),
0.0,
0,
- ptr::null_mut(),
0,
+ NSEventSubtype::NSWindowExposedEventType,
0,
0);
- NSApp().postEvent_atStart_(event, false);
+ NSApp().postEvent_atStart_(event, 0);
pool.drain();
}
}
@@ -355,7 +352,7 @@ impl CompositorProxy for CefCompositorProxy {
#[cfg(target_os="linux")]
fn send(&mut self, msg: compositor_task::Msg) {
// FIXME(pcwalton): Kick the GTK event loop awake?
- self.sender.send(msg);
+ self.sender.send(msg).unwrap();
}
fn clone_compositor_proxy(&self) -> Box<CompositorProxy+Send> {
diff --git a/ports/cef/wrappers.rs b/ports/cef/wrappers.rs
index cf3ebdd4b28..a93531c198f 100644
--- a/ports/cef/wrappers.rs
+++ b/ports/cef/wrappers.rs
@@ -29,6 +29,7 @@ use types::{cef_termination_status_t, cef_text_input_context_t, cef_thread_id_t}
use types::{cef_time_t, cef_transition_type_t, cef_urlrequest_status_t};
use types::{cef_v8_accesscontrol_t, cef_v8_propertyattribute_t, cef_value_type_t};
use types::{cef_window_info_t, cef_xml_encoding_type_t, cef_xml_node_type_t};
+use unicode::str::Utf16Encoder;
use libc::{self, c_char, c_int, c_ushort, c_void};
use std::collections::HashMap;
@@ -271,39 +272,6 @@ extern "C" fn free_utf16_buffer(buffer: *mut c_ushort) {
}
}
-// TODO(pcwalton): Post Rust-upgrade, remove this and use `collections::str::Utf16Encoder`.
-pub struct Utf16Encoder<I> {
- chars: I,
- extra: u16,
-}
-
-impl<I> Utf16Encoder<I> {
- pub fn new(chars: I) -> Utf16Encoder<I> where I: Iterator<Item=char> {
- Utf16Encoder {
- chars: chars,
- extra: 0,
- }
- }
-}
-
-impl<I> Iterator for Utf16Encoder<I> where I: Iterator<Item=char> {
- type Item = u16;
- fn next(&mut self) -> Option<u16> {
- if self.extra != 0 {
- return Some(mem::replace(&mut self.extra, 0))
- }
-
- let mut buf = [0u16; 2];
- self.chars.next().map(|ch| {
- let n = ch.encode_utf16(buf.as_mut_slice()).unwrap_or(0);
- if n == 2 {
- self.extra = buf[1]
- }
- buf[0]
- })
- }
-}
-
impl<'a> CefWrap<cef_string_t> for &'a mut String {
fn to_c(_: &'a mut String) -> cef_string_t {
panic!("unimplemented CEF type conversion: &'a mut String");
diff --git a/ports/glutin/Cargo.toml b/ports/glutin/Cargo.toml
index 59315532dc7..d58ed4a32bd 100644
--- a/ports/glutin/Cargo.toml
+++ b/ports/glutin/Cargo.toml
@@ -41,3 +41,5 @@ git = "https://github.com/servo/rust-egl"
[dependencies]
time = "0.1.12"
+bitflags = "*"
+libc = "*"
diff --git a/ports/glutin/lib.rs b/ports/glutin/lib.rs
index 445a4471cd8..b644483adb2 100644
--- a/ports/glutin/lib.rs
+++ b/ports/glutin/lib.rs
@@ -4,9 +4,12 @@
//! A simple application that uses glutin to open a window for Servo to display in.
-#![feature(box_syntax, int_uint)]
-#![allow(unstable)]
+#![feature(int_uint)]
+#![feature(core)]
+#![cfg_attr(feature = "window", feature(hash))]
+#![feature(box_syntax)]
+#[macro_use] extern crate bitflags;
#[cfg(target_os="macos")]
extern crate cgl;
extern crate compositing;
diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs
index 3afb152fcef..2256d34b998 100644
--- a/ports/glutin/window.rs
+++ b/ports/glutin/window.rs
@@ -35,8 +35,6 @@ use std::cell::{Cell, RefCell};
#[cfg(feature = "window")]
use std::num::Float;
#[cfg(feature = "window")]
-use time::{self, Timespec};
-#[cfg(feature = "window")]
use util::opts;
#[cfg(all(feature = "headless", target_os="linux"))]
@@ -47,7 +45,7 @@ static mut g_nested_event_loop_listener: Option<*mut (NestedEventLoopListener +
#[cfg(feature = "window")]
bitflags! {
- #[derive(Show)]
+ #[derive(Debug)]
flags KeyModifiers: u8 {
const LEFT_CONTROL = 1,
const RIGHT_CONTROL = 2,
@@ -71,15 +69,13 @@ pub struct Window {
ready_state: Cell<ReadyState>,
paint_state: Cell<PaintState>,
key_modifiers: Cell<KeyModifiers>,
-
- last_title_set_time: Cell<Timespec>,
}
#[cfg(feature = "window")]
impl Window {
pub fn new(is_foreground: bool, window_size: TypedSize2D<DevicePixel, u32>) -> Rc<Window> {
let mut glutin_window = glutin::WindowBuilder::new()
- .with_title("Servo [glutin]".to_string())
+ .with_title("Servo".to_string())
.with_dimensions(window_size.to_untyped().width, window_size.to_untyped().height)
.with_gl_version(Window::gl_version())
.with_visibility(is_foreground)
@@ -89,7 +85,7 @@ impl Window {
glutin_window.set_window_resize_callback(Some(Window::nested_window_resize as fn(u32, u32)));
- gl::load_with(|s| glutin_window.get_proc_address(s));
+ Window::load_gl_functions(&glutin_window);
let window = Window {
window: glutin_window,
@@ -101,8 +97,6 @@ impl Window {
ready_state: Cell::new(ReadyState::Blank),
paint_state: Cell::new(PaintState::Idle),
key_modifiers: Cell::new(KeyModifiers::empty()),
-
- last_title_set_time: Cell::new(Timespec::new(0, 0)),
};
gl::clear_color(0.6, 0.6, 0.6, 1.0);
@@ -134,6 +128,15 @@ impl Window {
(2, 0)
}
+ #[cfg(not(target_os="android"))]
+ fn load_gl_functions(window: &glutin::Window) {
+ gl::load_with(|s| window.get_proc_address(s));
+ }
+
+ #[cfg(target_os="android")]
+ fn load_gl_functions(_: &glutin::Window) {
+ }
+
fn handle_window_event(&self, event: glutin::Event) -> bool {
match event {
Event::KeyboardInput(element_state, _scan_code, virtual_key_code) => {
@@ -166,8 +169,8 @@ impl Window {
self.event_queue.borrow_mut().push(WindowEvent::Resize(TypedSize2D(width, height)));
}
Event::MouseInput(element_state, mouse_button) => {
- if mouse_button == MouseButton::LeftMouseButton ||
- mouse_button == MouseButton::RightMouseButton {
+ if mouse_button == MouseButton::Left ||
+ mouse_button == MouseButton::Right {
let mouse_pos = self.mouse_pos.get();
self.handle_mouse(mouse_button, element_state, mouse_pos.x, mouse_pos.y);
}
@@ -247,36 +250,6 @@ impl Window {
self.event_queue.borrow_mut().push(WindowEvent::MouseWindowEventClass(event));
}
- fn update_window_title(&self) {
- let now = time::get_time();
- if now.sec == self.last_title_set_time.get().sec {
- return
- }
- self.last_title_set_time.set(now);
-
- match self.ready_state.get() {
- ReadyState::Blank => {
- self.window.set_title("blank - Servo [glutin]")
- }
- ReadyState::Loading => {
- self.window.set_title("Loading - Servo [glutin]")
- }
- ReadyState::PerformingLayout => {
- self.window.set_title("Performing Layout - Servo [glutin]")
- }
- ReadyState::FinishedLoading => {
- match self.paint_state.get() {
- PaintState::Painting => {
- self.window.set_title("Rendering - Servo [glutin]")
- }
- PaintState::Idle => {
- self.window.set_title("Servo [glutin]")
- }
- }
- }
- }
- }
-
pub fn wait_events(&self) -> WindowEvent {
{
let mut event_queue = self.event_queue.borrow_mut();
@@ -362,27 +335,27 @@ impl Window {
VirtualKeyCode::Y => Ok(Key::Y),
VirtualKeyCode::Z => Ok(Key::Z),
- VirtualKeyCode::Numpad0 => Ok(Key::Num0),
- VirtualKeyCode::Numpad1 => Ok(Key::Num1),
- VirtualKeyCode::Numpad2 => Ok(Key::Num2),
- VirtualKeyCode::Numpad3 => Ok(Key::Num3),
- VirtualKeyCode::Numpad4 => Ok(Key::Num4),
- VirtualKeyCode::Numpad5 => Ok(Key::Num5),
- VirtualKeyCode::Numpad6 => Ok(Key::Num6),
- VirtualKeyCode::Numpad7 => Ok(Key::Num7),
- VirtualKeyCode::Numpad8 => Ok(Key::Num8),
- VirtualKeyCode::Numpad9 => Ok(Key::Num9),
-
- VirtualKeyCode::Key0 => Ok(Key::Kp0),
- VirtualKeyCode::Key1 => Ok(Key::Kp1),
- VirtualKeyCode::Key2 => Ok(Key::Kp2),
- VirtualKeyCode::Key3 => Ok(Key::Kp3),
- VirtualKeyCode::Key4 => Ok(Key::Kp4),
- VirtualKeyCode::Key5 => Ok(Key::Kp5),
- VirtualKeyCode::Key6 => Ok(Key::Kp6),
- VirtualKeyCode::Key7 => Ok(Key::Kp7),
- VirtualKeyCode::Key8 => Ok(Key::Kp8),
- VirtualKeyCode::Key9 => Ok(Key::Kp9),
+ VirtualKeyCode::Numpad0 => Ok(Key::Kp0),
+ VirtualKeyCode::Numpad1 => Ok(Key::Kp1),
+ VirtualKeyCode::Numpad2 => Ok(Key::Kp2),
+ VirtualKeyCode::Numpad3 => Ok(Key::Kp3),
+ VirtualKeyCode::Numpad4 => Ok(Key::Kp4),
+ VirtualKeyCode::Numpad5 => Ok(Key::Kp5),
+ VirtualKeyCode::Numpad6 => Ok(Key::Kp6),
+ VirtualKeyCode::Numpad7 => Ok(Key::Kp7),
+ VirtualKeyCode::Numpad8 => Ok(Key::Kp8),
+ VirtualKeyCode::Numpad9 => Ok(Key::Kp9),
+
+ VirtualKeyCode::Key0 => Ok(Key::Num0),
+ VirtualKeyCode::Key1 => Ok(Key::Num1),
+ VirtualKeyCode::Key2 => Ok(Key::Num2),
+ VirtualKeyCode::Key3 => Ok(Key::Num3),
+ VirtualKeyCode::Key4 => Ok(Key::Num4),
+ VirtualKeyCode::Key5 => Ok(Key::Num5),
+ VirtualKeyCode::Key6 => Ok(Key::Num6),
+ VirtualKeyCode::Key7 => Ok(Key::Num7),
+ VirtualKeyCode::Key8 => Ok(Key::Num8),
+ VirtualKeyCode::Key9 => Ok(Key::Num9),
VirtualKeyCode::Return => Ok(Key::Enter),
VirtualKeyCode::Space => Ok(Key::Space),
@@ -469,20 +442,24 @@ impl WindowMethods for Window {
/// Sets the ready state.
fn set_ready_state(&self, ready_state: ReadyState) {
self.ready_state.set(ready_state);
- self.update_window_title()
}
/// Sets the paint state.
fn set_paint_state(&self, paint_state: PaintState) {
self.paint_state.set(paint_state);
- self.update_window_title()
}
fn hidpi_factor(&self) -> ScaleFactor<ScreenPx, DevicePixel, f32> {
ScaleFactor(self.window.hidpi_factor())
}
- fn set_page_title(&self, _: Option<String>) {
+ fn set_page_title(&self, title: Option<String>) {
+ let title = match title {
+ Some(ref title) if title.len() > 0 => title.as_slice(),
+ _ => "untitled",
+ };
+ let title = format!("{} - Servo", title);
+ self.window.set_title(&title);
}
fn set_page_load_data(&self, _: LoadData) {
@@ -491,9 +468,59 @@ impl WindowMethods for Window {
fn load_end(&self) {
}
+ // TODO: Enable on macos when supported by glutin.
+ #[cfg(target_os="macos")]
+ fn set_cursor(&self, _: Cursor) {
+ }
+
+ #[cfg(target_os="android")]
fn set_cursor(&self, _: Cursor) {
}
+ #[cfg(target_os="linux")]
+ fn set_cursor(&self, c: Cursor) {
+ use glutin::MouseCursor;
+
+ let glutin_cursor = match c {
+ Cursor::NoCursor => MouseCursor::NoneCursor,
+ Cursor::DefaultCursor => MouseCursor::Default,
+ Cursor::PointerCursor => MouseCursor::Hand,
+ Cursor::ContextMenuCursor => MouseCursor::ContextMenu,
+ Cursor::HelpCursor => MouseCursor::Help,
+ Cursor::ProgressCursor => MouseCursor::Progress,
+ Cursor::WaitCursor => MouseCursor::Wait,
+ Cursor::CellCursor => MouseCursor::Cell,
+ Cursor::CrosshairCursor => MouseCursor::Crosshair,
+ Cursor::TextCursor => MouseCursor::Text,
+ Cursor::VerticalTextCursor => MouseCursor::VerticalText,
+ Cursor::AliasCursor => MouseCursor::Alias,
+ Cursor::CopyCursor => MouseCursor::Copy,
+ Cursor::MoveCursor => MouseCursor::Move,
+ Cursor::NoDropCursor => MouseCursor::NoDrop,
+ Cursor::NotAllowedCursor => MouseCursor::NotAllowed,
+ Cursor::GrabCursor => MouseCursor::Grab,
+ Cursor::GrabbingCursor => MouseCursor::Grabbing,
+ Cursor::EResizeCursor => MouseCursor::EResize,
+ Cursor::NResizeCursor => MouseCursor::NResize,
+ Cursor::NeResizeCursor => MouseCursor::NeResize,
+ Cursor::NwResizeCursor => MouseCursor::NwResize,
+ Cursor::SResizeCursor => MouseCursor::SResize,
+ Cursor::SeResizeCursor => MouseCursor::SeResize,
+ Cursor::SwResizeCursor => MouseCursor::SwResize,
+ Cursor::WResizeCursor => MouseCursor::WResize,
+ Cursor::EwResizeCursor => MouseCursor::EwResize,
+ Cursor::NsResizeCursor => MouseCursor::NsResize,
+ Cursor::NeswResizeCursor => MouseCursor::NeswResize,
+ Cursor::NwseResizeCursor => MouseCursor::NwseResize,
+ Cursor::ColResizeCursor => MouseCursor::ColResize,
+ Cursor::RowResizeCursor => MouseCursor::RowResize,
+ Cursor::AllScrollCursor => MouseCursor::AllScroll,
+ Cursor::ZoomInCursor => MouseCursor::ZoomIn,
+ Cursor::ZoomOutCursor => MouseCursor::ZoomOut,
+ };
+ self.window.set_cursor(glutin_cursor);
+ }
+
fn prepare_for_composite(&self) -> bool {
true
}
diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock
index 39316a8938f..dbf9980a793 100644
--- a/ports/gonk/Cargo.lock
+++ b/ports/gonk/Cargo.lock
@@ -8,6 +8,7 @@ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout 0.0.1",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"script 0.0.1",
"servo 0.0.1",
@@ -17,7 +18,7 @@ dependencies = [
[[package]]
name = "azure"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-azure#779233af589e797f07e9e2f3f45017fb55c33c68"
+source = "git+https://github.com/servo/rust-azure#ec5fddfe96f889e35cc83abd2255f8325f2ec147"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -25,11 +26,17 @@ dependencies = [
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
]
[[package]]
+name = "bitflags"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "canvas"
version = "0.0.1"
dependencies = [
@@ -64,26 +71,26 @@ dependencies = [
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"script_traits 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "cookie"
-version = "0.1.8"
-source = "git+https://github.com/servo/cookie-rs?branch=lenientparse_backport#47ffa4d3c6f85d28f222d6e1d54635fff5622ea3"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core_foundation"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-core-foundation#ce3d852765827b64a0d5fb2aadd77da39665b0b0"
+source = "git+https://github.com/servo/rust-core-foundation#da9a52655fce4727dcf261d6ed9a49eeddc7b131"
[[package]]
name = "core_graphics"
@@ -96,7 +103,7 @@ dependencies = [
[[package]]
name = "core_text"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-core-text#b5cb33905350e99b2a19f5a22f7b1efea7ad48c2"
+source = "git+https://github.com/servo/rust-core-text#e769be9cb3366f9d403ddbee040e031ce03d32bb"
dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@@ -105,9 +112,9 @@ dependencies = [
[[package]]
name = "cssparser"
version = "0.2.0"
-source = "git+https://github.com/servo/rust-cssparser#d7d50ae2a7da4aca1b2c4d248139510c8e9a25c6"
+source = "git+https://github.com/servo/rust-cssparser#cf59a4cf55b6386db255d6205b9804d8d74efd35"
dependencies = [
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -118,7 +125,8 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"msg 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -127,29 +135,31 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "egl"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-egl#cd74c82a8537090edb6c16478e2261db2a8c0b4f"
+source = "git+https://github.com/servo/rust-egl#328e79b6256dea346f1821ccc4215e95fd1d58bc"
[[package]]
name = "encoding"
-version = "0.2.18"
+version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "encoding-index-japanese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-korean 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-simpchinese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-singlebyte 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding-index-tradchinese 1.20141219.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-japanese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-korean 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-simpchinese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-singlebyte 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding-index-tradchinese 1.20141219.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "encoding-index-japanese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -157,7 +167,7 @@ dependencies = [
[[package]]
name = "encoding-index-korean"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -165,7 +175,7 @@ dependencies = [
[[package]]
name = "encoding-index-simpchinese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -173,7 +183,7 @@ dependencies = [
[[package]]
name = "encoding-index-singlebyte"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -181,7 +191,7 @@ dependencies = [
[[package]]
name = "encoding-index-tradchinese"
-version = "1.20141219.0"
+version = "1.20141219.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding_index_tests 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -195,12 +205,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "expat-sys"
version = "2.1.0"
-source = "git+https://github.com/servo/libexpat#da2ddaf78cbef836b8790807bb76b357c58df3a1"
+source = "git+https://github.com/servo/libexpat#fe8c3222efdd486b95ef198ef4eee0506e37a809"
[[package]]
name = "fontconfig"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-fontconfig#f42ff5cbd0404fe4d2cd64e8d9bb6307bad8fd7c"
+source = "git+https://github.com/servo/rust-fontconfig#91195bd29daa9280680bb28ba556821d504a17c6"
dependencies = [
"fontconfig-sys 2.11.1 (git+https://github.com/servo/libfontconfig)",
]
@@ -208,7 +218,7 @@ dependencies = [
[[package]]
name = "fontconfig-sys"
version = "2.11.1"
-source = "git+https://github.com/servo/libfontconfig#fcc324d2c8175d2e8e8c0aab032c03a404809f6d"
+source = "git+https://github.com/servo/libfontconfig#adc60cacbca697123f4535ce2ff07619ec013cec"
dependencies = [
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
@@ -217,33 +227,37 @@ dependencies = [
[[package]]
name = "freetype"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-freetype#ec0231343a3ad360d86846c12895a0a0cbb19f79"
+source = "git+https://github.com/servo/rust-freetype#f65e8d82550b5d5b06a7785a13a008e125c30b7a"
[[package]]
name = "freetype-sys"
version = "2.4.11"
-source = "git+https://github.com/servo/libfreetype2#f5c49c0da1d5bc6b206c4176344012ac37524243"
+source = "git+https://github.com/servo/libfreetype2#7b9d112c0a93574b4bf518922d16b8879c7aadae"
[[package]]
name = "gcc"
-version = "0.1.4"
-source = "git+https://github.com/alexcrichton/gcc-rs#f5c52d956e0742a66e40c8301e634e136c3ae287"
+version = "0.1.7"
+source = "git+https://github.com/alexcrichton/gcc-rs#016cc1597bbe52c26e41cf687476ba93f27fec41"
[[package]]
name = "gcc"
-version = "0.1.4"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "geom"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-geom#a4a4a03aa024412bf3f4e093c0198b433c6ad63f"
+source = "git+https://github.com/servo/rust-geom#6b079ba2738ed15bac2b6ec66850494afb9f2b4c"
+dependencies = [
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "gfx"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
@@ -256,87 +270,94 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"style 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "gl_common"
-version = "0.0.3"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
+version = "0.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "gl_generator"
-version = "0.0.12"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
+version = "0.0.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "khronos_api 0.0.5 (git+https://github.com/bjz/gl-rs.git)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "xml-rs 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "xml-rs 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gleam"
version = "0.0.1"
-source = "git+https://github.com/servo/gleam#375779e0e8e1eaa8ff1a732c81fa91808a7f6c63"
+source = "git+https://github.com/servo/gleam#1a85194298997cf602270d4c1aeb0a043ce339e7"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "gl_generator 0.0.12 (git+https://github.com/bjz/gl-rs.git)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glx"
version = "0.0.1"
-source = "git+https://github.com/servo/rust-glx#f056a8998987f6f081f9ad7fa396beb1b2988c02"
+source = "git+https://github.com/servo/rust-glx#d8a3329d1f68dc4cf72509daca7ef837b8ce94d6"
dependencies = [
- "gl_common 0.0.3 (git+https://github.com/bjz/gl-rs.git)",
- "gl_generator 0.0.12 (git+https://github.com/bjz/gl-rs.git)",
+ "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gl_generator 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "harfbuzz"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-harfbuzz#59b5b18087418404d661784934c3d864386024b5"
+source = "git+https://github.com/servo/rust-harfbuzz#d5833511875673aa994ca194922acb3b1ea3ec61"
[[package]]
name = "html5ever"
version = "0.0.0"
-source = "git+https://github.com/servo/html5ever#d35dfaaf0d85007057a299afc370d07e92538944"
+source = "git+https://github.com/servo/html5ever#1c8c09934657fa8edb8ac94070a9061bc040621d"
dependencies = [
"html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)",
- "phf 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_mac 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_macros 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "html5ever_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/html5ever#d35dfaaf0d85007057a299afc370d07e92538944"
+source = "git+https://github.com/servo/html5ever#1c8c09934657fa8edb8ac94070a9061bc040621d"
[[package]]
name = "hyper"
-version = "0.1.1"
-source = "git+https://github.com/servo/hyper?branch=old_servo_new_cookies#7a346f481d683705709526594aa5f13b5c923bc1"
+version = "0.1.10"
+source = "git+https://github.com/servo/hyper?branch=servo#1f5547c4b7fd29781426f82dd857a96f1478b01c"
dependencies = [
- "cookie 0.1.8 (git+https://github.com/servo/cookie-rs?branch=lenientparse_backport)",
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "mime 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "mucell 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicase 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "unsafe-any 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cookie 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mime 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mucell 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicase 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unsafe-any 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -353,20 +374,21 @@ dependencies = [
[[package]]
name = "js"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-mozjs#6cabb12f858f27d23fc3d2d9f0c334b80eb56573"
+source = "git+https://github.com/servo/rust-mozjs#db08a4eacdb3d92df9a38c8a5d7ad1e1ee0fef4e"
dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs-sys 0.0.0 (git+https://github.com/servo/mozjs)",
]
[[package]]
name = "khronos_api"
version = "0.0.5"
-source = "git+https://github.com/bjz/gl-rs.git#230e6c9ed611cddfcb6682dee9686471d54863d0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "layers"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-layers#253fd0eb7e49b356393e14abdf34c76152cba10f"
+source = "git+https://github.com/servo/rust-layers#62870a30b06fb8776e01140167e55d1f2370b503"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
@@ -376,6 +398,7 @@ dependencies = [
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
]
@@ -384,20 +407,26 @@ dependencies = [
name = "layout"
version = "0.0.1"
dependencies = [
+ "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"layout_traits 0.0.1",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
+ "png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -414,24 +443,26 @@ dependencies = [
[[package]]
name = "lazy_static"
-version = "0.1.6"
-source = "git+https://github.com/Kimundi/lazy-static.rs#31a7aa0176ecd70b4aab274a40d1e2cd78c1fbf8"
+version = "0.1.7"
+source = "git+https://github.com/Kimundi/lazy-static.rs#b48b0c551087af9d598a0452f4e3973d98d4419b"
+
+[[package]]
+name = "libc"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libressl-pnacl-sys"
-version = "2.1.0"
+version = "2.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "pnacl-build-helper 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pnacl-build-helper 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
-version = "0.1.9"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "regex 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
-]
[[package]]
name = "matches"
@@ -440,98 +471,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mime"
-version = "0.0.6"
+version = "0.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mod_path"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mozjs-sys"
version = "0.0.0"
-source = "git+https://github.com/servo/mozjs#58ee8869c7e589244ab2eb3a3ad15e2b64498428"
+source = "git+https://github.com/servo/mozjs#2267d10685f101438e4f9e8bdfeb9964214dbeeb"
[[package]]
name = "msg"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"style 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "mucell"
-version = "0.1.10"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "net"
version = "0.0.1"
dependencies = [
- "cookie 0.1.8 (git+https://github.com/servo/cookie-rs?branch=lenientparse_backport)",
+ "cookie 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
- "openssl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
+ "openssl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "openssl"
-version = "0.2.15"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "openssl-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-sys"
-version = "0.2.16"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libressl-pnacl-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf"
-version = "0.4.9"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
-name = "phf_mac"
-version = "0.4.9"
+name = "phf_macros"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "phf_shared 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_shared 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "phf_shared"
-version = "0.4.9"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
-version = "0.1.1"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -540,57 +575,64 @@ version = "0.0.1"
[[package]]
name = "pnacl-build-helper"
-version = "1.0.0"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "png"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-png#ade2143c96641abdaedd8bc556f45935d18c35df"
+source = "git+https://github.com/servo/rust-png#687f103498654815682d2a750f26bbefc46d9da4"
dependencies = [
- "gcc 0.1.4 (git+https://github.com/alexcrichton/gcc-rs)",
+ "gcc 0.1.7 (git+https://github.com/alexcrichton/gcc-rs)",
"png-sys 1.6.16 (git+https://github.com/servo/rust-png)",
]
[[package]]
name = "png-sys"
version = "1.6.16"
-source = "git+https://github.com/servo/rust-png#ade2143c96641abdaedd8bc556f45935d18c35df"
+source = "git+https://github.com/servo/rust-png#687f103498654815682d2a750f26bbefc46d9da4"
[[package]]
-name = "regex"
-version = "0.1.10"
+name = "rand"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "rustc-serialize"
-version = "0.2.7"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "script"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"devtools_traits 0.0.1",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"html5ever 0.0.0 (git+https://github.com/servo/html5ever)",
- "hyper 0.1.1 (git+https://github.com/servo/hyper?branch=old_servo_new_cookies)",
+ "hyper 0.1.10 (git+https://github.com/servo/hyper?branch=servo)",
"js 0.1.0 (git+https://github.com/servo/rust-mozjs)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
"plugins 0.0.1",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
- "uuid 0.1.7 (git+https://github.com/rust-lang/uuid)",
+ "uuid 0.1.9 (git+https://github.com/rust-lang/uuid)",
]
[[package]]
@@ -599,9 +641,10 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -609,6 +652,7 @@ dependencies = [
name = "servo"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compositing 0.0.1",
"devtools 0.0.1",
"gfx 0.0.1",
@@ -617,15 +661,15 @@ dependencies = [
"net 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"script 0.0.1",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
[[package]]
name = "skia"
version = "0.0.20130412"
-source = "git+https://github.com/servo/skia?branch=upstream-2014-06-16#387777643df6df6ce8fb61ce069c7c60b32ab38c"
+source = "git+https://github.com/servo/skia?branch=upstream-2014-06-16#76b626df0d6cfb32eb1ee5ba3c7b52aadd5a42e3"
dependencies = [
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
@@ -634,16 +678,16 @@ dependencies = [
[[package]]
name = "stb_image"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-stb-image#2ba03a447b9ef101c25e07bb7f8876416e5fcd71"
+source = "git+https://github.com/servo/rust-stb-image#8fb5031333ea142802724719ce20bfa132bc4802"
[[package]]
name = "string_cache"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#43a1e5d0d0f2a45e2b96160c8fbe6e1d9602cfa9"
+source = "git+https://github.com/servo/string-cache#12b84faff894d358a546bf064b0daf5f04f2a96b"
dependencies = [
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
- "phf 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf_mac 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "phf 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "phf_macros 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"xxhash 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -651,26 +695,27 @@ dependencies = [
[[package]]
name = "string_cache_macros"
version = "0.0.0"
-source = "git+https://github.com/servo/string-cache#43a1e5d0d0f2a45e2b96160c8fbe6e1d9602cfa9"
+source = "git+https://github.com/servo/string-cache#12b84faff894d358a546bf064b0daf5f04f2a96b"
dependencies = [
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
]
[[package]]
name = "style"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
- "encoding 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
- "lazy_static 0.1.6 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "mod_path 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mod_path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@@ -685,64 +730,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "time"
-version = "0.1.12"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "gcc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicase"
-version = "0.0.2"
+version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unsafe-any"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "url"
-version = "0.2.16"
+version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "util"
version = "0.0.1"
dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.2.0 (git+https://github.com/servo/rust-cssparser)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
+ "lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",
"text_writer 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "uuid"
-version = "0.1.7"
-source = "git+https://github.com/rust-lang/uuid#3ea51ffa0682c820e8c8b505de078e3bc93e2cb3"
+version = "0.1.9"
+source = "git+https://github.com/rust-lang/uuid#3128649cde7c4ba390b31298093d6c181a23eb61"
dependencies = [
- "rustc-serialize 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xlib"
version = "0.1.0"
-source = "git+https://github.com/servo/rust-xlib#138b0e281b9fd64f7d2e17080fa9a2d4a8554313"
+source = "git+https://github.com/servo/rust-xlib#4f1bfc476256c37a152980d42213116a62629599"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "xml-rs"
-version = "0.1.12"
+version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "xxhash"
diff --git a/ports/gonk/Cargo.toml b/ports/gonk/Cargo.toml
index f78f4cfbd25..574eab7c26f 100644
--- a/ports/gonk/Cargo.toml
+++ b/ports/gonk/Cargo.toml
@@ -36,3 +36,5 @@ path = "../../components/util"
[dependencies.egl]
git = "https://github.com/servo/rust-egl"
+[dependencies]
+libc = "*"
diff --git a/ports/gonk/build.rs b/ports/gonk/build.rs
index 19319fe349c..1e3d07fa18c 100644
--- a/ports/gonk/build.rs
+++ b/ports/gonk/build.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use std::io::process::{Command, ProcessExit, StdioContainer};
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
use std::os;
diff --git a/ports/gonk/src/input.rs b/ports/gonk/src/input.rs
index 0de1014baef..26ec396dbc4 100644
--- a/ports/gonk/src/input.rs
+++ b/ports/gonk/src/input.rs
@@ -9,7 +9,7 @@ use std::mem::zeroed;
use std::os::errno;
use std::os::unix::AsRawFd;
use std::num::Float;
-use std::io::File;
+use std::old_io::File;
use std::thread::Thread;
use std::sync::mpsc::Sender;
diff --git a/ports/gonk/src/lib.rs b/ports/gonk/src/lib.rs
index b65cf9dae86..d3d729481bb 100644
--- a/ports/gonk/src/lib.rs
+++ b/ports/gonk/src/lib.rs
@@ -11,8 +11,8 @@ extern crate log;
extern crate compositing;
extern crate devtools;
-extern crate "net" as servo_net;
-extern crate "msg" as servo_msg;
+extern crate net;
+extern crate msg;
#[macro_use]
extern crate util;
extern crate script;
@@ -27,18 +27,18 @@ use compositing::windowing::{WindowEvent, WindowMethods};
#[cfg(not(test))]
use compositing::{CompositorProxy, CompositorTask, Constellation};
#[cfg(not(test))]
-use servo_msg::constellation_msg::Msg as ConstellationMsg;
+use msg::constellation_msg::Msg as ConstellationMsg;
#[cfg(not(test))]
-use servo_msg::constellation_msg::ConstellationChan;
+use msg::constellation_msg::ConstellationChan;
#[cfg(not(test))]
use script::dom::bindings::codegen::RegisterBindings;
#[cfg(not(test))]
-use servo_net::image_cache_task::ImageCacheTask;
+use net::image_cache_task::ImageCacheTask;
#[cfg(not(test))]
-use servo_net::storage_task::StorageTaskFactory;
+use net::storage_task::StorageTaskFactory;
#[cfg(not(test))]
-use servo_net::resource_task::new_resource_task;
+use net::resource_task::new_resource_task;
#[cfg(not(test))]
use gfx::font_cache_task::FontCacheTask;
#[cfg(not(test))]
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index e248c4a74fe..7b8819583c3 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -161,7 +161,10 @@ class MachCommands(CommandBase):
@CommandArgument('--verbose', '-v',
action='store_true',
help='Print verbose output')
- def clean(self, manifest_path, verbose=False):
+
+ @CommandArgument('params', nargs='...',
+ help="Command-line arguments to be passed through to Cargo")
+ def clean(self, manifest_path, params, verbose=False):
self.ensure_bootstrapped()
opts = []
@@ -169,6 +172,6 @@ class MachCommands(CommandBase):
opts += ["--manifest-path", manifest_path]
if verbose:
opts += ["-v"]
-
+ opts += params
return subprocess.call(["cargo", "clean"] + opts,
env=self.build_env(), cwd=self.servo_crate())
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 3b151affdd0..0f86edcb541 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -166,6 +166,7 @@ class CommandBase(object):
if self.context.bootstrapped:
return
+ subprocess.check_call(["git", "submodule", "sync"])
submodules = subprocess.check_output(["git", "submodule", "status"])
for line in submodules.split('\n'):
components = line.strip().split(' ')
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index 7cec97f0d0a..d427fe1181f 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -75,7 +75,14 @@ class MachCommands(CommandBase):
else:
args = args + params
- subprocess.check_call(args, env=env)
+ try:
+ subprocess.check_call(args, env=env)
+ except OSError as e:
+ if e.errno == 2:
+ print("Servo Binary can't be found! Run './mach build'"
+ " and try again!")
+ else:
+ raise e
@Command('doc',
description='Generate documentation',
diff --git a/rust-snapshot-hash b/rust-snapshot-hash
index e4cefd940fb..00e97589eca 100644
--- a/rust-snapshot-hash
+++ b/rust-snapshot-hash
@@ -1 +1 @@
-00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev
+80627cd3cc4099b76cb2fb26ebe2f2f8a6c2335e/rustc-1.0.0-dev
diff --git a/support/android-rs-glue b/support/android-rs-glue
-Subproject 70c2242c45216a731d5ccd5d028ebbd206e2c9a
+Subproject f9da46ed02736508d75333008d54506eec87a33
diff --git a/support/not-the-toml-you-re-looking-for.rs b/support/not-the-toml-you-re-looking-for.rs
index 48f75215ced..caf7bde3edd 100644
--- a/support/not-the-toml-you-re-looking-for.rs
+++ b/support/not-the-toml-you-re-looking-for.rs
@@ -1,6 +1,6 @@
fn main() {
::std::os::set_exit_status(1);
- let _ = ::std::io::stderr().write(br"
+ let _ = ::std::old_io::stderr().write(br"
This is not the `Cargo.toml` file you're looking for.
Invoke Cargo through mach instead, e.g. `./mach build`.
diff --git a/support/rust-task_info/Cargo.toml b/support/rust-task_info/Cargo.toml
index 16df934d054..27f3385f5ed 100644
--- a/support/rust-task_info/Cargo.toml
+++ b/support/rust-task_info/Cargo.toml
@@ -4,4 +4,4 @@ name = "task_info"
version = "0.0.1"
authors = ["The Servo Project Developers"]
-build = "make -f makefile.cargo"
+build = "build.rs"
diff --git a/support/rust-task_info/build.rs b/support/rust-task_info/build.rs
new file mode 100644
index 00000000000..e4341cdab46
--- /dev/null
+++ b/support/rust-task_info/build.rs
@@ -0,0 +1,21 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#![feature(env)]
+#![feature(io)]
+
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
+use std::env;
+
+fn main() {
+ let out_dir = env::var_string("OUT_DIR").unwrap();
+ let result = Command::new("make")
+ .args(&["-f", "makefile.cargo"])
+ .stdout(StdioContainer::InheritFd(1))
+ .stderr(StdioContainer::InheritFd(2))
+ .status()
+ .unwrap();
+ assert_eq!(result, ProcessExit::ExitStatus(0));
+ println!("cargo:rustc-flags=-L native={}", out_dir);
+}
diff --git a/support/rust-task_info/src/lib.rs b/support/rust-task_info/src/lib.rs
index 4aea5cff193..fe2a5bd3524 100644
--- a/support/rust-task_info/src/lib.rs
+++ b/support/rust-task_info/src/lib.rs
@@ -10,6 +10,8 @@
#![crate_name = "task_info"]
#![crate_type = "rlib"]
+#![feature(libc)]
+
extern crate libc;
#[cfg(target_os="macos")]
diff --git a/tests/content/test_interfaces.html b/tests/content/test_interfaces.html
index 7949221adb0..fe74bcacb54 100644
--- a/tests/content/test_interfaces.html
+++ b/tests/content/test_interfaces.html
@@ -173,6 +173,7 @@ var interfaceNamesInGlobalScope = [
"WorkerLocation", // #2823
"WorkerNavigator", // #2823
"XMLHttpRequest",
+ "XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
];
diff --git a/tests/contenttest.rs b/tests/contenttest.rs
index ea08475228c..7c79401e27a 100644
--- a/tests/contenttest.rs
+++ b/tests/contenttest.rs
@@ -8,23 +8,22 @@
// except according to those terms.
extern crate getopts;
-extern crate regex;
extern crate test;
use test::{AutoColor, TestOpts, run_tests_console, TestDesc, TestDescAndFn, DynTestFn, DynTestName};
use test::ShouldFail;
use getopts::{getopts, reqopt};
use std::{os, str};
-use std::io::fs;
-use std::io::Reader;
-use std::io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus};
+use std::old_io::fs;
+use std::old_io::Reader;
+use std::old_io::process::{Command, Ignored, CreatePipe, InheritFd, ExitStatus};
+use std::old_path::Path;
use std::thunk::Thunk;
-use regex::Regex;
#[derive(Clone)]
struct Config {
source_dir: String,
- filter: Option<Regex>
+ filter: Option<String>
}
fn main() {
@@ -49,7 +48,7 @@ fn parse_config(args: Vec<String>) -> Config {
Config {
source_dir: matches.opt_str("source-dir").unwrap(),
- filter: matches.free.as_slice().first().map(|&:s| Regex::new(s.as_slice()).unwrap())
+ filter: matches.free.first().map(|s| s.clone())
}
}
@@ -59,16 +58,9 @@ fn test_options(config: Config) -> TestOpts {
run_ignored: false,
run_tests: true,
run_benchmarks: false,
- ratchet_metrics: None,
- ratchet_noise_percent: None,
- save_metrics: None,
- test_shard: None,
logfile: None,
nocapture: false,
color: AutoColor,
- show_boxplot: false,
- boxplot_width: 0,
- show_all_stats: false,
}
}
@@ -89,7 +81,7 @@ fn make_test(file: String) -> TestDescAndFn {
ignore: false,
should_fail: ShouldFail::No,
},
- testfn: DynTestFn(Thunk::new(move |:| { run_test(file) }))
+ testfn: DynTestFn(Thunk::new(move || { run_test(file) }))
}
}
diff --git a/tests/ref/basic.list b/tests/ref/basic.list
index a733a543904..77d75374691 100644
--- a/tests/ref/basic.list
+++ b/tests/ref/basic.list
@@ -125,6 +125,7 @@ fragment=top != ../html/acid2.html acid2_ref.html
== background_image_position_a.html background_image_position_ref.html
== multiple_css_class_a.html multiple_css_class_b.html
+== iframe/bg_color.html iframe/bg_color_ref.html
== iframe/simple.html iframe/simple_ref.html
== iframe/simple_inline_default.html iframe/simple_inline_default_ref.html
== iframe/simple_inline_width.html iframe/simple_inline_width_ref.html
@@ -247,3 +248,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
== text_justify_none_a.html text_justify_none_ref.html
== text_overflow_basic_a.html text_overflow_basic_ref.html
== text_align_complex_a.html text_align_complex_ref.html
+== percentage_height_root.html percentage_height_root_ref.html
diff --git a/tests/ref/iframe/bg_color.html b/tests/ref/iframe/bg_color.html
new file mode 100644
index 00000000000..a139865a2b6
--- /dev/null
+++ b/tests/ref/iframe/bg_color.html
@@ -0,0 +1,8 @@
+<html>
+ <body style="background-color: blue; margin: 0;">
+ <div style="margin: 20px;">
+ <iframe src="about:blank" style="border: 0; background-color: green;">
+ </iframe>
+ </div>
+ </body>
+</html>
diff --git a/tests/ref/iframe/bg_color_ref.html b/tests/ref/iframe/bg_color_ref.html
new file mode 100644
index 00000000000..085a248a8cf
--- /dev/null
+++ b/tests/ref/iframe/bg_color_ref.html
@@ -0,0 +1,6 @@
+<html>
+ <body style="background-color: blue; margin: 0;">
+ <div style="width: 300px; height: 150px; margin: 20px; background-color: green;">
+ </div>
+ </body>
+</html>
diff --git a/tests/ref/percentage_height_root.html b/tests/ref/percentage_height_root.html
new file mode 100644
index 00000000000..ba90dd5450f
--- /dev/null
+++ b/tests/ref/percentage_height_root.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style type="text/css">
+ html, body {
+ margin: 0;
+ padding: 0;
+ height: 100%;
+ }
+ div {
+ height: 100%;
+ background-color: green;
+ }
+ </style>
+ </head>
+ <body>
+ <div></div>
+ </body>
+</html>
diff --git a/tests/ref/percentage_height_root_ref.html b/tests/ref/percentage_height_root_ref.html
new file mode 100644
index 00000000000..6ea83e4a441
--- /dev/null
+++ b/tests/ref/percentage_height_root_ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style type="text/css">
+ div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ background-color: green;
+ }
+ </style>
+ </head>
+ <body>
+ <div></div>
+ </body>
+</html>
diff --git a/tests/reftest.rs b/tests/reftest.rs
index 024605e4814..c718e827969 100644
--- a/tests/reftest.rs
+++ b/tests/reftest.rs
@@ -7,22 +7,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[macro_use] extern crate bitflags;
extern crate png;
extern crate test;
-extern crate regex;
extern crate url;
use std::ascii::AsciiExt;
-use std::io;
-use std::io::{File, Reader, Command, IoResult};
-use std::io::process::ExitStatus;
-use std::io::fs::PathExtensions;
+use std::old_io as io;
+use std::old_io::{File, Reader, Command, IoResult};
+use std::old_io::process::ExitStatus;
+use std::old_io::fs::PathExtensions;
+use std::old_path::Path;
use std::os;
-use std::path::Path;
use std::thunk::Thunk;
use test::{AutoColor, DynTestName, DynTestFn, TestDesc, TestOpts, TestDescAndFn, ShouldFail};
use test::run_tests_console;
-use regex::Regex;
use url::Url;
@@ -47,7 +46,7 @@ fn main() {
let (render_mode_string, base_path, testname) = match harness_args {
[] | [_] => panic!("USAGE: cpu|gpu base_path [testname regex]"),
[ref render_mode_string, ref base_path] => (render_mode_string, base_path, None),
- [ref render_mode_string, ref base_path, ref testname, ..] => (render_mode_string, base_path, Some(Regex::new(testname.as_slice()).unwrap())),
+ [ref render_mode_string, ref base_path, ref testname, ..] => (render_mode_string, base_path, Some(testname.clone())),
};
let mut render_mode = match render_mode_string.as_slice() {
@@ -88,15 +87,8 @@ fn main() {
logfile: None,
run_tests: true,
run_benchmarks: false,
- ratchet_noise_percent: None,
- ratchet_metrics: None,
- save_metrics: None,
- test_shard: None,
nocapture: false,
color: AutoColor,
- show_boxplot: false,
- boxplot_width: 0,
- show_all_stats: false,
};
match run(test_opts,
diff --git a/tests/wpt/metadata/FileAPI/historical.html.ini b/tests/wpt/metadata/FileAPI/historical.html.ini
new file mode 100644
index 00000000000..412e4bb8085
--- /dev/null
+++ b/tests/wpt/metadata/FileAPI/historical.html.ini
@@ -0,0 +1,5 @@
+[historical.html]
+ type: testharness
+ [FileReader should not support readAsBinaryString]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/FileAPI/idlharness.html.ini b/tests/wpt/metadata/FileAPI/idlharness.html.ini
index 79967c85ae1..4a69d9d5fa3 100644
--- a/tests/wpt/metadata/FileAPI/idlharness.html.ini
+++ b/tests/wpt/metadata/FileAPI/idlharness.html.ini
@@ -237,3 +237,18 @@
[File interface: existence and properties of interface object]
expected: FAIL
+ [FileList must be primary interface of file_input.files]
+ expected: FAIL
+
+ [Stringification of file_input.files]
+ expected: FAIL
+
+ [FileList interface: file_input.files must inherit property "item" with the proper type (0)]
+ expected: FAIL
+
+ [FileList interface: calling item(unsigned long) on file_input.files with too few arguments must throw TypeError]
+ expected: FAIL
+
+ [FileList interface: file_input.files must inherit property "length" with the proper type (1)]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/FileAPI/reading-data-section/FileReader-event-handler-attributes.html.ini b/tests/wpt/metadata/FileAPI/reading-data-section/FileReader-event-handler-attributes.html.ini
new file mode 100644
index 00000000000..0581ac711ac
--- /dev/null
+++ b/tests/wpt/metadata/FileAPI/reading-data-section/FileReader-event-handler-attributes.html.ini
@@ -0,0 +1,20 @@
+[FileReader-event-handler-attributes.html]
+ type: testharness
+ [FileReader.onloadstart: initial value]
+ expected: FAIL
+
+ [FileReader.onprogress: initial value]
+ expected: FAIL
+
+ [FileReader.onload: initial value]
+ expected: FAIL
+
+ [FileReader.onabort: initial value]
+ expected: FAIL
+
+ [FileReader.onerror: initial value]
+ expected: FAIL
+
+ [FileReader.onloadend: initial value]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index 50b5c1276fa..3beefc2e83e 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -1031,9 +1031,6 @@
"url": "/battery-status/battery-interface.js"
},
{
- "url": "/battery-status/countdown.js"
- },
- {
"url": "/battery-status/prime.js"
},
{
@@ -4444,10 +4441,10 @@
"url": "/battery-status/battery-full-manual.html"
},
{
- "url": "/battery-status/battery-plugged-in-manual.html"
+ "url": "/battery-status/battery-plugging-in-manual.html"
},
{
- "url": "/battery-status/battery-unplugged-manual.html"
+ "url": "/battery-status/battery-unplugging-manual.html"
},
{
"url": "/gamepad/events-manual.html"
@@ -4543,6 +4540,24 @@
"url": "/html-longdesc/reflected-changing-longdesc-manual.html"
},
{
+ "url": "/html-media-capture/capture_audio-manual.html"
+ },
+ {
+ "url": "/html-media-capture/capture_audio_cancel-manual.html"
+ },
+ {
+ "url": "/html-media-capture/capture_image-manual.html"
+ },
+ {
+ "url": "/html-media-capture/capture_image_cancel-manual.html"
+ },
+ {
+ "url": "/html-media-capture/capture_video-manual.html"
+ },
+ {
+ "url": "/html-media-capture/capture_video_cancel-manual.html"
+ },
+ {
"url": "/html/browsers/offline/application-cache-api/api_status_checking-manual.html"
},
{
@@ -9461,6 +9476,9 @@
"url": "/FileAPI/reading-data-section/Determining-Encoding.html"
},
{
+ "url": "/FileAPI/reading-data-section/FileReader-event-handler-attributes.html"
+ },
+ {
"url": "/FileAPI/reading-data-section/FileReader-multiple-reads.html"
},
{
@@ -11939,6 +11957,9 @@
"url": "/html-media-capture/idlharness.html"
},
{
+ "url": "/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html"
+ },
+ {
"url": "/html/browsers/browsing-the-web/read-media/pageload-image.html"
},
{
@@ -11969,9 +11990,6 @@
"url": "/html/browsers/history/the-history-interface/002.html"
},
{
- "url": "/html/browsers/history/the-history-interface/003.html"
- },
- {
"url": "/html/browsers/history/the-history-interface/004.html"
},
{
@@ -11996,9 +12014,93 @@
"url": "/html/browsers/history/the-history-interface/012.html"
},
{
+ "url": "/html/browsers/history/the-history-interface/combination_history_001.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/combination_history_002.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/combination_history_003.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/combination_history_004.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/combination_history_005.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/combination_history_006.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/combination_history_007.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_back.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_forward.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_go_minus.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_go_plus.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_pushstate.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_pushstate_err.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_replacestate.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_replacestate_err.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html"
+ },
+ {
+ "url": "/html/browsers/history/the-history-interface/history_state.html"
+ },
+ {
"url": "/html/browsers/history/the-location-interface/location-stringifier.html"
},
{
+ "url": "/html/browsers/history/the-location-interface/location_assign.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_hash.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_host.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_hostname.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_href.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_pathname.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_port.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_protocol.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_replace.html"
+ },
+ {
+ "url": "/html/browsers/history/the-location-interface/location_search.html"
+ },
+ {
"url": "/html/browsers/history/the-location-interface/security_location_0.sub.htm"
},
{
@@ -13859,6 +13961,9 @@
"url": "/html/semantics/forms/the-input-element/email.html"
},
{
+ "url": "/html/semantics/forms/the-input-element/files.html"
+ },
+ {
"url": "/html/semantics/forms/the-input-element/hidden.html"
},
{
@@ -14651,9 +14756,6 @@
"url": "/media-source/mediasource-play.html"
},
{
- "url": "/media-source/mediasource-redundant-seek.html"
- },
- {
"url": "/media-source/mediasource-remove.html"
},
{
@@ -17937,6 +18039,10 @@
},
{
"timeout": "long",
+ "url": "/media-source/mediasource-redundant-seek.html"
+ },
+ {
+ "timeout": "long",
"url": "/websockets/binary/002.html"
},
{
@@ -18054,6 +18160,6 @@
"deleted": [],
"items": {}
},
- "rev": "9b3cf7130b08834291687e8b011e85829c20ea79",
+ "rev": "a44e574f5832d164472a7c26010bfd460f74d314",
"url_base": "/"
} \ No newline at end of file
diff --git a/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini b/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini
index d7cd91227be..3f7c008620d 100644
--- a/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/interfaces.html.ini
@@ -63,3 +63,14 @@
[ProgressEvent interface: existence and properties of interface object]
expected: FAIL
+ [XMLHttpRequestEventTarget interface: existence and properties of interface object]
+ expected: FAIL
+
+ [XMLHttpRequestEventTarget interface object length]
+ expected: FAIL
+
+ [XMLHttpRequestUpload interface: existence and properties of interface object]
+ expected: FAIL
+
+ [XMLHttpRequest interface: existence and properties of interface object]
+ expected: FAIL
diff --git a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-2.htm.ini b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-2.htm.ini
index 862b46c6127..f2835b7b56b 100644
--- a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-2.htm.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-2.htm.ini
@@ -1,5 +1,5 @@
[open-url-multi-window-2.htm]
type: testharness
- expected: OK
[XMLHttpRequest: open() resolving URLs (multi-Window; 2; evil)]
expected: FAIL
+
diff --git a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-3.htm.ini b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-3.htm.ini
index 97a29e015d1..3ff53354ff2 100644
--- a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-3.htm.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-3.htm.ini
@@ -1,5 +1,5 @@
[open-url-multi-window-3.htm]
type: testharness
- expected: OK
[XMLHttpRequest: open() resolving URLs (multi-Window; 3; evil)]
expected: FAIL
+
diff --git a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-4.htm.ini b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-4.htm.ini
index 222b2c97c7d..1245e6adfa6 100644
--- a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-4.htm.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-4.htm.ini
@@ -1,6 +1,5 @@
[open-url-multi-window-4.htm]
type: testharness
- expected: OK
[XMLHttpRequest: open() resolving URLs (multi-Window; 4; evil)]
expected: FAIL
diff --git a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-5.htm.ini b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-5.htm.ini
index be714b4625f..b10f258a87b 100644
--- a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-5.htm.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-5.htm.ini
@@ -1,6 +1,5 @@
[open-url-multi-window-5.htm]
type: testharness
- expected: OK
[XMLHttpRequest: open() resolving URLs (multi-Window; 5)]
expected: FAIL
diff --git a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window.htm.ini b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window.htm.ini
index 0330785ec1b..be47fe69bab 100644
--- a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window.htm.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window.htm.ini
@@ -1,6 +1,5 @@
[open-url-multi-window.htm]
type: testharness
- expected: OK
[XMLHttpRequest: open() resolving URLs (multi-Window; 1)]
expected: FAIL
diff --git a/tests/wpt/metadata/XMLHttpRequest/send-accept.htm.ini b/tests/wpt/metadata/XMLHttpRequest/send-accept.htm.ini
deleted file mode 100644
index ba258e49999..00000000000
--- a/tests/wpt/metadata/XMLHttpRequest/send-accept.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[send-accept.htm]
- type: testharness
- [XMLHttpRequest: send() - Accept]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/XMLHttpRequest/send-entity-body-document.htm.ini b/tests/wpt/metadata/XMLHttpRequest/send-entity-body-document.htm.ini
index d35f507ee10..b66ba511485 100644
--- a/tests/wpt/metadata/XMLHttpRequest/send-entity-body-document.htm.ini
+++ b/tests/wpt/metadata/XMLHttpRequest/send-entity-body-document.htm.ini
@@ -1,3 +1,5 @@
[send-entity-body-document.htm]
type: testharness
- expected: TIMEOUT
+ [XMLHttpRequest: send() - Document]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/dom/interfaces.html.ini b/tests/wpt/metadata/dom/interfaces.html.ini
index 1986a969986..08b2e8d5f21 100644
--- a/tests/wpt/metadata/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/dom/interfaces.html.ini
@@ -21,9 +21,6 @@
[EventTarget interface: operation removeEventListener(DOMString,EventListener,boolean)]
expected: FAIL
- [NodeList interface: existence and properties of interface prototype object]
- expected: FAIL
-
[MutationObserver interface: existence and properties of interface object]
expected: FAIL
@@ -240,9 +237,6 @@
[DocumentType interface: operation after([object Object\],[object Object\])]
expected: FAIL
- [DocumentType interface: operation replace([object Object\],[object Object\])]
- expected: FAIL
-
[DocumentType interface: document.doctype must inherit property "before" with the proper type (3)]
expected: FAIL
@@ -255,12 +249,6 @@
[DocumentType interface: calling after([object Object\],[object Object\]) on document.doctype with too few arguments must throw TypeError]
expected: FAIL
- [DocumentType interface: document.doctype must inherit property "replace" with the proper type (5)]
- expected: FAIL
-
- [DocumentType interface: calling replace([object Object\],[object Object\]) on document.doctype with too few arguments must throw TypeError]
- expected: FAIL
-
[Element interface: operation hasAttributes()]
expected: FAIL
@@ -312,9 +300,6 @@
[Element interface: operation after([object Object\],[object Object\])]
expected: FAIL
- [Element interface: operation replace([object Object\],[object Object\])]
- expected: FAIL
-
[Element interface: element must inherit property "hasAttributes" with the proper type (7)]
expected: FAIL
@@ -399,12 +384,6 @@
[Element interface: calling after([object Object\],[object Object\]) on element with too few arguments must throw TypeError]
expected: FAIL
- [Element interface: element must inherit property "replace" with the proper type (41)]
- expected: FAIL
-
- [Element interface: calling replace([object Object\],[object Object\]) on element with too few arguments must throw TypeError]
- expected: FAIL
-
[NamedNodeMap interface: operation getNamedItem(DOMString)]
expected: FAIL
@@ -435,9 +414,6 @@
[CharacterData interface: operation after([object Object\],[object Object\])]
expected: FAIL
- [CharacterData interface: operation replace([object Object\],[object Object\])]
- expected: FAIL
-
[Text interface object length]
expected: FAIL
@@ -474,12 +450,6 @@
[CharacterData interface: calling after([object Object\],[object Object\]) on document.createTextNode("abc") with too few arguments must throw TypeError]
expected: FAIL
- [CharacterData interface: document.createTextNode("abc") must inherit property "replace" with the proper type (11)]
- expected: FAIL
-
- [CharacterData interface: calling replace([object Object\],[object Object\]) on document.createTextNode("abc") with too few arguments must throw TypeError]
- expected: FAIL
-
[CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "previousElementSibling" with the proper type (7)]
expected: FAIL
@@ -498,12 +468,6 @@
[CharacterData interface: calling after([object Object\],[object Object\]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError]
expected: FAIL
- [CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "replace" with the proper type (11)]
- expected: FAIL
-
- [CharacterData interface: calling replace([object Object\],[object Object\]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError]
- expected: FAIL
-
[Comment interface object length]
expected: FAIL
@@ -525,12 +489,6 @@
[CharacterData interface: calling after([object Object\],[object Object\]) on document.createComment("abc") with too few arguments must throw TypeError]
expected: FAIL
- [CharacterData interface: document.createComment("abc") must inherit property "replace" with the proper type (11)]
- expected: FAIL
-
- [CharacterData interface: calling replace([object Object\],[object Object\]) on document.createComment("abc") with too few arguments must throw TypeError]
- expected: FAIL
-
[Range interface: attribute startContainer]
expected: FAIL
@@ -1125,3 +1083,42 @@
[Comment interface: existence and properties of interface object]
expected: FAIL
+ [DocumentType interface: operation replaceWith([object Object\],[object Object\])]
+ expected: FAIL
+
+ [DocumentType interface: document.doctype must inherit property "replaceWith" with the proper type (5)]
+ expected: FAIL
+
+ [DocumentType interface: calling replaceWith([object Object\],[object Object\]) on document.doctype with too few arguments must throw TypeError]
+ expected: FAIL
+
+ [Element interface: operation replaceWith([object Object\],[object Object\])]
+ expected: FAIL
+
+ [Element interface: element must inherit property "replaceWith" with the proper type (41)]
+ expected: FAIL
+
+ [Element interface: calling replaceWith([object Object\],[object Object\]) on element with too few arguments must throw TypeError]
+ expected: FAIL
+
+ [CharacterData interface: operation replaceWith([object Object\],[object Object\])]
+ expected: FAIL
+
+ [CharacterData interface: document.createTextNode("abc") must inherit property "replaceWith" with the proper type (11)]
+ expected: FAIL
+
+ [CharacterData interface: calling replaceWith([object Object\],[object Object\]) on document.createTextNode("abc") with too few arguments must throw TypeError]
+ expected: FAIL
+
+ [CharacterData interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "replaceWith" with the proper type (11)]
+ expected: FAIL
+
+ [CharacterData interface: calling replaceWith([object Object\],[object Object\]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError]
+ expected: FAIL
+
+ [CharacterData interface: document.createComment("abc") must inherit property "replaceWith" with the proper type (11)]
+ expected: FAIL
+
+ [CharacterData interface: calling replaceWith([object Object\],[object Object\]) on document.createComment("abc") with too few arguments must throw TypeError]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/dom/nodes/Document-URL.sub.html.ini b/tests/wpt/metadata/dom/nodes/Document-URL.sub.html.ini
deleted file mode 100644
index 7a91f1b7480..00000000000
--- a/tests/wpt/metadata/dom/nodes/Document-URL.sub.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[Document-URL.sub.html]
- type: testharness
- expected: TIMEOUT
- [Document.URL with redirect]
- expected: TIMEOUT
-
diff --git a/tests/wpt/metadata/dom/nodes/Element-matches.html.ini b/tests/wpt/metadata/dom/nodes/Element-matches.html.ini
deleted file mode 100644
index 6fe7f798375..00000000000
--- a/tests/wpt/metadata/dom/nodes/Element-matches.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[Element-matches.html]
- type: testharness
- expected: TIMEOUT
diff --git a/tests/wpt/metadata/dom/nodes/Node-parentNode.html.ini b/tests/wpt/metadata/dom/nodes/Node-parentNode.html.ini
deleted file mode 100644
index a9b0f0820f9..00000000000
--- a/tests/wpt/metadata/dom/nodes/Node-parentNode.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[Node-parentNode.html]
- type: testharness
- expected: TIMEOUT
diff --git a/tests/wpt/metadata/dom/nodes/ParentNode-querySelector-All.html.ini b/tests/wpt/metadata/dom/nodes/ParentNode-querySelector-All.html.ini
deleted file mode 100644
index d43b2a8558e..00000000000
--- a/tests/wpt/metadata/dom/nodes/ParentNode-querySelector-All.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[ParentNode-querySelector-All.html]
- type: testharness
- expected: TIMEOUT
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini
new file mode 100644
index 00000000000..fa072d925b3
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini
@@ -0,0 +1,8 @@
+[PopStateEvent.html]
+ type: testharness
+ [initPopStateEvent]
+ expected: FAIL
+
+ [Dispatching a synthetic PopStateEvent]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/read-text/load-text-plain.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/read-text/load-text-plain.html.ini
index 495e93a7e77..cc9779501b8 100644
--- a/tests/wpt/metadata/html/browsers/browsing-the-web/read-text/load-text-plain.html.ini
+++ b/tests/wpt/metadata/html/browsers/browsing-the-web/read-text/load-text-plain.html.ini
@@ -1,12 +1,11 @@
[load-text-plain.html]
type: testharness
- expected: TIMEOUT
[Checking document metadata for text file]
- expected: NOTRUN
+ expected: FAIL
[Checking DOM for text file]
- expected: NOTRUN
+ expected: FAIL
[Checking contents for text file]
- expected: NOTRUN
+ expected: FAIL
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini
new file mode 100644
index 00000000000..c9e2281c872
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini
@@ -0,0 +1,5 @@
+[location_assign.html]
+ type: testharness
+ [location assign]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_hash.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_hash.html.ini
new file mode 100644
index 00000000000..a81d6814682
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_hash.html.ini
@@ -0,0 +1,5 @@
+[location_hash.html]
+ type: testharness
+ [location hash]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_host.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_host.html.ini
new file mode 100644
index 00000000000..61a0317a74c
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_host.html.ini
@@ -0,0 +1,5 @@
+[location_host.html]
+ type: testharness
+ [location host]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_hostname.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_hostname.html.ini
new file mode 100644
index 00000000000..a91dc1def9f
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_hostname.html.ini
@@ -0,0 +1,5 @@
+[location_hostname.html]
+ type: testharness
+ [location hostname]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_pathname.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_pathname.html.ini
new file mode 100644
index 00000000000..ab5d9e0cab5
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_pathname.html.ini
@@ -0,0 +1,5 @@
+[location_pathname.html]
+ type: testharness
+ [location pathname]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_port.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_port.html.ini
new file mode 100644
index 00000000000..16792b4c74e
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_port.html.ini
@@ -0,0 +1,5 @@
+[location_port.html]
+ type: testharness
+ [location port]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_protocol.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_protocol.html.ini
new file mode 100644
index 00000000000..23ce5105758
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_protocol.html.ini
@@ -0,0 +1,5 @@
+[location_protocol.html]
+ type: testharness
+ [location protocol]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini
new file mode 100644
index 00000000000..1b879fa71ac
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini
@@ -0,0 +1,5 @@
+[location_replace.html]
+ type: testharness
+ [location replace]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_search.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_search.html.ini
new file mode 100644
index 00000000000..fa2ec8514b8
--- /dev/null
+++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_search.html.ini
@@ -0,0 +1,5 @@
+[location_search.html]
+ type: testharness
+ [location search]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html.ini b/tests/wpt/metadata/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html.ini
index 919c4571deb..9f0bc5e5747 100644
--- a/tests/wpt/metadata/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html.ini
+++ b/tests/wpt/metadata/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html.ini
@@ -1,3 +1,17 @@
[named-objects.html]
type: testharness
- expected: TIMEOUT
+ [Check if the first nested browsing context is returned by window[\'c\'\]]
+ expected: FAIL
+
+ [Check if window[\'a\'\] contains all a, applet, area, embed, form, img, and object elements, and their order]
+ expected: FAIL
+
+ [Check if window[\'fs\'\] return the frameset element with name=\'fs\']
+ expected: FAIL
+
+ [Check if window[\'b\'\] returns the elements with the id=\'b\']
+ expected: FAIL
+
+ [Check if window[\'d\'\] returns the element with id=\'d\']
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html.ini b/tests/wpt/metadata/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html.ini
index 863956329af..522166b1d7b 100644
--- a/tests/wpt/metadata/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html.ini
+++ b/tests/wpt/metadata/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html.ini
@@ -6,3 +6,4 @@
[The SecurityError must be thrown if the container\'s document does not have the same effective script origin]
expected: FAIL
+
diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini
index a8a410a944b..2cf84f4a77f 100644
--- a/tests/wpt/metadata/html/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.html.ini
@@ -2292,12 +2292,6 @@
[Element interface: calling after([object Object\],[object Object\]) on document.createElement("noscript") with too few arguments must throw TypeError]
expected: FAIL
- [Element interface: document.createElement("noscript") must inherit property "replace" with the proper type (41)]
- expected: FAIL
-
- [Element interface: calling replace([object Object\],[object Object\]) on document.createElement("noscript") with too few arguments must throw TypeError]
- expected: FAIL
-
[HTMLUnknownElement interface: existence and properties of interface object]
expected: FAIL
@@ -9915,3 +9909,72 @@
[HTMLFontElement interface: document.createElement("font") must inherit property "size" with the proper type (2)]
expected: FAIL
+ [Element interface: document.createElement("noscript") must inherit property "replaceWith" with the proper type (41)]
+ expected: FAIL
+
+ [Element interface: calling replaceWith([object Object\],[object Object\]) on document.createElement("noscript") with too few arguments must throw TypeError]
+ expected: FAIL
+
+ [PopStateEvent must be primary interface of new PopStateEvent("popstate", { data: {} })]
+ expected: FAIL
+
+ [Stringification of new PopStateEvent("popstate", { data: {} })]
+ expected: FAIL
+
+ [PopStateEvent interface: new PopStateEvent("popstate", { data: {} }) must inherit property "state" with the proper type (0)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "type" with the proper type (0)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "target" with the proper type (1)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "currentTarget" with the proper type (2)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "NONE" with the proper type (3)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "CAPTURING_PHASE" with the proper type (4)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "AT_TARGET" with the proper type (5)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "BUBBLING_PHASE" with the proper type (6)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "eventPhase" with the proper type (7)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "stopPropagation" with the proper type (8)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "stopImmediatePropagation" with the proper type (9)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "bubbles" with the proper type (10)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "cancelable" with the proper type (11)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "preventDefault" with the proper type (12)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "defaultPrevented" with the proper type (13)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must have own property "isTrusted"]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "timeStamp" with the proper type (15)]
+ expected: FAIL
+
+ [Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "initEvent" with the proper type (16)]
+ expected: FAIL
+
+ [Event interface: calling initEvent(DOMString,boolean,boolean) on new PopStateEvent("popstate", { data: {} }) with too few arguments must throw TypeError]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_multiple.html.ini b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_multiple.html.ini
index 8d4ee45f2b8..956ccc14150 100644
--- a/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_multiple.html.ini
+++ b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_multiple.html.ini
@@ -1,6 +1,5 @@
[base_multiple.html]
type: testharness
- expected: TIMEOUT
[The attributes of the a element must be affected by the first base element]
- expected: NOTRUN
+ expected: FAIL
diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html.ini
deleted file mode 100644
index 0ec075cd574..00000000000
--- a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_03.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[move_iframe_in_dom_03.html]
- type: testharness
- expected: TIMEOUT
diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini
index dd1e489c720..dc6f217a5af 100644
--- a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini
+++ b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/update-the-source-set.html.ini
@@ -96,9 +96,6 @@
[<picture></picture><svg></svg><source srcset="data:,b"><img src="data:,a" data-expect="data:,b">]
expected: FAIL
- [<picture></picture><svg></svg><font></font><source srcset="data:,b"><img src="data:,a" data-expect="data:,a">]
- expected: FAIL
-
[<picture></picture><svg></svg><!--<font face> tag breaks out of svg--><font face=""></font><source srcset="data:,b"><img src="data:,a" data-expect="data:,b">]
expected: FAIL
@@ -264,3 +261,6 @@
[<picture></picture><source srcset="data:,b"><img data-expect="data:,b">]
expected: FAIL
+ [<picture></picture><svg></svg><font></font><source srcset="data:,b"><font></font><img src="data:,a" data-expect="data:,a">]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/semantics/forms/the-input-element/files.html.ini b/tests/wpt/metadata/html/semantics/forms/the-input-element/files.html.ini
new file mode 100644
index 00000000000..37cc4c14fcd
--- /dev/null
+++ b/tests/wpt/metadata/html/semantics/forms/the-input-element/files.html.ini
@@ -0,0 +1,71 @@
+[files.html]
+ type: testharness
+ [files for input type=hidden]
+ expected: FAIL
+
+ [files for input type=text]
+ expected: FAIL
+
+ [files for input type=search]
+ expected: FAIL
+
+ [files for input type=tel]
+ expected: FAIL
+
+ [files for input type=url]
+ expected: FAIL
+
+ [files for input type=email]
+ expected: FAIL
+
+ [files for input type=password]
+ expected: FAIL
+
+ [files for input type=datetime]
+ expected: FAIL
+
+ [files for input type=date]
+ expected: FAIL
+
+ [files for input type=month]
+ expected: FAIL
+
+ [files for input type=week]
+ expected: FAIL
+
+ [files for input type=time]
+ expected: FAIL
+
+ [files for input type=datetime-local]
+ expected: FAIL
+
+ [files for input type=number]
+ expected: FAIL
+
+ [files for input type=range]
+ expected: FAIL
+
+ [files for input type=color]
+ expected: FAIL
+
+ [files for input type=checkbox]
+ expected: FAIL
+
+ [files for input type=radio]
+ expected: FAIL
+
+ [files for input type=submit]
+ expected: FAIL
+
+ [files for input type=image]
+ expected: FAIL
+
+ [files for input type=reset]
+ expected: FAIL
+
+ [files for input type=button]
+ expected: FAIL
+
+ [files for input type=file]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-for-event.html.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-for-event.html.ini
index 68ab614588b..7f199914f0f 100644
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-for-event.html.ini
+++ b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-for-event.html.ini
@@ -24,3 +24,15 @@
[Script 7]
expected: FAIL
+ [Script 8]
+ expected: FAIL
+
+ [Script 9]
+ expected: FAIL
+
+ [Script 10]
+ expected: FAIL
+
+ [Script 11]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata/workers/semantics/xhr/001.html.ini b/tests/wpt/metadata/workers/semantics/xhr/001.html.ini
deleted file mode 100644
index 51403f766a3..00000000000
--- a/tests/wpt/metadata/workers/semantics/xhr/001.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[001.html]
- type: testharness
- expected: TIMEOUT
- [async XMLHttpRequest in dedicated worker]
- expected: NOTRUN
-
diff --git a/tests/wpt/metadata/workers/semantics/xhr/002.html.ini b/tests/wpt/metadata/workers/semantics/xhr/002.html.ini
deleted file mode 100644
index 676dd0f0cef..00000000000
--- a/tests/wpt/metadata/workers/semantics/xhr/002.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[002.html]
- type: testharness
- expected: TIMEOUT
- [sync XMLHttpRequest in dedicated worker]
- expected: NOTRUN
-
diff --git a/tests/wpt/metadata/workers/semantics/xhr/003.html.ini b/tests/wpt/metadata/workers/semantics/xhr/003.html.ini
index 8f105af8d7d..3d8fcb50935 100644
--- a/tests/wpt/metadata/workers/semantics/xhr/003.html.ini
+++ b/tests/wpt/metadata/workers/semantics/xhr/003.html.ini
@@ -1,6 +1,5 @@
[003.html]
type: testharness
- expected: TIMEOUT
[async XMLHttpRequest in shared worker]
- expected: NOTRUN
+ expected: FAIL
diff --git a/tests/wpt/metadata/workers/semantics/xhr/004.html.ini b/tests/wpt/metadata/workers/semantics/xhr/004.html.ini
index a9368173aab..a70a50b6d8b 100644
--- a/tests/wpt/metadata/workers/semantics/xhr/004.html.ini
+++ b/tests/wpt/metadata/workers/semantics/xhr/004.html.ini
@@ -1,6 +1,5 @@
[004.html]
type: testharness
- expected: TIMEOUT
[sync XMLHttpRequest in shared worker]
- expected: NOTRUN
+ expected: FAIL
diff --git a/tests/wpt/metadata/workers/semantics/xhr/005.html.ini b/tests/wpt/metadata/workers/semantics/xhr/005.html.ini
deleted file mode 100644
index 55274091723..00000000000
--- a/tests/wpt/metadata/workers/semantics/xhr/005.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[005.html]
- type: testharness
- expected: TIMEOUT
- [base url, dedicated worker]
- expected: NOTRUN
-
diff --git a/tests/wpt/metadata/workers/semantics/xhr/006.html.ini b/tests/wpt/metadata/workers/semantics/xhr/006.html.ini
index 447b62a304a..ec690d657ae 100644
--- a/tests/wpt/metadata/workers/semantics/xhr/006.html.ini
+++ b/tests/wpt/metadata/workers/semantics/xhr/006.html.ini
@@ -1,6 +1,5 @@
[006.html]
type: testharness
- expected: TIMEOUT
[base url, shared worker]
- expected: NOTRUN
+ expected: FAIL
diff --git a/tests/wpt/web-platform-tests b/tests/wpt/web-platform-tests
-Subproject 9b3cf7130b08834291687e8b011e85829c20ea7
+Subproject a44e574f5832d164472a7c26010bfd460f74d31