Merge commit 'refs/upstream/master' into gecko-backout

This commit is contained in:
moz-servo-sync 2017-06-23 20:47:48 +00:00
commit 38f172e7f5
28 changed files with 141 additions and 365 deletions

View file

@ -52,7 +52,7 @@ If you've already partially compiled servo but forgot to do this step, run `./ma
#### On Debian-based Linuxes #### On Debian-based Linuxes
``` sh ``` sh
sudo apt install git curl freeglut3-dev autoconf \ sudo apt install git curl freeglut3-dev autoconf libx11-dev \
libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \ libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \
gperf g++ build-essential cmake virtualenv python-pip \ gperf g++ build-essential cmake virtualenv python-pip \
libssl1.0-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev \ libssl1.0-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev \

View file

@ -703,6 +703,7 @@ impl Document {
// Step 3 // Step 3
let global_scope = self.window.upcast::<GlobalScope>(); let global_scope = self.window.upcast::<GlobalScope>();
let webrender_pipeline_id = global_scope.pipeline_id().to_webrender(); let webrender_pipeline_id = global_scope.pipeline_id().to_webrender();
self.window.update_viewport_for_scroll(x, y);
self.window.perform_a_scroll(x, self.window.perform_a_scroll(x,
y, y,
ClipId::root_scroll_node(webrender_pipeline_id), ClipId::root_scroll_node(webrender_pipeline_id),

View file

@ -1356,7 +1356,7 @@ impl Element {
// Step 10 (TODO) // Step 10 (TODO)
// Step 11 // Step 11
win.scroll_node(node.to_trusted_node_address(), x, y, behavior); win.scroll_node(node, x, y, behavior);
} }
// https://w3c.github.io/DOM-Parsing/#parsing // https://w3c.github.io/DOM-Parsing/#parsing
@ -1798,7 +1798,7 @@ impl ElementMethods for Element {
// Step 10 (TODO) // Step 10 (TODO)
// Step 11 // Step 11
win.scroll_node(node.to_trusted_node_address(), self.ScrollLeft(), y, behavior); win.scroll_node(node, self.ScrollLeft(), y, behavior);
} }
// https://drafts.csswg.org/cssom-view/#dom-element-scrolltop // https://drafts.csswg.org/cssom-view/#dom-element-scrolltop
@ -1891,7 +1891,7 @@ impl ElementMethods for Element {
// Step 10 (TODO) // Step 10 (TODO)
// Step 11 // Step 11
win.scroll_node(node.to_trusted_node_address(), x, self.ScrollTop(), behavior); win.scroll_node(node, x, self.ScrollTop(), behavior);
} }
// https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth // https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth

View file

@ -111,6 +111,7 @@ impl HTMLStyleElement {
win.layout_chan().send(Msg::AddStylesheet(sheet.clone())).unwrap(); win.layout_chan().send(Msg::AddStylesheet(sheet.clone())).unwrap();
*self.stylesheet.borrow_mut() = Some(sheet); *self.stylesheet.borrow_mut() = Some(sheet);
self.cssom_stylesheet.set(None);
doc.invalidate_stylesheets(); doc.invalidate_stylesheets();
} }

View file

@ -103,11 +103,9 @@ impl NodeList {
} }
} }
pub fn iter(&self) -> NodeListIterator { pub fn iter<'a>(&'a self) -> impl Iterator<Item=Root<Node>> + 'a {
NodeListIterator { let len = self.Length();
nodes: self, (0..len).flat_map(move |i| self.Item(i))
offset: 0,
}
} }
} }
@ -289,18 +287,3 @@ impl ChildrenList {
self.last_index.set(0u32); self.last_index.set(0u32);
} }
} }
pub struct NodeListIterator<'a> {
nodes: &'a NodeList,
offset: u32,
}
impl<'a> Iterator for NodeListIterator<'a> {
type Item = Root<Node>;
fn next(&mut self) -> Option<Root<Node>> {
let result = self.nodes.Item(self.offset);
self.offset = self.offset + 1;
result
}
}

View file

