Code review comments and upstream merge conflicts

Incorporated code review comments in components/net/http_loader.rs
Resolved merge conflicts in cargo.lock file. Updated ReferrerPolicy in
lib.rs
This commit is contained in:
Raghav 2016-11-04 11:18:22 -04:00
commit 26dac98546
340 changed files with 9134 additions and 452 deletions

View file

@ -70,4 +70,8 @@ keydown
abort abort
beforescriptexecute beforescriptexecute
afterscriptexecute afterscriptexecute
invalid
change
open
toggle

View file

@ -0,0 +1,22 @@
[package]
name = "bluetooth"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
publish = false
[lib]
name = "bluetooth"
path = "lib.rs"
[dependencies]
bitflags = "0.7"
bluetooth_traits = {path = "../bluetooth_traits"}
device = {git = "https://github.com/servo/devices", features = ["bluetooth-test"]}
ipc-channel = "0.5"
rand = "0.3"
util = {path = "../util"}
uuid = {version = "0.3.1", features = ["v4"]}
[target.'cfg(target_os = "linux")'.dependencies]
tinyfiledialogs = {git = "https://github.com/jdm/tinyfiledialogs"}

View file

@ -2,29 +2,39 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use device::bluetooth::BluetoothAdapter; #[macro_use]
use device::bluetooth::BluetoothDevice; extern crate bitflags;
use device::bluetooth::BluetoothGATTCharacteristic; extern crate bluetooth_traits;
use device::bluetooth::BluetoothGATTDescriptor; extern crate device;
use device::bluetooth::BluetoothGATTService; extern crate ipc_channel;
extern crate rand;
#[cfg(target_os = "linux")]
extern crate tinyfiledialogs;
extern crate util;
extern crate uuid;
pub mod test;
use bluetooth_traits::{BluetoothCharacteristicMsg, BluetoothCharacteristicsMsg};
use bluetooth_traits::{BluetoothDescriptorMsg, BluetoothDescriptorsMsg};
use bluetooth_traits::{BluetoothDeviceMsg, BluetoothError, BluetoothMethodMsg};
use bluetooth_traits::{BluetoothResult, BluetoothServiceMsg, BluetoothServicesMsg};
use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence, RequestDeviceoptions};
use device::bluetooth::{BluetoothAdapter, BluetoothDevice, BluetoothGATTCharacteristic};
use device::bluetooth::{BluetoothGATTDescriptor, BluetoothGATTService};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use net_traits::bluetooth_scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence, RequestDeviceoptions}; use rand::Rng;
use net_traits::bluetooth_thread::{BluetoothCharacteristicMsg, BluetoothCharacteristicsMsg};
use net_traits::bluetooth_thread::{BluetoothDescriptorMsg, BluetoothDescriptorsMsg};
use net_traits::bluetooth_thread::{BluetoothDeviceMsg, BluetoothError, BluetoothMethodMsg};
use net_traits::bluetooth_thread::{BluetoothResult, BluetoothServiceMsg, BluetoothServicesMsg};
use rand::{self, Rng};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::string::String; use std::string::String;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
#[cfg(target_os = "linux")]
use tinyfiledialogs;
use util::thread::spawn_named; use util::thread::spawn_named;
const ADAPTER_ERROR: &'static str = "No adapter found"; const ADAPTER_ERROR: &'static str = "No adapter found";
const ADAPTER_NOT_POWERED_ERROR: &'static str = "Bluetooth adapter not powered";
// A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed. // A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed.
// https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439 (Vol. 3, page 480) // https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=286439 (Vol. 3, page 480)
const MAXIMUM_TRANSACTION_TIME: u8 = 30; const MAXIMUM_TRANSACTION_TIME: u8 = 30;
@ -63,7 +73,12 @@ macro_rules! return_if_cached(
macro_rules! get_adapter_or_return_error( macro_rules! get_adapter_or_return_error(
($bl_manager:expr, $sender:expr) => ( ($bl_manager:expr, $sender:expr) => (
match $bl_manager.get_or_create_adapter() { match $bl_manager.get_or_create_adapter() {
Some(adapter) => adapter, Some(adapter) => {
if !adapter.is_powered().unwrap_or(false) {
return drop($sender.send(Err(BluetoothError::Type(ADAPTER_NOT_POWERED_ERROR.to_string()))))
}
adapter
},
None => return drop($sender.send(Err(BluetoothError::Type(ADAPTER_ERROR.to_string())))), None => return drop($sender.send(Err(BluetoothError::Type(ADAPTER_ERROR.to_string())))),
} }
); );
@ -147,6 +162,13 @@ fn matches_filters(device: &BluetoothDevice, filters: &BluetoothScanfilterSequen
return filters.iter().any(|f| matches_filter(device, f)) return filters.iter().any(|f| matches_filter(device, f))
} }
fn is_mock_adapter(adapter: &BluetoothAdapter) -> bool {
match adapter {
&BluetoothAdapter::Mock(_) => true,
_ => false,
}
}
pub struct BluetoothManager { pub struct BluetoothManager {
receiver: IpcReceiver<BluetoothMethodMsg>, receiver: IpcReceiver<BluetoothMethodMsg>,
adapter: Option<BluetoothAdapter>, adapter: Option<BluetoothAdapter>,
@ -220,6 +242,9 @@ impl BluetoothManager {
BluetoothMethodMsg::WriteValue(id, value, sender) => { BluetoothMethodMsg::WriteValue(id, value, sender) => {
self.write_value(id, value, sender) self.write_value(id, value, sender)
}, },
BluetoothMethodMsg::Test(data_set_name, sender) => {
self.test(data_set_name, sender)
}
BluetoothMethodMsg::Exit => { BluetoothMethodMsg::Exit => {
break break
}, },
@ -227,13 +252,46 @@ impl BluetoothManager {
} }
} }
// Test
fn test(&mut self, data_set_name: String, sender: IpcSender<BluetoothResult<()>>) {
self.address_to_id.clear();
self.service_to_device.clear();
self.characteristic_to_service.clear();
self.descriptor_to_characteristic.clear();
self.cached_devices.clear();
self.cached_services.clear();
self.cached_characteristics.clear();
self.cached_descriptors.clear();
self.allowed_services.clear();
self.adapter = BluetoothAdapter::init_mock().ok();
match test::test(self, data_set_name) {
Ok(_) => {
let _ = sender.send(Ok(()));
},
Err(error) => {
let _ = sender.send(Err(BluetoothError::Type(error.description().to_owned())));
},
}
}
// Adapter // Adapter
fn get_or_create_adapter(&mut self) -> Option<BluetoothAdapter> { pub fn get_or_create_adapter(&mut self) -> Option<BluetoothAdapter> {
let adapter_valid = self.adapter.as_ref().map_or(false, |a| a.get_address().is_ok()); let adapter_valid = self.adapter.as_ref().map_or(false, |a| a.get_address().is_ok());
if !adapter_valid { if !adapter_valid {
self.adapter = BluetoothAdapter::init().ok(); self.adapter = BluetoothAdapter::init().ok();
} }
let adapter = match self.adapter.as_ref() {
Some(adapter) => adapter,
None => return None,
};
if is_mock_adapter(adapter) && !adapter.is_present().unwrap_or(false) {
return None;
}
self.adapter.clone() self.adapter.clone()
} }
@ -262,7 +320,16 @@ impl BluetoothManager {
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn select_device(&mut self, devices: Vec<BluetoothDevice>) -> Option<String> { fn select_device(&mut self, devices: Vec<BluetoothDevice>, adapter: &BluetoothAdapter) -> Option<String> {
if is_mock_adapter(adapter) {
for device in devices {
if let Ok(address) = device.get_address() {
return Some(address);
}
}
return None;
}
let mut dialog_rows: Vec<String> = vec!(); let mut dialog_rows: Vec<String> = vec!();
for device in devices { for device in devices {
dialog_rows.extend_from_slice(&[device.get_address().unwrap_or("".to_string()), dialog_rows.extend_from_slice(&[device.get_address().unwrap_or("".to_string()),
@ -283,7 +350,7 @@ impl BluetoothManager {
} }
#[cfg(not(target_os = "linux"))] #[cfg(not(target_os = "linux"))]
fn select_device(&mut self, devices: Vec<BluetoothDevice>) -> Option<String> { fn select_device(&mut self, devices: Vec<BluetoothDevice>, _adapter: &BluetoothAdapter) -> Option<String> {
for device in devices { for device in devices {
if let Ok(address) = device.get_address() { if let Ok(address) = device.get_address() {
return Some(address); return Some(address);
@ -304,6 +371,17 @@ impl BluetoothManager {
device_id device_id
} }
fn device_from_service_id(&self, service_id: &str) -> Option<BluetoothDevice> {
let device_id = match self.service_to_device.get(service_id) {
Some(id) => id,
None => return None,
};
match self.cached_devices.get(device_id) {
Some(d) => Some(d.clone()),
None => None,
}
}
// Service // Service
fn get_and_cache_gatt_services(&mut self, fn get_and_cache_gatt_services(&mut self,
@ -456,7 +534,9 @@ impl BluetoothManager {
let mut adapter = get_adapter_or_return_error!(self, sender); let mut adapter = get_adapter_or_return_error!(self, sender);
if let Ok(ref session) = adapter.create_discovery_session() { if let Ok(ref session) = adapter.create_discovery_session() {
if session.start_discovery().is_ok() { if session.start_discovery().is_ok() {
thread::sleep(Duration::from_millis(DISCOVERY_TIMEOUT_MS)); if !is_mock_adapter(&adapter) {
thread::sleep(Duration::from_millis(DISCOVERY_TIMEOUT_MS));
}
} }
let _ = session.stop_discovery(); let _ = session.stop_discovery();
} }
@ -473,7 +553,7 @@ impl BluetoothManager {
} }
// Step 8. // Step 8.
if let Some(address) = self.select_device(matched_devices) { if let Some(address) = self.select_device(matched_devices, &adapter) {
let device_id = match self.address_to_id.get(&address) { let device_id = match self.address_to_id.get(&address) {
Some(id) => id.clone(), Some(id) => id.clone(),
None => return drop(sender.send(Err(BluetoothError::NotFound))), None => return drop(sender.send(Err(BluetoothError::NotFound))),
@ -509,7 +589,12 @@ impl BluetoothManager {
for _ in 0..MAXIMUM_TRANSACTION_TIME { for _ in 0..MAXIMUM_TRANSACTION_TIME {
match d.is_connected().unwrap_or(false) { match d.is_connected().unwrap_or(false) {
true => return drop(sender.send(Ok(true))), true => return drop(sender.send(Ok(true))),
false => thread::sleep(Duration::from_millis(CONNECTION_TIMEOUT_MS)), false => {
if is_mock_adapter(&adapter) {
break;
}
thread::sleep(Duration::from_millis(CONNECTION_TIMEOUT_MS));
},
} }
} }
return drop(sender.send(Err(BluetoothError::Network))); return drop(sender.send(Err(BluetoothError::Network)));
@ -609,11 +694,15 @@ impl BluetoothManager {
Some(a) => a, Some(a) => a,
None => return drop(sender.send(Err(BluetoothError::Type(ADAPTER_ERROR.to_string())))), None => return drop(sender.send(Err(BluetoothError::Type(ADAPTER_ERROR.to_string())))),
}; };
let device = match self.device_from_service_id(&service_id) {
Some(device) => device,
None => return drop(sender.send(Err(BluetoothError::NotFound))),
};
let primary_service = match self.get_gatt_service(&mut adapter, &service_id) { let primary_service = match self.get_gatt_service(&mut adapter, &service_id) {
Some(s) => s, Some(s) => s,
None => return drop(sender.send(Err(BluetoothError::NotFound))), None => return drop(sender.send(Err(BluetoothError::NotFound))),
}; };
let services = primary_service.get_includes().unwrap_or(vec!()); let services = primary_service.get_includes(device).unwrap_or(vec!());
for service in services { for service in services {
if let Ok(service_uuid) = service.get_uuid() { if let Ok(service_uuid) = service.get_uuid() {
if uuid == service_uuid { if uuid == service_uuid {
@ -636,11 +725,15 @@ impl BluetoothManager {
Some(a) => a, Some(a) => a,
None => return drop(sender.send(Err(BluetoothError::Type(ADAPTER_ERROR.to_string())))), None => return drop(sender.send(Err(BluetoothError::Type(ADAPTER_ERROR.to_string())))),
}; };
let device = match self.device_from_service_id(&service_id) {
Some(device) => device,
None => return drop(sender.send(Err(BluetoothError::NotFound))),
};
let primary_service = match self.get_gatt_service(&mut adapter, &service_id) { let primary_service = match self.get_gatt_service(&mut adapter, &service_id) {
Some(s) => s, Some(s) => s,
None => return drop(sender.send(Err(BluetoothError::NotFound))), None => return drop(sender.send(Err(BluetoothError::NotFound))),
}; };
let services = primary_service.get_includes().unwrap_or(vec!()); let services = primary_service.get_includes(device).unwrap_or(vec!());
let mut services_vec = vec!(); let mut services_vec = vec!();
for service in services { for service in services {
if let Ok(service_uuid) = service.get_uuid() { if let Ok(service_uuid) = service.get_uuid() {

View file

@ -0,0 +1,501 @@
/* 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/. */
use BluetoothManager;
use device::bluetooth::{BluetoothAdapter, BluetoothDevice};
use device::bluetooth::{BluetoothGATTCharacteristic, BluetoothGATTDescriptor, BluetoothGATTService};
use std::borrow::ToOwned;
use std::cell::RefCell;
use std::collections::HashSet;
use std::error::Error;
use std::string::String;
use uuid::Uuid;
thread_local!(pub static CACHED_IDS: RefCell<HashSet<Uuid>> = RefCell::new(HashSet::new()));
const ADAPTER_ERROR: &'static str = "No adapter found";
const WRONG_DATA_SET_ERROR: &'static str = "Wrong data set name was provided";
const READ_FLAG: &'static str = "read";
const WRITE_FLAG: &'static str = "write";
// Adapter names
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=65
const NOT_PRESENT_ADAPTER: &'static str = "NotPresentAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=83
const NOT_POWERED_ADAPTER: &'static str = "NotPoweredAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=118
const EMPTY_ADAPTER: &'static str = "EmptyAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=126
const GLUCOSE_HEART_RATE_ADAPTER: &'static str = "GlucoseHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=135
const UNICODE_DEVICE_ADAPTER: &'static str = "UnicodeDeviceAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=205
const MISSING_SERVICE_HEART_RATE_ADAPTER: &'static str = "MissingServiceHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=219
const MISSING_CHARACTERISTIC_HEART_RATE_ADAPTER: &'static str = "MissingCharacteristicHeartRateAdapter";
const MISSING_DESCRIPTOR_HEART_RATE_ADAPTER: &'static str = "MissingDescriptorHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=234
const HEART_RATE_ADAPTER: &'static str = "HeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=250
const EMPTY_NAME_HEART_RATE_ADAPTER: &'static str = "EmptyNameHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=267
const NO_NAME_HEART_RATE_ADAPTER: &'static str = "NoNameHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=284
const TWO_HEART_RATE_SERVICES_ADAPTER: &'static str = "TwoHeartRateServicesAdapter";
const BLACKLIST_TEST_ADAPTER: &'static str = "BlacklistTestAdapter";
// Device names
const CONNECTABLE_DEVICE_NAME: &'static str = "Connectable Device";
const EMPTY_DEVICE_NAME: &'static str = "";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#glucosedevice
const GLUCOSE_DEVICE_NAME: &'static str = "Glucose Device";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#heartratedevice
const HEART_RATE_DEVICE_NAME: &'static str = "Heart Rate Device";
const UNICODE_DEVICE_NAME: &'static str = "❤❤❤❤❤❤❤❤❤";
// Device addresses
const CONNECTABLE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:04";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#glucosedevice
const GLUCOSE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:02";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#heartratedevice
const HEART_RATE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:03";
const UNICODE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:01";
// Service UUIDs
const BLACKLIST_TEST_SERVICE_UUID: &'static str = "611c954a-263b-4f4a-aab6-01ddb953f985";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.device_information.xml
const DEVICE_INFORMATION_UUID: &'static str = "0000180a-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.generic_access.xml
const GENERIC_ACCESS_SERVICE_UUID: &'static str = "00001800-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.glucose.xml
const GLUCOSE_SERVICE_UUID: &'static str = "00001808-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_rate.xml
const HEART_RATE_SERVICE_UUID: &'static str = "0000180d-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.service.human_interface_device.xml
const HUMAN_INTERFACE_DEVICE_SERVICE_UUID: &'static str = "00001812-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.tx_power.xml
const TX_POWER_SERVICE_UUID: &'static str = "00001804-0000-1000-8000-00805f9b34fb";
// Characteristic UUIDs
const BLACKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID: &'static str = "bad1c9a2-9a5b-4015-8b60-1579bbbf2135";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.body_sensor_location.xml
const BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID: &'static str = "00002a38-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.gap.device_name.xml
const DEVICE_NAME_CHARACTERISTIC_UUID: &'static str = "00002a00-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_measurement.xml
const HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID: &'static str = "00002a37-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.gap.peripheral_privacy_flag.xml
const PERIPHERAL_PRIVACY_FLAG_CHARACTERISTIC_UUID: &'static str = "00002a02-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.serial_number_string.xml
const SERIAL_NUMBER_STRING_UUID: &'static str = "00002a25-0000-1000-8000-00805f9b34fb";
// Descriptor UUIDs
const BLACKLIST_EXCLUDE_READS_DESCRIPTOR_UUID: &'static str = "aaaaaaaa-aaaa-1181-0510-810819516110";
const BLACKLIST_DESCRIPTOR_UUID: &'static str = "07711111-6104-0970-7011-1107105110aaa";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_user_description.xml
const CHARACTERISTIC_USER_DESCRIPTION_UUID: &'static str = "00002901-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
const CLIENT_CHARACTERISTIC_CONFIGURATION_UUID: &'static str = "00002902-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.number_of_digitals.xml
const NUMBER_OF_DIGITALS_UUID: &'static str = "00002909-0000-1000-8000-00805f9b34fb";
const HEART_RATE_DEVICE_NAME_DESCRIPTION: &'static str = "The name of this device.";
fn generate_id() -> Uuid {
let mut id = Uuid::nil();
let mut generated = false;
while !generated {
id = Uuid::new_v4();
CACHED_IDS.with(|cache|
if !cache.borrow().contains(&id) {
cache.borrow_mut().insert(id.clone());
generated = true;
}
);
}
id
}
// Set the adapter's name, is_powered and is_discoverable attributes
fn set_adapter(adapter: &BluetoothAdapter, adapter_name: String) -> Result<(), Box<Error>> {
try!(adapter.set_name(adapter_name));
try!(adapter.set_powered(true));
try!(adapter.set_discoverable(true));
Ok(())
}
// Create Device
fn create_device(adapter: &BluetoothAdapter,
name: String,
address: String)
-> Result<BluetoothDevice, Box<Error>> {
let device = try!(BluetoothDevice::create_mock_device(adapter.clone(), generate_id().to_string()));
try!(device.set_name(Some(name)));
try!(device.set_address(address));
try!(device.set_connectable(true));
Ok(device)
}
// Create Device with UUIDs
fn create_device_with_uuids(adapter: &BluetoothAdapter,
name: String,
address: String,
uuids: Vec<String>)
-> Result<BluetoothDevice, Box<Error>> {
let device = try!(create_device(adapter, name, address));
try!(device.set_uuids(uuids));
Ok(device)
}
// Create Service
fn create_service(device: &BluetoothDevice,
uuid: String)
-> Result<BluetoothGATTService, Box<Error>> {
let service = try!(BluetoothGATTService::create_mock_service(device.clone(), generate_id().to_string()));
try!(service.set_uuid(uuid));
Ok(service)
}
// Create Characteristic
fn create_characteristic(service: &BluetoothGATTService,
uuid: String)
-> Result<BluetoothGATTCharacteristic, Box<Error>> {
let characteristic =
try!(BluetoothGATTCharacteristic::create_mock_characteristic(service.clone(), generate_id().to_string()));
try!(characteristic.set_uuid(uuid));
Ok(characteristic)
}
// Create Characteristic with value
fn create_characteristic_with_value(service: &BluetoothGATTService,
uuid: String,
value: Vec<u8>)
-> Result<BluetoothGATTCharacteristic, Box<Error>> {
let characteristic = try!(create_characteristic(service, uuid));
try!(characteristic.set_value(value));
Ok(characteristic)
}
// Create Descriptor
fn create_descriptor(characteristic: &BluetoothGATTCharacteristic,
uuid: String)
-> Result<BluetoothGATTDescriptor, Box<Error>> {
let descriptor =
try!(BluetoothGATTDescriptor::create_mock_descriptor(characteristic.clone(), generate_id().to_string()));
try!(descriptor.set_uuid(uuid));
Ok(descriptor)
}
// Create Descriptor with value
fn create_descriptor_with_value(characteristic: &BluetoothGATTCharacteristic,
uuid: String,
value: Vec<u8>)
-> Result<BluetoothGATTDescriptor, Box<Error>> {
let descriptor = try!(create_descriptor(characteristic, uuid));
try!(descriptor.set_value(value));
Ok(descriptor)
}
fn create_heart_rate_service(device: &BluetoothDevice,
empty: bool)
-> Result<BluetoothGATTService, Box<Error>> {
// Heart Rate Service
let heart_rate_service = try!(create_service(device, HEART_RATE_SERVICE_UUID.to_owned()));
if empty {
return Ok(heart_rate_service)
}
// Heart Rate Measurement Characteristic
let _heart_rate_measurement_characteristic =
try!(create_characteristic_with_value(&heart_rate_service,
HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID.to_owned(),
vec![0]));
// Body Sensor Location Characteristic 1
let body_sensor_location_characteristic_1 =
try!(create_characteristic_with_value(&heart_rate_service,
BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID.to_owned(),
vec![49]));
try!(body_sensor_location_characteristic_1.set_flags(vec![READ_FLAG.to_string()]));
// Body Sensor Location Characteristic 2
let body_sensor_location_characteristic_2 =
try!(create_characteristic_with_value(&heart_rate_service,
BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID.to_owned(),
vec![50]));
try!(body_sensor_location_characteristic_2.set_flags(vec![READ_FLAG.to_string()]));
Ok(heart_rate_service)
}
fn create_generic_access_service(device: &BluetoothDevice,
empty: bool)
-> Result<BluetoothGATTService, Box<Error>> {
// Generic Access Service
let generic_access_service =
try!(create_service(device, GENERIC_ACCESS_SERVICE_UUID.to_owned()));
if empty {
return Ok(generic_access_service)
}
// Device Name Characteristic
let device_name_characteristic =
try!(create_characteristic_with_value(&generic_access_service,
DEVICE_NAME_CHARACTERISTIC_UUID.to_owned(),
HEART_RATE_DEVICE_NAME.as_bytes().to_vec()));
try!(device_name_characteristic.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
// Number of Digitals descriptor
let number_of_digitals_descriptor_1 =
try!(create_descriptor_with_value(&device_name_characteristic,
NUMBER_OF_DIGITALS_UUID.to_owned(),
vec![49]));
try!(number_of_digitals_descriptor_1.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
let number_of_digitals_descriptor_2 =
try!(create_descriptor_with_value(&device_name_characteristic,
NUMBER_OF_DIGITALS_UUID.to_owned(),
vec![50]));
try!(number_of_digitals_descriptor_2.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
// Characteristic User Description Descriptor
let _characteristic_user_description =
try!(create_descriptor_with_value(&device_name_characteristic,
CHARACTERISTIC_USER_DESCRIPTION_UUID.to_owned(),
HEART_RATE_DEVICE_NAME_DESCRIPTION.as_bytes().to_vec()));
// Client Characteristic Configuration descriptor
let _client_characteristic_configuration =
try!(create_descriptor_with_value(&device_name_characteristic,
CLIENT_CHARACTERISTIC_CONFIGURATION_UUID.to_owned(),
vec![0]));
// Peripheral Privacy Flag Characteristic
let peripheral_privacy_flag_characteristic =
try!(create_characteristic(&generic_access_service, PERIPHERAL_PRIVACY_FLAG_CHARACTERISTIC_UUID.to_owned()));
try!(peripheral_privacy_flag_characteristic
.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
Ok(generic_access_service)
}
// Create Heart Rate Device
fn create_heart_rate_device(adapter: &BluetoothAdapter,
empty: bool)
-> Result<BluetoothDevice, Box<Error>> {
// Heart Rate Device
let heart_rate_device =
try!(create_device_with_uuids(adapter,
HEART_RATE_DEVICE_NAME.to_owned(),
HEART_RATE_DEVICE_ADDRESS.to_owned(),
vec![GENERIC_ACCESS_SERVICE_UUID.to_owned(),
HEART_RATE_SERVICE_UUID.to_owned()]));
if empty {
return Ok(heart_rate_device);
}
// Generic Access Service
let _generic_access_service = try!(create_generic_access_service(&heart_rate_device, false));
// Heart Rate Service
let _heart_rate_service = try!(create_heart_rate_service(&heart_rate_device, false));
Ok(heart_rate_device)
}
fn create_missing_characterisitc_heart_rate_device(adapter: &BluetoothAdapter) -> Result<(), Box<Error>> {
let heart_rate_device_empty = try!(create_heart_rate_device(adapter, true));
let _generic_access_service_empty = try!(create_generic_access_service(&heart_rate_device_empty, true));
let _heart_rate_service_empty = try!(create_heart_rate_service(&heart_rate_device_empty, true));
Ok(())
}
fn create_missing_descriptor_heart_rate_device(adapter: &BluetoothAdapter) -> Result<(), Box<Error>> {
let heart_rate_device_empty = try!(create_heart_rate_device(adapter, true));
let generic_access_service_empty = try!(create_generic_access_service(&heart_rate_device_empty, true));
let _device_name_characteristic =
try!(create_characteristic_with_value(&generic_access_service_empty,
DEVICE_NAME_CHARACTERISTIC_UUID.to_owned(),
HEART_RATE_DEVICE_NAME.as_bytes().to_vec()));
let peripheral_privacy_flag_characteristic =
try!(create_characteristic(&generic_access_service_empty,
PERIPHERAL_PRIVACY_FLAG_CHARACTERISTIC_UUID.to_owned()));
try!(peripheral_privacy_flag_characteristic.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
let _heart_rate_service = try!(create_heart_rate_service(&heart_rate_device_empty, false));
Ok(())
}
fn create_two_heart_rate_services_device(adapter: &BluetoothAdapter) -> Result<(), Box<Error>> {
let heart_rate_device_empty = try!(create_heart_rate_device(adapter, true));
try!(heart_rate_device_empty.set_uuids(vec![GENERIC_ACCESS_SERVICE_UUID.to_owned(),
HEART_RATE_SERVICE_UUID.to_owned(),
HEART_RATE_SERVICE_UUID.to_owned()]));
let _generic_access_service = try!(create_generic_access_service(&heart_rate_device_empty, false));
let heart_rate_service_empty_1 = try!(create_heart_rate_service(&heart_rate_device_empty, true));
let heart_rate_service_empty_2 = try!(create_heart_rate_service(&heart_rate_device_empty, true));
let _heart_rate_measurement_characteristic =
try!(create_characteristic_with_value(&heart_rate_service_empty_1,
HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID.to_owned(),
vec![0]));
let _body_sensor_location_characteristic_1 =
try!(create_characteristic_with_value(&heart_rate_service_empty_1,
BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID.to_owned(),
vec![49]));
let _body_sensor_location_characteristic_2 =
try!(create_characteristic_with_value(&heart_rate_service_empty_2,
BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID.to_owned(),
vec![50]));
Ok(())
}
fn create_blacklisted_device(adapter: &BluetoothAdapter) -> Result<(), Box<Error>> {
let connectable_device =
try!(create_device_with_uuids(adapter,
CONNECTABLE_DEVICE_NAME.to_owned(),
CONNECTABLE_DEVICE_ADDRESS.to_owned(),
vec![BLACKLIST_TEST_SERVICE_UUID.to_owned(),
DEVICE_INFORMATION_UUID.to_owned(),
GENERIC_ACCESS_SERVICE_UUID.to_owned(),
HEART_RATE_SERVICE_UUID.to_owned(),
HUMAN_INTERFACE_DEVICE_SERVICE_UUID.to_owned()]));
let blacklist_test_service = try!(create_service(&connectable_device, BLACKLIST_TEST_SERVICE_UUID.to_owned()));
let blacklist_exclude_reads_characteristic =
try!(create_characteristic(&blacklist_test_service,
BLACKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID.to_owned()));
try!(blacklist_exclude_reads_characteristic
.set_flags(vec![READ_FLAG.to_string(), WRITE_FLAG.to_string()]));
let _blacklist_exclude_reads_descriptor =
try!(create_descriptor_with_value(&blacklist_exclude_reads_characteristic,
BLACKLIST_EXCLUDE_READS_DESCRIPTOR_UUID.to_owned(),
vec![54; 3]));
let _blacklist_descriptor =
try!(create_descriptor_with_value(&blacklist_exclude_reads_characteristic,
BLACKLIST_DESCRIPTOR_UUID.to_owned(),
vec![54; 3]));
let device_information_service = try!(create_service(&connectable_device, DEVICE_INFORMATION_UUID.to_owned()));
let _serial_number_string_characteristic =
try!(create_characteristic(&device_information_service, SERIAL_NUMBER_STRING_UUID.to_owned()));
let _generic_access_service = try!(create_generic_access_service(&connectable_device, false));
let _heart_rate_service = try!(create_heart_rate_service(&connectable_device, false));
let _human_interface_device_service =
try!(create_service(&connectable_device, HUMAN_INTERFACE_DEVICE_SERVICE_UUID.to_owned()));
Ok(())
}
pub fn test(manager: &mut BluetoothManager, data_set_name: String) -> Result<(), Box<Error>> {
let may_existing_adapter = manager.get_or_create_adapter();
let adapter = match may_existing_adapter.as_ref() {
Some(adapter) => adapter,
None => return Err(Box::from(ADAPTER_ERROR.to_string())),
};
match data_set_name.as_str() {
NOT_PRESENT_ADAPTER => {
try!(set_adapter(adapter, NOT_PRESENT_ADAPTER.to_owned()));
try!(adapter.set_present(false));
},
NOT_POWERED_ADAPTER => {
try!(set_adapter(adapter, NOT_POWERED_ADAPTER.to_owned()));
try!(adapter.set_powered(false));
},
EMPTY_ADAPTER => {
try!(set_adapter(adapter, EMPTY_ADAPTER.to_owned()));
},
GLUCOSE_HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, GLUCOSE_HEART_RATE_ADAPTER.to_owned()));
let _glucose_devie = try!(create_device_with_uuids(adapter,
GLUCOSE_DEVICE_NAME.to_owned(),
GLUCOSE_DEVICE_ADDRESS.to_owned(),
vec![GLUCOSE_SERVICE_UUID.to_owned(),
TX_POWER_SERVICE_UUID.to_owned()]));
let _heart_rate_device_empty = try!(create_heart_rate_device(adapter, true));
},
UNICODE_DEVICE_ADAPTER => {
try!(set_adapter(adapter, UNICODE_DEVICE_ADAPTER.to_owned()));
let _unicode_device = try!(create_device(adapter,
UNICODE_DEVICE_NAME.to_owned(),
UNICODE_DEVICE_ADDRESS.to_owned()));
},
MISSING_SERVICE_HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, MISSING_SERVICE_HEART_RATE_ADAPTER.to_owned()));
let _heart_rate_device_empty = try!(create_heart_rate_device(adapter, true));
},
MISSING_CHARACTERISTIC_HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, MISSING_CHARACTERISTIC_HEART_RATE_ADAPTER.to_owned()));
let _ = try!(create_missing_characterisitc_heart_rate_device(adapter));
},
MISSING_DESCRIPTOR_HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, MISSING_DESCRIPTOR_HEART_RATE_ADAPTER.to_owned()));
let _ = try!(create_missing_descriptor_heart_rate_device(adapter));
},
HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, HEART_RATE_ADAPTER.to_owned()));
let _heart_rate_device = try!(create_heart_rate_device(adapter, false));
},
EMPTY_NAME_HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, EMPTY_NAME_HEART_RATE_ADAPTER.to_owned()));
let heart_rate_device = try!(create_heart_rate_device(adapter, false));
try!(heart_rate_device.set_name(Some(EMPTY_DEVICE_NAME.to_owned())));
},
NO_NAME_HEART_RATE_ADAPTER => {
try!(set_adapter(adapter, NO_NAME_HEART_RATE_ADAPTER.to_owned()));
let heart_rate_device = try!(create_heart_rate_device(adapter, false));
try!(heart_rate_device.set_name(None));
},
TWO_HEART_RATE_SERVICES_ADAPTER => {
try!(set_adapter(adapter, TWO_HEART_RATE_SERVICES_ADAPTER.to_owned()));
let _ = try!(create_two_heart_rate_services_device(adapter));
},
BLACKLIST_TEST_ADAPTER => {
try!(set_adapter(adapter, BLACKLIST_TEST_ADAPTER.to_owned()));
let _ = try!(create_blacklisted_device(adapter));
},
_ => return Err(Box::from(WRONG_DATA_SET_ERROR.to_string())),
}
return Ok(());
}

View file

@ -0,0 +1,15 @@
[package]
name = "bluetooth_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
publish = false
[lib]
name = "bluetooth_traits"
path = "lib.rs"
[dependencies]
ipc-channel = "0.5"
serde = "0.8"
serde_derive = "0.8"

View file

@ -2,8 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_scanfilter::RequestDeviceoptions; #![feature(proc_macro)]
extern crate ipc_channel;
#[macro_use]
extern crate serde_derive;
pub mod scanfilter;
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use scanfilter::RequestDeviceoptions;
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub enum BluetoothError { pub enum BluetoothError {
@ -78,5 +86,6 @@ pub enum BluetoothMethodMsg {
GetDescriptors(String, Option<String>, IpcSender<BluetoothResult<BluetoothDescriptorsMsg>>), GetDescriptors(String, Option<String>, IpcSender<BluetoothResult<BluetoothDescriptorsMsg>>),
ReadValue(String, IpcSender<BluetoothResult<Vec<u8>>>), ReadValue(String, IpcSender<BluetoothResult<Vec<u8>>>),
WriteValue(String, Vec<u8>, IpcSender<BluetoothResult<bool>>), WriteValue(String, Vec<u8>, IpcSender<BluetoothResult<bool>>),
Test(String, IpcSender<BluetoothResult<()>>),
Exit, Exit,
} }

View file

@ -18,7 +18,7 @@ use gleam::gl::types::{GLint, GLsizei};
use image::{DynamicImage, ImageFormat, RgbImage}; use image::{DynamicImage, ImageFormat, RgbImage};
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, CONTROL};
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId, TraversalDirection}; use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId, TraversalDirection};
use net_traits::image::base::{Image, PixelFormat}; use net_traits::image::base::{Image, PixelFormat};
use profile_traits::mem::{self, Reporter, ReporterRequest}; use profile_traits::mem::{self, Reporter, ReporterRequest};
@ -739,6 +739,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
fn set_frame_tree(&mut self, fn set_frame_tree(&mut self,
frame_tree: &SendableFrameTree, frame_tree: &SendableFrameTree,
response_chan: IpcSender<()>) { response_chan: IpcSender<()>) {
debug!("Setting the frame tree for pipeline {}", frame_tree.pipeline.id);
if let Err(e) = response_chan.send(()) { if let Err(e) = response_chan.send(()) {
warn!("Sending reponse to set frame tree failed ({}).", e); warn!("Sending reponse to set frame tree failed ({}).", e);
} }
@ -1301,7 +1302,23 @@ impl<Window: WindowMethods> IOCompositor<Window> {
} }
} }
fn on_key_event(&self, ch: Option<char>, key: Key, state: KeyState, modifiers: KeyModifiers) { fn on_key_event(&mut self,
ch: Option<char>,
key: Key,
state: KeyState,
modifiers: KeyModifiers) {
// Steal a few key events for webrender debug options.
if modifiers.contains(CONTROL) && state == KeyState::Pressed {
match key {
Key::F12 => {
let profiler_enabled = self.webrender.get_profiler_enabled();
self.webrender.set_profiler_enabled(!profiler_enabled);
return;
}
_ => {}
}
}
let msg = ConstellationMsg::KeyEvent(ch, key, state, modifiers); let msg = ConstellationMsg::KeyEvent(ch, key, state, modifiers);
if let Err(e) = self.constellation_chan.send(msg) { if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending key event to constellation failed ({}).", e); warn!("Sending key event to constellation failed ({}).", e);

View file

@ -11,6 +11,7 @@ path = "lib.rs"
[dependencies] [dependencies]
backtrace = "0.2.1" backtrace = "0.2.1"
bluetooth_traits = { path = "../bluetooth_traits" }
canvas = {path = "../canvas"} canvas = {path = "../canvas"}
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
compositing = {path = "../compositing"} compositing = {path = "../compositing"}

View file

@ -10,6 +10,7 @@
//! `LayoutThread`, and `PaintThread`. //! `LayoutThread`, and `PaintThread`.
use backtrace::Backtrace; use backtrace::Backtrace;
use bluetooth_traits::BluetoothMethodMsg;
use canvas::canvas_paint_thread::CanvasPaintThread; use canvas::canvas_paint_thread::CanvasPaintThread;
use canvas::webgl_paint_thread::WebGLPaintThread; use canvas::webgl_paint_thread::WebGLPaintThread;
use canvas_traits::CanvasMsg; use canvas_traits::CanvasMsg;
@ -29,7 +30,6 @@ use msg::constellation_msg::{FrameId, FrameType, PipelineId};
use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use msg::constellation_msg::{Key, KeyModifiers, KeyState};
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection}; use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
use net_traits::{self, IpcSend, ResourceThreads}; use net_traits::{self, IpcSend, ResourceThreads};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::ImageCacheThread; use net_traits::image_cache_thread::ImageCacheThread;
use net_traits::storage_thread::StorageThreadMsg; use net_traits::storage_thread::StorageThreadMsg;
use offscreen_gl_context::{GLContextAttributes, GLLimits}; use offscreen_gl_context::{GLContextAttributes, GLLimits};
@ -668,13 +668,16 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// Create a new frame and update the internal bookkeeping. // Create a new frame and update the internal bookkeeping.
fn new_frame(&mut self, frame_id: FrameId, pipeline_id: PipelineId) { fn new_frame(&mut self, frame_id: FrameId, pipeline_id: PipelineId) {
let frame = Frame::new(frame_id, pipeline_id); let frame = Frame::new(frame_id, pipeline_id);
match self.pipelines.get_mut(&pipeline_id) {
Some(pipeline) => pipeline.is_mature = true,
None => return warn!("Pipeline {} matured after closure.", pipeline_id),
};
self.frames.insert(frame_id, frame); self.frames.insert(frame_id, frame);
// If a child frame, add it to the parent pipeline.
let parent_info = self.pipelines.get(&pipeline_id)
.and_then(|pipeline| pipeline.parent_info);
if let Some((parent_id, _)) = parent_info {
if let Some(parent) = self.pipelines.get_mut(&parent_id) {
parent.add_child(frame_id);
}
}
} }
/// Handles loading pages, navigation, and granting access to the compositor /// Handles loading pages, navigation, and granting access to the compositor
@ -777,6 +780,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} }
FromCompositorMsg::IsReadyToSaveImage(pipeline_states) => { FromCompositorMsg::IsReadyToSaveImage(pipeline_states) => {
let is_ready = self.handle_is_ready_to_save_image(pipeline_states); let is_ready = self.handle_is_ready_to_save_image(pipeline_states);
debug!("Ready to save image {:?}.", is_ready);
if opts::get().is_running_problem_test { if opts::get().is_running_problem_test {
println!("got ready to save image query, result is {:?}", is_ready); println!("got ready to save image query, result is {:?}", is_ready);
} }
@ -1022,8 +1026,31 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.shutting_down = true; self.shutting_down = true;
// TODO: exit before the root frame is initialized? // TODO: exit before the root frame is initialized?
debug!("Removing root frame.");
let root_frame_id = self.root_frame_id; let root_frame_id = self.root_frame_id;
self.close_frame(root_frame_id, ExitPipelineMode::Normal); self.close_frame(root_frame_id, ExitPipelineMode::Normal);
// Close any pending frames and pipelines
while let Some(pending) = self.pending_frames.pop() {
debug!("Removing pending frame {}.", pending.frame_id);
self.close_frame(pending.frame_id, ExitPipelineMode::Normal);
debug!("Removing pending pipeline {}.", pending.new_pipeline_id);
self.close_pipeline(pending.new_pipeline_id, ExitPipelineMode::Normal);
}
// In case there are frames which weren't attached to the frame tree, we close them.
let frame_ids: Vec<FrameId> = self.frames.keys().cloned().collect();
for frame_id in frame_ids {
debug!("Removing detached frame {}.", frame_id);
self.close_frame(frame_id, ExitPipelineMode::Normal);
}
// In case there are pipelines which weren't attached to the pipeline tree, we close them.
let pipeline_ids: Vec<PipelineId> = self.pipelines.keys().cloned().collect();
for pipeline_id in pipeline_ids {
debug!("Removing detached pipeline {}.", pipeline_id);
self.close_pipeline(pipeline_id, ExitPipelineMode::Normal);
}
} }
fn handle_shutdown(&mut self) { fn handle_shutdown(&mut self) {
@ -1208,8 +1235,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} }
fn handle_subframe_loaded(&mut self, pipeline_id: PipelineId) { fn handle_subframe_loaded(&mut self, pipeline_id: PipelineId) {
let parent_info = match self.pipelines.get(&pipeline_id) { let (frame_id, parent_info) = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.parent_info, Some(pipeline) => (pipeline.frame_id, pipeline.parent_info),
None => return warn!("Pipeline {:?} loaded after closure.", pipeline_id), None => return warn!("Pipeline {:?} loaded after closure.", pipeline_id),
}; };
let subframe_parent_id = match parent_info { let subframe_parent_id = match parent_info {
@ -1217,8 +1244,9 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
None => return warn!("Pipeline {:?} has no parent.", pipeline_id), None => return warn!("Pipeline {:?} has no parent.", pipeline_id),
}; };
let msg = ConstellationControlMsg::DispatchFrameLoadEvent { let msg = ConstellationControlMsg::DispatchFrameLoadEvent {
target: pipeline_id, target: frame_id,
parent: subframe_parent_id, parent: subframe_parent_id,
child: pipeline_id,
}; };
let result = match self.pipelines.get(&subframe_parent_id) { let result = match self.pipelines.get(&subframe_parent_id) {
Some(pipeline) => pipeline.script_chan.send(msg), Some(pipeline) => pipeline.script_chan.send(msg),
@ -1392,13 +1420,19 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// requested change so it can update its internal state. // requested change so it can update its internal state.
// //
// If replace is true, the current entry is replaced instead of a new entry being added. // If replace is true, the current entry is replaced instead of a new entry being added.
let parent_info = self.pipelines.get(&source_id).and_then(|source| source.parent_info); let (frame_id, parent_info) = match self.pipelines.get(&source_id) {
Some(pipeline) => (pipeline.frame_id, pipeline.parent_info),
None => {
warn!("Pipeline {:?} loaded after closure.", source_id);
return None;
}
};
match parent_info { match parent_info {
Some((parent_pipeline_id, _)) => { Some((parent_pipeline_id, _)) => {
self.handle_load_start_msg(source_id); self.handle_load_start_msg(source_id);
// Message the constellation to find the script thread for this iframe // Message the constellation to find the script thread for this iframe
// and issue an iframe load through there. // and issue an iframe load through there.
let msg = ConstellationControlMsg::Navigate(parent_pipeline_id, source_id, load_data, replace); let msg = ConstellationControlMsg::Navigate(parent_pipeline_id, frame_id, load_data, replace);
let result = match self.pipelines.get(&parent_pipeline_id) { let result = match self.pipelines.get(&parent_pipeline_id) {
Some(parent_pipeline) => parent_pipeline.script_chan.send(msg), Some(parent_pipeline) => parent_pipeline.script_chan.send(msg),
None => { None => {
@ -1586,16 +1620,17 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
fn handle_mozbrowser_event_msg(&mut self, fn handle_mozbrowser_event_msg(&mut self,
parent_pipeline_id: PipelineId, parent_pipeline_id: PipelineId,
pipeline_id: Option<PipelineId>, pipeline_id: PipelineId,
event: MozBrowserEvent) { event: MozBrowserEvent) {
assert!(PREFS.is_mozbrowser_enabled()); assert!(PREFS.is_mozbrowser_enabled());
let frame_id = self.pipelines.get(&pipeline_id).map(|pipeline| pipeline.frame_id);
// Find the script channel for the given parent pipeline, // Find the script channel for the given parent pipeline,
// and pass the event to that script thread. // and pass the event to that script thread.
// If the pipeline lookup fails, it is because we have torn down the pipeline, // If the pipeline lookup fails, it is because we have torn down the pipeline,
// so it is reasonable to silently ignore the event. // so it is reasonable to silently ignore the event.
match self.pipelines.get(&parent_pipeline_id) { match self.pipelines.get(&parent_pipeline_id) {
Some(pipeline) => pipeline.trigger_mozbrowser_event(pipeline_id, event), Some(pipeline) => pipeline.trigger_mozbrowser_event(frame_id, event),
None => warn!("Pipeline {:?} handling mozbrowser event after closure.", parent_pipeline_id), None => warn!("Pipeline {:?} handling mozbrowser event after closure.", parent_pipeline_id),
} }
} }
@ -1626,8 +1661,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} }
fn focus_parent_pipeline(&mut self, pipeline_id: PipelineId) { fn focus_parent_pipeline(&mut self, pipeline_id: PipelineId) {
let parent_info = match self.pipelines.get(&pipeline_id) { let (frame_id, parent_info) = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.parent_info, Some(pipeline) => (pipeline.frame_id, pipeline.parent_info),
None => return warn!("Pipeline {:?} focus parent after closure.", pipeline_id), None => return warn!("Pipeline {:?} focus parent after closure.", pipeline_id),
}; };
let (parent_pipeline_id, _) = match parent_info { let (parent_pipeline_id, _) = match parent_info {
@ -1637,7 +1672,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// Send a message to the parent of the provided pipeline (if it exists) // Send a message to the parent of the provided pipeline (if it exists)
// telling it to mark the iframe element as focused. // telling it to mark the iframe element as focused.
let msg = ConstellationControlMsg::FocusIFrame(parent_pipeline_id, pipeline_id); let msg = ConstellationControlMsg::FocusIFrame(parent_pipeline_id, frame_id);
let result = match self.pipelines.get(&parent_pipeline_id) { let result = match self.pipelines.get(&parent_pipeline_id) {
Some(pipeline) => pipeline.script_chan.send(msg), Some(pipeline) => pipeline.script_chan.send(msg),
None => return warn!("Pipeline {:?} focus after closure.", parent_pipeline_id), None => return warn!("Pipeline {:?} focus after closure.", parent_pipeline_id),
@ -1691,10 +1726,13 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} }
fn handle_visibility_change_complete(&mut self, pipeline_id: PipelineId, visibility: bool) { fn handle_visibility_change_complete(&mut self, pipeline_id: PipelineId, visibility: bool) {
let parent_pipeline_info = self.pipelines.get(&pipeline_id).and_then(|source| source.parent_info); let (frame_id, parent_pipeline_info) = match self.pipelines.get(&pipeline_id) {
None => return warn!("Visibity change for closed pipeline {:?}.", pipeline_id),
Some(pipeline) => (pipeline.frame_id, pipeline.parent_info),
};
if let Some((parent_pipeline_id, _)) = parent_pipeline_info { if let Some((parent_pipeline_id, _)) = parent_pipeline_info {
let visibility_msg = ConstellationControlMsg::NotifyVisibilityChange(parent_pipeline_id, let visibility_msg = ConstellationControlMsg::NotifyVisibilityChange(parent_pipeline_id,
pipeline_id, frame_id,
visibility); visibility);
let result = match self.pipelines.get(&parent_pipeline_id) { let result = match self.pipelines.get(&parent_pipeline_id) {
None => return warn!("Parent pipeline {:?} closed", parent_pipeline_id), None => return warn!("Parent pipeline {:?} closed", parent_pipeline_id),
@ -1856,7 +1894,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// This makes things like contentDocument work correctly. // This makes things like contentDocument work correctly.
if let Some((parent_pipeline_id, _)) = pipeline_info { if let Some((parent_pipeline_id, _)) = pipeline_info {
let msg = ConstellationControlMsg::UpdatePipelineId(parent_pipeline_id, let msg = ConstellationControlMsg::UpdatePipelineId(parent_pipeline_id,
prev_pipeline_id, frame_id,
next_pipeline_id); next_pipeline_id);
let result = match self.pipelines.get(&parent_pipeline_id) { let result = match self.pipelines.get(&parent_pipeline_id) {
None => return warn!("Pipeline {:?} child traversed after closure.", parent_pipeline_id), None => return warn!("Pipeline {:?} child traversed after closure.", parent_pipeline_id),
@ -1875,8 +1913,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
fn get_top_level_frame_for_pipeline(&self, pipeline_id: Option<PipelineId>) -> FrameId { fn get_top_level_frame_for_pipeline(&self, pipeline_id: Option<PipelineId>) -> FrameId {
if PREFS.is_mozbrowser_enabled() { if PREFS.is_mozbrowser_enabled() {
pipeline_id.and_then(|id| self.get_mozbrowser_ancestor_info(id)) pipeline_id.and_then(|id| self.get_mozbrowser_ancestor_info(id))
.and_then(|pipeline_info| self.pipelines.get(&pipeline_info.1)) .map(|(_, mozbrowser_iframe_id)| mozbrowser_iframe_id)
.map(|pipeline| pipeline.frame_id)
.unwrap_or(self.root_frame_id) .unwrap_or(self.root_frame_id)
} else { } else {
// If mozbrowser is not enabled, the root frame is the only top-level frame // If mozbrowser is not enabled, the root frame is the only top-level frame
@ -1910,11 +1947,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} }
if self.frames.contains_key(&frame_change.frame_id) { if self.frames.contains_key(&frame_change.frame_id) {
// Mature the new pipeline, and return frames evicted from history.
if let Some(ref mut pipeline) = self.pipelines.get_mut(&frame_change.new_pipeline_id) {
pipeline.is_mature = true;
}
if frame_change.replace { if frame_change.replace {
let evicted = self.frames.get_mut(&frame_change.frame_id).map(|frame| { let evicted = self.frames.get_mut(&frame_change.frame_id).map(|frame| {
frame.replace_current(frame_change.new_pipeline_id) frame.replace_current(frame_change.new_pipeline_id)
@ -1930,16 +1962,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
} else { } else {
// The new pipeline is in a new frame with no history // The new pipeline is in a new frame with no history
self.new_frame(frame_change.frame_id, frame_change.new_pipeline_id); self.new_frame(frame_change.frame_id, frame_change.new_pipeline_id);
// If a child frame, add it to the parent pipeline. Otherwise
// it must surely be the root frame being created!
let parent_info = self.pipelines.get(&frame_change.new_pipeline_id)
.and_then(|pipeline| pipeline.parent_info);
if let Some((parent_id, _)) = parent_info {
if let Some(parent) = self.pipelines.get_mut(&parent_id) {
parent.add_child(frame_change.frame_id);
}
}
} }
if !frame_change.replace { if !frame_change.replace {
@ -1958,49 +1980,25 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
fn handle_activate_document_msg(&mut self, pipeline_id: PipelineId) { fn handle_activate_document_msg(&mut self, pipeline_id: PipelineId) {
debug!("Document ready to activate {:?}", pipeline_id); debug!("Document ready to activate {:?}", pipeline_id);
if let Some(ref child_pipeline) = self.pipelines.get(&pipeline_id) { // Notify the parent (if there is one).
if let Some(ref parent_info) = child_pipeline.parent_info { if let Some(pipeline) = self.pipelines.get(&pipeline_id) {
if let Some(parent_pipeline) = self.pipelines.get(&parent_info.0) { if let Some((parent_pipeline_id, _)) = pipeline.parent_info {
let _ = parent_pipeline.script_chan if let Some(parent_pipeline) = self.pipelines.get(&parent_pipeline_id) {
.send(ConstellationControlMsg::FramedContentChanged( let msg = ConstellationControlMsg::FramedContentChanged(parent_pipeline_id, pipeline.frame_id);
parent_info.0, let _ = parent_pipeline.script_chan.send(msg);
pipeline_id));
} }
} }
} }
// If this pipeline is already part of the current frame tree,
// we don't need to do anything.
if self.pipeline_is_in_current_frame(pipeline_id) {
return;
}
// Find the pending frame change whose new pipeline id is pipeline_id. // Find the pending frame change whose new pipeline id is pipeline_id.
// If it is found, mark this pending frame as ready to be enabled.
let pending_index = self.pending_frames.iter().rposition(|frame_change| { let pending_index = self.pending_frames.iter().rposition(|frame_change| {
frame_change.new_pipeline_id == pipeline_id frame_change.new_pipeline_id == pipeline_id
}); });
if let Some(pending_index) = pending_index {
self.pending_frames[pending_index].document_ready = true;
}
// This is a bit complex. We need to loop through pending frames and find // If it is found, remove it from the pending frames, and make it
// ones that can be swapped. A frame can be swapped (enabled) once it is // the active document of its frame.
// ready to layout (has document_ready set), and also is mature if let Some(pending_index) = pending_index {
// (i.e. the pipeline it is replacing has been enabled and now has a frame). let frame_change = self.pending_frames.swap_remove(pending_index);
// The outer loop is required because any time a pipeline is enabled, that
// may affect whether other pending frames are now able to be enabled. On the
// other hand, if no frames can be enabled after looping through all pending
// frames, we can safely exit the loop, knowing that we will need to wait on
// a dependent pipeline to be ready to paint.
while let Some(valid_frame_change) = self.pending_frames.iter().rposition(|frame_change| {
let frame_is_mature = frame_change.old_pipeline_id
.and_then(|old_pipeline_id| self.pipelines.get(&old_pipeline_id))
.map(|old_pipeline| old_pipeline.is_mature)
.unwrap_or(true);
frame_change.document_ready && frame_is_mature
}) {
let frame_change = self.pending_frames.swap_remove(valid_frame_change);
self.add_or_replace_pipeline_in_frame_tree(frame_change); self.add_or_replace_pipeline_in_frame_tree(frame_change);
} }
} }
@ -2100,6 +2098,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// screenshot can safely be written. // screenshot can safely be written.
for frame in self.current_frame_tree_iter(self.root_frame_id) { for frame in self.current_frame_tree_iter(self.root_frame_id) {
let pipeline_id = frame.current.pipeline_id; let pipeline_id = frame.current.pipeline_id;
debug!("Checking readiness of frame {}, pipeline {}.", frame.id, pipeline_id);
let pipeline = match self.pipelines.get(&pipeline_id) { let pipeline = match self.pipelines.get(&pipeline_id) {
None => { None => {
@ -2265,7 +2264,9 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.close_frame(*child_frame, exit_mode); self.close_frame(*child_frame, exit_mode);
} }
let pipeline = match self.pipelines.get_mut(&pipeline_id) { // Note, we don't remove the pipeline now, we wait for the message to come back from
// the pipeline.
let pipeline = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline, Some(pipeline) => pipeline,
None => return warn!("Closing pipeline {:?} twice.", pipeline_id), None => return warn!("Closing pipeline {:?} twice.", pipeline_id),
}; };
@ -2337,6 +2338,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// Note that this function can panic, due to ipc-channel creation failure. // Note that this function can panic, due to ipc-channel creation failure.
// avoiding this panic would require a mechanism for dealing // avoiding this panic would require a mechanism for dealing
// with low-resource scenarios. // with low-resource scenarios.
debug!("Sending frame tree for frame {}.", self.root_frame_id);
if let Some(frame_tree) = self.frame_to_sendable(self.root_frame_id) { if let Some(frame_tree) = self.frame_to_sendable(self.root_frame_id) {
let (chan, port) = ipc::channel().expect("Failed to create IPC channel!"); let (chan, port) = ipc::channel().expect("Failed to create IPC channel!");
self.compositor_proxy.send(ToCompositorMsg::SetFrameTree(frame_tree, self.compositor_proxy.send(ToCompositorMsg::SetFrameTree(frame_tree,
@ -2350,12 +2352,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
/// For a given pipeline, determine the mozbrowser iframe that transitively contains /// For a given pipeline, determine the mozbrowser iframe that transitively contains
/// it. There could be arbitrary levels of nested iframes in between them. /// it. There could be arbitrary levels of nested iframes in between them.
fn get_mozbrowser_ancestor_info(&self, original_pipeline_id: PipelineId) -> Option<(PipelineId, PipelineId)> { fn get_mozbrowser_ancestor_info(&self, original_pipeline_id: PipelineId) -> Option<(PipelineId, FrameId)> {
let mut pipeline_id = original_pipeline_id; let mut pipeline_id = original_pipeline_id;
loop { loop {
match self.pipelines.get(&pipeline_id) { match self.pipelines.get(&pipeline_id) {
Some(pipeline) => match pipeline.parent_info { Some(pipeline) => match pipeline.parent_info {
Some((parent_id, FrameType::MozBrowserIFrame)) => return Some((parent_id, pipeline_id)), Some((parent_id, FrameType::MozBrowserIFrame)) => return Some((parent_id, pipeline.frame_id)),
Some((parent_id, _)) => pipeline_id = parent_id, Some((parent_id, _)) => pipeline_id = parent_id,
None => return None, None => return None,
}, },
@ -2378,14 +2380,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
}; };
// If this is a mozbrowser iframe, then send the event with new url // If this is a mozbrowser iframe, then send the event with new url
if let Some((ancestor_id, mozbrowser_iframe_id)) = self.get_mozbrowser_ancestor_info(pipeline_id) { if let Some((ancestor_id, mozbrowser_frame_id)) = self.get_mozbrowser_ancestor_info(pipeline_id) {
if let Some(ancestor) = self.pipelines.get(&ancestor_id) { if let Some(ancestor) = self.pipelines.get(&ancestor_id) {
if let Some(pipeline) = self.pipelines.get(&mozbrowser_iframe_id) { let can_go_forward = !self.joint_session_future(mozbrowser_frame_id).is_empty();
let can_go_forward = !self.joint_session_future(pipeline.frame_id).is_empty(); let can_go_back = !self.joint_session_past(mozbrowser_frame_id).is_empty();
let can_go_back = !self.joint_session_past(pipeline.frame_id).is_empty(); let event = MozBrowserEvent::LocationChange(url, can_go_back, can_go_forward);
let event = MozBrowserEvent::LocationChange(url, can_go_back, can_go_forward); ancestor.trigger_mozbrowser_event(Some(mozbrowser_frame_id), event);
ancestor.trigger_mozbrowser_event(Some(mozbrowser_iframe_id), event);
}
} }
} }
} }

View file

@ -11,6 +11,7 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
extern crate backtrace; extern crate backtrace;
extern crate bluetooth_traits;
extern crate canvas; extern crate canvas;
extern crate canvas_traits; extern crate canvas_traits;
extern crate compositing; extern crate compositing;

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_traits::BluetoothMethodMsg;
use compositing::CompositionPipeline; use compositing::CompositionPipeline;
use compositing::CompositorProxy; use compositing::CompositorProxy;
use compositing::compositor_thread::Msg as CompositorMsg; use compositing::compositor_thread::Msg as CompositorMsg;
@ -17,7 +18,6 @@ use ipc_channel::router::ROUTER;
use layout_traits::LayoutThreadFactory; use layout_traits::LayoutThreadFactory;
use msg::constellation_msg::{FrameId, FrameType, PipelineId, PipelineNamespaceId}; use msg::constellation_msg::{FrameId, FrameType, PipelineId, PipelineNamespaceId};
use net_traits::{IpcSend, ResourceThreads}; use net_traits::{IpcSend, ResourceThreads};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::ImageCacheThread; use net_traits::image_cache_thread::ImageCacheThread;
use profile_traits::mem as profile_mem; use profile_traits::mem as profile_mem;
use profile_traits::time; use profile_traits::time;
@ -69,9 +69,6 @@ pub struct Pipeline {
/// Whether this pipeline should be treated as visible for the purposes of scheduling and /// Whether this pipeline should be treated as visible for the purposes of scheduling and
/// resource management. /// resource management.
pub visible: bool, pub visible: bool,
/// Whether this pipeline is has matured or not.
/// A pipeline is considered mature when it has an associated frame.
pub is_mature: bool,
} }
/// Initial setup data needed to construct a pipeline. /// Initial setup data needed to construct a pipeline.
@ -152,6 +149,7 @@ impl Pipeline {
let new_layout_info = NewLayoutInfo { let new_layout_info = NewLayoutInfo {
parent_pipeline_id: parent_pipeline_id, parent_pipeline_id: parent_pipeline_id,
new_pipeline_id: state.id, new_pipeline_id: state.id,
frame_id: state.frame_id,
frame_type: frame_type, frame_type: frame_type,
load_data: state.load_data.clone(), load_data: state.load_data.clone(),
pipeline_port: pipeline_port, pipeline_port: pipeline_port,
@ -203,6 +201,7 @@ impl Pipeline {
let unprivileged_pipeline_content = UnprivilegedPipelineContent { let unprivileged_pipeline_content = UnprivilegedPipelineContent {
id: state.id, id: state.id,
frame_id: state.frame_id,
parent_info: state.parent_info, parent_info: state.parent_info,
constellation_chan: state.constellation_chan, constellation_chan: state.constellation_chan,
scheduler_chan: state.scheduler_chan, scheduler_chan: state.scheduler_chan,
@ -281,7 +280,6 @@ impl Pipeline {
running_animations: false, running_animations: false,
visible: visible, visible: visible,
is_private: is_private, is_private: is_private,
is_mature: false,
} }
} }
@ -348,7 +346,7 @@ impl Pipeline {
} }
pub fn trigger_mozbrowser_event(&self, pub fn trigger_mozbrowser_event(&self,
child_id: Option<PipelineId>, child_id: Option<FrameId>,
event: MozBrowserEvent) { event: MozBrowserEvent) {
assert!(PREFS.is_mozbrowser_enabled()); assert!(PREFS.is_mozbrowser_enabled());
@ -380,6 +378,7 @@ impl Pipeline {
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub struct UnprivilegedPipelineContent { pub struct UnprivilegedPipelineContent {
id: PipelineId, id: PipelineId,
frame_id: FrameId,
parent_info: Option<(PipelineId, FrameType)>, parent_info: Option<(PipelineId, FrameType)>,
constellation_chan: IpcSender<ScriptMsg>, constellation_chan: IpcSender<ScriptMsg>,
layout_to_constellation_chan: IpcSender<LayoutMsg>, layout_to_constellation_chan: IpcSender<LayoutMsg>,
@ -414,6 +413,7 @@ impl UnprivilegedPipelineContent {
{ {
let layout_pair = STF::create(InitialScriptState { let layout_pair = STF::create(InitialScriptState {
id: self.id, id: self.id,
frame_id: self.frame_id,
parent_info: self.parent_info, parent_info: self.parent_info,
control_chan: self.script_chan.clone(), control_chan: self.script_chan.clone(),
control_port: self.script_port, control_port: self.script_port,

View file

@ -77,7 +77,7 @@ pub struct SharedLayoutContext {
pub style_context: SharedStyleContext, pub style_context: SharedStyleContext,
/// The shared image cache thread. /// The shared image cache thread.
pub image_cache_thread: ImageCacheThread, pub image_cache_thread: Mutex<ImageCacheThread>,
/// A channel for the image cache to send responses to. /// A channel for the image cache to send responses to.
pub image_cache_sender: Mutex<ImageCacheChan>, pub image_cache_sender: Mutex<ImageCacheChan>,
@ -133,7 +133,8 @@ impl SharedLayoutContext {
debug_assert!(opts::get().output_file.is_some() || opts::get().exit_after_load); debug_assert!(opts::get().output_file.is_some() || opts::get().exit_after_load);
// See if the image is already available // See if the image is already available
let result = self.image_cache_thread.find_image(url.clone(), use_placeholder); let result = self.image_cache_thread.lock().unwrap()
.find_image(url.clone(), use_placeholder);
match result { match result {
Ok(image) => return Some(image), Ok(image) => return Some(image),
@ -147,7 +148,7 @@ impl SharedLayoutContext {
// If we are emitting an output file, then we need to block on // If we are emitting an output file, then we need to block on
// image load or we risk emitting an output file missing the image. // image load or we risk emitting an output file missing the image.
let (sync_tx, sync_rx) = ipc::channel().unwrap(); let (sync_tx, sync_rx) = ipc::channel().unwrap();
self.image_cache_thread.request_image(url, ImageCacheChan(sync_tx), None); self.image_cache_thread.lock().unwrap().request_image(url, ImageCacheChan(sync_tx), None);
loop { loop {
match sync_rx.recv() { match sync_rx.recv() {
Err(_) => return None, Err(_) => return None,
@ -171,7 +172,8 @@ impl SharedLayoutContext {
.map(|img| ImageOrMetadataAvailable::ImageAvailable(img)); .map(|img| ImageOrMetadataAvailable::ImageAvailable(img));
} }
// See if the image is already available // See if the image is already available
let result = self.image_cache_thread.find_image_or_metadata(url.clone(), let result = self.image_cache_thread.lock().unwrap()
.find_image_or_metadata(url.clone(),
use_placeholder); use_placeholder);
match result { match result {
Ok(image_or_metadata) => Some(image_or_metadata), Ok(image_or_metadata) => Some(image_or_metadata),
@ -180,7 +182,8 @@ impl SharedLayoutContext {
// Not yet requested, async mode - request image or metadata from the cache // Not yet requested, async mode - request image or metadata from the cache
Err(ImageState::NotRequested) => { Err(ImageState::NotRequested) => {
let sender = self.image_cache_sender.lock().unwrap().clone(); let sender = self.image_cache_sender.lock().unwrap().clone();
self.image_cache_thread.request_image_and_metadata(url, sender, None); self.image_cache_thread.lock().unwrap()
.request_image_and_metadata(url, sender, None);
None None
} }
// Image has been requested, is still pending. Return no image for this paint loop. // Image has been requested, is still pending. Return no image for this paint loop.

View file

@ -523,8 +523,6 @@ impl WebRenderFrameBuilder {
stacking_context: &mut webrender_traits::StackingContext) stacking_context: &mut webrender_traits::StackingContext)
-> DisplayListId { -> DisplayListId {
let id = api.next_display_list_id(); let id = api.next_display_list_id();
stacking_context.has_stacking_contexts = stacking_context.has_stacking_contexts ||
display_list.descriptor().has_stacking_contexts;
stacking_context.display_lists.push(id); stacking_context.display_lists.push(id);
self.display_lists.push((id, display_list)); self.display_lists.push((id, display_list));
id id

View file

@ -511,7 +511,7 @@ impl LayoutThread {
local_context_creation_data: Mutex::new(local_style_context_creation_data), local_context_creation_data: Mutex::new(local_style_context_creation_data),
timer: self.timer.clone(), timer: self.timer.clone(),
}, },
image_cache_thread: self.image_cache_thread.clone(), image_cache_thread: Mutex::new(self.image_cache_thread.clone()),
image_cache_sender: Mutex::new(self.image_cache_sender.clone()), image_cache_sender: Mutex::new(self.image_cache_sender.clone()),
font_cache_thread: Mutex::new(self.font_cache_thread.clone()), font_cache_thread: Mutex::new(self.font_cache_thread.clone()),
webrender_image_cache: self.webrender_image_cache.clone(), webrender_image_cache: self.webrender_image_cache.clone(),

View file

@ -305,17 +305,3 @@ pub enum FrameType {
IFrame, IFrame,
MozBrowserIFrame, MozBrowserIFrame,
} }
/// [Policies](https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-states)
/// for providing a referrer header for a request
#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
pub enum ReferrerPolicy {
NoReferrer,
NoReferrerWhenDowngrade,
Origin,
SameOrigin,
OriginWhenCrossOrigin,
UnsafeUrl,
StrictOrigin,
StrictOriginWhenCrossOrigin
}

View file

@ -14,7 +14,6 @@ bitflags = "0.7"
brotli = "1.0.6" brotli = "1.0.6"
content-blocker = "0.2.1" content-blocker = "0.2.1"
cookie = {version = "0.2.5", features = ["serialize-rustc"]} cookie = {version = "0.2.5", features = ["serialize-rustc"]}
device = {git = "https://github.com/servo/devices"}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}
flate2 = "0.2.0" flate2 = "0.2.0"
hyper = "0.9.9" hyper = "0.9.9"
@ -32,7 +31,6 @@ openssl = "0.7.6"
openssl-verify = "0.1" openssl-verify = "0.1"
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"} profile_traits = {path = "../profile_traits"}
rand = "0.3"
rustc-serialize = "0.3" rustc-serialize = "0.3"
serde = "0.8" serde = "0.8"
serde_derive = "0.8" serde_derive = "0.8"

View file

@ -23,8 +23,7 @@ use hyper::mime::{Mime, SubLevel, TopLevel};
use hyper::status::StatusCode; use hyper::status::StatusCode;
use hyper_serde::Serde; use hyper_serde::Serde;
use mime_guess::guess_mime_type; use mime_guess::guess_mime_type;
use msg::constellation_msg::ReferrerPolicy; use net_traits::{FetchTaskTarget, FetchMetadata, NetworkError, ReferrerPolicy};
use net_traits::{FetchTaskTarget, FetchMetadata, NetworkError};
use net_traits::request::{CacheMode, CredentialsMode, Destination}; use net_traits::request::{CacheMode, CredentialsMode, Destination};
use net_traits::request::{RedirectMode, Referrer, Request, RequestMode, ResponseTainting}; use net_traits::request::{RedirectMode, Referrer, Request, RequestMode, ResponseTainting};
use net_traits::request::{Type, Origin, Window}; use net_traits::request::{Type, Origin, Window};

View file

@ -5,8 +5,8 @@
use about_loader; use about_loader;
use mime_classifier::MimeClassifier; use mime_classifier::MimeClassifier;
use mime_guess::guess_mime_type; use mime_guess::guess_mime_type;
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use msg::constellation_msg::PipelineId;
use net_traits::{LoadConsumer, LoadData, LoadOrigin, Metadata, NetworkError}; use net_traits::{LoadConsumer, LoadData, LoadOrigin, Metadata, NetworkError, ReferrerPolicy};
use net_traits::ProgressMsg::{Done, Payload}; use net_traits::ProgressMsg::{Done, Payload};
use resource_thread::{CancellationListener, ProgressSender}; use resource_thread::{CancellationListener, ProgressSender};
use resource_thread::{send_error, start_sending_sniffed_opt}; use resource_thread::{send_error, start_sending_sniffed_opt};

View file

@ -28,9 +28,9 @@ use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use log; use log;
use mime_classifier::MimeClassifier; use mime_classifier::MimeClassifier;
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use msg::constellation_msg::PipelineId;
use net_traits::{CookieSource, IncludeSubdomains, LoadConsumer, LoadContext, LoadData}; use net_traits::{CookieSource, IncludeSubdomains, LoadConsumer, LoadContext, LoadData};
use net_traits::{CustomResponse, CustomResponseMediator, Metadata, NetworkError}; use net_traits::{CustomResponse, CustomResponseMediator, Metadata, NetworkError, ReferrerPolicy};
use net_traits::ProgressMsg::{Done, Payload}; use net_traits::ProgressMsg::{Done, Payload};
use net_traits::hosts::replace_hosts; use net_traits::hosts::replace_hosts;
use net_traits::response::HttpsState; use net_traits::response::HttpsState;
@ -447,15 +447,11 @@ fn strict_origin(referrer_url: Url, url: Url) -> Option<Url> {
/// https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin-when-cross-origin /// https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin-when-cross-origin
fn strict_origin_when_cross_origin(referrer_url: Url, url: Url) -> Option<Url> { fn strict_origin_when_cross_origin(referrer_url: Url, url: Url) -> Option<Url> {
let cross_origin = referrer_url.origin() != url.origin();
if referrer_url.scheme() == "https" && url.scheme() != "https" { if referrer_url.scheme() == "https" && url.scheme() != "https" {
return None; return None;
} else {
if cross_origin {
return strip_url(referrer_url, true);
}
return strip_url(referrer_url, false);
} }
let cross_origin = referrer_url.origin() != url.origin();
return strip_url(referrer_url, cross_origin);
} }
/// https://w3c.github.io/webappsec-referrer-policy/#strip-url /// https://w3c.github.io/webappsec-referrer-policy/#strip-url
@ -807,7 +803,7 @@ pub fn obtain_response<A>(request_factory: &HttpRequestFactory<R=A>,
} }
if log_enabled!(log::LogLevel::Info) { if log_enabled!(log::LogLevel::Info) {
info!("{}", method); info!("{} {}", method, connection_url);
for header in headers.iter() { for header in headers.iter() {
info!(" - {}", header); info!(" - {}", header);
} }

View file

@ -16,7 +16,6 @@ extern crate bitflags;
extern crate brotli; extern crate brotli;
extern crate content_blocker as content_blocker_parser; extern crate content_blocker as content_blocker_parser;
extern crate cookie as cookie_rs; extern crate cookie as cookie_rs;
extern crate device;
extern crate devtools_traits; extern crate devtools_traits;
extern crate flate2; extern crate flate2;
extern crate hyper; extern crate hyper;
@ -34,7 +33,6 @@ extern crate net_traits;
extern crate openssl; extern crate openssl;
extern crate openssl_verify; extern crate openssl_verify;
extern crate profile_traits; extern crate profile_traits;
extern crate rand;
extern crate rustc_serialize; extern crate rustc_serialize;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
@ -51,7 +49,6 @@ extern crate websocket;
pub mod about_loader; pub mod about_loader;
pub mod blob_loader; pub mod blob_loader;
pub mod bluetooth_thread;
pub mod chrome_loader; pub mod chrome_loader;
pub mod connector; pub mod connector;
pub mod content_blocker; pub mod content_blocker;

View file

@ -42,7 +42,7 @@ use hyper::mime::{Attr, Mime};
use hyper_serde::Serde; use hyper_serde::Serde;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use msg::constellation_msg::PipelineId;
use request::{Request, RequestInit}; use request::{Request, RequestInit};
use response::{HttpsState, Response}; use response::{HttpsState, Response};
use std::io::Error as IOError; use std::io::Error as IOError;
@ -51,8 +51,6 @@ use url::Url;
use websocket::header; use websocket::header;
pub mod blob_url_store; pub mod blob_url_store;
pub mod bluetooth_scanfilter;
pub mod bluetooth_thread;
pub mod filemanager_thread; pub mod filemanager_thread;
pub mod hosts; pub mod hosts;
pub mod image_cache_thread; pub mod image_cache_thread;
@ -111,6 +109,28 @@ pub struct CustomResponseMediator {
pub load_url: Url pub load_url: Url
} }
/// [Policies](https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-states)
/// for providing a referrer header for a request
#[derive(Clone, Copy, Debug, Deserialize, HeapSizeOf, Serialize)]
pub enum ReferrerPolicy {
/// "no-referrer"
NoReferrer,
/// "no-referrer-when-downgrade"
NoReferrerWhenDowngrade,
/// "origin"
Origin,
/// "same-origin"
SameOrigin,
/// "origin-when-cross-origin"
OriginWhenCrossOrigin,
/// "unsafe-url"
UnsafeUrl,
/// "strict-origin"
StrictOrigin,
/// "strict-origin-when-cross-origin"
StrictOriginWhenCrossOrigin,
}
#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] #[derive(Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct LoadData { pub struct LoadData {
pub url: Url, pub url: Url,

View file

@ -2,9 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use ReferrerPolicy;
use hyper::header::Headers; use hyper::header::Headers;
use hyper::method::Method; use hyper::method::Method;
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use msg::constellation_msg::PipelineId;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::default::Default; use std::default::Default;
use std::mem::swap; use std::mem::swap;

View file

@ -25,6 +25,7 @@ angle = {git = "https://github.com/servo/angle", branch = "servo"}
app_units = "0.3" app_units = "0.3"
audio-video-metadata = "0.1.2" audio-video-metadata = "0.1.2"
bitflags = "0.7" bitflags = "0.7"
bluetooth_traits = {path = "../bluetooth_traits"}
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0" caseless = "0.1.0"
cookie = {version = "0.2.5", features = ["serialize-rustc"]} cookie = {version = "0.2.5", features = ["serialize-rustc"]}

View file

@ -94,6 +94,7 @@ impl DocumentLoader {
pub fn new_with_threads(resource_threads: ResourceThreads, pub fn new_with_threads(resource_threads: ResourceThreads,
initial_load: Option<Url>) -> DocumentLoader { initial_load: Option<Url>) -> DocumentLoader {
debug!("Initial blocking load {:?}.", initial_load);
let initial_loads = initial_load.into_iter().map(LoadType::PageSource).collect(); let initial_loads = initial_load.into_iter().map(LoadType::PageSource).collect();
DocumentLoader { DocumentLoader {
@ -105,6 +106,7 @@ impl DocumentLoader {
/// Add a load to the list of blocking loads. /// Add a load to the list of blocking loads.
fn add_blocking_load(&mut self, load: LoadType) { fn add_blocking_load(&mut self, load: LoadType) {
debug!("Adding blocking load {:?} ({}).", load, self.blocking_loads.len());
self.blocking_loads.push(load); self.blocking_loads.push(load);
} }
@ -119,6 +121,7 @@ impl DocumentLoader {
/// Mark an in-progress network request complete. /// Mark an in-progress network request complete.
pub fn finish_load(&mut self, load: &LoadType) { pub fn finish_load(&mut self, load: &LoadType) {
debug!("Removing blocking load {:?} ({}).", load, self.blocking_loads.len());
let idx = self.blocking_loads.iter().position(|unfinished| *unfinished == *load); let idx = self.blocking_loads.iter().position(|unfinished| *unfinished == *load);
self.blocking_loads.remove(idx.expect(&format!("unknown completed load {:?}", load))); self.blocking_loads.remove(idx.expect(&format!("unknown completed load {:?}", load)));
} }

View file

@ -6276,7 +6276,7 @@ class CGCallback(CGClass):
}) })
bodyWithoutThis = string.Template( bodyWithoutThis = string.Template(
setupCall + setupCall +
"rooted!(in(s.get_context()) let thisObjJS = ptr::null_mut());" "rooted!(in(s.get_context()) let thisObjJS = ptr::null_mut());\n"
"return ${methodName}(${callArgs});").substitute({ "return ${methodName}(${callArgs});").substitute({
"callArgs": ", ".join(argnamesWithoutThis), "callArgs": ", ".join(argnamesWithoutThis),
"methodName": 'self.' + method.name, "methodName": 'self.' + method.name,

View file

@ -58,8 +58,8 @@ use js::jsapi::{GCTraceKindToAscii, Heap, JSObject, JSTracer, TraceKind};
use js::jsval::JSVal; use js::jsval::JSVal;
use js::rust::Runtime; use js::rust::Runtime;
use libc; use libc;
use msg::constellation_msg::{FrameId, FrameType, PipelineId, ReferrerPolicy}; use msg::constellation_msg::{FrameId, FrameType, PipelineId};
use net_traits::{Metadata, NetworkError, ResourceThreads}; use net_traits::{Metadata, NetworkError, ReferrerPolicy, ResourceThreads};
use net_traits::filemanager_thread::RelativePos; use net_traits::filemanager_thread::RelativePos;
use net_traits::image::base::{Image, ImageMetadata}; use net_traits::image::base::{Image, ImageMetadata};
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread};

View file

@ -3,6 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::{BluetoothError, BluetoothMethodMsg};
use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence};
use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use core::clone::Clone; use core::clone::Clone;
use dom::bindings::codegen::Bindings::BluetoothBinding::{self, BluetoothMethods, BluetoothRequestDeviceFilter}; use dom::bindings::codegen::Bindings::BluetoothBinding::{self, BluetoothMethods, BluetoothRequestDeviceFilter};
use dom::bindings::codegen::Bindings::BluetoothBinding::RequestDeviceOptions; use dom::bindings::codegen::Bindings::BluetoothBinding::RequestDeviceOptions;
@ -18,9 +21,6 @@ use dom::globalscope::GlobalScope;
use dom::promise::Promise; use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use js::conversions::ToJSValConvertible; use js::conversions::ToJSValConvertible;
use net_traits::bluetooth_scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence};
use net_traits::bluetooth_scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use net_traits::bluetooth_thread::{BluetoothError, BluetoothMethodMsg};
use std::rc::Rc; use std::rc::Rc;
const FILTER_EMPTY_ERROR: &'static str = "'filters' member, if present, must be nonempty to find any devices."; const FILTER_EMPTY_ERROR: &'static str = "'filters' member, if present, must be nonempty to find any devices.";

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding:: use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::
BluetoothCharacteristicPropertiesMethods; BluetoothCharacteristicPropertiesMethods;
@ -25,7 +26,6 @@ use dom::bluetoothuuid::{BluetoothDescriptorUUID, BluetoothUUID};
use dom::globalscope::GlobalScope; use dom::globalscope::GlobalScope;
use dom::promise::Promise; use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::rc::Rc; use std::rc::Rc;
// Maximum length of an attribute value. // Maximum length of an attribute value.

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods; use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding:: use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::
@ -21,7 +22,6 @@ use dom::bluetoothremotegattcharacteristic::{BluetoothRemoteGATTCharacteristic,
use dom::globalscope::GlobalScope; use dom::globalscope::GlobalScope;
use dom::promise::Promise; use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::rc::Rc; use std::rc::Rc;
// http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor // http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods; use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
@ -18,7 +19,6 @@ use dom::bluetoothuuid::{BluetoothServiceUUID, BluetoothUUID};
use dom::globalscope::GlobalScope; use dom::globalscope::GlobalScope;
use dom::promise::Promise; use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::cell::Cell; use std::cell::Cell;
use std::rc::Rc; use std::rc::Rc;

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted}; use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
use dom::bindings::error::Error::{self, Security}; use dom::bindings::error::Error::{self, Security};
@ -18,7 +19,6 @@ use dom::bluetoothuuid::{BluetoothCharacteristicUUID, BluetoothServiceUUID, Blue
use dom::globalscope::GlobalScope; use dom::globalscope::GlobalScope;
use dom::promise::Promise; use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::rc::Rc; use std::rc::Rc;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice // https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice

View file

@ -96,9 +96,8 @@ use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{JSContext, JSObject, JSRuntime}; use js::jsapi::{JSContext, JSObject, JSRuntime};
use js::jsapi::JS_GetRuntime; use js::jsapi::JS_GetRuntime;
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use msg::constellation_msg::{FrameId, Key, KeyModifiers, KeyState};
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use net_traits::{FetchResponseMsg, IpcSend, ReferrerPolicy};
use net_traits::{FetchResponseMsg, IpcSend};
use net_traits::CookieSource::NonHTTP; use net_traits::CookieSource::NonHTTP;
use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl}; use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::request::RequestInit; use net_traits::request::RequestInit;
@ -606,7 +605,7 @@ impl Document {
self.ready_state.set(state); self.ready_state.set(state);
self.upcast::<EventTarget>().fire_simple_event("readystatechange"); self.upcast::<EventTarget>().fire_event(atom!("readystatechange"));
} }
/// Return whether scripting is enabled or not /// Return whether scripting is enabled or not
@ -1400,7 +1399,7 @@ impl Document {
if let Some((parent_pipeline_id, _)) = self.window.parent_info() { if let Some((parent_pipeline_id, _)) = self.window.parent_info() {
let global_scope = self.window.upcast::<GlobalScope>(); let global_scope = self.window.upcast::<GlobalScope>();
let event = ConstellationMsg::MozBrowserEvent(parent_pipeline_id, let event = ConstellationMsg::MozBrowserEvent(parent_pipeline_id,
Some(global_scope.pipeline_id()), global_scope.pipeline_id(),
event); event);
global_scope.constellation_chan().send(event).unwrap(); global_scope.constellation_chan().send(event).unwrap();
} }
@ -1513,8 +1512,10 @@ impl Document {
} }
} }
let loader = self.loader.borrow(); if !self.loader.borrow().is_blocked() && !self.loader.borrow().events_inhibited() {
if !loader.is_blocked() && !loader.events_inhibited() { // Schedule a task to fire a "load" event (if no blocking loads have arrived in the mean time)
// NOTE: we can end up executing this code more than once, in case more blocking loads arrive.
debug!("Document loads are complete.");
let win = self.window(); let win = self.window();
let msg = MainThreadScriptMsg::DocumentLoadsComplete( let msg = MainThreadScriptMsg::DocumentLoadsComplete(
win.upcast::<GlobalScope>().pipeline_id()); win.upcast::<GlobalScope>().pipeline_id());
@ -1630,11 +1631,11 @@ impl Document {
} }
/// Find an iframe element in the document. /// Find an iframe element in the document.
pub fn find_iframe(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> { pub fn find_iframe(&self, frame_id: FrameId) -> Option<Root<HTMLIFrameElement>> {
self.upcast::<Node>() self.upcast::<Node>()
.traverse_preorder() .traverse_preorder()
.filter_map(Root::downcast::<HTMLIFrameElement>) .filter_map(Root::downcast::<HTMLIFrameElement>)
.find(|node| node.pipeline_id() == Some(pipeline)) .find(|node| node.frame_id() == frame_id)
} }
pub fn get_dom_loading(&self) -> u64 { pub fn get_dom_loading(&self) -> u64 {

View file

@ -330,7 +330,9 @@ impl Runnable for EventRunnable {
fn handler(self: Box<EventRunnable>) { fn handler(self: Box<EventRunnable>) {
let target = self.target.root(); let target = self.target.root();
target.fire_event(&*self.name, self.bubbles, self.cancelable); let bubbles = self.bubbles.clone();
let cancelable = self.cancelable.clone();
target.fire_event_with_params(self.name, bubbles, cancelable);
} }
} }
@ -345,6 +347,6 @@ impl Runnable for SimpleEventRunnable {
fn handler(self: Box<SimpleEventRunnable>) { fn handler(self: Box<SimpleEventRunnable>) {
let target = self.target.root(); let target = self.target.root();
target.fire_simple_event(&*self.name); target.fire_event(self.name);
} }
} }

View file

@ -490,21 +490,42 @@ impl EventTarget {
!self.handlers.borrow().is_empty() !self.handlers.borrow().is_empty()
} }
// https://html.spec.whatwg.org/multipage/#fire-a-simple-event // https://dom.spec.whatwg.org/#concept-event-fire
pub fn fire_simple_event(&self, name: &str) -> Root<Event> { pub fn fire_event(&self, name: Atom) -> Root<Event> {
self.fire_event(name, EventBubbles::DoesNotBubble, self.fire_event_with_params(name,
EventCancelable::NotCancelable) EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable)
} }
// https://dom.spec.whatwg.org/#concept-event-fire // https://dom.spec.whatwg.org/#concept-event-fire
pub fn fire_event(&self, name: &str, pub fn fire_bubbling_event(&self, name: Atom) -> Root<Event> {
bubbles: EventBubbles, self.fire_event_with_params(name,
cancelable: EventCancelable) EventBubbles::Bubbles,
-> Root<Event> { EventCancelable::NotCancelable)
let event = Event::new(&self.global(), Atom::from(name), bubbles, cancelable); }
// https://dom.spec.whatwg.org/#concept-event-fire
pub fn fire_cancelable_event(&self, name: Atom) -> Root<Event> {
self.fire_event_with_params(name,
EventBubbles::DoesNotBubble,
EventCancelable::Cancelable)
}
// https://dom.spec.whatwg.org/#concept-event-fire
pub fn fire_bubbling_cancelable_event(&self, name: Atom) -> Root<Event> {
self.fire_event_with_params(name,
EventBubbles::Bubbles,
EventCancelable::Cancelable)
}
// https://dom.spec.whatwg.org/#concept-event-fire
pub fn fire_event_with_params(&self,
name: Atom,
bubbles: EventBubbles,
cancelable: EventCancelable)
-> Root<Event> {
let event = Event::new(&self.global(), name, bubbles, cancelable);
event.fire(self); event.fire(self);
event event
} }
} }

View file

@ -25,7 +25,7 @@ use dom::node::{Node, document_from_node, window_from_node};
use dom::urlhelper::UrlHelper; use dom::urlhelper::UrlHelper;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use html5ever_atoms::LocalName; use html5ever_atoms::LocalName;
use msg::constellation_msg::ReferrerPolicy; use net_traits::ReferrerPolicy;
use num_traits::ToPrimitive; use num_traits::ToPrimitive;
use script_traits::MozBrowserEvent; use script_traits::MozBrowserEvent;
use std::default::Default; use std::default::Default;

View file

@ -206,24 +206,24 @@ impl HTMLCollection {
HTMLCollection::create(window, root, box ElementChildFilter) HTMLCollection::create(window, root, box ElementChildFilter)
} }
pub fn elements_iter_after(&self, after: &Node) -> HTMLCollectionElementsIter { pub fn elements_iter_after<'a>(&'a self, after: &'a Node) -> impl Iterator<Item=Root<Element>> + 'a {
// Iterate forwards from a node. // Iterate forwards from a node.
HTMLCollectionElementsIter { HTMLCollectionElementsIter {
node_iter: box after.following_nodes(&self.root), node_iter: after.following_nodes(&self.root),
root: Root::from_ref(&self.root), root: Root::from_ref(&self.root),
filter: &self.filter, filter: &self.filter,
} }
} }
pub fn elements_iter(&self) -> HTMLCollectionElementsIter { pub fn elements_iter<'a>(&'a self) -> impl Iterator<Item=Root<Element>> + 'a {
// Iterate forwards from the root. // Iterate forwards from the root.
self.elements_iter_after(&*self.root) self.elements_iter_after(&*self.root)
} }
pub fn elements_iter_before(&self, before: &Node) -> HTMLCollectionElementsIter { pub fn elements_iter_before<'a>(&'a self, before: &'a Node) -> impl Iterator<Item=Root<Element>> + 'a {
// Iterate backwards from a node. // Iterate backwards from a node.
HTMLCollectionElementsIter { HTMLCollectionElementsIter {
node_iter: box before.preceding_nodes(&self.root), node_iter: before.preceding_nodes(&self.root),
root: Root::from_ref(&self.root), root: Root::from_ref(&self.root),
filter: &self.filter, filter: &self.filter,
} }
@ -235,13 +235,13 @@ impl HTMLCollection {
} }
// TODO: Make this generic, and avoid code duplication // TODO: Make this generic, and avoid code duplication
pub struct HTMLCollectionElementsIter<'a> { struct HTMLCollectionElementsIter<'a, I> {
node_iter: Box<Iterator<Item = Root<Node>>>, node_iter: I,
root: Root<Node>, root: Root<Node>,
filter: &'a Box<CollectionFilter>, filter: &'a Box<CollectionFilter>,
} }
impl<'a> Iterator for HTMLCollectionElementsIter<'a> { impl<'a, I: Iterator<Item=Root<Node>>> Iterator for HTMLCollectionElementsIter<'a, I> {
type Item = Root<Element>; type Item = Root<Element>;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
@ -285,13 +285,15 @@ impl HTMLCollectionMethods for HTMLCollection {
// Iterate forwards, starting at the cursor. // Iterate forwards, starting at the cursor.
let offset = index - (cached_index + 1); let offset = index - (cached_index + 1);
let node: Root<Node> = Root::upcast(element); let node: Root<Node> = Root::upcast(element);
self.set_cached_cursor(index, self.elements_iter_after(&node).nth(offset as usize)) let mut iter = self.elements_iter_after(&node);
self.set_cached_cursor(index, iter.nth(offset as usize))
} else { } else {
// The cursor is after the element we're looking for // The cursor is after the element we're looking for
// Iterate backwards, starting at the cursor. // Iterate backwards, starting at the cursor.
let offset = cached_index - (index + 1); let offset = cached_index - (index + 1);
let node: Root<Node> = Root::upcast(element); let node: Root<Node> = Root::upcast(element);
self.set_cached_cursor(index, self.elements_iter_before(&node).nth(offset as usize)) let mut iter = self.elements_iter_before(&node);
self.set_cached_cursor(index, iter.nth(offset as usize))
} }
} else { } else {
// Cache miss // Cache miss

View file

@ -94,7 +94,7 @@ impl Runnable for DetailsNotificationRunnable {
fn handler(self: Box<DetailsNotificationRunnable>) { fn handler(self: Box<DetailsNotificationRunnable>) {
let target = self.element.root(); let target = self.element.root();
if target.check_toggle_count(self.toggle_number) { if target.check_toggle_count(self.toggle_number) {
target.upcast::<EventTarget>().fire_simple_event("toggle"); target.upcast::<EventTarget>().fire_event(atom!("toggle"));
} }
} }
} }

View file

@ -20,7 +20,6 @@ use dom::bindings::str::DOMString;
use dom::blob::Blob; use dom::blob::Blob;
use dom::document::Document; use dom::document::Document;
use dom::element::Element; use dom::element::Element;
use dom::event::{EventBubbles, EventCancelable};
use dom::eventtarget::EventTarget; use dom::eventtarget::EventTarget;
use dom::file::File; use dom::file::File;
use dom::globalscope::GlobalScope; use dom::globalscope::GlobalScope;
@ -305,16 +304,14 @@ impl HTMLFormElement {
{ {
if self.interactive_validation().is_err() { if self.interactive_validation().is_err() {
// TODO: Implement event handlers on all form control elements // TODO: Implement event handlers on all form control elements
self.upcast::<EventTarget>().fire_simple_event("invalid"); self.upcast::<EventTarget>().fire_event(atom!("invalid"));
return; return;
} }
} }
// Step 5 // Step 5
if submit_method_flag == SubmittedFrom::NotFromForm { if submit_method_flag == SubmittedFrom::NotFromForm {
let event = self.upcast::<EventTarget>() let event = self.upcast::<EventTarget>()
.fire_event("submit", .fire_bubbling_cancelable_event(atom!("submit"));
EventBubbles::Bubbles,
EventCancelable::Cancelable);
if event.DefaultPrevented() { if event.DefaultPrevented() {
return; return;
} }
@ -484,9 +481,7 @@ impl HTMLFormElement {
// Step 5-6 // Step 5-6
let unhandled_invalid_controls = invalid_controls.into_iter().filter_map(|field| { let unhandled_invalid_controls = invalid_controls.into_iter().filter_map(|field| {
let event = field.as_event_target() let event = field.as_event_target()
.fire_event("invalid", .fire_cancelable_event(atom!("invalid"));
EventBubbles::DoesNotBubble,
EventCancelable::Cancelable);
if !event.DefaultPrevented() { return Some(field); } if !event.DefaultPrevented() { return Some(field); }
None None
}).collect::<Vec<FormSubmittableElement>>(); }).collect::<Vec<FormSubmittableElement>>();
@ -615,9 +610,7 @@ impl HTMLFormElement {
} }
let event = self.upcast::<EventTarget>() let event = self.upcast::<EventTarget>()
.fire_event("reset", .fire_bubbling_cancelable_event(atom!("reset"));
EventBubbles::Bubbles,
EventCancelable::Cancelable);
if event.DefaultPrevented() { if event.DefaultPrevented() {
return; return;
} }

View file

@ -207,6 +207,11 @@ impl HTMLIFrameElement {
self.pipeline_id.get() self.pipeline_id.get()
} }
#[inline]
pub fn frame_id(&self) -> FrameId {
self.frame_id
}
pub fn change_visibility_status(&self, visibility: bool) { pub fn change_visibility_status(&self, visibility: bool) {
if self.visibility.get() != visibility { if self.visibility.get() != visibility {
self.visibility.set(visibility); self.visibility.set(visibility);
@ -239,7 +244,7 @@ impl HTMLIFrameElement {
// TODO Step 3 - set child document `mut iframe load` flag // TODO Step 3 - set child document `mut iframe load` flag
// Step 4 // Step 4
self.upcast::<EventTarget>().fire_simple_event("load"); self.upcast::<EventTarget>().fire_event(atom!("load"));
let mut blocker = self.load_blocker.borrow_mut(); let mut blocker = self.load_blocker.borrow_mut();
LoadBlocker::terminate(&mut blocker); LoadBlocker::terminate(&mut blocker);
@ -409,7 +414,7 @@ unsafe fn build_mozbrowser_event_detail(event: MozBrowserEvent,
pub fn Navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> ErrorResult { pub fn Navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> ErrorResult {
if iframe.Mozbrowser() { if iframe.Mozbrowser() {
if iframe.upcast::<Node>().is_in_doc() { if iframe.upcast::<Node>().is_in_doc_with_browsing_context() {
let window = window_from_node(iframe); let window = window_from_node(iframe);
let msg = ConstellationMsg::TraverseHistory(iframe.pipeline_id(), direction); let msg = ConstellationMsg::TraverseHistory(iframe.pipeline_id(), direction);
window.upcast::<GlobalScope>().constellation_chan().send(msg).unwrap(); window.upcast::<GlobalScope>().constellation_chan().send(msg).unwrap();
@ -495,7 +500,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload
fn Reload(&self, _hard_reload: bool) -> ErrorResult { fn Reload(&self, _hard_reload: bool) -> ErrorResult {
if self.Mozbrowser() { if self.Mozbrowser() {
if self.upcast::<Node>().is_in_doc() { if self.upcast::<Node>().is_in_doc_with_browsing_context() {
self.navigate_or_reload_child_browsing_context(None, true); self.navigate_or_reload_child_browsing_context(None, true);
} }
Ok(()) Ok(())
@ -593,7 +598,16 @@ impl VirtualMethods for HTMLIFrameElement {
}, },
&local_name!("src") => { &local_name!("src") => {
if let AttributeMutation::Set(_) = mutation { if let AttributeMutation::Set(_) = mutation {
if self.upcast::<Node>().is_in_doc() { // https://html.spec.whatwg.org/multipage/#the-iframe-element
// "Similarly, whenever an iframe element with a non-null nested browsing context
// but with no srcdoc attribute specified has its src attribute set, changed, or removed,
// the user agent must process the iframe attributes,"
// but we can't check that directly, since the child browsing context
// may be in a different script thread. Instread, we check to see if the parent
// is in a document tree and has a browsing context, which is what causes
// the child browsing context to be created.
if self.upcast::<Node>().is_in_doc_with_browsing_context() {
debug!("iframe {} src set while in browsing context.", self.frame_id);
self.process_the_iframe_attributes(); self.process_the_iframe_attributes();
} }
} }
@ -616,7 +630,14 @@ impl VirtualMethods for HTMLIFrameElement {
s.bind_to_tree(tree_in_doc); s.bind_to_tree(tree_in_doc);
} }
if tree_in_doc { // https://html.spec.whatwg.org/multipage/#the-iframe-element
// "When an iframe element is inserted into a document that has
// a browsing context, the user agent must create a new
// browsing context, set the element's nested browsing context
// to the newly-created browsing context, and then process the
// iframe attributes for the "first time"."
if self.upcast::<Node>().is_in_doc_with_browsing_context() {
debug!("iframe {} bound to browsing context.", self.frame_id);
self.process_the_iframe_attributes(); self.process_the_iframe_attributes();
} }
} }

View file

@ -105,12 +105,12 @@ impl Runnable for ImageResponseHandlerRunnable {
// Fire image.onload // Fire image.onload
if trigger_image_load { if trigger_image_load {
element.upcast::<EventTarget>().fire_simple_event("load"); element.upcast::<EventTarget>().fire_event(atom!("load"));
} }
// Fire image.onerror // Fire image.onerror
if trigger_image_error { if trigger_image_error {
element.upcast::<EventTarget>().fire_simple_event("error"); element.upcast::<EventTarget>().fire_event(atom!("error"));
} }
// Trigger reflow // Trigger reflow
@ -180,8 +180,8 @@ impl HTMLImageElement {
// Step 11, substep 5 // Step 11, substep 5
let img = self.img.root(); let img = self.img.root();
img.current_request.borrow_mut().source_url = Some(self.src.into()); img.current_request.borrow_mut().source_url = Some(self.src.into());
img.upcast::<EventTarget>().fire_simple_event("error"); img.upcast::<EventTarget>().fire_event(atom!("error"));
img.upcast::<EventTarget>().fire_simple_event("loadend"); img.upcast::<EventTarget>().fire_event(atom!("loadend"));
} }
} }

View file

@ -849,12 +849,8 @@ impl HTMLInputElement {
let filelist = FileList::new(&window, files); let filelist = FileList::new(&window, files);
self.filelist.set(Some(&filelist)); self.filelist.set(Some(&filelist));
target.fire_event("input", target.fire_bubbling_event(atom!("input"));
EventBubbles::Bubbles, target.fire_bubbling_event(atom!("change"));
EventCancelable::NotCancelable);
target.fire_event("change",
EventBubbles::Bubbles,
EventCancelable::NotCancelable);
} }
} }
} }
@ -1290,12 +1286,8 @@ impl Activatable for HTMLInputElement {
// https://html.spec.whatwg.org/multipage/#radio-button-state-(type=radio):activation-behavior // https://html.spec.whatwg.org/multipage/#radio-button-state-(type=radio):activation-behavior
// Check if document owner is fully active // Check if document owner is fully active
let target = self.upcast::<EventTarget>(); let target = self.upcast::<EventTarget>();
target.fire_event("input", target.fire_bubbling_event(atom!("input"));
EventBubbles::Bubbles, target.fire_bubbling_event(atom!("change"));
EventCancelable::NotCancelable);
target.fire_event("change",
EventBubbles::Bubbles,
EventCancelable::NotCancelable);
}, },
InputType::InputFile => self.select_files(None), InputType::InputFile => self.select_files(None),
_ => () _ => ()

View file

@ -30,8 +30,7 @@ use hyper::mime::{Mime, TopLevel, SubLevel};
use hyper_serde::Serde; use hyper_serde::Serde;
use ipc_channel::ipc; use ipc_channel::ipc;
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use msg::constellation_msg::ReferrerPolicy; use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError, ReferrerPolicy};
use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError};
use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as RequestType}; use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as RequestType};
use network_listener::{NetworkListener, PreInvoke}; use network_listener::{NetworkListener, PreInvoke};
use script_layout_interface::message::Msg; use script_layout_interface::message::Msg;
@ -325,7 +324,7 @@ impl FetchResponseListener for StylesheetContext {
if let Some(ref meta) = self.metadata { if let Some(ref meta) = self.metadata {
if let Some(Serde(ContentType(Mime(TopLevel::Text, SubLevel::Css, _)))) = meta.content_type { if let Some(Serde(ContentType(Mime(TopLevel::Text, SubLevel::Css, _)))) = meta.content_type {
} else { } else {
self.elem.root().upcast::<EventTarget>().fire_simple_event("error"); self.elem.root().upcast::<EventTarget>().fire_event(atom!("error"));
} }
} }
} }
@ -380,9 +379,9 @@ impl FetchResponseListener for StylesheetContext {
document.finish_load(LoadType::Stylesheet(self.url.clone())); document.finish_load(LoadType::Stylesheet(self.url.clone()));
let event = if successful { "load" } else { "error" }; let event = if successful { atom!("load") } else { atom!("error") };
elem.upcast::<EventTarget>().fire_simple_event(event); elem.upcast::<EventTarget>().fire_event(event);
} }
} }

View file

@ -142,7 +142,7 @@ impl WeakMediaQueryListVec {
pub fn evaluate_and_report_changes(&self) { pub fn evaluate_and_report_changes(&self) {
for mql in self.cell.borrow().iter() { for mql in self.cell.borrow().iter() {
if let MediaQueryListMatchState::Changed(_) = mql.root().unwrap().evaluate_changes() { if let MediaQueryListMatchState::Changed(_) = mql.root().unwrap().evaluate_changes() {
mql.root().unwrap().upcast::<EventTarget>().fire_simple_event("change"); mql.root().unwrap().upcast::<EventTarget>().fire_event(atom!("change"));
} }
} }
} }

View file

@ -399,6 +399,7 @@ pub mod testbinding;
pub mod testbindingiterable; pub mod testbindingiterable;
pub mod testbindingpairiterable; pub mod testbindingpairiterable;
pub mod testbindingproxy; pub mod testbindingproxy;
pub mod testrunner;
pub mod text; pub mod text;
pub mod textdecoder; pub mod textdecoder;
pub mod textencoder; pub mod textencoder;

View file

@ -771,6 +771,10 @@ impl Node {
self.owner_doc().is_html_document() self.owner_doc().is_html_document()
} }
pub fn is_in_doc_with_browsing_context(&self) -> bool {
self.is_in_doc() && self.owner_doc().browsing_context().is_some()
}
pub fn children(&self) -> NodeSiblingIterator { pub fn children(&self) -> NodeSiblingIterator {
NodeSiblingIterator { NodeSiblingIterator {
current: self.GetFirstChild(), current: self.GetFirstChild(),
@ -849,22 +853,23 @@ impl Node {
let tr = new_child(); let tr = new_child();
let after_node = if index == -1 {
None
} else {
match get_items().elements_iter()
.map(Root::upcast::<Node>)
.map(Some)
.chain(iter::once(None))
.nth(index as usize) {
None => return Err(Error::IndexSize),
Some(node) => node,
}
};
{ {
let tr_node = tr.upcast::<Node>(); let tr_node = tr.upcast::<Node>();
try!(self.InsertBefore(tr_node, after_node.r())); if index == -1 {
try!(self.InsertBefore(tr_node, None));
} else {
let items = get_items();
let node = match items.elements_iter()
.map(Root::upcast::<Node>)
.map(Some)
.chain(iter::once(None))
.nth(index as usize) {
None => return Err(Error::IndexSize),
Some(node) => node,
};
try!(self.InsertBefore(tr_node, node.r()));
}
} }
Ok(Root::upcast::<HTMLElement>(tr)) Ok(Root::upcast::<HTMLElement>(tr))

View file

@ -25,7 +25,7 @@ use dom::headers::{Guard, Headers};
use dom::promise::Promise; use dom::promise::Promise;
use dom::xmlhttprequest::Extractable; use dom::xmlhttprequest::Extractable;
use hyper::method::Method as HttpMethod; use hyper::method::Method as HttpMethod;
use msg::constellation_msg::ReferrerPolicy as MsgReferrerPolicy; use net_traits::ReferrerPolicy as MsgReferrerPolicy;
use net_traits::request::{Origin, Window}; use net_traits::request::{Origin, Window};
use net_traits::request::CacheMode as NetTraitsRequestCache; use net_traits::request::CacheMode as NetTraitsRequestCache;
use net_traits::request::CredentialsMode as NetTraitsRequestCredentials; use net_traits::request::CredentialsMode as NetTraitsRequestCredentials;

View file

@ -18,6 +18,7 @@ use dom::globalscope::GlobalScope;
use js::jsapi::{HandleValue, JSContext}; use js::jsapi::{HandleValue, JSContext};
use script_thread::Runnable; use script_thread::Runnable;
use script_traits::{ScriptMsg, DOMMessage}; use script_traits::{ScriptMsg, DOMMessage};
use servo_atoms::Atom;
use std::cell::Cell; use std::cell::Cell;
use url::Url; use url::Url;
@ -56,12 +57,12 @@ impl ServiceWorker {
pub fn dispatch_simple_error(address: TrustedServiceWorkerAddress) { pub fn dispatch_simple_error(address: TrustedServiceWorkerAddress) {
let service_worker = address.root(); let service_worker = address.root();
service_worker.upcast().fire_simple_event("error"); service_worker.upcast().fire_event(atom!("error"));
} }
pub fn set_transition_state(&self, state: ServiceWorkerState) { pub fn set_transition_state(&self, state: ServiceWorkerState) {
self.state.set(state); self.state.set(state);
self.upcast::<EventTarget>().fire_simple_event("statechange"); self.upcast::<EventTarget>().fire_event(Atom::from("statechange"));
} }
pub fn get_script_url(&self) -> Url { pub fn get_script_url(&self) -> Url {

View file

@ -15,6 +15,7 @@ use dom::promise::Promise;
use dom::serviceworker::ServiceWorker; use dom::serviceworker::ServiceWorker;
use dom::serviceworkerregistration::ServiceWorkerRegistration; use dom::serviceworkerregistration::ServiceWorkerRegistration;
use script_thread::ScriptThread; use script_thread::ScriptThread;
use servo_atoms::Atom;
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use std::default::Default; use std::default::Default;
use std::rc::Rc; use std::rc::Rc;
@ -45,7 +46,7 @@ pub trait Controllable {
impl Controllable for ServiceWorkerContainer { impl Controllable for ServiceWorkerContainer {
fn set_controller(&self, active_worker: &ServiceWorker) { fn set_controller(&self, active_worker: &ServiceWorker) {
self.controller.set(Some(active_worker)); self.controller.set(Some(active_worker));
self.upcast::<EventTarget>().fire_simple_event("controllerchange"); self.upcast::<EventTarget>().fire_event(Atom::from("controllerchange"));
} }
} }

View file

@ -28,6 +28,7 @@ use net_traits::request::{CredentialsMode, Destination, RequestInit, Type as Req
use rand::random; use rand::random;
use script_runtime::{CommonScriptMsg, StackRootTLS, get_reports, new_rt_and_cx, ScriptChan}; use script_runtime::{CommonScriptMsg, StackRootTLS, get_reports, new_rt_and_cx, ScriptChan};
use script_traits::{TimerEvent, WorkerGlobalScopeInit, ScopeThings, ServiceWorkerMsg, WorkerScriptLoadOrigin}; use script_traits::{TimerEvent, WorkerGlobalScopeInit, ScopeThings, ServiceWorkerMsg, WorkerScriptLoadOrigin};
use servo_atoms::Atom;
use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel}; use std::sync::mpsc::{Receiver, RecvError, Select, Sender, channel};
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
@ -268,7 +269,7 @@ impl ServiceWorkerGlobalScope {
// TODO XXXcreativcoder This will eventually use a FetchEvent interface to fire event // TODO XXXcreativcoder This will eventually use a FetchEvent interface to fire event
// when we have the Request and Response dom api's implemented // when we have the Request and Response dom api's implemented
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/index.html#fetch-event-section // https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/index.html#fetch-event-section
self.upcast::<EventTarget>().fire_simple_event("fetch"); self.upcast::<EventTarget>().fire_event(Atom::from("fetch"));
let _ = mediator.response_chan.send(None); let _ = mediator.response_chan.send(None);
} }
} }

View file

@ -0,0 +1,53 @@
/* 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/. */
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::codegen::Bindings::TestRunnerBinding;
use dom::bindings::codegen::Bindings::TestRunnerBinding::TestRunnerMethods;
use dom::bindings::error::{Error, ErrorResult};
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::DOMString;
use dom::globalscope::GlobalScope;
use ipc_channel::ipc::{self, IpcSender};
// https://webbluetoothcg.github.io/web-bluetooth/tests#test-runner
#[dom_struct]
pub struct TestRunner {
reflector_: Reflector,
}
impl TestRunner {
pub fn new_inherited() -> TestRunner {
TestRunner {
reflector_: Reflector::new(),
}
}
pub fn new(global: &GlobalScope) -> Root<TestRunner> {
reflect_dom_object(box TestRunner::new_inherited(),
global,
TestRunnerBinding::Wrap)
}
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothMethodMsg> {
self.global().as_window().bluetooth_thread()
}
}
impl TestRunnerMethods for TestRunner {
// https://webbluetoothcg.github.io/web-bluetooth/tests#setBluetoothMockDataSet
fn SetBluetoothMockDataSet(&self, dataSetName: DOMString) -> ErrorResult {
let (sender, receiver) = ipc::channel().unwrap();
self.get_bluetooth_thread().send(BluetoothMethodMsg::Test(String::from(dataSetName), sender)).unwrap();
match receiver.recv().unwrap().into() {
Ok(()) => {
Ok(())
},
Err(error) => {
Err(Error::from(error))
},
}
}
}

View file

@ -0,0 +1,16 @@
/* 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/. */
// https://webbluetoothcg.github.io/web-bluetooth/tests#test-runner
// callback BluetoothManualChooserEventsCallback = void(sequence<DOMString> events);
[Pref="dom.bluetooth.testing.enabled", Exposed=Window]
interface TestRunner {
[Throws]
void setBluetoothMockDataSet(DOMString dataSetName);
// void setBluetoothManualChooser();
// void getBluetoothManualChooserEvents(BluetoothManualChooserEventsCallback callback);
// void sendBluetoothManualChooserEvent(DOMString event, DOMString argument);
};

View file

@ -185,3 +185,10 @@ Window implements WindowLocalStorage;
// http://w3c.github.io/animation-timing/#framerequestcallback // http://w3c.github.io/animation-timing/#framerequestcallback
callback FrameRequestCallback = void (DOMHighResTimeStamp time); callback FrameRequestCallback = void (DOMHighResTimeStamp time);
// https://webbluetoothcg.github.io/web-bluetooth/tests#test-interfaces
partial interface Window {
[Pref="dom.bluetooth.testing.enabled", Exposed=Window]
readonly attribute TestRunner testRunner;
//readonly attribute EventSender eventSender;
};

View file

@ -498,7 +498,7 @@ impl Runnable for ConnectionEstablishedTask {
} }
// Step 6. // Step 6.
ws.upcast().fire_simple_event("open"); ws.upcast().fire_event(atom!("open"));
} }
} }
@ -548,7 +548,7 @@ impl Runnable for CloseTask {
// Step 2. // Step 2.
if self.failed { if self.failed {
ws.upcast().fire_simple_event("error"); ws.upcast().fire_event(atom!("error"));
} }
// Step 3. // Step 3.

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au; use app_units::Au;
use bluetooth_traits::BluetoothMethodMsg;
use cssparser::Parser; use cssparser::Parser;
use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType};
use dom::bindings::callback::ExceptionHandling; use dom::bindings::callback::ExceptionHandling;
@ -44,6 +45,7 @@ use dom::performance::Performance;
use dom::promise::Promise; use dom::promise::Promise;
use dom::screen::Screen; use dom::screen::Screen;
use dom::storage::Storage; use dom::storage::Storage;
use dom::testrunner::TestRunner;
use euclid::{Point2D, Rect, Size2D}; use euclid::{Point2D, Rect, Size2D};
use fetch; use fetch;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
@ -51,9 +53,8 @@ use js::jsapi::{HandleObject, HandleValue, JSAutoCompartment, JSContext};
use js::jsapi::{JS_GC, JS_GetRuntime, SetWindowProxy}; use js::jsapi::{JS_GC, JS_GetRuntime, SetWindowProxy};
use js::jsval::UndefinedValue; use js::jsval::UndefinedValue;
use js::rust::Runtime; use js::rust::Runtime;
use msg::constellation_msg::{FrameType, PipelineId, ReferrerPolicy}; use msg::constellation_msg::{FrameType, PipelineId};
use net_traits::ResourceThreads; use net_traits::{ResourceThreads, ReferrerPolicy};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread};
use net_traits::storage_thread::StorageType; use net_traits::storage_thread::StorageType;
use num_traits::ToPrimitive; use num_traits::ToPrimitive;
@ -239,6 +240,8 @@ pub struct Window {
/// All the MediaQueryLists we need to update /// All the MediaQueryLists we need to update
media_query_lists: WeakMediaQueryListVec, media_query_lists: WeakMediaQueryListVec,
test_runner: MutNullableHeap<JS<TestRunner>>,
} }
impl Window { impl Window {
@ -881,6 +884,10 @@ impl WindowMethods for Window {
fn Fetch(&self, input: RequestOrUSVString, init: &RequestInit) -> Rc<Promise> { fn Fetch(&self, input: RequestOrUSVString, init: &RequestInit) -> Rc<Promise> {
fetch::Fetch(&self.upcast(), input, init) fetch::Fetch(&self.upcast(), input, init)
} }
fn TestRunner(&self) -> Root<TestRunner> {
self.test_runner.or_init(|| TestRunner::new(self.upcast()))
}
} }
impl Window { impl Window {
@ -1588,6 +1595,7 @@ impl Window {
error_reporter: error_reporter, error_reporter: error_reporter,
scroll_offsets: DOMRefCell::new(HashMap::new()), scroll_offsets: DOMRefCell::new(HashMap::new()),
media_query_lists: WeakMediaQueryListVec::new(), media_query_lists: WeakMediaQueryListVec::new(),
test_runner: Default::default(),
}; };
WindowBinding::Wrap(runtime.cx(), win) WindowBinding::Wrap(runtime.cx(), win)

View file

@ -138,7 +138,7 @@ impl Worker {
pub fn dispatch_simple_error(address: TrustedWorkerAddress) { pub fn dispatch_simple_error(address: TrustedWorkerAddress) {
let worker = address.root(); let worker = address.root();
worker.upcast().fire_simple_event("error"); worker.upcast().fire_event(atom!("error"));
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]

View file

@ -48,9 +48,9 @@ use ipc_channel::router::ROUTER;
use js::jsapi::{JSContext, JS_ParseJSON}; use js::jsapi::{JSContext, JS_ParseJSON};
use js::jsapi::JS_ClearPendingException; use js::jsapi::JS_ClearPendingException;
use js::jsval::{JSVal, NullValue, UndefinedValue}; use js::jsval::{JSVal, NullValue, UndefinedValue};
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use msg::constellation_msg::PipelineId;
use net_traits::{CoreResourceThread, FetchMetadata, FilteredMetadata}; use net_traits::{CoreResourceThread, FetchMetadata, FilteredMetadata};
use net_traits::{FetchResponseListener, LoadOrigin, NetworkError}; use net_traits::{FetchResponseListener, LoadOrigin, NetworkError, ReferrerPolicy};
use net_traits::CoreResourceMsg::Fetch; use net_traits::CoreResourceMsg::Fetch;
use net_traits::request::{CredentialsMode, Destination, RequestInit, RequestMode}; use net_traits::request::{CredentialsMode, Destination, RequestInit, RequestMode};
use net_traits::trim_http_whitespace; use net_traits::trim_http_whitespace;

View file

@ -32,6 +32,7 @@ extern crate audio_video_metadata;
#[allow(unused_extern_crates)] #[allow(unused_extern_crates)]
#[macro_use] #[macro_use]
extern crate bitflags; extern crate bitflags;
extern crate bluetooth_traits;
extern crate canvas_traits; extern crate canvas_traits;
extern crate caseless; extern crate caseless;
extern crate cookie as cookie_rs; extern crate cookie as cookie_rs;

View file

@ -17,6 +17,7 @@
//! a page runs its course and the script thread returns to processing events in the main event //! a page runs its course and the script thread returns to processing events in the main event
//! loop. //! loop.
use bluetooth_traits::BluetoothMethodMsg;
use devtools; use devtools;
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo}; use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo};
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
@ -71,9 +72,8 @@ use js::jsval::UndefinedValue;
use js::rust::Runtime; use js::rust::Runtime;
use layout_wrapper::ServoLayoutNode; use layout_wrapper::ServoLayoutNode;
use mem::heap_size_of_self_and_children; use mem::heap_size_of_self_and_children;
use msg::constellation_msg::{FrameType, PipelineId, PipelineNamespace, ReferrerPolicy}; use msg::constellation_msg::{FrameId, FrameType, PipelineId, PipelineNamespace};
use net_traits::{CoreResourceMsg, IpcSend, Metadata, ResourceThreads}; use net_traits::{CoreResourceMsg, IpcSend, Metadata, ReferrerPolicy, ResourceThreads};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread};
use net_traits::request::{CredentialsMode, Destination, RequestInit}; use net_traits::request::{CredentialsMode, Destination, RequestInit};
use network_listener::NetworkListener; use network_listener::NetworkListener;
@ -135,6 +135,8 @@ pub unsafe fn trace_thread(tr: *mut JSTracer) {
struct InProgressLoad { struct InProgressLoad {
/// The pipeline which requested this load. /// The pipeline which requested this load.
pipeline_id: PipelineId, pipeline_id: PipelineId,
/// The frame being loaded into.
frame_id: FrameId,
/// The parent pipeline and frame type associated with this load, if any. /// The parent pipeline and frame type associated with this load, if any.
parent_info: Option<(PipelineId, FrameType)>, parent_info: Option<(PipelineId, FrameType)>,
/// The current window size associated with this pipeline. /// The current window size associated with this pipeline.
@ -154,12 +156,14 @@ struct InProgressLoad {
impl InProgressLoad { impl InProgressLoad {
/// Create a new InProgressLoad object. /// Create a new InProgressLoad object.
fn new(id: PipelineId, fn new(id: PipelineId,
frame_id: FrameId,
parent_info: Option<(PipelineId, FrameType)>, parent_info: Option<(PipelineId, FrameType)>,
layout_chan: Sender<message::Msg>, layout_chan: Sender<message::Msg>,
window_size: Option<WindowSizeData>, window_size: Option<WindowSizeData>,
url: Url) -> InProgressLoad { url: Url) -> InProgressLoad {
InProgressLoad { InProgressLoad {
pipeline_id: id, pipeline_id: id,
frame_id: frame_id,
parent_info: parent_info, parent_info: parent_info,
layout_chan: layout_chan, layout_chan: layout_chan,
window_size: window_size, window_size: window_size,
@ -452,15 +456,15 @@ impl ScriptThreadFactory for ScriptThread {
let (sender, receiver) = channel(); let (sender, receiver) = channel();
let layout_chan = sender.clone(); let layout_chan = sender.clone();
let pipeline_id = state.id;
thread::spawn_named(format!("ScriptThread {:?}", state.id), thread::spawn_named(format!("ScriptThread {:?}", state.id),
move || { move || {
thread_state::initialize(thread_state::SCRIPT); thread_state::initialize(thread_state::SCRIPT);
PipelineId::install(pipeline_id); PipelineId::install(state.id);
PipelineNamespace::install(state.pipeline_namespace_id); PipelineNamespace::install(state.pipeline_namespace_id);
let roots = RootCollection::new(); let roots = RootCollection::new();
let _stack_roots_tls = StackRootTLS::new(&roots); let _stack_roots_tls = StackRootTLS::new(&roots);
let id = state.id; let id = state.id;
let frame_id = state.frame_id;
let parent_info = state.parent_info; let parent_info = state.parent_info;
let mem_profiler_chan = state.mem_profiler_chan.clone(); let mem_profiler_chan = state.mem_profiler_chan.clone();
let window_size = state.window_size; let window_size = state.window_size;
@ -474,7 +478,7 @@ impl ScriptThreadFactory for ScriptThread {
let mut failsafe = ScriptMemoryFailsafe::new(&script_thread); let mut failsafe = ScriptMemoryFailsafe::new(&script_thread);
let new_load = InProgressLoad::new(id, parent_info, layout_chan, window_size, let new_load = InProgressLoad::new(id, frame_id, parent_info, layout_chan, window_size,
load_data.url.clone()); load_data.url.clone());
script_thread.start_page_load(new_load, load_data); script_thread.start_page_load(new_load, load_data);
@ -888,8 +892,8 @@ impl ScriptThread {
fn handle_msg_from_constellation(&self, msg: ConstellationControlMsg) { fn handle_msg_from_constellation(&self, msg: ConstellationControlMsg) {
match msg { match msg {
ConstellationControlMsg::Navigate(parent_pipeline_id, pipeline_id, load_data, replace) => ConstellationControlMsg::Navigate(parent_pipeline_id, frame_id, load_data, replace) =>
self.handle_navigate(parent_pipeline_id, Some(pipeline_id), load_data, replace), self.handle_navigate(parent_pipeline_id, Some(frame_id), load_data, replace),
ConstellationControlMsg::SendEvent(id, event) => ConstellationControlMsg::SendEvent(id, event) =>
self.handle_event(id, event), self.handle_event(id, event),
ConstellationControlMsg::ResizeInactive(id, new_size) => ConstellationControlMsg::ResizeInactive(id, new_size) =>
@ -902,22 +906,22 @@ impl ScriptThread {
self.handle_thaw_msg(pipeline_id), self.handle_thaw_msg(pipeline_id),
ConstellationControlMsg::ChangeFrameVisibilityStatus(pipeline_id, visible) => ConstellationControlMsg::ChangeFrameVisibilityStatus(pipeline_id, visible) =>
self.handle_visibility_change_msg(pipeline_id, visible), self.handle_visibility_change_msg(pipeline_id, visible),
ConstellationControlMsg::NotifyVisibilityChange(parent_pipeline_id, pipeline_id, visible) => ConstellationControlMsg::NotifyVisibilityChange(parent_pipeline_id, frame_id, visible) =>
self.handle_visibility_change_complete_msg(parent_pipeline_id, pipeline_id, visible), self.handle_visibility_change_complete_msg(parent_pipeline_id, frame_id, visible),
ConstellationControlMsg::MozBrowserEvent(parent_pipeline_id, ConstellationControlMsg::MozBrowserEvent(parent_pipeline_id,
pipeline_id, frame_id,
event) => event) =>
self.handle_mozbrowser_event_msg(parent_pipeline_id, self.handle_mozbrowser_event_msg(parent_pipeline_id,
pipeline_id, frame_id,
event), event),
ConstellationControlMsg::UpdatePipelineId(parent_pipeline_id, ConstellationControlMsg::UpdatePipelineId(parent_pipeline_id,
old_pipeline_id, frame_id,
new_pipeline_id) => new_pipeline_id) =>
self.handle_update_pipeline_id(parent_pipeline_id, self.handle_update_pipeline_id(parent_pipeline_id,
old_pipeline_id, frame_id,
new_pipeline_id), new_pipeline_id),
ConstellationControlMsg::FocusIFrame(parent_pipeline_id, pipeline_id) => ConstellationControlMsg::FocusIFrame(parent_pipeline_id, frame_id) =>
self.handle_focus_iframe_msg(parent_pipeline_id, pipeline_id), self.handle_focus_iframe_msg(parent_pipeline_id, frame_id),
ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, msg) => ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, msg) =>
self.handle_webdriver_msg(pipeline_id, msg), self.handle_webdriver_msg(pipeline_id, msg),
ConstellationControlMsg::TickAllAnimations(pipeline_id) => ConstellationControlMsg::TickAllAnimations(pipeline_id) =>
@ -927,10 +931,10 @@ impl ScriptThread {
ConstellationControlMsg::WebFontLoaded(pipeline_id) => ConstellationControlMsg::WebFontLoaded(pipeline_id) =>
self.handle_web_font_loaded(pipeline_id), self.handle_web_font_loaded(pipeline_id),
ConstellationControlMsg::DispatchFrameLoadEvent { ConstellationControlMsg::DispatchFrameLoadEvent {
target: pipeline_id, parent: parent_pipeline_id } => target: frame_id, parent: parent_id, child: child_id } =>
self.handle_frame_load_event(parent_pipeline_id, pipeline_id), self.handle_frame_load_event(parent_id, frame_id, child_id),
ConstellationControlMsg::FramedContentChanged(parent_pipeline_id, pipeline_id) => ConstellationControlMsg::FramedContentChanged(parent_pipeline_id, frame_id) =>
self.handle_framed_content_changed(parent_pipeline_id, pipeline_id), self.handle_framed_content_changed(parent_pipeline_id, frame_id),
ConstellationControlMsg::ReportCSSError(pipeline_id, filename, line, column, msg) => ConstellationControlMsg::ReportCSSError(pipeline_id, filename, line, column, msg) =>
self.handle_css_error_reporting(pipeline_id, filename, line, column, msg), self.handle_css_error_reporting(pipeline_id, filename, line, column, msg),
ConstellationControlMsg::Reload(pipeline_id) => ConstellationControlMsg::Reload(pipeline_id) =>
@ -1139,6 +1143,7 @@ impl ScriptThread {
let NewLayoutInfo { let NewLayoutInfo {
parent_pipeline_id, parent_pipeline_id,
new_pipeline_id, new_pipeline_id,
frame_id,
frame_type, frame_type,
load_data, load_data,
pipeline_port, pipeline_port,
@ -1175,7 +1180,7 @@ impl ScriptThread {
.unwrap(); .unwrap();
// Kick off the fetch for the new resource. // Kick off the fetch for the new resource.
let new_load = InProgressLoad::new(new_pipeline_id, Some((parent_pipeline_id, frame_type)), let new_load = InProgressLoad::new(new_pipeline_id, frame_id, Some((parent_pipeline_id, frame_type)),
layout_chan, parent_window.window_size(), layout_chan, parent_window.window_size(),
load_data.url.clone()); load_data.url.clone());
self.start_page_load(new_load, load_data); self.start_page_load(new_load, load_data);
@ -1187,12 +1192,15 @@ impl ScriptThread {
None => return warn!("Message sent to closed pipeline {}.", pipeline), None => return warn!("Message sent to closed pipeline {}.", pipeline),
}; };
if doc.loader().is_blocked() { if doc.loader().is_blocked() {
debug!("Script thread got loads complete while loader is blocked.");
return; return;
} }
doc.mut_loader().inhibit_events(); doc.mut_loader().inhibit_events();
// https://html.spec.whatwg.org/multipage/#the-end step 7 // https://html.spec.whatwg.org/multipage/#the-end step 7
// Schedule a task to fire a "load" event (if no blocking loads have arrived in the mean time)
// NOTE: we can end up executing this code more than once, in case more blocking loads arrive.
let handler = box DocumentProgressHandler::new(Trusted::new(&doc)); let handler = box DocumentProgressHandler::new(Trusted::new(&doc));
self.dom_manipulation_task_source.queue(handler, doc.window().upcast()).unwrap(); self.dom_manipulation_task_source.queue(handler, doc.window().upcast()).unwrap();
@ -1259,7 +1267,7 @@ impl ScriptThread {
} }
/// Updates iframe element after a change in visibility /// Updates iframe element after a change in visibility
fn handle_visibility_change_complete_msg(&self, parent_pipeline_id: PipelineId, id: PipelineId, visible: bool) { fn handle_visibility_change_complete_msg(&self, parent_pipeline_id: PipelineId, id: FrameId, visible: bool) {
if let Some(root_context) = self.browsing_context.get() { if let Some(root_context) = self.browsing_context.get() {
if let Some(ref inner_context) = root_context.find(parent_pipeline_id) { if let Some(ref inner_context) = root_context.find(parent_pipeline_id) {
if let Some(iframe) = inner_context.active_document().find_iframe(id) { if let Some(iframe) = inner_context.active_document().find_iframe(id) {
@ -1328,12 +1336,12 @@ impl ScriptThread {
fn handle_focus_iframe_msg(&self, fn handle_focus_iframe_msg(&self,
parent_pipeline_id: PipelineId, parent_pipeline_id: PipelineId,
pipeline_id: PipelineId) { frame_id: FrameId) {
let borrowed_context = self.root_browsing_context(); let borrowed_context = self.root_browsing_context();
let context = borrowed_context.find(parent_pipeline_id).unwrap(); let context = borrowed_context.find(parent_pipeline_id).unwrap();
let doc = context.active_document(); let doc = context.active_document();
let frame_element = doc.find_iframe(pipeline_id); let frame_element = doc.find_iframe(frame_id);
if let Some(ref frame_element) = frame_element { if let Some(ref frame_element) = frame_element {
doc.begin_focus_transaction(); doc.begin_focus_transaction();
@ -1344,11 +1352,11 @@ impl ScriptThread {
fn handle_framed_content_changed(&self, fn handle_framed_content_changed(&self,
parent_pipeline_id: PipelineId, parent_pipeline_id: PipelineId,
pipeline_id: PipelineId) { frame_id: FrameId) {
let root_context = self.root_browsing_context(); let root_context = self.root_browsing_context();
let context = root_context.find(parent_pipeline_id).unwrap(); let context = root_context.find(parent_pipeline_id).unwrap();
let doc = context.active_document(); let doc = context.active_document();
let frame_element = doc.find_iframe(pipeline_id); let frame_element = doc.find_iframe(frame_id);
if let Some(ref frame_element) = frame_element { if let Some(ref frame_element) = frame_element {
frame_element.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage); frame_element.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
let window = context.active_window(); let window = context.active_window();
@ -1362,14 +1370,14 @@ impl ScriptThread {
/// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadstart /// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadstart
fn handle_mozbrowser_event_msg(&self, fn handle_mozbrowser_event_msg(&self,
parent_pipeline_id: PipelineId, parent_pipeline_id: PipelineId,
pipeline_id: Option<PipelineId>, frame_id: Option<FrameId>,
event: MozBrowserEvent) { event: MozBrowserEvent) {
match self.root_browsing_context().find(parent_pipeline_id) { match self.root_browsing_context().find(parent_pipeline_id) {
None => warn!("Mozbrowser event after pipeline {:?} closed.", parent_pipeline_id), None => warn!("Mozbrowser event after pipeline {:?} closed.", parent_pipeline_id),
Some(context) => match pipeline_id { Some(context) => match frame_id {
None => context.active_window().dispatch_mozbrowser_event(event), None => context.active_window().dispatch_mozbrowser_event(event),
Some(pipeline_id) => match context.active_document().find_iframe(pipeline_id) { Some(frame_id) => match context.active_document().find_iframe(frame_id) {
None => warn!("Mozbrowser event after iframe {:?}/{:?} closed.", parent_pipeline_id, pipeline_id), None => warn!("Mozbrowser event after iframe {:?}/{:?} closed.", parent_pipeline_id, frame_id),
Some(frame_element) => frame_element.dispatch_mozbrowser_event(event), Some(frame_element) => frame_element.dispatch_mozbrowser_event(event),
}, },
}, },
@ -1378,13 +1386,13 @@ impl ScriptThread {
fn handle_update_pipeline_id(&self, fn handle_update_pipeline_id(&self,
parent_pipeline_id: PipelineId, parent_pipeline_id: PipelineId,
old_pipeline_id: PipelineId, frame_id: FrameId,
new_pipeline_id: PipelineId) { new_pipeline_id: PipelineId) {
let borrowed_context = self.root_browsing_context(); let borrowed_context = self.root_browsing_context();
let frame_element = borrowed_context.find(parent_pipeline_id).and_then(|context| { let frame_element = borrowed_context.find(parent_pipeline_id).and_then(|context| {
let doc = context.active_document(); let doc = context.active_document();
doc.find_iframe(old_pipeline_id) doc.find_iframe(frame_id)
}); });
frame_element.unwrap().update_pipeline_id(new_pipeline_id); frame_element.unwrap().update_pipeline_id(new_pipeline_id);
@ -1567,13 +1575,15 @@ impl ScriptThread {
} }
/// Notify the containing document of a child frame that has completed loading. /// Notify the containing document of a child frame that has completed loading.
fn handle_frame_load_event(&self, parent_pipeline_id: PipelineId, id: PipelineId) { fn handle_frame_load_event(&self, parent_id: PipelineId, frame_id: FrameId, child_id: PipelineId) {
let document = match self.root_browsing_context().find(parent_pipeline_id) { let document = match self.root_browsing_context().find(parent_id) {
Some(browsing_context) => browsing_context.active_document(), Some(browsing_context) => browsing_context.active_document(),
None => return warn!("Message sent to closed pipeline {}.", parent_pipeline_id), None => return warn!("Message sent to closed pipeline {}.", parent_id),
}; };
if let Some(iframe) = document.find_iframe(id) { if let Some(iframe) = document.find_iframe(frame_id) {
iframe.iframe_load_event_steps(id); if iframe.pipeline_id() == Some(child_id) {
iframe.iframe_load_event_steps(child_id);
}
} }
} }
@ -1609,7 +1619,7 @@ impl ScriptThread {
root_context.and_then(|root_context| { root_context.and_then(|root_context| {
root_context.find(parent_id).and_then(|context| { root_context.find(parent_id).and_then(|context| {
let doc = context.active_document(); let doc = context.active_document();
doc.find_iframe(incomplete.pipeline_id) doc.find_iframe(incomplete.frame_id)
}) })
}) })
}); });
@ -2037,7 +2047,7 @@ impl ScriptThread {
/// The entry point for content to notify that a new load has been requested /// The entry point for content to notify that a new load has been requested
/// for the given pipeline (specifically the "navigate" algorithm). /// for the given pipeline (specifically the "navigate" algorithm).
fn handle_navigate(&self, parent_pipeline_id: PipelineId, fn handle_navigate(&self, parent_pipeline_id: PipelineId,
pipeline_id: Option<PipelineId>, frame_id: Option<FrameId>,
load_data: LoadData, load_data: LoadData,
replace: bool) { replace: bool) {
// Step 7. // Step 7.
@ -2057,12 +2067,12 @@ impl ScriptThread {
} }
} }
match pipeline_id { match frame_id {
Some(pipeline_id) => { Some(frame_id) => {
let root_context = self.root_browsing_context(); let root_context = self.root_browsing_context();
let iframe = root_context.find(parent_pipeline_id).and_then(|context| { let iframe = root_context.find(parent_pipeline_id).and_then(|context| {
let doc = context.active_document(); let doc = context.active_document();
doc.find_iframe(pipeline_id) doc.find_iframe(frame_id)
}); });
if let Some(iframe) = iframe.r() { if let Some(iframe) = iframe.r() {
iframe.navigate_or_reload_child_browsing_context(Some(load_data), replace); iframe.navigate_or_reload_child_browsing_context(Some(load_data), replace);

View file

@ -11,6 +11,7 @@ path = "lib.rs"
[dependencies] [dependencies]
app_units = "0.3" app_units = "0.3"
bluetooth_traits = {path = "../bluetooth_traits"}
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}
cookie = {version = "0.2.5", features = ["serialize-rustc"]} cookie = {version = "0.2.5", features = ["serialize-rustc"]}
devtools_traits = {path = "../devtools_traits"} devtools_traits = {path = "../devtools_traits"}

View file

@ -11,6 +11,7 @@
#![deny(missing_docs)] #![deny(missing_docs)]
#![deny(unsafe_code)] #![deny(unsafe_code)]
extern crate bluetooth_traits;
extern crate canvas_traits; extern crate canvas_traits;
extern crate cookie as cookie_rs; extern crate cookie as cookie_rs;
extern crate devtools_traits; extern crate devtools_traits;
@ -37,6 +38,7 @@ extern crate url;
mod script_msg; mod script_msg;
pub mod webdriver_msg; pub mod webdriver_msg;
use bluetooth_traits::BluetoothMethodMsg;
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId}; use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
use euclid::Size2D; use euclid::Size2D;
use euclid::length::Length; use euclid::length::Length;
@ -53,9 +55,8 @@ use hyper::method::Method;
use ipc_channel::ipc::{IpcReceiver, IpcSender}; use ipc_channel::ipc::{IpcReceiver, IpcSender};
use libc::c_void; use libc::c_void;
use msg::constellation_msg::{FrameId, FrameType, Key, KeyModifiers, KeyState}; use msg::constellation_msg::{FrameId, FrameType, Key, KeyModifiers, KeyState};
use msg::constellation_msg::{PipelineId, PipelineNamespaceId, ReferrerPolicy, TraversalDirection}; use msg::constellation_msg::{PipelineId, PipelineNamespaceId, TraversalDirection};
use net_traits::ResourceThreads; use net_traits::{ReferrerPolicy, ResourceThreads};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_thread::ImageCacheThread; use net_traits::image_cache_thread::ImageCacheThread;
use net_traits::response::HttpsState; use net_traits::response::HttpsState;
@ -167,7 +168,9 @@ pub struct NewLayoutInfo {
pub parent_pipeline_id: PipelineId, pub parent_pipeline_id: PipelineId,
/// Id of the newly-created pipeline. /// Id of the newly-created pipeline.
pub new_pipeline_id: PipelineId, pub new_pipeline_id: PipelineId,
/// Type of the new frame associated with this pipeline. /// Id of the frame associated with this pipeline.
pub frame_id: FrameId,
/// Type of the frame associated with this pipeline.
pub frame_type: FrameType, pub frame_type: FrameType,
/// Network request data which will be initiated by the script thread. /// Network request data which will be initiated by the script thread.
pub load_data: LoadData, pub load_data: LoadData,
@ -207,22 +210,20 @@ pub enum ConstellationControlMsg {
/// Notifies script thread whether frame is visible /// Notifies script thread whether frame is visible
ChangeFrameVisibilityStatus(PipelineId, bool), ChangeFrameVisibilityStatus(PipelineId, bool),
/// Notifies script thread that frame visibility change is complete /// Notifies script thread that frame visibility change is complete
/// First PipelineId is for the parent, second PipelineId is for the actual pipeline. /// PipelineId is for the parent, FrameId is for the actual frame.
NotifyVisibilityChange(PipelineId, PipelineId, bool), NotifyVisibilityChange(PipelineId, FrameId, bool),
/// Notifies script thread that a url should be loaded in this iframe. /// Notifies script thread that a url should be loaded in this iframe.
/// First PipelineId is for the parent, second PipelineId is for the actual pipeline. /// PipelineId is for the parent, FrameId is for the actual frame.
Navigate(PipelineId, PipelineId, LoadData, bool), Navigate(PipelineId, FrameId, LoadData, bool),
/// Requests the script thread forward a mozbrowser event to an iframe it owns, /// Requests the script thread forward a mozbrowser event to an iframe it owns,
/// or to the window if no child pipeline id is provided. /// or to the window if no child frame id is provided.
/// First PipelineId is for the parent, second PipelineId is for the actual pipeline. MozBrowserEvent(PipelineId, Option<FrameId>, MozBrowserEvent),
MozBrowserEvent(PipelineId, Option<PipelineId>, MozBrowserEvent),
/// Updates the current pipeline ID of a given iframe. /// Updates the current pipeline ID of a given iframe.
/// First PipelineId is for the parent, second is the old PipelineId for the frame, /// First PipelineId is for the parent, second is the new PipelineId for the frame.
/// third is the new PipelineId for the frame. UpdatePipelineId(PipelineId, FrameId, PipelineId),
UpdatePipelineId(PipelineId, PipelineId, PipelineId),
/// Set an iframe to be focused. Used when an element in an iframe gains focus. /// Set an iframe to be focused. Used when an element in an iframe gains focus.
/// First PipelineId is for the parent, second PipelineId is for the actual pipeline. /// PipelineId is for the parent, FrameId is for the actual frame.
FocusIFrame(PipelineId, PipelineId), FocusIFrame(PipelineId, FrameId),
/// Passes a webdriver command to the script thread for execution /// Passes a webdriver command to the script thread for execution
WebDriverScriptCommand(PipelineId, WebDriverScriptCommand), WebDriverScriptCommand(PipelineId, WebDriverScriptCommand),
/// Notifies script thread that all animations are done /// Notifies script thread that all animations are done
@ -234,14 +235,16 @@ pub enum ConstellationControlMsg {
WebFontLoaded(PipelineId), WebFontLoaded(PipelineId),
/// Cause a `load` event to be dispatched at the appropriate frame element. /// Cause a `load` event to be dispatched at the appropriate frame element.
DispatchFrameLoadEvent { DispatchFrameLoadEvent {
/// The pipeline that has been marked as loaded. /// The frame that has been marked as loaded.
target: PipelineId, target: FrameId,
/// The pipeline that contains a frame loading the target pipeline. /// The pipeline that contains a frame loading the target pipeline.
parent: PipelineId, parent: PipelineId,
/// The pipeline that has completed loading.
child: PipelineId,
}, },
/// Notifies a parent frame that one of its child frames is now active. /// Notifies a parent pipeline that one of its child frames is now active.
/// First PipelineId is for the parent, second PipelineId is for the actual pipeline. /// PipelineId is for the parent, FrameId is the child frame.
FramedContentChanged(PipelineId, PipelineId), FramedContentChanged(PipelineId, FrameId),
/// Report an error from a CSS parser for the given pipeline /// Report an error from a CSS parser for the given pipeline
ReportCSSError(PipelineId, String, usize, usize, String), ReportCSSError(PipelineId, String, usize, usize, String),
/// Reload the given page. /// Reload the given page.
@ -429,6 +432,8 @@ pub struct InitialScriptState {
/// The subpage ID of this pipeline to create in its pipeline parent. /// The subpage ID of this pipeline to create in its pipeline parent.
/// If `None`, this is the root. /// If `None`, this is the root.
pub parent_info: Option<(PipelineId, FrameType)>, pub parent_info: Option<(PipelineId, FrameType)>,
/// The ID of the frame this script is part of.
pub frame_id: FrameId,
/// A channel with which messages can be sent to us (the script thread). /// A channel with which messages can be sent to us (the script thread).
pub control_chan: IpcSender<ConstellationControlMsg>, pub control_chan: IpcSender<ConstellationControlMsg>,
/// A port on which messages sent by the constellation to script can be received. /// A port on which messages sent by the constellation to script can be received.

View file

@ -83,10 +83,9 @@ pub enum ScriptMsg {
/// A new load has been requested, with an option to replace the current entry once loaded /// A new load has been requested, with an option to replace the current entry once loaded
/// instead of adding a new entry. /// instead of adding a new entry.
LoadUrl(PipelineId, LoadData, bool), LoadUrl(PipelineId, LoadData, bool),
/// Dispatch a mozbrowser event to a given iframe, /// Dispatch a mozbrowser event to the parent of this pipeline.
/// or to the window if no subpage id is provided. /// The first PipelineId is for the parent, the second is for the originating pipeline.
/// First PipelineId is for the parent, second PipelineId is for the actual pipeline. MozBrowserEvent(PipelineId, PipelineId, MozBrowserEvent),
MozBrowserEvent(PipelineId, Option<PipelineId>, MozBrowserEvent),
/// HTMLIFrameElement Forward or Back traversal. /// HTMLIFrameElement Forward or Back traversal.
TraverseHistory(Option<PipelineId>, TraversalDirection), TraverseHistory(Option<PipelineId>, TraversalDirection),
/// Gets the length of the joint session history from the constellation. /// Gets the length of the joint session history from the constellation.

View file

@ -4,6 +4,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth 0.0.1",
"bluetooth_traits 0.0.1",
"browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)", "browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
@ -186,14 +188,45 @@ name = "block"
version = "0.1.6" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bluetooth"
version = "0.0.1"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"device 0.0.1 (git+https://github.com/servo/devices)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
"util 0.0.1",
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bluetooth_traits"
version = "0.0.1"
dependencies = [
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "blurdroid" name = "blurdroid"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "blurmock"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "blurz" name = "blurz"
version = "0.2.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"dbus 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "dbus 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -345,6 +378,7 @@ name = "constellation"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"compositing 0.0.1", "compositing 0.0.1",
@ -490,10 +524,11 @@ dependencies = [
[[package]] [[package]]
name = "device" name = "device"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/servo/devices#6d40b1412fb496b0d9434ee2f46e9dfc4dc67ae7" source = "git+https://github.com/servo/devices#4a6ab4be0de229fafa6aa3657a5702646832ba08"
dependencies = [ dependencies = [
"blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"blurz 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "blurmock 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"blurz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -971,7 +1006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -984,7 +1019,7 @@ dependencies = [
[[package]] [[package]]
name = "html5ever-atoms" name = "html5ever-atoms"
version = "0.1.0" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1169,7 +1204,7 @@ dependencies = [
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1428,7 +1463,6 @@ dependencies = [
"brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"content-blocker 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "content-blocker 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"device 0.0.1 (git+https://github.com/servo/devices)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1446,7 +1480,6 @@ dependencies = [
"openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1973,6 +2006,7 @@ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"audio-video-metadata 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "audio-video-metadata 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1986,7 +2020,7 @@ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2042,7 +2076,7 @@ dependencies = [
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2073,6 +2107,7 @@ name = "script_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
@ -2338,7 +2373,7 @@ dependencies = [
"fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2374,7 +2409,7 @@ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "owning_ref 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2738,7 +2773,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender" name = "webrender"
version = "0.8.0" version = "0.8.0"
source = "git+https://github.com/servo/webrender#2be67987a0ff7bdd4820b65283e6fc1604cc301c" source = "git+https://github.com/servo/webrender#8b53081a3de714f8c1296e20658fabe4e75a6244"
dependencies = [ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2763,7 +2798,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender_traits" name = "webrender_traits"
version = "0.8.0" version = "0.8.0"
source = "git+https://github.com/servo/webrender#2be67987a0ff7bdd4820b65283e6fc1604cc301c" source = "git+https://github.com/servo/webrender#8b53081a3de714f8c1296e20658fabe4e75a6244"
dependencies = [ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2854,7 +2889,7 @@ name = "xml5ever"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2881,7 +2916,8 @@ dependencies = [
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
"checksum blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fce4ea3366b583e9d49e1aa3a42252e53b42911bccd06f31c3e81c48ccfc79e" "checksum blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fce4ea3366b583e9d49e1aa3a42252e53b42911bccd06f31c3e81c48ccfc79e"
"checksum blurz 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96134f6ac62fa6925761dbdb4096617d65d7c1d383d90e5c2d4c489919f773dc" "checksum blurmock 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c3034c7372bc7951e0a916b7e952b0043cd4ccb5112cd30827f0e1708e05c2b1"
"checksum blurz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d49796c8d5a1b5f6b2b8686e46ed4ab842987c477f765b69f1d3e8df6072608"
"checksum brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bff2d5511b5ba5840f46cc3f9c0c3ab09db20e9b9a4db344ef7df3fb547a627a" "checksum brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bff2d5511b5ba5840f46cc3f9c0c3ab09db20e9b9a4db344ef7df3fb547a627a"
"checksum browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)" = "<none>" "checksum browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)" = "<none>"
"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
@ -2946,7 +2982,7 @@ dependencies = [
"checksum heartbeats-simple-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53c4b67617665d7f4172f381f9843c1bec6a4fccc9a9226529e5b1be40dc1301" "checksum heartbeats-simple-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53c4b67617665d7f4172f381f9843c1bec6a4fccc9a9226529e5b1be40dc1301"
"checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58" "checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58"
"checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7" "checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7"
"checksum html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "860439a63e39a4d3506b9cff6107fa238f89edf7aee41ca5a055acb301a556a3" "checksum html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daefa106438c66af58309c84842b5db1df2733fe35849f39adde6fdf63583d40"
"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae" "checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae"
"checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c" "checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c"
"checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e" "checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e"

View file

@ -46,6 +46,8 @@ util_tests = {path = "../../tests/unit/util"}
[dependencies] [dependencies]
backtrace = "0.2" backtrace = "0.2"
bluetooth_traits = {path = "../bluetooth_traits"}
bluetooth = {path = "../bluetooth"}
browserhtml = {git = "https://github.com/browserhtml/browserhtml", branch = "crate"} browserhtml = {git = "https://github.com/browserhtml/browserhtml", branch = "crate"}
canvas = {path = "../canvas"} canvas = {path = "../canvas"}
canvas_traits = {path = "../canvas_traits"} canvas_traits = {path = "../canvas_traits"}

View file

@ -24,6 +24,8 @@ extern crate gaol;
extern crate gleam; extern crate gleam;
extern crate log; extern crate log;
pub extern crate bluetooth;
pub extern crate bluetooth_traits;
pub extern crate canvas; pub extern crate canvas;
pub extern crate canvas_traits; pub extern crate canvas_traits;
pub extern crate compositing; pub extern crate compositing;
@ -61,6 +63,8 @@ fn webdriver(port: u16, constellation: Sender<ConstellationMsg>) {
#[cfg(not(feature = "webdriver"))] #[cfg(not(feature = "webdriver"))]
fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { } fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { }
use bluetooth::BluetoothThreadFactory;
use bluetooth_traits::BluetoothMethodMsg;
use compositing::{CompositorProxy, IOCompositor}; use compositing::{CompositorProxy, IOCompositor};
use compositing::compositor_thread::InitialCompositorState; use compositing::compositor_thread::InitialCompositorState;
use compositing::windowing::WindowEvent; use compositing::windowing::WindowEvent;
@ -75,11 +79,9 @@ use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
use gfx::font_cache_thread::FontCacheThread; use gfx::font_cache_thread::FontCacheThread;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use log::{Log, LogMetadata, LogRecord}; use log::{Log, LogMetadata, LogRecord};
use net::bluetooth_thread::BluetoothThreadFactory;
use net::image_cache_thread::new_image_cache_thread; use net::image_cache_thread::new_image_cache_thread;
use net::resource_thread::new_resource_threads; use net::resource_thread::new_resource_threads;
use net_traits::IpcSend; use net_traits::IpcSend;
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use profile::mem as profile_mem; use profile::mem as profile_mem;
use profile::time as profile_time; use profile::time as profile_time;
use profile_traits::mem; use profile_traits::mem;

View file

@ -236,10 +236,12 @@ COMPILATION_TARGETS = {
"target_dir": "../gecko_bindings", "target_dir": "../gecko_bindings",
"blacklist_types": [ "blacklist_types": [
"nsACString_internal", "nsACString_internal",
"nsAString_internal",
], ],
"raw_lines": [ "raw_lines": [
"pub use nsstring::nsACString;", "pub use nsstring::{nsACString, nsAString};",
"type nsACString_internal = nsACString;", "type nsACString_internal = nsACString;",
"type nsAString_internal = nsAString;"
], ],
"flags": [ "flags": [
"--ignore-methods", "--ignore-methods",

View file

@ -32,14 +32,14 @@ def msvc32_symbolify(source, ident):
class GkAtomSource: class GkAtomSource:
PATTERN = re.compile('^GK_ATOM\((.+),\s*"(.*)"\)') PATTERN = re.compile('^GK_ATOM\((?P<ident>.+),\s*"(?P<value>.*)"\)', re.M)
FILE = "dist/include/nsGkAtomList.h" FILE = "dist/include/nsGkAtomList.h"
CLASS = "nsGkAtoms" CLASS = "nsGkAtoms"
TYPE = "nsIAtom" TYPE = "nsIAtom"
class CSSPseudoElementsAtomSource: class CSSPseudoElementsAtomSource:
PATTERN = re.compile('^CSS_PSEUDO_ELEMENT\((.+),\s*"(.*)",') PATTERN = re.compile('^CSS_PSEUDO_ELEMENT\((?P<ident>.+),\s*"(?P<value>.*)",', re.M)
FILE = "dist/include/nsCSSPseudoElementList.h" FILE = "dist/include/nsCSSPseudoElementList.h"
CLASS = "nsCSSPseudoElements" CLASS = "nsCSSPseudoElements"
# NB: nsICSSPseudoElement is effectively the same as a nsIAtom, but we need # NB: nsICSSPseudoElement is effectively the same as a nsIAtom, but we need
@ -48,16 +48,24 @@ class CSSPseudoElementsAtomSource:
class CSSAnonBoxesAtomSource: class CSSAnonBoxesAtomSource:
PATTERN = re.compile('^CSS_ANON_BOX\((.+),\s*"(.*)"\)') PATTERN = re.compile('^CSS_ANON_BOX\((?P<ident>.+),\s*"(?P<value>.*)"\)', re.M)
FILE = "dist/include/nsCSSAnonBoxList.h" FILE = "dist/include/nsCSSAnonBoxList.h"
CLASS = "nsCSSAnonBoxes" CLASS = "nsCSSAnonBoxes"
TYPE = "nsICSSAnonBoxPseudo" TYPE = "nsICSSAnonBoxPseudo"
class CSSPropsAtomSource:
PATTERN = re.compile('^CSS_PROP_[A-Z]+\(\s*(?P<value>[^,]+),\s*(?P<ident>[^,]+)', re.M)
FILE = "dist/include/nsCSSPropList.h"
CLASS = "nsCSSProps"
TYPE = "nsICSSProperty"
SOURCES = [ SOURCES = [
GkAtomSource, GkAtomSource,
CSSPseudoElementsAtomSource, CSSPseudoElementsAtomSource,
CSSAnonBoxesAtomSource, CSSAnonBoxesAtomSource,
CSSPropsAtomSource,
] ]
@ -95,10 +103,14 @@ def collect_atoms(objdir):
atoms = [] atoms = []
for source in SOURCES: for source in SOURCES:
with open(os.path.join(objdir, source.FILE)) as f: with open(os.path.join(objdir, source.FILE)) as f:
for line in f.readlines(): content = f.read()
result = re.match(source.PATTERN, line) found = set()
if result: for match in source.PATTERN.finditer(content):
atoms.append(Atom(source, result.group(1), result.group(2))) ident = match.group('ident')
if ident in found:
continue
found.add(ident)
atoms.append(Atom(source, ident, match.group('value')))
return atoms return atoms

View file

@ -1,7 +1,8 @@
/* automatically generated by rust-bindgen */ /* automatically generated by rust-bindgen */
pub use nsstring::nsACString; pub use nsstring::{nsACString, nsAString};
type nsACString_internal = nsACString; type nsACString_internal = nsACString;
type nsAString_internal = nsAString;
pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>; pub type ServoComputedValuesStrong = ::gecko_bindings::sugar::ownership::Strong<ServoComputedValues>;
pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>; pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;
pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues; pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;
@ -922,16 +923,73 @@ extern "C" {
pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal) pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;
} }
extern "C" {
pub fn Servo_DeclarationBlock_CreateEmpty()
-> RawServoDeclarationBlockStrong;
}
extern "C" {
pub fn Servo_DeclarationBlock_Clone(declarations:
RawServoDeclarationBlockBorrowed)
-> RawServoDeclarationBlockStrong;
}
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed, pub fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
b: RawServoDeclarationBlockBorrowed) b: RawServoDeclarationBlockBorrowed)
-> bool; -> bool;
} }
extern "C" {
pub fn Servo_DeclarationBlock_GetCssText(declarations:
RawServoDeclarationBlockBorrowed,
result: *mut nsAString_internal);
}
extern "C" { extern "C" {
pub fn Servo_DeclarationBlock_SerializeOneValue(declarations: pub fn Servo_DeclarationBlock_SerializeOneValue(declarations:
RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockBorrowed,
buffer: *mut nsString); buffer: *mut nsString);
} }
extern "C" {
pub fn Servo_DeclarationBlock_Count(declarations:
RawServoDeclarationBlockBorrowed)
-> u32;
}
extern "C" {
pub fn Servo_DeclarationBlock_GetNthProperty(declarations:
RawServoDeclarationBlockBorrowed,
index: u32,
result:
*mut nsAString_internal)
-> bool;
}
extern "C" {
pub fn Servo_DeclarationBlock_GetPropertyValue(declarations:
RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom,
is_custom: bool,
value:
*mut nsAString_internal);
}
extern "C" {
pub fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations:
RawServoDeclarationBlockBorrowed,
property:
*mut nsIAtom,
is_custom: bool)
-> bool;
}
extern "C" {
pub fn Servo_DeclarationBlock_SetProperty(declarations:
RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom,
is_custom: bool,
value: *mut nsACString_internal,
is_important: bool) -> bool;
}
extern "C" {
pub fn Servo_DeclarationBlock_RemoveProperty(declarations:
RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom,
is_custom: bool);
}
extern "C" { extern "C" {
pub fn Servo_CSSSupports(name: *const nsACString_internal, pub fn Servo_CSSSupports(name: *const nsACString_internal,
value: *const nsACString_internal) -> bool; value: *const nsACString_internal) -> bool;

File diff suppressed because it is too large Load diff

5
dependencyci.yml Normal file
View file

@ -0,0 +1,5 @@
platforms:
pypi:
charade:
tests:
unmaintained: skip

View file

@ -1,5 +1,9 @@
# Servo's directory structure: # Servo's directory structure:
* components * components
* bluetooth
* Implementation the bluetooth thread.
* bluetooth_traits
* APIs to the bluetooth crate for crates that don't want to depend on the bluetooth crate for build speed reasons.
* canvas * canvas
* Implementation of painting threads for 2d and WebGL canvases. * Implementation of painting threads for 2d and WebGL canvases.
* canvas_traits * canvas_traits

View file

@ -16,10 +16,11 @@ usage() {
upload() { upload() {
local package_filename local nightly_filename nightly_timestamp
package_filename="$(basename "${2}")" nightly_timestamp="$(date -u +"%Y-%m-%dT%H-%M-%SZ")"
nightly_filename="${nightly_timestamp}-$(basename "${2}")"
local -r nightly_upload_dir="s3://servo-builds/nightly/${1}" local -r nightly_upload_dir="s3://servo-builds/nightly/${1}"
local -r package_upload_path="${nightly_upload_dir}/${package_filename}" local -r package_upload_path="${nightly_upload_dir}/${nightly_filename}"
s3cmd --mime-type="application/octet-stream" \ s3cmd --mime-type="application/octet-stream" \
put "${2}" "${package_upload_path}" put "${2}" "${package_upload_path}"
s3cmd cp "${package_upload_path}" "${nightly_upload_dir}/servo-latest.${3}" s3cmd cp "${package_upload_path}" "${nightly_upload_dir}/servo-latest.${3}"

68
ports/cef/Cargo.lock generated
View file

@ -159,14 +159,45 @@ name = "block"
version = "0.1.6" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bluetooth"
version = "0.0.1"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"device 0.0.1 (git+https://github.com/servo/devices)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
"util 0.0.1",
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bluetooth_traits"
version = "0.0.1"
dependencies = [
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "blurdroid" name = "blurdroid"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "blurmock"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "blurz" name = "blurz"
version = "0.2.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"dbus 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "dbus 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -302,6 +333,7 @@ name = "constellation"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"compositing 0.0.1", "compositing 0.0.1",
@ -447,10 +479,11 @@ dependencies = [
[[package]] [[package]]
name = "device" name = "device"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/servo/devices#6d40b1412fb496b0d9434ee2f46e9dfc4dc67ae7" source = "git+https://github.com/servo/devices#4a6ab4be0de229fafa6aa3657a5702646832ba08"
dependencies = [ dependencies = [
"blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"blurz 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "blurmock 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"blurz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -878,7 +911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -891,7 +924,7 @@ dependencies = [
[[package]] [[package]]
name = "html5ever-atoms" name = "html5ever-atoms"
version = "0.1.0" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1076,7 +1109,7 @@ dependencies = [
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1328,7 +1361,6 @@ dependencies = [
"brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"content-blocker 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "content-blocker 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"device 0.0.1 (git+https://github.com/servo/devices)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1346,7 +1378,6 @@ dependencies = [
"openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1824,6 +1855,7 @@ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"audio-video-metadata 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "audio-video-metadata 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1837,7 +1869,7 @@ dependencies = [
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1893,7 +1925,7 @@ dependencies = [
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1914,6 +1946,7 @@ name = "script_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
@ -2004,6 +2037,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth 0.0.1",
"bluetooth_traits 0.0.1",
"browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)", "browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
@ -2222,7 +2257,7 @@ dependencies = [
"fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2596,7 +2631,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender" name = "webrender"
version = "0.8.0" version = "0.8.0"
source = "git+https://github.com/servo/webrender#2be67987a0ff7bdd4820b65283e6fc1604cc301c" source = "git+https://github.com/servo/webrender#8b53081a3de714f8c1296e20658fabe4e75a6244"
dependencies = [ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2621,7 +2656,7 @@ dependencies = [
[[package]] [[package]]
name = "webrender_traits" name = "webrender_traits"
version = "0.8.0" version = "0.8.0"
source = "git+https://github.com/servo/webrender#2be67987a0ff7bdd4820b65283e6fc1604cc301c" source = "git+https://github.com/servo/webrender#8b53081a3de714f8c1296e20658fabe4e75a6244"
dependencies = [ dependencies = [
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2712,7 +2747,7 @@ name = "xml5ever"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2739,7 +2774,8 @@ dependencies = [
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
"checksum blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fce4ea3366b583e9d49e1aa3a42252e53b42911bccd06f31c3e81c48ccfc79e" "checksum blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fce4ea3366b583e9d49e1aa3a42252e53b42911bccd06f31c3e81c48ccfc79e"
"checksum blurz 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96134f6ac62fa6925761dbdb4096617d65d7c1d383d90e5c2d4c489919f773dc" "checksum blurmock 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c3034c7372bc7951e0a916b7e952b0043cd4ccb5112cd30827f0e1708e05c2b1"
"checksum blurz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d49796c8d5a1b5f6b2b8686e46ed4ab842987c477f765b69f1d3e8df6072608"
"checksum brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bff2d5511b5ba5840f46cc3f9c0c3ab09db20e9b9a4db344ef7df3fb547a627a" "checksum brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bff2d5511b5ba5840f46cc3f9c0c3ab09db20e9b9a4db344ef7df3fb547a627a"
"checksum browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)" = "<none>" "checksum browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)" = "<none>"
"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
@ -2798,7 +2834,7 @@ dependencies = [
"checksum heartbeats-simple-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53c4b67617665d7f4172f381f9843c1bec6a4fccc9a9226529e5b1be40dc1301" "checksum heartbeats-simple-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53c4b67617665d7f4172f381f9843c1bec6a4fccc9a9226529e5b1be40dc1301"
"checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58" "checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58"
"checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7" "checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7"
"checksum html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "860439a63e39a4d3506b9cff6107fa238f89edf7aee41ca5a055acb301a556a3" "checksum html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daefa106438c66af58309c84842b5db1df2733fe35849f39adde6fdf63583d40"
"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae" "checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae"
"checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c" "checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c"
"checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e" "checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e"

View file

@ -7,6 +7,7 @@ use cssparser::{Parser, ToCss};
use env_logger; use env_logger;
use euclid::Size2D; use euclid::Size2D;
use parking_lot::RwLock; use parking_lot::RwLock;
use std::fmt::Write;
use std::mem::transmute; use std::mem::transmute;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use style::arc_ptr_eq; use style::arc_ptr_eq;
@ -25,9 +26,9 @@ use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSet
use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed}; use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong}; use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder}; use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
use style::gecko_bindings::bindings::{nsACString, nsAString};
use style::gecko_bindings::bindings::Gecko_Utf8SliceToString; use style::gecko_bindings::bindings::Gecko_Utf8SliceToString;
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull; use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
use style::gecko_bindings::bindings::nsACString;
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom}; use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom};
use style::gecko_bindings::structs::ServoElementSnapshot; use style::gecko_bindings::structs::ServoElementSnapshot;
use style::gecko_bindings::structs::nsRestyleHint; use style::gecko_bindings::structs::nsRestyleHint;
@ -420,6 +421,18 @@ pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString) -> RawServo
Arc::new(RwLock::new(GeckoElement::parse_style_attribute(value))).into_strong() Arc::new(RwLock::new(GeckoElement::parse_style_attribute(value))).into_strong()
} }
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_CreateEmpty() -> RawServoDeclarationBlockStrong {
Arc::new(RwLock::new(PropertyDeclarationBlock { declarations: vec![], important_count: 0 })).into_strong()
}
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_Clone(declarations: RawServoDeclarationBlockBorrowed)
-> RawServoDeclarationBlockStrong {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
Arc::new(RwLock::new(declarations.read().clone())).into_strong()
}
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: RawServoDeclarationBlockBorrowed) { pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: RawServoDeclarationBlockBorrowed) {
unsafe { RwLock::<PropertyDeclarationBlock>::addref(declarations) }; unsafe { RwLock::<PropertyDeclarationBlock>::addref(declarations) };
@ -437,6 +450,13 @@ pub extern "C" fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorro
*RwLock::<PropertyDeclarationBlock>::as_arc(&a).read() == *RwLock::<PropertyDeclarationBlock>::as_arc(&b).read() *RwLock::<PropertyDeclarationBlock>::as_arc(&a).read() == *RwLock::<PropertyDeclarationBlock>::as_arc(&b).read()
} }
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_GetCssText(declarations: RawServoDeclarationBlockBorrowed,
result: *mut nsAString) {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
declarations.read().to_css(unsafe { result.as_mut().unwrap() }).unwrap();
}
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue( pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
declarations: RawServoDeclarationBlockBorrowed, declarations: RawServoDeclarationBlockBorrowed,
@ -469,6 +489,85 @@ pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
} }
} }
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_Count(declarations: RawServoDeclarationBlockBorrowed) -> u32 {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
declarations.read().declarations.len() as u32
}
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_GetNthProperty(declarations: RawServoDeclarationBlockBorrowed,
index: u32, result: *mut nsAString) -> bool {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
if let Some(&(ref decl, _)) = declarations.read().declarations.get(index as usize) {
let result = unsafe { result.as_mut().unwrap() };
write!(result, "{}", decl.name()).unwrap();
true
} else {
false
}
}
// FIXME Methods of PropertyDeclarationBlock should take atoms directly.
// This function is just a temporary workaround before that finishes.
fn get_property_name_from_atom(atom: *mut nsIAtom, is_custom: bool) -> String {
let atom = Atom::from(atom);
if !is_custom {
atom.to_string()
} else {
let mut result = String::with_capacity(atom.len() as usize + 2);
write!(result, "--{}", atom).unwrap();
result
}
}
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_GetPropertyValue(declarations: RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom, is_custom: bool,
value: *mut nsAString) {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
let property = get_property_name_from_atom(property, is_custom);
declarations.read().property_value_to_css(&property, unsafe { value.as_mut().unwrap() }).unwrap();
}
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations: RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom, is_custom: bool) -> bool {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
let property = get_property_name_from_atom(property, is_custom);
declarations.read().property_priority(&property).important()
}
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_SetProperty(declarations: RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom, is_custom: bool,
value: *mut nsACString, is_important: bool) -> bool {
let property = get_property_name_from_atom(property, is_custom);
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
// FIXME Needs real URL and ParserContextExtraData.
let base_url = &*DUMMY_BASE_URL;
let extra_data = ParserContextExtraData::default();
if let Ok(decls) = parse_one_declaration(&property, value, &base_url,
Box::new(StdoutErrorReporter), extra_data) {
let mut declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations).write();
let importance = if is_important { Importance::Important } else { Importance::Normal };
for decl in decls.into_iter() {
declarations.set_parsed_declaration(decl, importance);
}
true
} else {
false
}
}
#[no_mangle]
pub extern "C" fn Servo_DeclarationBlock_RemoveProperty(declarations: RawServoDeclarationBlockBorrowed,
property: *mut nsIAtom, is_custom: bool) {
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
let property = get_property_name_from_atom(property, is_custom);
declarations.write().remove_property(&property);
}
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_CSSSupports(property: *const nsACString, value: *const nsACString) -> bool { pub extern "C" fn Servo_CSSSupports(property: *const nsACString, value: *const nsACString) -> bool {
let property = unsafe { property.as_ref().unwrap().as_str_unchecked() }; let property = unsafe { property.as_ref().unwrap().as_str_unchecked() };

View file

@ -703,6 +703,19 @@ impl Window {
VirtualKeyCode::Tab => Ok(Key::Tab), VirtualKeyCode::Tab => Ok(Key::Tab),
VirtualKeyCode::Subtract => Ok(Key::Minus), VirtualKeyCode::Subtract => Ok(Key::Minus),
VirtualKeyCode::F1 => Ok(Key::F1),
VirtualKeyCode::F2 => Ok(Key::F2),
VirtualKeyCode::F3 => Ok(Key::F3),
VirtualKeyCode::F4 => Ok(Key::F4),
VirtualKeyCode::F5 => Ok(Key::F5),
VirtualKeyCode::F6 => Ok(Key::F6),
VirtualKeyCode::F7 => Ok(Key::F7),
VirtualKeyCode::F8 => Ok(Key::F8),
VirtualKeyCode::F9 => Ok(Key::F9),
VirtualKeyCode::F10 => Ok(Key::F10),
VirtualKeyCode::F11 => Ok(Key::F11),
VirtualKeyCode::F12 => Ok(Key::F12),
VirtualKeyCode::NavigateBackward => Ok(Key::NavigateBackward), VirtualKeyCode::NavigateBackward => Ok(Key::NavigateBackward),
VirtualKeyCode::NavigateForward => Ok(Key::NavigateForward), VirtualKeyCode::NavigateForward => Ok(Key::NavigateForward),
_ => Err(()), _ => Err(()),

View file

@ -19,7 +19,6 @@ import subprocess
import mako.template import mako.template
from mach.registrar import Registrar from mach.registrar import Registrar
from datetime import datetime
from mach.decorators import ( from mach.decorators import (
CommandArgument, CommandArgument,
@ -155,7 +154,6 @@ class PackageCommands(CommandBase):
dir_to_build = '/'.join(binary_path.split('/')[:-1]) dir_to_build = '/'.join(binary_path.split('/')[:-1])
dir_to_root = '/'.join(binary_path.split('/')[:-3]) dir_to_root = '/'.join(binary_path.split('/')[:-3])
now = datetime.utcnow()
print("Creating Servo.app") print("Creating Servo.app")
dir_to_dmg = '/'.join(binary_path.split('/')[:-2]) + '/dmg' dir_to_dmg = '/'.join(binary_path.split('/')[:-2]) + '/dmg'
@ -212,9 +210,7 @@ class PackageCommands(CommandBase):
print("Creating dmg") print("Creating dmg")
os.symlink('/Applications', dir_to_dmg + '/Applications') os.symlink('/Applications', dir_to_dmg + '/Applications')
dmg_path = '/'.join(dir_to_build.split('/')[:-1]) + '/' dmg_path = '/'.join(dir_to_build.split('/')[:-1]) + '/'
time = now.replace(microsecond=0).isoformat() dmg_path += "servo-tech-demo.dmg"
time = time.replace(':', '-')
dmg_path += time + "-servo-tech-demo.dmg"
try: try:
subprocess.check_call(['hdiutil', 'create', '-volname', 'Servo', dmg_path, '-srcfolder', dir_to_dmg]) subprocess.check_call(['hdiutil', 'create', '-volname', 'Servo', dmg_path, '-srcfolder', dir_to_dmg])
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
@ -229,7 +225,7 @@ class PackageCommands(CommandBase):
dir_to_tar = '/'.join(dir_to_build.split('/')[:-1]) + '/brew/' dir_to_tar = '/'.join(dir_to_build.split('/')[:-1]) + '/brew/'
if not path.exists(dir_to_tar): if not path.exists(dir_to_tar):
os.makedirs(dir_to_tar) os.makedirs(dir_to_tar)
tar_path = dir_to_tar + now.strftime("servo-%Y-%m-%d.tar.gz") tar_path = dir_to_tar + "servo.tar.gz"
if path.exists(dir_to_brew): if path.exists(dir_to_brew):
print("Cleaning up from previous packaging") print("Cleaning up from previous packaging")
delete(dir_to_brew) delete(dir_to_brew)
@ -316,9 +312,7 @@ class PackageCommands(CommandBase):
os.close(runservo) os.close(runservo)
print("Creating tarball") print("Creating tarball")
time = datetime.utcnow().replace(microsecond=0).isoformat() tar_path = path.join(self.get_target_dir(), 'servo-tech-demo.tar.gz')
time = time.replace(':', "-")
tar_path = path.join(self.get_target_dir(), time + '-servo-tech-demo.tar.gz')
archive_deterministically(dir_to_temp, tar_path, prepend_path='servo/') archive_deterministically(dir_to_temp, tar_path, prepend_path='servo/')

View file

@ -40,6 +40,9 @@ f000ffc0-0451-4000-b000-000000000000
# Block access to standardized unique identifiers, for privacy reasons. # Block access to standardized unique identifiers, for privacy reasons.
00002a25-0000-1000-8000-00805f9b34fb 00002a25-0000-1000-8000-00805f9b34fb
# Blacklisted characteristic used to test readValue function.
bad1c9a2-9a5b-4015-8b60-1579bbbf2135 exclude-reads
## Descriptors ## Descriptors
@ -50,4 +53,10 @@ f000ffc0-0451-4000-b000-000000000000
# org.bluetooth.descriptor.gatt.server_characteristic_configuration # org.bluetooth.descriptor.gatt.server_characteristic_configuration
# Writing to this would let a web page interfere with the broadcasted services. # Writing to this would let a web page interfere with the broadcasted services.
00002903-0000-1000-8000-00805f9b34fb exclude-writes 00002903-0000-1000-8000-00805f9b34fb exclude-writes
# Blacklisted descriptor used to test.
07711111-6104-0970-7011-1107105110aaa
# Blacklisted descriptor used to test.
aaaaaaaa-aaaa-1181-0510-810819516110 exclude-reads

View file

@ -1,5 +1,6 @@
{ {
"dom.bluetooth.enabled": false, "dom.bluetooth.enabled": false,
"dom.bluetooth.testing.enabled": false,
"dom.forcetouch.enabled": true, "dom.forcetouch.enabled": true,
"dom.mouseevent.which.enabled": false, "dom.mouseevent.which.enabled": false,
"dom.mozbrowser.enabled": true, "dom.mozbrowser.enabled": true,

View file

@ -1,5 +1,6 @@
{ {
"dom.bluetooth.enabled": false, "dom.bluetooth.enabled": false,
"dom.bluetooth.testing.enabled": false,
"dom.forcetouch.enabled": false, "dom.forcetouch.enabled": false,
"dom.mouseevent.which.enabled": false, "dom.mouseevent.which.enabled": false,
"dom.mozbrowser.enabled": false, "dom.mozbrowser.enabled": false,

View file

@ -16,7 +16,8 @@ void write_clip(ClipInfo clip) {
clip.bottom_right.outer_inner_radius.x, clip.bottom_right.outer_inner_radius.x,
clip.bottom_left.outer_inner_radius.x); clip.bottom_left.outer_inner_radius.x);
//TODO: interpolate the final mask UV //TODO: interpolate the final mask UV
vClipMaskUvRect = clip.mask_info.uv_rect; vec2 texture_size = textureSize(sMask, 0);
vClipMaskUvRect = clip.mask_info.uv_rect / texture_size.xyxy;
vClipMaskLocalRect = clip.mask_info.local_rect; //TODO: transform vClipMaskLocalRect = clip.mask_info.local_rect; //TODO: transform
} }
#endif #endif

View file

@ -254,7 +254,8 @@ struct PrimitiveInstance {
int render_task_index; int render_task_index;
int layer_index; int layer_index;
int clip_address; int clip_address;
ivec3 user_data; int sub_index;
ivec2 user_data;
}; };
PrimitiveInstance fetch_instance(int index) { PrimitiveInstance fetch_instance(int index) {
@ -270,7 +271,8 @@ PrimitiveInstance fetch_instance(int index) {
pi.render_task_index = data0.z; pi.render_task_index = data0.z;
pi.layer_index = data0.w; pi.layer_index = data0.w;
pi.clip_address = data1.x; pi.clip_address = data1.x;
pi.user_data = data1.yzw; pi.sub_index = data1.y;
pi.user_data = data1.zw;
return pi; return pi;
} }
@ -302,7 +304,10 @@ struct Primitive {
vec4 local_clip_rect; vec4 local_clip_rect;
int prim_index; int prim_index;
int clip_index; int clip_index;
ivec3 user_data; // when sending multiple primitives of the same type (e.g. border segments)
// this index allows the vertex shader to recognize the difference
int sub_index;
ivec2 user_data;
}; };
Primitive load_primitive(int index) { Primitive load_primitive(int index) {
@ -318,8 +323,9 @@ Primitive load_primitive(int index) {
prim.local_clip_rect = pg.local_clip_rect; prim.local_clip_rect = pg.local_clip_rect;
prim.prim_index = pi.specific_prim_index; prim.prim_index = pi.specific_prim_index;
prim.user_data = pi.user_data;
prim.clip_index = pi.clip_address; prim.clip_index = pi.clip_address;
prim.sub_index = pi.sub_index;
prim.user_data = pi.user_data;
return prim; return prim;
} }
@ -588,7 +594,6 @@ struct Image {
vec4 st_rect; // Location of the image texture in the texture atlas. vec4 st_rect; // Location of the image texture in the texture atlas.
vec4 stretch_size_and_tile_spacing; // Size of the actual image and amount of space between vec4 stretch_size_and_tile_spacing; // Size of the actual image and amount of space between
// tiled instances of this image. // tiled instances of this image.
bool has_pixel_coords;
}; };
Image fetch_image(int index) { Image fetch_image(int index) {
@ -599,9 +604,6 @@ Image fetch_image(int index) {
image.st_rect = texelFetchOffset(sData32, uv, 0, ivec2(0, 0)); image.st_rect = texelFetchOffset(sData32, uv, 0, ivec2(0, 0));
image.stretch_size_and_tile_spacing = texelFetchOffset(sData32, uv, 0, ivec2(1, 0)); image.stretch_size_and_tile_spacing = texelFetchOffset(sData32, uv, 0, ivec2(1, 0));
image.has_pixel_coords = image.st_rect.z < 0.0;
image.st_rect.z = abs(image.st_rect.z);
return image; return image;
} }

View file

@ -12,7 +12,7 @@ void main(void) {
prim.layer, prim.layer,
prim.tile); prim.tile);
vStopCount = int(prim.user_data.y); vStopCount = int(prim.user_data.x);
vPos = vi.local_clamped_pos; vPos = vi.local_clamped_pos;
// Snap the start/end points to device pixel units. // Snap the start/end points to device pixel units.
@ -24,10 +24,8 @@ void main(void) {
vStartPoint = floor(0.5 + gradient.start_end_point.xy * uDevicePixelRatio) / uDevicePixelRatio; vStartPoint = floor(0.5 + gradient.start_end_point.xy * uDevicePixelRatio) / uDevicePixelRatio;
vEndPoint = floor(0.5 + gradient.start_end_point.zw * uDevicePixelRatio) / uDevicePixelRatio; vEndPoint = floor(0.5 + gradient.start_end_point.zw * uDevicePixelRatio) / uDevicePixelRatio;
int stop_index = int(prim.user_data.x);
for (int i=0 ; i < vStopCount ; ++i) { for (int i=0 ; i < vStopCount ; ++i) {
GradientStop stop = fetch_gradient_stop(stop_index + i); GradientStop stop = fetch_gradient_stop(prim.sub_index + i);
vColors[i] = stop.color; vColors[i] = stop.color;
vOffsets[i/4][i%4] = stop.offset.x; vOffsets[i/4][i%4] = stop.offset.x;
} }

View file

@ -6,6 +6,7 @@
void main(void) { void main(void) {
Primitive prim = load_primitive(gl_InstanceID); Primitive prim = load_primitive(gl_InstanceID);
Border border = fetch_border(prim.prim_index); Border border = fetch_border(prim.prim_index);
int sub_part = prim.sub_index;
vec2 tl_outer = prim.local_rect.xy; vec2 tl_outer = prim.local_rect.xy;
vec2 tl_inner = tl_outer + vec2(max(border.radii[0].x, border.widths.x), vec2 tl_inner = tl_outer + vec2(max(border.radii[0].x, border.widths.x),
@ -27,7 +28,7 @@ void main(void) {
-max(border.radii[1].w, border.widths.w)); -max(border.radii[1].w, border.widths.w));
vec4 segment_rect; vec4 segment_rect;
switch (prim.user_data.x) { switch (sub_part) {
case PST_TOP_LEFT: case PST_TOP_LEFT:
segment_rect = vec4(tl_outer, tl_inner - tl_outer); segment_rect = vec4(tl_outer, tl_inner - tl_outer);
break; break;
@ -92,9 +93,6 @@ void main(void) {
vLocalRect = prim.local_rect; vLocalRect = prim.local_rect;
#endif #endif
float x0, y0, x1, y1;
int sub_part = prim.user_data.x;
switch (sub_part) { switch (sub_part) {
case PST_LEFT: case PST_LEFT:
vBorderStyle = int(border.style.x); vBorderStyle = int(border.style.x);
@ -150,6 +148,7 @@ void main(void) {
break; break;
} }
float x0, y0, x1, y1;
switch (sub_part) { switch (sub_part) {
// These are the layer tile part PrimitivePart as uploaded by the tiling.rs // These are the layer tile part PrimitivePart as uploaded by the tiling.rs
case PST_TOP_LEFT: case PST_TOP_LEFT:

View file

@ -6,14 +6,14 @@
void main(void) { void main(void) {
Primitive prim = load_primitive(gl_InstanceID); Primitive prim = load_primitive(gl_InstanceID);
BoxShadow bs = fetch_boxshadow(prim.prim_index); BoxShadow bs = fetch_boxshadow(prim.prim_index);
vec4 segment_rect = fetch_instance_geometry(prim.user_data.x + prim.user_data.y); vec4 segment_rect = fetch_instance_geometry(prim.sub_index);
VertexInfo vi = write_vertex(segment_rect, VertexInfo vi = write_vertex(segment_rect,
prim.local_clip_rect, prim.local_clip_rect,
prim.layer, prim.layer,
prim.tile); prim.tile);
RenderTaskData child_task = fetch_render_task(prim.user_data.z); RenderTaskData child_task = fetch_render_task(prim.user_data.x);
vUv.z = child_task.data1.x; vUv.z = child_task.data1.x;
// Constant offsets to inset from bilinear filtering border. // Constant offsets to inset from bilinear filtering border.

View file

@ -7,9 +7,8 @@ void main(void) {
Primitive prim = load_primitive(gl_InstanceID); Primitive prim = load_primitive(gl_InstanceID);
Gradient gradient = fetch_gradient(prim.prim_index); Gradient gradient = fetch_gradient(prim.prim_index);
int stop_index = prim.user_data.x + prim.user_data.y; GradientStop g0 = fetch_gradient_stop(prim.sub_index + 0);
GradientStop g0 = fetch_gradient_stop(stop_index + 0); GradientStop g1 = fetch_gradient_stop(prim.sub_index + 1);
GradientStop g1 = fetch_gradient_stop(stop_index + 1);
vec4 segment_rect; vec4 segment_rect;
switch (int(gradient.kind.x)) { switch (int(gradient.kind.x)) {

View file

@ -7,9 +7,8 @@ void main(void) {
Primitive prim = load_primitive(gl_InstanceID); Primitive prim = load_primitive(gl_InstanceID);
Gradient gradient = fetch_gradient(prim.prim_index); Gradient gradient = fetch_gradient(prim.prim_index);
int stop_index = prim.user_data.x + prim.user_data.y; GradientStop g0 = fetch_gradient_stop(prim.sub_index + 0);
GradientStop g0 = fetch_gradient_stop(stop_index + 0); GradientStop g1 = fetch_gradient_stop(prim.sub_index + 1);
GradientStop g1 = fetch_gradient_stop(stop_index + 1);
vec4 segment_rect; vec4 segment_rect;
switch (int(gradient.kind.x)) { switch (int(gradient.kind.x)) {

View file

@ -23,14 +23,9 @@ void main(void) {
#endif #endif
// vUv will contain how many times this image has wrapped around the image size. // vUv will contain how many times this image has wrapped around the image size.
vec2 st0 = image.st_rect.xy; vec2 texture_size = vec2(textureSize(sDiffuse, 0));
vec2 st1 = image.st_rect.zw; vec2 st0 = image.st_rect.xy / texture_size;
vec2 st1 = image.st_rect.zw / texture_size;
if (image.has_pixel_coords) {
vec2 texture_size = vec2(textureSize(sDiffuse, 0));
st0 /= texture_size;
st1 /= texture_size;
}
vTextureSize = st1 - st0; vTextureSize = st1 - st0;
vTextureOffset = st0; vTextureOffset = st0;

View file

@ -6,7 +6,7 @@
void main(void) { void main(void) {
Primitive prim = load_primitive(gl_InstanceID); Primitive prim = load_primitive(gl_InstanceID);
TextRun text = fetch_text_run(prim.prim_index); TextRun text = fetch_text_run(prim.prim_index);
Glyph glyph = fetch_glyph(prim.user_data.x + prim.user_data.y); Glyph glyph = fetch_glyph(prim.sub_index);
vec4 local_rect = vec4(glyph.offset.xy, (glyph.uv_rect.zw - glyph.uv_rect.xy) / uDevicePixelRatio); vec4 local_rect = vec4(glyph.offset.xy, (glyph.uv_rect.zw - glyph.uv_rect.xy) / uDevicePixelRatio);
#ifdef WR_FEATURE_TRANSFORM #ifdef WR_FEATURE_TRANSFORM

View file

@ -25,7 +25,6 @@
#define varying in #define varying in
// Uniform inputs // Uniform inputs
uniform sampler2D sMask;
// Fragment shader outputs // Fragment shader outputs
out vec4 oFragColor; out vec4 oFragColor;
@ -35,6 +34,7 @@
// Shared shader uniforms // Shared shader uniforms
//====================================================================================== //======================================================================================
uniform sampler2D sDiffuse; uniform sampler2D sDiffuse;
uniform sampler2D sMask;
//====================================================================================== //======================================================================================
// Interpolator definitions // Interpolator definitions

View file

@ -20,9 +20,10 @@ use hyper::server::{Handler, Listening, Server};
use hyper::server::{Request as HyperRequest, Response as HyperResponse}; use hyper::server::{Request as HyperRequest, Response as HyperResponse};
use hyper::status::StatusCode; use hyper::status::StatusCode;
use hyper::uri::RequestUri; use hyper::uri::RequestUri;
use msg::constellation_msg::{ReferrerPolicy, TEST_PIPELINE_ID}; use msg::constellation_msg::TEST_PIPELINE_ID;
use net::fetch::cors_cache::CORSCache; use net::fetch::cors_cache::CORSCache;
use net::fetch::methods::{fetch, fetch_with_cors_cache}; use net::fetch::methods::{fetch, fetch_with_cors_cache};
use net_traits::ReferrerPolicy;
use net_traits::request::{Origin, RedirectMode, Referrer, Request, RequestMode}; use net_traits::request::{Origin, RedirectMode, Referrer, Request, RequestMode};
use net_traits::response::{CacheState, Response, ResponseBody, ResponseType}; use net_traits::response::{CacheState, Response, ResponseBody, ResponseType};
use std::fs::File; use std::fs::File;

View file

@ -18,7 +18,7 @@ use hyper::http::RawStatus;
use hyper::method::Method; use hyper::method::Method;
use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper::mime::{Mime, SubLevel, TopLevel};
use hyper::status::StatusCode; use hyper::status::StatusCode;
use msg::constellation_msg::{PipelineId, ReferrerPolicy, TEST_PIPELINE_ID}; use msg::constellation_msg::{PipelineId, TEST_PIPELINE_ID};
use net::cookie::Cookie; use net::cookie::Cookie;
use net::cookie_storage::CookieStorage; use net::cookie_storage::CookieStorage;
use net::hsts::HstsEntry; use net::hsts::HstsEntry;
@ -26,7 +26,7 @@ use net::http_loader::{HttpRequest, HttpRequestFactory, HttpState, LoadError, UI
use net::http_loader::{HttpResponse, LoadErrorType}; use net::http_loader::{HttpResponse, LoadErrorType};
use net::resource_thread::{AuthCacheEntry, CancellationListener}; use net::resource_thread::{AuthCacheEntry, CancellationListener};
use net_traits::{CookieSource, IncludeSubdomains, LoadContext, LoadData}; use net_traits::{CookieSource, IncludeSubdomains, LoadContext, LoadData};
use net_traits::{CustomResponse, LoadOrigin, Metadata}; use net_traits::{CustomResponse, LoadOrigin, Metadata, ReferrerPolicy};
use std::borrow::Cow; use std::borrow::Cow;
use std::io::{self, Cursor, Read, Write}; use std::io::{self, Cursor, Read, Write};
use std::sync::{Arc, RwLock, mpsc}; use std::sync::{Arc, RwLock, mpsc};

View file

@ -3,10 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use ipc_channel::ipc; use ipc_channel::ipc;
use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use msg::constellation_msg::PipelineId;
use net::resource_thread::new_core_resource_thread; use net::resource_thread::new_core_resource_thread;
use net_traits::{CoreResourceMsg, LoadConsumer, LoadContext, LoadData}; use net_traits::{CoreResourceMsg, LoadConsumer, LoadContext, LoadData};
use net_traits::{LoadOrigin, NetworkError, ProgressMsg}; use net_traits::{LoadOrigin, NetworkError, ProgressMsg, ReferrerPolicy};
use net_traits::hosts::{host_replacement, parse_hostsfile}; use net_traits::hosts::{host_replacement, parse_hostsfile};
use profile_traits::time::ProfilerChan; use profile_traits::time::ProfilerChan;
use std::borrow::ToOwned; use std::borrow::ToOwned;

View file

@ -1,2 +1 @@
mozprocess >= 0.19 mozprocess >= 0.19

View file

@ -130,6 +130,7 @@ class FirefoxBrowser(Browser):
"marionette.defaultPrefs.port": self.marionette_port, "marionette.defaultPrefs.port": self.marionette_port,
"dom.disable_open_during_load": False, "dom.disable_open_during_load": False,
"network.dns.localDomains": ",".join(hostnames), "network.dns.localDomains": ",".join(hostnames),
"network.proxy.type": 0,
"places.history.enabled": False}) "places.history.enabled": False})
if self.e10s: if self.e10s:
self.profile.set_preferences({"browser.tabs.remote.autostart": True}) self.profile.set_preferences({"browser.tabs.remote.autostart": True})

View file

@ -3,11 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var props = {output:%(output)d}; var props = {output:%(output)d};
var start_loc = document.createElement('a');
start_loc.href = location.href;
setup(props); setup(props);
add_completion_callback(function (tests, harness_status) { add_completion_callback(function (tests, harness_status) {
var id = location.pathname + location.search + location.hash; var id = start_loc.pathname + start_loc.search + start_loc.hash;
console.log("ALERT: RESULT: " + JSON.stringify([ console.log("ALERT: RESULT: " + JSON.stringify([
id, id,
harness_status.status, harness_status.status,

View file

@ -16,6 +16,8 @@
# TODO: keep comments in the tree # TODO: keep comments in the tree
from __future__ import unicode_literals
import types import types
from cStringIO import StringIO from cStringIO import StringIO
@ -48,8 +50,9 @@ atoms = {"True": True,
"False": False, "False": False,
"Reset": object()} "Reset": object()}
def decode(byte_str): def decode(s):
return byte_str.decode("utf8") assert isinstance(s, unicode)
return s
def precedence(operator_node): def precedence(operator_node):
@ -76,7 +79,8 @@ class Tokenizer(object):
def tokenize(self, stream): def tokenize(self, stream):
self.reset() self.reset()
if type(stream) in types.StringTypes: assert not isinstance(stream, unicode)
if isinstance(stream, str):
stream = StringIO(stream) stream = StringIO(stream)
if not hasattr(stream, "name"): if not hasattr(stream, "name"):
self.filename = "" self.filename = ""
@ -85,13 +89,15 @@ class Tokenizer(object):
self.next_line_state = self.line_start_state self.next_line_state = self.line_start_state
for i, line in enumerate(stream): for i, line in enumerate(stream):
assert isinstance(line, str)
self.state = self.next_line_state self.state = self.next_line_state
assert self.state is not None assert self.state is not None
states = [] states = []
self.next_line_state = None self.next_line_state = None
self.line_number = i + 1 self.line_number = i + 1
self.index = 0 self.index = 0
self.line = line.rstrip() self.line = line.decode('utf-8').rstrip()
assert isinstance(self.line, unicode)
while self.state != self.eol_state: while self.state != self.eol_state:
states.append(self.state) states.append(self.state)
tokens = self.state() tokens = self.state()
@ -474,7 +480,7 @@ class Tokenizer(object):
value += self.escape_value(c) value += self.escape_value(c)
self.consume() self.consume()
return unichr(value).encode("utf8") return unichr(value)
def escape_value(self, c): def escape_value(self, c):
if '0' <= c <= '9': if '0' <= c <= '9':

View file

@ -11,9 +11,6 @@ from ..node import BinaryExpressionNode, BinaryOperatorNode, VariableNode, Numbe
class TestConditional(unittest.TestCase): class TestConditional(unittest.TestCase):
def parse(self, input_str):
return self.parser.parse(StringIO(input_str))
def compile(self, input_text): def compile(self, input_text):
return conditional.compile(input_text) return conditional.compile(input_text)

View file

@ -13,9 +13,6 @@ from ..backends import static
class TestStatic(unittest.TestCase): class TestStatic(unittest.TestCase):
def parse(self, input_str):
return self.parser.parse(StringIO(input_str))
def compile(self, input_text, input_data): def compile(self, input_text, input_data):
return static.compile(input_text, input_data) return static.compile(input_text, input_data)

View file

@ -6674,6 +6674,978 @@
"url": "/_mozilla/mozilla/binding_keyword.html" "url": "/_mozilla/mozilla/binding_keyword.html"
} }
], ],
"mozilla/bluetooth/connect/connection-succeeds.html": [
{
"path": "mozilla/bluetooth/connect/connection-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/connect/connection-succeeds.html"
}
],
"mozilla/bluetooth/connect/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/connect/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/connect/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/connect/get-same-gatt-server.html": [
{
"path": "mozilla/bluetooth/connect/get-same-gatt-server.html",
"url": "/_mozilla/mozilla/bluetooth/connect/get-same-gatt-server.html"
}
],
"mozilla/bluetooth/disconnect/connect-disconnect-twice.html": [
{
"path": "mozilla/bluetooth/disconnect/connect-disconnect-twice.html",
"url": "/_mozilla/mozilla/bluetooth/disconnect/connect-disconnect-twice.html"
}
],
"mozilla/bluetooth/disconnect/disconnect-once.html": [
{
"path": "mozilla/bluetooth/disconnect/disconnect-once.html",
"url": "/_mozilla/mozilla/bluetooth/disconnect/disconnect-once.html"
}
],
"mozilla/bluetooth/disconnect/disconnect-twice-in-a-row.html": [
{
"path": "mozilla/bluetooth/disconnect/disconnect-twice-in-a-row.html",
"url": "/_mozilla/mozilla/bluetooth/disconnect/disconnect-twice-in-a-row.html"
}
],
"mozilla/bluetooth/getCharacteristic/blacklisted-characteristic.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/blacklisted-characteristic.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/blacklisted-characteristic.html"
}
],
"mozilla/bluetooth/getCharacteristic/characteristic-found.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/characteristic-found.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/characteristic-found.html"
}
],
"mozilla/bluetooth/getCharacteristic/characteristic-not-found.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/characteristic-not-found.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/characteristic-not-found.html"
}
],
"mozilla/bluetooth/getCharacteristic/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/getCharacteristic/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/disconnect-called-before.html"
}
],
"mozilla/bluetooth/getCharacteristic/disconnect-called-during.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/disconnect-called-during.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/disconnect-called-during.html"
}
],
"mozilla/bluetooth/getCharacteristic/get-same-characteristic.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/get-same-characteristic.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/get-same-characteristic.html"
}
],
"mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/invalid-characteristic-name.html"
}
],
"mozilla/bluetooth/getCharacteristic/service-is-removed.html": [
{
"path": "mozilla/bluetooth/getCharacteristic/service-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristic/service-is-removed.html"
}
],
"mozilla/bluetooth/getCharacteristics/blacklisted-characteristics-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/blacklisted-characteristics-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/blacklisted-characteristics-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/blacklisted-characteristics.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/blacklisted-characteristics.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/blacklisted-characteristics.html"
}
],
"mozilla/bluetooth/getCharacteristics/characteristics-found-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/characteristics-found-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/characteristics-found-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/characteristics-found.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/characteristics-found.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/characteristics-found.html"
}
],
"mozilla/bluetooth/getCharacteristics/characteristics-not-found-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/characteristics-not-found-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/characteristics-not-found-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/characteristics-not-found.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/characteristics-not-found.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/characteristics-not-found.html"
}
],
"mozilla/bluetooth/getCharacteristics/correct-characteristics.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/correct-characteristics.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/correct-characteristics.html"
}
],
"mozilla/bluetooth/getCharacteristics/device-goes-out-of-range-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/device-goes-out-of-range-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/device-goes-out-of-range-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/getCharacteristics/disconnect-called-before-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/disconnect-called-before-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/disconnect-called-before-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/disconnect-called-before.html"
}
],
"mozilla/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/disconnect-called-during-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/disconnect-called-during.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/disconnect-called-during.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/disconnect-called-during.html"
}
],
"mozilla/bluetooth/getCharacteristics/get-same-characteristics.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/get-same-characteristics.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/get-same-characteristics.html"
}
],
"mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/invalid-characteristic-name.html"
}
],
"mozilla/bluetooth/getCharacteristics/service-is-removed-with-uuid.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/service-is-removed-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/service-is-removed-with-uuid.html"
}
],
"mozilla/bluetooth/getCharacteristics/service-is-removed.html": [
{
"path": "mozilla/bluetooth/getCharacteristics/service-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/getCharacteristics/service-is-removed.html"
}
],
"mozilla/bluetooth/getDescriptor/blacklisted-descriptor.html": [
{
"path": "mozilla/bluetooth/getDescriptor/blacklisted-descriptor.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/blacklisted-descriptor.html"
}
],
"mozilla/bluetooth/getDescriptor/characteristic-is-removed.html": [
{
"path": "mozilla/bluetooth/getDescriptor/characteristic-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/characteristic-is-removed.html"
}
],
"mozilla/bluetooth/getDescriptor/descriptor-found.html": [
{
"path": "mozilla/bluetooth/getDescriptor/descriptor-found.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/descriptor-found.html"
}
],
"mozilla/bluetooth/getDescriptor/descriptor-not-found.html": [
{
"path": "mozilla/bluetooth/getDescriptor/descriptor-not-found.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/descriptor-not-found.html"
}
],
"mozilla/bluetooth/getDescriptor/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/getDescriptor/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/getDescriptor/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/getDescriptor/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/disconnect-called-before.html"
}
],
"mozilla/bluetooth/getDescriptor/disconnect-called-during.html": [
{
"path": "mozilla/bluetooth/getDescriptor/disconnect-called-during.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/disconnect-called-during.html"
}
],
"mozilla/bluetooth/getDescriptor/get-same-descriptor.html": [
{
"path": "mozilla/bluetooth/getDescriptor/get-same-descriptor.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/get-same-descriptor.html"
}
],
"mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html": [
{
"path": "mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptor/invalid-descriptor-name.html"
}
],
"mozilla/bluetooth/getDescriptors/blacklisted-descriptors-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/blacklisted-descriptors-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/blacklisted-descriptors-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/blacklisted-descriptors.html": [
{
"path": "mozilla/bluetooth/getDescriptors/blacklisted-descriptors.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/blacklisted-descriptors.html"
}
],
"mozilla/bluetooth/getDescriptors/characteristic-is-removed-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/characteristic-is-removed-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/characteristic-is-removed-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/characteristic-is-removed.html": [
{
"path": "mozilla/bluetooth/getDescriptors/characteristic-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/characteristic-is-removed.html"
}
],
"mozilla/bluetooth/getDescriptors/correct-descriptors.html": [
{
"path": "mozilla/bluetooth/getDescriptors/correct-descriptors.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/correct-descriptors.html"
}
],
"mozilla/bluetooth/getDescriptors/descriptors-found-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/descriptors-found-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/descriptors-found-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/descriptors-found.html": [
{
"path": "mozilla/bluetooth/getDescriptors/descriptors-found.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/descriptors-found.html"
}
],
"mozilla/bluetooth/getDescriptors/descriptors-not-found-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/descriptors-not-found-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/descriptors-not-found-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/descriptors-not-found.html": [
{
"path": "mozilla/bluetooth/getDescriptors/descriptors-not-found.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/descriptors-not-found.html"
}
],
"mozilla/bluetooth/getDescriptors/device-goes-out-of-range-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/device-goes-out-of-range-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/device-goes-out-of-range-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/getDescriptors/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/getDescriptors/disconnect-called-before-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/disconnect-called-before-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/disconnect-called-before-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/getDescriptors/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/disconnect-called-before.html"
}
],
"mozilla/bluetooth/getDescriptors/disconnect-called-during-with-uuid.html": [
{
"path": "mozilla/bluetooth/getDescriptors/disconnect-called-during-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/disconnect-called-during-with-uuid.html"
}
],
"mozilla/bluetooth/getDescriptors/disconnect-called-during.html": [
{
"path": "mozilla/bluetooth/getDescriptors/disconnect-called-during.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/disconnect-called-during.html"
}
],
"mozilla/bluetooth/getDescriptors/get-same-descriptors.html": [
{
"path": "mozilla/bluetooth/getDescriptors/get-same-descriptors.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/get-same-descriptors.html"
}
],
"mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html": [
{
"path": "mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html",
"url": "/_mozilla/mozilla/bluetooth/getDescriptors/invalid-descriptor-name.html"
}
],
"mozilla/bluetooth/getPrimaryService/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/getPrimaryService/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/disconnect-called-before.html"
}
],
"mozilla/bluetooth/getPrimaryService/disconnect-called-during.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/disconnect-called-during.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/disconnect-called-during.html"
}
],
"mozilla/bluetooth/getPrimaryService/disconnected-device.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/disconnected-device.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/disconnected-device.html"
}
],
"mozilla/bluetooth/getPrimaryService/get-same-service.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/get-same-service.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/get-same-service.html"
}
],
"mozilla/bluetooth/getPrimaryService/invalid-service-name.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/invalid-service-name.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/invalid-service-name.html"
}
],
"mozilla/bluetooth/getPrimaryService/no-permission-absent-service.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/no-permission-absent-service.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/no-permission-absent-service.html"
}
],
"mozilla/bluetooth/getPrimaryService/no-permission-present-service.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/no-permission-present-service.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/no-permission-present-service.html"
}
],
"mozilla/bluetooth/getPrimaryService/service-found.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/service-found.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/service-found.html"
}
],
"mozilla/bluetooth/getPrimaryService/service-not-found.html": [
{
"path": "mozilla/bluetooth/getPrimaryService/service-not-found.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryService/service-not-found.html"
}
],
"mozilla/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/blacklisted-services.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/blacklisted-services.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/blacklisted-services.html"
}
],
"mozilla/bluetooth/getPrimaryServices/correct-services.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/correct-services.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/correct-services.html"
}
],
"mozilla/bluetooth/getPrimaryServices/device-goes-out-of-range-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/device-goes-out-of-range-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/device-goes-out-of-range-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/getPrimaryServices/disconnect-called-before-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/disconnect-called-before-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/disconnect-called-before-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/disconnect-called-before.html"
}
],
"mozilla/bluetooth/getPrimaryServices/disconnect-called-during-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/disconnect-called-during-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/disconnect-called-during-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/disconnect-called-during.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/disconnect-called-during.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/disconnect-called-during.html"
}
],
"mozilla/bluetooth/getPrimaryServices/disconnected-device-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/disconnected-device-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/disconnected-device-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/disconnected-device.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/disconnected-device.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/disconnected-device.html"
}
],
"mozilla/bluetooth/getPrimaryServices/get-same-service.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/get-same-service.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/get-same-service.html"
}
],
"mozilla/bluetooth/getPrimaryServices/invalid-service-name.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/invalid-service-name.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/invalid-service-name.html"
}
],
"mozilla/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html"
}
],
"mozilla/bluetooth/getPrimaryServices/services-found-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/services-found-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/services-found-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/services-found.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/services-found.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/services-found.html"
}
],
"mozilla/bluetooth/getPrimaryServices/services-not-found-with-uuid.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/services-not-found-with-uuid.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/services-not-found-with-uuid.html"
}
],
"mozilla/bluetooth/getPrimaryServices/services-not-found.html": [
{
"path": "mozilla/bluetooth/getPrimaryServices/services-not-found.html",
"url": "/_mozilla/mozilla/bluetooth/getPrimaryServices/services-not-found.html"
}
],
"mozilla/bluetooth/readValue/characteristic/blacklisted-characteristic.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/blacklisted-characteristic.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/blacklisted-characteristic.html"
}
],
"mozilla/bluetooth/readValue/characteristic/characteristic-is-removed.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/characteristic-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/characteristic-is-removed.html"
}
],
"mozilla/bluetooth/readValue/characteristic/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/readValue/characteristic/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/disconnect-called-before.html"
}
],
"mozilla/bluetooth/readValue/characteristic/read-succeeds.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/read-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/read-succeeds.html"
}
],
"mozilla/bluetooth/readValue/characteristic/read-updates-value.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/read-updates-value.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/read-updates-value.html"
}
],
"mozilla/bluetooth/readValue/characteristic/service-is-removed.html": [
{
"path": "mozilla/bluetooth/readValue/characteristic/service-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/characteristic/service-is-removed.html"
}
],
"mozilla/bluetooth/readValue/descriptor/blacklisted-descriptor.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/blacklisted-descriptor.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/blacklisted-descriptor.html"
}
],
"mozilla/bluetooth/readValue/descriptor/characteristic-is-removed.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/characteristic-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/characteristic-is-removed.html"
}
],
"mozilla/bluetooth/readValue/descriptor/descriptor-is-removed.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/descriptor-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/descriptor-is-removed.html"
}
],
"mozilla/bluetooth/readValue/descriptor/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/readValue/descriptor/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/disconnect-called-before.html"
}
],
"mozilla/bluetooth/readValue/descriptor/read-succeeds.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/read-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/read-succeeds.html"
}
],
"mozilla/bluetooth/readValue/descriptor/read-updates-value.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/read-updates-value.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/read-updates-value.html"
}
],
"mozilla/bluetooth/readValue/descriptor/service-is-removed.html": [
{
"path": "mozilla/bluetooth/readValue/descriptor/service-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/readValue/descriptor/service-is-removed.html"
}
],
"mozilla/bluetooth/requestDevice/accept-all-devices-with-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/accept-all-devices-with-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/accept-all-devices-with-filter.html"
}
],
"mozilla/bluetooth/requestDevice/accept-all-devices.html": [
{
"path": "mozilla/bluetooth/requestDevice/accept-all-devices.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/accept-all-devices.html"
}
],
"mozilla/bluetooth/requestDevice/adapter-not-present.html": [
{
"path": "mozilla/bluetooth/requestDevice/adapter-not-present.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/adapter-not-present.html"
}
],
"mozilla/bluetooth/requestDevice/adapter-off.html": [
{
"path": "mozilla/bluetooth/requestDevice/adapter-off.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/adapter-off.html"
}
],
"mozilla/bluetooth/requestDevice/blacklisted-service-in-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/blacklisted-service-in-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/blacklisted-service-in-filter.html"
}
],
"mozilla/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html": [
{
"path": "mozilla/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-filter.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-filters-member.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-filters-member.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-filters-member.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-namePrefix.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-namePrefix.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-namePrefix.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-services-member.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-services-member.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/empty-services-member.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-device-name-name.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-device-name-name.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-device-name-name.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-device-name-namePrefix.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-device-name-namePrefix.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-device-name-namePrefix.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/no-arguments.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/no-arguments.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/no-arguments.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/no-filters-member.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/no-filters-member.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/no-filters-member.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-name.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-name-namePrefix.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-name.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-name.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-name.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-namePrefix.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-namePrefix.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-namePrefix.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-namePrefix.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-namePrefix.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-namePrefix.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.html"
}
],
"mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html": [
{
"path": "mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.html"
}
],
"mozilla/bluetooth/requestDevice/correct-uuids.html": [
{
"path": "mozilla/bluetooth/requestDevice/correct-uuids.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/correct-uuids.html"
}
],
"mozilla/bluetooth/requestDevice/discovery-succeeds.html": [
{
"path": "mozilla/bluetooth/requestDevice/discovery-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/discovery-succeeds.html"
}
],
"mozilla/bluetooth/requestDevice/filter-does-not-match.html": [
{
"path": "mozilla/bluetooth/requestDevice/filter-does-not-match.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/filter-does-not-match.html"
}
],
"mozilla/bluetooth/requestDevice/filter-matches.html": [
{
"path": "mozilla/bluetooth/requestDevice/filter-matches.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/filter-matches.html"
}
],
"mozilla/bluetooth/requestDevice/name-empty-device-from-name-empty-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-empty-device-from-name-empty-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-empty-device-from-name-empty-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-empty-device-from-name-prefix-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-empty-device-from-name-prefix-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-empty-device-from-name-prefix-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-empty-device-from-name-wrong-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-empty-device-from-name-wrong-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-empty-device-from-name-wrong-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-empty-device-from-service-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-empty-device-from-service-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-empty-device-from-service-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-empty-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-empty-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-empty-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-missing-device-from-name-empty-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-missing-device-from-name-empty-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-missing-device-from-name-empty-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-missing-device-from-name-prefix-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-missing-device-from-name-prefix-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-missing-device-from-name-prefix-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-missing-device-from-name-wrong-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-missing-device-from-name-wrong-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-missing-device-from-name-wrong-filter.html"
}
],
"mozilla/bluetooth/requestDevice/name-missing-device-from-service-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/name-missing-device-from-service-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/name-missing-device-from-service-filter.html"
}
],
"mozilla/bluetooth/requestDevice/no-devices.html": [
{
"path": "mozilla/bluetooth/requestDevice/no-devices.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/no-devices.html"
}
],
"mozilla/bluetooth/requestDevice/not-accept-all-devices-without-filter.html": [
{
"path": "mozilla/bluetooth/requestDevice/not-accept-all-devices-without-filter.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/not-accept-all-devices-without-filter.html"
}
],
"mozilla/bluetooth/requestDevice/same-device.html": [
{
"path": "mozilla/bluetooth/requestDevice/same-device.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/same-device.html"
}
],
"mozilla/bluetooth/requestDevice/single-filter-single-service.html": [
{
"path": "mozilla/bluetooth/requestDevice/single-filter-single-service.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/single-filter-single-service.html"
}
],
"mozilla/bluetooth/requestDevice/single-filter-two-services-fails.html": [
{
"path": "mozilla/bluetooth/requestDevice/single-filter-two-services-fails.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/single-filter-two-services-fails.html"
}
],
"mozilla/bluetooth/requestDevice/single-filter-two-services-succeeds.html": [
{
"path": "mozilla/bluetooth/requestDevice/single-filter-two-services-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/single-filter-two-services-succeeds.html"
}
],
"mozilla/bluetooth/requestDevice/two-filters.html": [
{
"path": "mozilla/bluetooth/requestDevice/two-filters.html",
"url": "/_mozilla/mozilla/bluetooth/requestDevice/two-filters.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/blacklisted-characteristic.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/blacklisted-characteristic.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/blacklisted-characteristic.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/characteristic-is-removed.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/characteristic-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/characteristic-is-removed.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/disconnect-called-before.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/service-is-removed.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/service-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/service-is-removed.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/write-succeeds.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/write-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/write-succeeds.html"
}
],
"mozilla/bluetooth/writeValue/characteristic/write-updates-value.html": [
{
"path": "mozilla/bluetooth/writeValue/characteristic/write-updates-value.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/characteristic/write-updates-value.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/blacklisted-descriptor.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/blacklisted-descriptor.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/blacklisted-descriptor.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/characteristic-is-removed.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/characteristic-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/characteristic-is-removed.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/descriptor-is-removed.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/descriptor-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/descriptor-is-removed.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/device-goes-out-of-range.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/device-goes-out-of-range.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/device-goes-out-of-range.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/disconnect-called-before.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/disconnect-called-before.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/disconnect-called-before.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/service-is-removed.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/service-is-removed.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/service-is-removed.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/write-succeeds.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/write-succeeds.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/write-succeeds.html"
}
],
"mozilla/bluetooth/writeValue/descriptor/write-updates-value.html": [
{
"path": "mozilla/bluetooth/writeValue/descriptor/write-updates-value.html",
"url": "/_mozilla/mozilla/bluetooth/writeValue/descriptor/write-updates-value.html"
}
],
"mozilla/body_listener.html": [ "mozilla/body_listener.html": [
{ {
"path": "mozilla/body_listener.html", "path": "mozilla/body_listener.html",

View file

@ -0,0 +1 @@
prefs: [dom.bluetooth.testing.enabled:true]

Some files were not shown because too many files have changed in this diff Show more