@ -13,7 +13,6 @@ use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::Bindings::EventHandlerBinding::OnBeforeUnloadEventHandlerNonNull; use dom::bindings::codegen::Bindings::EventHandlerBinding::OnBeforeUnloadEventHandlerNonNull;
use dom::bindings::codegen::Bindings::EventHandlerBinding::OnErrorEventHandlerNonNull; use dom::bindings::codegen::Bindings::EventHandlerBinding::OnErrorEventHandlerNonNull;
use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::FunctionBinding::Function;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState; use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState;
use dom::bindings::codegen::Bindings::RequestBinding::RequestInit; use dom::bindings::codegen::Bindings::RequestBinding::RequestInit;
use dom::bindings::codegen::Bindings::WindowBinding::{self, FrameRequestCallback, WindowMethods}; use dom::bindings::codegen::Bindings::WindowBinding::{self, FrameRequestCallback, WindowMethods};
@ -1126,8 +1125,11 @@ impl Window {
//let document = self.Document(); //let document = self.Document();
// Step 12 // Step 12
let global_scope = self.upcast::<GlobalScope>(); let global_scope = self.upcast::<GlobalScope>();
self.perform_a_scroll(x.to_f32().unwrap_or(0.0f32), let x = x.to_f32().unwrap_or(0.0f32);
y.to_f32().unwrap_or(0.0f32), let y = y.to_f32().unwrap_or(0.0f32);
self.update_viewport_for_scroll(x, y);
self.perform_a_scroll(x,
y,
global_scope.pipeline_id().root_scroll_node(), global_scope.pipeline_id().root_scroll_node(),
behavior, behavior,
None); None);
@ -1158,9 +1160,6 @@ impl Window {
scroll_offset: Vector2D::new(-x, -y), scroll_offset: Vector2D::new(-x, -y),
})).unwrap(); })).unwrap();
// TODO (farodin91): Raise an event to stop the current_viewport
self.update_viewport_for_scroll(x, y);
let global_scope = self.upcast::<GlobalScope>(); let global_scope = self.upcast::<GlobalScope>();
let message = ConstellationMsg::ScrollFragmentPoint(scroll_root_id, point, smooth); let message = ConstellationMsg::ScrollFragmentPoint(scroll_root_id, point, smooth);
global_scope.constellation_chan().send(message).unwrap(); global_scope.constellation_chan().send(message).unwrap();
@ -1450,33 +1449,32 @@ impl Window {
} }
pub fn scroll_offset_query(&self, node: &Node) -> Vector2D<f32> { pub fn scroll_offset_query(&self, node: &Node) -> Vector2D<f32> {
let mut node = Root::from_ref(node);
loop {
if let Some(scroll_offset) = self.scroll_offsets if let Some(scroll_offset) = self.scroll_offsets
.borrow() .borrow()
.get(&node.to_untrusted_node_address()) { .get(&node.to_untrusted_node_address()) {
return *scroll_offset return *scroll_offset
} }
node = match node.GetParentNode() { Vector2D::new(0.0, 0.0)
Some(node) => node,
None => break,
}
}
let vp_origin = self.current_viewport.get().origin;
Vector2D::new(vp_origin.x.to_f32_px(), vp_origin.y.to_f32_px())
} }
// https://drafts.csswg.org/cssom-view/#dom-element-scroll // https://drafts.csswg.org/cssom-view/#dom-element-scroll
pub fn scroll_node(&self, pub fn scroll_node(&self,
node: TrustedNodeAddress, node: &Node,
x_: f64, x_: f64,
y_: f64, y_: f64,
behavior: ScrollBehavior) { behavior: ScrollBehavior) {
if !self.reflow(ReflowGoal::ForScriptQuery, if !self.reflow(ReflowGoal::ForScriptQuery,
ReflowQueryType::NodeScrollRootIdQuery(node), ReflowQueryType::NodeScrollRootIdQuery(node.to_trusted_node_address()),
ReflowReason::Query) { ReflowReason::Query) {
return; return;
} }
// The scroll offsets are immediatly updated since later calls
// to topScroll and others may access the properties before
// webrender has a chance to update the offsets.
self.scroll_offsets.borrow_mut().insert(node.to_untrusted_node_address(),
Vector2D::new(x_ as f32, y_ as f32));
let NodeScrollRootIdResponse(scroll_root_id) = self.layout_rpc.node_scroll_root_id(); let NodeScrollRootIdResponse(scroll_root_id) = self.layout_rpc.node_scroll_root_id();
// Step 12 // Step 12

View file

@ -7,7 +7,7 @@
use fnv::FnvHasher; use fnv::FnvHasher;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
// The top 12 bits of the 32-bit hash value are not used by the bloom filter. // The top 8 bits of the 32-bit hash value are not used by the bloom filter.
// Consumers may rely on this to pack hashes more efficiently. // Consumers may rely on this to pack hashes more efficiently.
pub const BLOOM_HASH_MASK: u32 = 0x00ffffff; pub const BLOOM_HASH_MASK: u32 = 0x00ffffff;
const KEY_SIZE: usize = 12; const KEY_SIZE: usize = 12;

View file

@ -16,12 +16,6 @@ use std::ffi::CString;
/// Global style data /// Global style data
pub struct GlobalStyleData { pub struct GlobalStyleData {
/// How many threads parallel styling can use.
pub num_threads: usize,
/// The parallel styling thread pool.
pub style_thread_pool: Option<rayon::ThreadPool>,
/// Shared RWLock for CSSOM objects /// Shared RWLock for CSSOM objects
pub shared_lock: SharedRwLock, pub shared_lock: SharedRwLock,
@ -29,6 +23,15 @@ pub struct GlobalStyleData {
pub options: StyleSystemOptions, pub options: StyleSystemOptions,
} }
/// Global thread pool
pub struct StyleThreadPool {
/// How many threads parallel styling can use.
pub num_threads: usize,
/// The parallel styling thread pool.
pub style_thread_pool: Option<rayon::ThreadPool>,
}
fn thread_name(index: usize) -> String { fn thread_name(index: usize) -> String {
format!("StyleThread#{}", index) format!("StyleThread#{}", index)
} }
@ -53,8 +56,8 @@ fn thread_shutdown(_: usize) {
} }
lazy_static! { lazy_static! {
/// Global style data /// Global thread pool
pub static ref GLOBAL_STYLE_DATA: GlobalStyleData = { pub static ref STYLE_THREAD_POOL: StyleThreadPool = {
let stylo_threads = env::var("STYLO_THREADS") let stylo_threads = env::var("STYLO_THREADS")
.map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS value")); .map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS value"));
let mut num_threads = match stylo_threads { let mut num_threads = match stylo_threads {
@ -93,11 +96,14 @@ lazy_static! {
pool pool
}; };
GlobalStyleData { StyleThreadPool {
num_threads: num_threads, num_threads: num_threads,
style_thread_pool: pool, style_thread_pool: pool,
shared_lock: SharedRwLock::new(),
options: StyleSystemOptions::default(),
} }
}; };
/// Global style data
pub static ref GLOBAL_STYLE_DATA: GlobalStyleData = GlobalStyleData {
shared_lock: SharedRwLock::new(),
options: StyleSystemOptions::default(),
};
} }

View file

@ -9,7 +9,7 @@
<%def name="predefined_type(name, type, initial_value, parse_method='parse', <%def name="predefined_type(name, type, initial_value, parse_method='parse',
needs_context=True, vector=False, computed_type=None, initial_specified_value=None, needs_context=True, vector=False, computed_type=None, initial_specified_value=None,
allow_quirks=False, **kwargs)"> allow_quirks=False, allow_empty=False, **kwargs)">
<%def name="predefined_type_inner(name, type, initial_value, parse_method)"> <%def name="predefined_type_inner(name, type, initial_value, parse_method)">
#[allow(unused_imports)] #[allow(unused_imports)]
use app_units::Au; use app_units::Au;
@ -27,7 +27,9 @@
pub use values::computed::${type} as T; pub use values::computed::${type} as T;
% endif % endif
} }
% if initial_value:
#[inline] pub fn get_initial_value() -> computed_value::T { ${initial_value} } #[inline] pub fn get_initial_value() -> computed_value::T { ${initial_value} }
% endif
% if initial_specified_value: % if initial_specified_value:
#[inline] pub fn get_initial_specified_value() -> SpecifiedValue { ${initial_specified_value} } #[inline] pub fn get_initial_specified_value() -> SpecifiedValue { ${initial_specified_value} }
% endif % endif
@ -46,7 +48,9 @@
} }
</%def> </%def>
% if vector: % if vector:
<%call expr="vector_longhand(name, predefined_type=type, **kwargs)"> <%call
expr="vector_longhand(name, predefined_type=type, allow_empty=allow_empty or not initial_value, **kwargs)"
>
${predefined_type_inner(name, type, initial_value, parse_method)} ${predefined_type_inner(name, type, initial_value, parse_method)}
% if caller: % if caller:
${caller.body()} ${caller.body()}
@ -202,7 +206,7 @@
} }
pub fn get_initial_value() -> computed_value::T { pub fn get_initial_value() -> computed_value::T {
% if allow_empty: % if allow_empty and allow_empty != "NotInitial":
computed_value::T(SmallVec::new()) computed_value::T(SmallVec::new())
% else: % else:
let mut v = SmallVec::new(); let mut v = SmallVec::new();
@ -333,7 +337,7 @@
let quirks_mode = context.quirks_mode; let quirks_mode = context.quirks_mode;
::properties::substitute_variables_${property.ident}( ::properties::substitute_variables_${property.ident}(
&declared_value, &custom_props, &declared_value, &custom_props,
|value| { &mut |value| {
if let Some(ref mut cascade_info) = *cascade_info { if let Some(ref mut cascade_info) = *cascade_info {
cascade_info.on_cascade_property(&declaration, cascade_info.on_cascade_property(&declaration,
&value); &value);

View file

@ -582,7 +582,7 @@ impl AnimationValue {
&variables.url_data, &variables.url_data,
variables.from_shorthand, variables.from_shorthand,
&custom_props, &custom_props,
|v| { &mut |v| {
let declaration = match *v { let declaration = match *v {
DeclaredValue::Value(value) => { DeclaredValue::Value(value) => {
PropertyDeclaration::${prop.camel_case}(value.clone()) PropertyDeclaration::${prop.camel_case}(value.clone())

View file

@ -429,17 +429,19 @@ ${helpers.predefined_type("transition-timing-function",
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function")} spec="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function")}
${helpers.predefined_type("transition-property", ${helpers.predefined_type(
"transition-property",
"TransitionProperty", "TransitionProperty",
"computed::TransitionProperty::All", "computed::TransitionProperty::All",
initial_specified_value="specified::TransitionProperty::All", initial_specified_value="specified::TransitionProperty::All",
vector=True, vector=True,
allow_empty=True, allow_empty="NotInitial",
need_index=True, need_index=True,
needs_context=False, needs_context=False,
animation_value_type="none", animation_value_type="none",
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-transitions/#propdef-transition-property")} spec="https://drafts.csswg.org/css-transitions/#propdef-transition-property",
)}
${helpers.predefined_type("transition-delay", ${helpers.predefined_type("transition-delay",
"Time", "Time",
@ -668,16 +670,17 @@ ${helpers.predefined_type("scroll-snap-destination",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
animation_value_type="ComputedValue")} animation_value_type="ComputedValue")}
${helpers.predefined_type("scroll-snap-coordinate", ${helpers.predefined_type(
"scroll-snap-coordinate",
"Position", "Position",
"computed::Position::zero()", "computed::Position::zero()",
vector=True, vector=True,
products="gecko", products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-destination)",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
allow_empty=True, allow_empty="NotInitial",
delegate_animate=True)} delegate_animate=True,
)}
<%helpers:longhand name="transform" extra_prefixes="webkit" <%helpers:longhand name="transform" extra_prefixes="webkit"
animation_value_type="ComputedValue" animation_value_type="ComputedValue"

View file

@ -88,17 +88,18 @@ ${helpers.predefined_type("stroke-opacity", "Opacity", "1.0",
products="gecko", animation_value_type="ComputedValue", products="gecko", animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty")} spec="https://www.w3.org/TR/SVG11/painting.html#StrokeOpacityProperty")}
${helpers.predefined_type("stroke-dasharray", ${helpers.predefined_type(
"stroke-dasharray",
"LengthOrPercentageOrNumber", "LengthOrPercentageOrNumber",
"Either::First(0.0)", None,
"parse_non_negative", "parse_non_negative",
vector="True", vector=True,
delegate_animate="True", delegate_animate=True,
allow_empty="True",
products="gecko", products="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
space_separated_allowed="True", space_separated_allowed="True",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing")} spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"stroke-dashoffset", "LengthOrPercentageOrNumber", "stroke-dashoffset", "LengthOrPercentageOrNumber",

View file

@ -373,13 +373,13 @@ impl PropertyDeclarationIdSet {
value: &DeclaredValue<longhands::${property.ident}::SpecifiedValue>, value: &DeclaredValue<longhands::${property.ident}::SpecifiedValue>,
% endif % endif
custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>, custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>,
f: F, f: &mut F,
error_reporter: &ParseErrorReporter, error_reporter: &ParseErrorReporter,
quirks_mode: QuirksMode) quirks_mode: QuirksMode)
% if property.boxed: % if property.boxed:
where F: FnOnce(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>) where F: FnMut(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>)
% else: % else:
where F: FnOnce(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>) where F: FnMut(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>)
% endif % endif
{ {
if let DeclaredValue::WithVariables(ref with_variables) = *value { if let DeclaredValue::WithVariables(ref with_variables) = *value {
@ -404,13 +404,13 @@ impl PropertyDeclarationIdSet {
url_data: &UrlExtraData, url_data: &UrlExtraData,
from_shorthand: Option<ShorthandId>, from_shorthand: Option<ShorthandId>,
custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>, custom_properties: &Option<Arc<::custom_properties::ComputedValuesMap>>,
f: F, f: &mut F,
error_reporter: &ParseErrorReporter, error_reporter: &ParseErrorReporter,
quirks_mode: QuirksMode) quirks_mode: QuirksMode)
% if property.boxed: % if property.boxed:
where F: FnOnce(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>) where F: FnMut(&DeclaredValue<Box<longhands::${property.ident}::SpecifiedValue>>)
% else: % else:
where F: FnOnce(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>) where F: FnMut(&DeclaredValue<longhands::${property.ident}::SpecifiedValue>)
% endif % endif
{ {
f(& f(&
@ -1765,7 +1765,9 @@ pub mod style_structs {
/// Returns whether there are any transitions specified. /// Returns whether there are any transitions specified.
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
pub fn specifies_transitions(&self) -> bool { pub fn specifies_transitions(&self) -> bool {
self.transition_property_count() > 0 self.transition_duration_iter()
.take(self.transition_property_count())
.any(|t| t.seconds() > 0.)
} }
% endif % endif
} }

View file

@ -19,7 +19,7 @@ use style::element_state::ElementState;
use style::error_reporting::RustLogReporter; use style::error_reporting::RustLogReporter;
use style::font_metrics::{FontMetricsProvider, get_metrics_provider_for_product}; use style::font_metrics::{FontMetricsProvider, get_metrics_provider_for_product};
use style::gecko::data::{PerDocumentStyleData, PerDocumentStyleDataImpl}; use style::gecko::data::{PerDocumentStyleData, PerDocumentStyleDataImpl};
use style::gecko::global_style_data::{GLOBAL_STYLE_DATA, GlobalStyleData}; use style::gecko::global_style_data::{GLOBAL_STYLE_DATA, GlobalStyleData, STYLE_THREAD_POOL};
use style::gecko::restyle_damage::GeckoRestyleDamage; use style::gecko::restyle_damage::GeckoRestyleDamage;
use style::gecko::selector_parser::PseudoElement; use style::gecko::selector_parser::PseudoElement;
use style::gecko::traversal::RecalcStyleOnly; use style::gecko::traversal::RecalcStyleOnly;
@ -227,7 +227,8 @@ fn traverse_subtree(element: GeckoElement,
debug!("Traversing subtree:"); debug!("Traversing subtree:");
debug!("{:?}", ShowSubtreeData(element.as_node())); debug!("{:?}", ShowSubtreeData(element.as_node()));
let traversal_driver = if global_style_data.style_thread_pool.is_none() || !element.is_root() { let style_thread_pool = &*STYLE_THREAD_POOL;
let traversal_driver = if style_thread_pool.style_thread_pool.is_none() || !element.is_root() {
TraversalDriver::Sequential TraversalDriver::Sequential
} else { } else {
TraversalDriver::Parallel TraversalDriver::Parallel
@ -236,7 +237,7 @@ fn traverse_subtree(element: GeckoElement,
let traversal = RecalcStyleOnly::new(shared_style_context, traversal_driver); let traversal = RecalcStyleOnly::new(shared_style_context, traversal_driver);
if traversal_driver.is_parallel() { if traversal_driver.is_parallel() {
parallel::traverse_dom(&traversal, element, token, parallel::traverse_dom(&traversal, element, token,
global_style_data.style_thread_pool.as_ref().unwrap()); style_thread_pool.style_thread_pool.as_ref().unwrap());
} else { } else {
sequential::traverse_dom(&traversal, element, token); sequential::traverse_dom(&traversal, element, token);
} }
@ -729,7 +730,7 @@ pub extern "C" fn Servo_Property_IsDiscreteAnimatable(property: nsCSSPropertyID)
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 { pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 {
GLOBAL_STYLE_DATA.num_threads as u32 STYLE_THREAD_POOL.num_threads as u32
} }
#[no_mangle] #[no_mangle]

View file

@ -6,6 +6,3 @@
[parse 'all, none'] [parse 'all, none']
expected: FAIL expected: FAIL
[parse 'initial']
expected: FAIL

View file

@ -553578,7 +553578,7 @@
"testharness" "testharness"
], ],
"cssom-view/elementScroll.html": [ "cssom-view/elementScroll.html": [
"5471dca08aae9d446c487d40853957e9290677f3", "56d85d2973ad630dd28842df6479b1f571b7f340",
"testharness" "testharness"
], ],
"cssom-view/elementsFromPoint.html": [ "cssom-view/elementsFromPoint.html": [
@ -553998,7 +553998,7 @@
"testharness" "testharness"
], ],
"cssom/style-sheet-interfaces-001.html": [ "cssom/style-sheet-interfaces-001.html": [
"15509e87505d5a22d4f6dbbffcc90c24fcee642a", "e77ec7de74baa901cc15a3b90d2b29125c282562",
"testharness" "testharness"
], ],
"cssom/style-sheet-interfaces-002.html": [ "cssom/style-sheet-interfaces-002.html": [
@ -615810,7 +615810,7 @@
"testharness" "testharness"
], ],
"workers/Worker_ErrorEvent_error.htm": [ "workers/Worker_ErrorEvent_error.htm": [
"975ca8b575fb2f616623b810696287513b164d2d", "43f1cd277819f57c7708690ff3a91dde8b2a3af5",
"testharness" "testharness"
], ],
"workers/Worker_ErrorEvent_filename.htm": [ "workers/Worker_ErrorEvent_filename.htm": [
@ -616102,7 +616102,7 @@
"testharness" "testharness"
], ],
"workers/data-url.html": [ "workers/data-url.html": [
"50abaf936cfb58ba14e6870c9b7f239f5d54f59c", "a9084f9a3b6fc31d54b564b80869826f132f1166",
"testharness" "testharness"
], ],
"workers/interfaces.idl": [ "workers/interfaces.idl": [

View file

@ -0,0 +1,4 @@
[003.html]
type: testharness
[Fragment Navigation: Updating scroll position]
expected: FAIL

View file

@ -1,3 +1,5 @@
[iframe-append-to-child-document.html] [iframe-append-to-child-document.html]
type: testharness type: testharness
disabled: https://github.com/servo/servo/issues/14411 [Append iframe element to its own child document]
bug: https://github.com/servo/servo/issues/17479
expected: FAIL

View file

@ -1,29 +0,0 @@
[semantics.html]
type: testharness
[@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' i\] <div {http://www.w3.org/XML/1998/namespace}lang="a"> in standards mode]
expected: FAIL
[@namespace x 'a'; [x|foo='' i\] <div {A}foo=""> in standards mode]
expected: FAIL
[@namespace x 'A'; [x|foo='' i\] <div {a}foo=""> in standards mode]
expected: FAIL
[@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' i\] <div {http://www.w3.org/XML/1998/namespace}lang="a"> in quirks mode]
expected: FAIL
[@namespace x 'a'; [x|foo='' i\] <div {A}foo=""> in quirks mode]
expected: FAIL
[@namespace x 'A'; [x|foo='' i\] <div {a}foo=""> in quirks mode]
expected: FAIL
[@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' i\] <div {http://www.w3.org/XML/1998/namespace}lang="a"> in XML]
expected: FAIL
[@namespace x 'a'; [x|foo='' i\] <div {A}foo=""> in XML]
expected: FAIL
[@namespace x 'A'; [x|foo='' i\] <div {a}foo=""> in XML]
expected: FAIL

View file

@ -1,218 +0,0 @@
[syntax.html]
type: testharness
[[foo='BAR'\] /* sanity check (valid) */ in standards mode]
expected: FAIL
[[foo='bar' i\] in standards mode]
expected: FAIL
[[foo='bar' I\] in standards mode]
expected: FAIL
[[foo=bar i\] in standards mode]
expected: FAIL
[[foo="bar" i\] in standards mode]
expected: FAIL
[[foo='bar'i\] in standards mode]
expected: FAIL
[[foo='bar'i \] in standards mode]
expected: FAIL
[[foo='bar' i \] in standards mode]
expected: FAIL
[[foo='bar' /**/ i\] in standards mode]
expected: FAIL
[[foo='bar' i /**/ \] in standards mode]
expected: FAIL
[[foo='bar'/**/i/**/\] in standards mode]
expected: FAIL
[[foo=bar/**/i\] in standards mode]
expected: FAIL
[[foo='bar'\ti\t\] /* \\t */ in standards mode]
expected: FAIL
[[foo='bar'\ni\n\] /* \\n */ in standards mode]
expected: FAIL
[[foo='bar'\ri\r\] /* \\r */ in standards mode]
expected: FAIL
[[foo='bar' \\i\] in standards mode]
expected: FAIL
[[foo='bar' \\69\] in standards mode]
expected: FAIL
[[foo~='bar' i\] in standards mode]
expected: FAIL
[[foo^='bar' i\] in standards mode]
expected: FAIL
[[foo$='bar' i\] in standards mode]
expected: FAIL
[[foo*='bar' i\] in standards mode]
expected: FAIL
[[foo|='bar' i\] in standards mode]
expected: FAIL
[[|foo='bar' i\] in standards mode]
expected: FAIL
[[*|foo='bar' i\] in standards mode]
expected: FAIL
[[foo='BAR'\] /* sanity check (valid) */ in quirks mode]
expected: FAIL
[[foo='bar' i\] in quirks mode]
expected: FAIL
[[foo='bar' I\] in quirks mode]
expected: FAIL
[[foo=bar i\] in quirks mode]
expected: FAIL
[[foo="bar" i\] in quirks mode]
expected: FAIL
[[foo='bar'i\] in quirks mode]
expected: FAIL
[[foo='bar'i \] in quirks mode]
expected: FAIL
[[foo='bar' i \] in quirks mode]
expected: FAIL
[[foo='bar' /**/ i\] in quirks mode]
expected: FAIL
[[foo='bar' i /**/ \] in quirks mode]
expected: FAIL
[[foo='bar'/**/i/**/\] in quirks mode]
expected: FAIL
[[foo=bar/**/i\] in quirks mode]
expected: FAIL
[[foo='bar'\ti\t\] /* \\t */ in quirks mode]
expected: FAIL
[[foo='bar'\ni\n\] /* \\n */ in quirks mode]
expected: FAIL
[[foo='bar'\ri\r\] /* \\r */ in quirks mode]
expected: FAIL
[[foo='bar' \\i\] in quirks mode]
expected: FAIL
[[foo='bar' \\69\] in quirks mode]
expected: FAIL
[[foo~='bar' i\] in quirks mode]
expected: FAIL
[[foo^='bar' i\] in quirks mode]
expected: FAIL
[[foo$='bar' i\] in quirks mode]
expected: FAIL
[[foo*='bar' i\] in quirks mode]
expected: FAIL
[[foo|='bar' i\] in quirks mode]
expected: FAIL
[[|foo='bar' i\] in quirks mode]
expected: FAIL
[[*|foo='bar' i\] in quirks mode]
expected: FAIL
[[foo='BAR'\] /* sanity check (valid) */ in XML]
expected: FAIL
[[foo='bar' i\] in XML]
expected: FAIL
[[foo='bar' I\] in XML]
expected: FAIL
[[foo=bar i\] in XML]
expected: FAIL
[[foo="bar" i\] in XML]
expected: FAIL
[[foo='bar'i\] in XML]
expected: FAIL
[[foo='bar'i \] in XML]
expected: FAIL
[[foo='bar' i \] in XML]
expected: FAIL
[[foo='bar' /**/ i\] in XML]
expected: FAIL
[[foo='bar' i /**/ \] in XML]
expected: FAIL
[[foo='bar'/**/i/**/\] in XML]
expected: FAIL
[[foo=bar/**/i\] in XML]
expected: FAIL
[[foo='bar'\ti\t\] /* \\t */ in XML]
expected: FAIL
[[foo='bar'\ni\n\] /* \\n */ in XML]
expected: FAIL
[[foo='bar'\ri\r\] /* \\r */ in XML]
expected: FAIL
[[foo='bar' \\i\] in XML]
expected: FAIL
[[foo='bar' \\69\] in XML]
expected: FAIL
[[foo~='bar' i\] in XML]
expected: FAIL
[[foo^='bar' i\] in XML]
expected: FAIL
[[foo$='bar' i\] in XML]
expected: FAIL
[[foo*='bar' i\] in XML]
expected: FAIL
[[foo|='bar' i\] in XML]
expected: FAIL
[[|foo='bar' i\] in XML]
expected: FAIL
[[*|foo='bar' i\] in XML]
expected: FAIL

View file

@ -1,2 +0,0 @@
[Worker_ErrorEvent_error.htm]
expected: ERROR

View file

@ -1,6 +1,5 @@
[data-url.html] [data-url.html]
type: testharness type: testharness
expected: ERROR
[worker has opaque origin] [worker has opaque origin]
expected: FAIL expected: FAIL

View file

@ -25556,7 +25556,7 @@
"testharness" "testharness"
], ],
"mozilla/calc.html": [ "mozilla/calc.html": [
"a1f441f7fd4b9ab3ae9e1cb5403cfe8de90bb71c", "5d59d5b367a023e778ce6968acdeca6b8b7c3197",
"testharness" "testharness"
], ],
"mozilla/canvas.initial.reset.2dstate.html": [ "mozilla/canvas.initial.reset.2dstate.html": [

View file

@ -9,6 +9,7 @@
#inner { #inner {
border-style: solid; /* So used border == computed border */ border-style: solid; /* So used border == computed border */
outline-style: solid; /* So used outline-width == computed outline-width */ outline-style: solid; /* So used outline-width == computed outline-width */
transition-property: none; /* so that tests don't occur in the middle of a transition */
} }
</style> </style>
</head> </head>

View file

@ -33,12 +33,14 @@
Curabitur elit lacus, bibendum non tempus a, bibendum sit amet ante. Mauris eget nibh quis leo rhoncus consequat. Integer iaculis sed sapien eu pellentesque. In aliquet elementum lorem, ut consequat elit ultrices id. Phasellus vestibulum ex ex, ac sagittis tortor convallis et. Curabitur placerat id lectus at aliquam. Morbi sed nisl sem. Nam sit amet arcu maximus, volutpat nisl ac, dignissim neque. Etiam nec efficitur libero. Quisque tristique pulvinar est, eget dictum ex vehicula non. Nam dignissim non felis a iaculis. Nullam vel dolor vitae libero aliquet congue. Donec mi eros, semper non lectus at, commodo ullamcorper ligula. Donec commodo, sem vel lacinia porttitor, elit orci maximus felis, eget eleifend est velit id lorem. Curabitur elit lacus, bibendum non tempus a, bibendum sit amet ante. Mauris eget nibh quis leo rhoncus consequat. Integer iaculis sed sapien eu pellentesque. In aliquet elementum lorem, ut consequat elit ultrices id. Phasellus vestibulum ex ex, ac sagittis tortor convallis et. Curabitur placerat id lectus at aliquam. Morbi sed nisl sem. Nam sit amet arcu maximus, volutpat nisl ac, dignissim neque. Etiam nec efficitur libero. Quisque tristique pulvinar est, eget dictum ex vehicula non. Nam dignissim non felis a iaculis. Nullam vel dolor vitae libero aliquet congue. Donec mi eros, semper non lectus at, commodo ullamcorper ligula. Donec commodo, sem vel lacinia porttitor, elit orci maximus felis, eget eleifend est velit id lorem.
</div> </div>
<div id="unrelated"></div>
</section> </section>
<script> <script>
setup({explicit_done:true}); setup({explicit_done:true});
window.onload = function () { window.onload = function () {
var section = document.getElementById("section"); var section = document.getElementById("section");
var unrelated = document.getElementById("unrelated");
test(function () { test(function () {
assert_equals(section.scrollTop, 0, "initial scrollTop should be 0"); assert_equals(section.scrollTop, 0, "initial scrollTop should be 0");
@ -49,6 +51,9 @@
assert_equals(section.scrollTop, 30, "changed scrollTop should be 40"); assert_equals(section.scrollTop, 30, "changed scrollTop should be 40");
assert_equals(section.scrollLeft, 40, "changed scrollLeft should be 40"); assert_equals(section.scrollLeft, 40, "changed scrollLeft should be 40");
assert_equals(unrelated.scrollTop, 0, "unrelated element should not scroll");
assert_equals(unrelated.scrollLeft, 0, "unrelated element should not scroll");
}, "Element scrollTop/Left getter/setter test"); }, "Element scrollTop/Left getter/setter test");
test(function () { test(function () {

View file

@ -61,6 +61,17 @@
assert: [ "styleElement.sheet exists", "styleElement.sheet is a CSSStyleSheet", assert: [ "styleElement.sheet exists", "styleElement.sheet is a CSSStyleSheet",
"linkElement.sheet exists", "linkElement.sheet is a CSSStyleSheet"] }); "linkElement.sheet exists", "linkElement.sheet is a CSSStyleSheet"] });
test(function () {
var style = document.createElement("style");
document.querySelector("head").appendChild(style);
var sheet1 = style.sheet;
assert_equals(sheet1.cssRules.length, 0);
style.appendChild(document.createTextNode("a { color: green; }"));
assert_equals(style.sheet.cssRules.length, 1);
}, "sheet_property_updates",
{ help: "https://www.w3.org/TR/cssom-1/#the-linkstyle-interface",
assert: "The sheet property on LinkStyle should always return the current associated style sheet." });
test(function() { test(function() {
assert_own_property(styleSheet, "ownerRule"); assert_own_property(styleSheet, "ownerRule");
assert_own_property(styleSheet, "cssRules"); assert_own_property(styleSheet, "cssRules");

View file

@ -4,6 +4,10 @@
<script src=/resources/testharness.js></script> <script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script> <script src=/resources/testharnessreport.js></script>
<script> <script>
// The worker events races with the window's load event; if the worker events
// arrive first, the harness will detect the error event and fail the test.
setup({ allow_uncaught_exception: true });
var t1 = async_test("Error handler outside the worker should not see the error value"); var t1 = async_test("Error handler outside the worker should not see the error value");
var t2 = async_test("Error handlers inside a worker should see the error value"); var t2 = async_test("Error handlers inside a worker should see the error value");

View file

@ -25,7 +25,9 @@ function assert_worker_construction_fails(test_desc, mime_type, worker_code) {
w.onmessage = t.step_func_done(function(e) { w.onmessage = t.step_func_done(function(e) {
assert_unreached('Should not receive any message back.'); assert_unreached('Should not receive any message back.');
}); });
w.onerror = t.step_func_done(function() { w.onerror = t.step_func_done(function(e) {
// Stop the error from being propagated to the WPT test harness
e.preventDefault();
}); });
}, test_desc); }, test_desc);
} }