mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
fixes dereferencing on an immutable reference (#31864)
This commit is contained in:
parent
585e0d69cd
commit
f7669b5238
32 changed files with 76 additions and 77 deletions
|
@ -746,10 +746,10 @@ impl CanvasState {
|
||||||
StringOrCanvasGradientOrCanvasPattern::String(DOMString::from(result))
|
StringOrCanvasGradientOrCanvasPattern::String(DOMString::from(result))
|
||||||
},
|
},
|
||||||
CanvasFillOrStrokeStyle::Gradient(ref gradient) => {
|
CanvasFillOrStrokeStyle::Gradient(ref gradient) => {
|
||||||
StringOrCanvasGradientOrCanvasPattern::CanvasGradient(DomRoot::from_ref(&*gradient))
|
StringOrCanvasGradientOrCanvasPattern::CanvasGradient(DomRoot::from_ref(gradient))
|
||||||
},
|
},
|
||||||
CanvasFillOrStrokeStyle::Pattern(ref pattern) => {
|
CanvasFillOrStrokeStyle::Pattern(ref pattern) => {
|
||||||
StringOrCanvasGradientOrCanvasPattern::CanvasPattern(DomRoot::from_ref(&*pattern))
|
StringOrCanvasGradientOrCanvasPattern::CanvasPattern(DomRoot::from_ref(pattern))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -789,10 +789,10 @@ impl CanvasState {
|
||||||
StringOrCanvasGradientOrCanvasPattern::String(DOMString::from(result))
|
StringOrCanvasGradientOrCanvasPattern::String(DOMString::from(result))
|
||||||
},
|
},
|
||||||
CanvasFillOrStrokeStyle::Gradient(ref gradient) => {
|
CanvasFillOrStrokeStyle::Gradient(ref gradient) => {
|
||||||
StringOrCanvasGradientOrCanvasPattern::CanvasGradient(DomRoot::from_ref(&*gradient))
|
StringOrCanvasGradientOrCanvasPattern::CanvasGradient(DomRoot::from_ref(gradient))
|
||||||
},
|
},
|
||||||
CanvasFillOrStrokeStyle::Pattern(ref pattern) => {
|
CanvasFillOrStrokeStyle::Pattern(ref pattern) => {
|
||||||
StringOrCanvasGradientOrCanvasPattern::CanvasPattern(DomRoot::from_ref(&*pattern))
|
StringOrCanvasGradientOrCanvasPattern::CanvasPattern(DomRoot::from_ref(pattern))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1038,7 @@ impl CanvasState {
|
||||||
None => return, // offscreen canvas doesn't have a placeholder canvas
|
None => return, // offscreen canvas doesn't have a placeholder canvas
|
||||||
};
|
};
|
||||||
let node = canvas.upcast::<Node>();
|
let node = canvas.upcast::<Node>();
|
||||||
let window = window_from_node(&*canvas);
|
let window = window_from_node(canvas);
|
||||||
let resolved_font_style = match window.resolved_font_style_query(node, value.to_string()) {
|
let resolved_font_style = match window.resolved_font_style_query(node, value.to_string()) {
|
||||||
Some(value) => value,
|
Some(value) => value,
|
||||||
None => return, // syntax error
|
None => return, // syntax error
|
||||||
|
|
|
@ -349,7 +349,7 @@ pub fn read(
|
||||||
rval: MutableHandleValue,
|
rval: MutableHandleValue,
|
||||||
) -> Result<Vec<DomRoot<MessagePort>>, ()> {
|
) -> Result<Vec<DomRoot<MessagePort>>, ()> {
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
let _ac = enter_realm(&*global);
|
let _ac = enter_realm(global);
|
||||||
let mut sc_holder = StructuredDataHolder::Read {
|
let mut sc_holder = StructuredDataHolder::Read {
|
||||||
blobs: None,
|
blobs: None,
|
||||||
message_ports: None,
|
message_ports: None,
|
||||||
|
|
|
@ -353,7 +353,7 @@ where
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn trace(&self, trc: *mut JSTracer) {
|
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||||
for (k, v) in &*self {
|
for (k, v) in self {
|
||||||
k.trace(trc);
|
k.trace(trc);
|
||||||
v.trace(trc);
|
v.trace(trc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,7 @@ impl Serializable for Blob {
|
||||||
*blob_impls = None;
|
*blob_impls = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let deserialized_blob = Blob::new(&*owner, blob_impl);
|
let deserialized_blob = Blob::new(owner, blob_impl);
|
||||||
|
|
||||||
let blobs = blobs.get_or_insert_with(|| HashMap::new());
|
let blobs = blobs.get_or_insert_with(|| HashMap::new());
|
||||||
blobs.insert(storage_key, deserialized_blob);
|
blobs.insert(storage_key, deserialized_blob);
|
||||||
|
|
|
@ -786,7 +786,7 @@ impl CustomElementReaction {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|arg| unsafe { HandleValue::from_raw(arg.handle()) })
|
.map(|arg| unsafe { HandleValue::from_raw(arg.handle()) })
|
||||||
.collect();
|
.collect();
|
||||||
let _ = callback.Call_(&*element, arguments, ExceptionHandling::Report);
|
let _ = callback.Call_(element, arguments, ExceptionHandling::Report);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,7 +461,7 @@ impl DedicatedWorkerGlobalScope {
|
||||||
|
|
||||||
{
|
{
|
||||||
let _ar = AutoWorkerReset::new(&global, worker.clone());
|
let _ar = AutoWorkerReset::new(&global, worker.clone());
|
||||||
let _ac = enter_realm(&*scope);
|
let _ac = enter_realm(scope);
|
||||||
scope.execute_script(DOMString::from(source));
|
scope.execute_script(DOMString::from(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1079,7 +1079,7 @@ impl Document {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.request_focus(
|
self.request_focus(
|
||||||
self.GetBody().as_ref().map(|e| &*e.upcast()),
|
self.GetBody().as_ref().map(|e| e.upcast()),
|
||||||
FocusType::Element,
|
FocusType::Element,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1837,7 +1837,7 @@ impl Document {
|
||||||
|
|
||||||
pub fn ime_dismissed(&self) {
|
pub fn ime_dismissed(&self) {
|
||||||
self.request_focus(
|
self.request_focus(
|
||||||
self.GetBody().as_ref().map(|e| &*e.upcast()),
|
self.GetBody().as_ref().map(|e| e.upcast()),
|
||||||
FocusType::Element,
|
FocusType::Element,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5264,7 +5264,7 @@ impl DocumentMethods for Document {
|
||||||
// media element matching the given id.
|
// media element matching the given id.
|
||||||
fn ServoGetMediaControls(&self, id: DOMString) -> Fallible<DomRoot<ShadowRoot>> {
|
fn ServoGetMediaControls(&self, id: DOMString) -> Fallible<DomRoot<ShadowRoot>> {
|
||||||
match self.media_controls.borrow().get(&*id) {
|
match self.media_controls.borrow().get(&*id) {
|
||||||
Some(m) => Ok(DomRoot::from_ref(&*m)),
|
Some(m) => Ok(DomRoot::from_ref(m)),
|
||||||
None => Err(Error::InvalidAccess),
|
None => Err(Error::InvalidAccess),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ impl FromStr for AdjacentPosition {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
|
|
||||||
fn from_str(position: &str) -> Result<Self, Self::Err> {
|
fn from_str(position: &str) -> Result<Self, Self::Err> {
|
||||||
match_ignore_ascii_case! { &*position,
|
match_ignore_ascii_case! { position,
|
||||||
"beforebegin" => Ok(AdjacentPosition::BeforeBegin),
|
"beforebegin" => Ok(AdjacentPosition::BeforeBegin),
|
||||||
"afterbegin" => Ok(AdjacentPosition::AfterBegin),
|
"afterbegin" => Ok(AdjacentPosition::AfterBegin),
|
||||||
"beforeend" => Ok(AdjacentPosition::BeforeEnd),
|
"beforeend" => Ok(AdjacentPosition::BeforeEnd),
|
||||||
|
@ -3346,7 +3346,7 @@ impl<'a> SelectorsElement for DomRoot<Element> {
|
||||||
self.id_attribute
|
self.id_attribute
|
||||||
.borrow()
|
.borrow()
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(false, |atom| case_sensitivity.eq_atom(&*id, atom))
|
.map_or(false, |atom| case_sensitivity.eq_atom(id, atom))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_part(&self, _name: &AtomIdent) -> bool {
|
fn is_part(&self, _name: &AtomIdent) -> bool {
|
||||||
|
|
|
@ -277,7 +277,7 @@ impl Event {
|
||||||
|
|
||||||
// Step 5.13
|
// Step 5.13
|
||||||
for object in event_path.iter().rev() {
|
for object in event_path.iter().rev() {
|
||||||
if &**object == &*target {
|
if &**object == target {
|
||||||
self.phase.set(EventPhase::AtTarget);
|
self.phase.set(EventPhase::AtTarget);
|
||||||
} else {
|
} else {
|
||||||
self.phase.set(EventPhase::Capturing);
|
self.phase.set(EventPhase::Capturing);
|
||||||
|
@ -298,7 +298,7 @@ impl Event {
|
||||||
|
|
||||||
// Step 5.14
|
// Step 5.14
|
||||||
for object in event_path.iter() {
|
for object in event_path.iter() {
|
||||||
let at_target = &**object == &*target;
|
let at_target = &**object == target;
|
||||||
if at_target || self.bubbles.get() {
|
if at_target || self.bubbles.get() {
|
||||||
self.phase.set(if at_target {
|
self.phase.set(if at_target {
|
||||||
EventPhase::AtTarget
|
EventPhase::AtTarget
|
||||||
|
|
|
@ -512,7 +512,7 @@ impl EventTarget {
|
||||||
|
|
||||||
// Step 3.8 TODO: settings objects not implemented
|
// Step 3.8 TODO: settings objects not implemented
|
||||||
let window = document.window();
|
let window = document.window();
|
||||||
let _ac = enter_realm(&*window);
|
let _ac = enter_realm(window);
|
||||||
|
|
||||||
// Step 3.9
|
// Step 3.9
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ impl EventTarget {
|
||||||
if handler.get().is_null() {
|
if handler.get().is_null() {
|
||||||
// Step 3.7
|
// Step 3.7
|
||||||
unsafe {
|
unsafe {
|
||||||
let ar = enter_realm(&*self);
|
let ar = enter_realm(self);
|
||||||
// FIXME(#13152): dispatch error event.
|
// FIXME(#13152): dispatch error event.
|
||||||
report_pending_exception(*cx, false, InRealm::Entered(&ar));
|
report_pending_exception(*cx, false, InRealm::Entered(&ar));
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ impl FormDataMethods for FormData {
|
||||||
FormDatumValue::String(ref s) => {
|
FormDatumValue::String(ref s) => {
|
||||||
FileOrUSVString::USVString(USVString(s.to_string()))
|
FileOrUSVString::USVString(USVString(s.to_string()))
|
||||||
},
|
},
|
||||||
FormDatumValue::File(ref b) => FileOrUSVString::File(DomRoot::from_ref(&*b)),
|
FormDatumValue::File(ref b) => FileOrUSVString::File(DomRoot::from_ref(b)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ impl FormDataMethods for FormData {
|
||||||
FormDatumValue::String(ref s) => {
|
FormDatumValue::String(ref s) => {
|
||||||
FileOrUSVString::USVString(USVString(s.to_string()))
|
FileOrUSVString::USVString(USVString(s.to_string()))
|
||||||
},
|
},
|
||||||
FormDatumValue::File(ref b) => FileOrUSVString::File(DomRoot::from_ref(&*b)),
|
FormDatumValue::File(ref b) => FileOrUSVString::File(DomRoot::from_ref(b)),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
|
|
|
@ -38,7 +38,7 @@ impl GamepadList {
|
||||||
.iter()
|
.iter()
|
||||||
.any(|g| g.gamepad_id() == gamepad.gamepad_id())
|
.any(|g| g.gamepad_id() == gamepad.gamepad_id())
|
||||||
{
|
{
|
||||||
self.list.borrow_mut().push(Dom::from_ref(&*gamepad));
|
self.list.borrow_mut().push(Dom::from_ref(gamepad));
|
||||||
// Ensure that the gamepad has the correct index
|
// Ensure that the gamepad has the correct index
|
||||||
gamepad.update_index(self.list.borrow().len() as i32 - 1);
|
gamepad.update_index(self.list.borrow().len() as i32 - 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -815,7 +815,7 @@ impl GlobalScope {
|
||||||
if let MessagePortState::Managed(_router_id, message_ports) =
|
if let MessagePortState::Managed(_router_id, message_ports) =
|
||||||
&*self.message_port_state.borrow()
|
&*self.message_port_state.borrow()
|
||||||
{
|
{
|
||||||
return message_ports.contains_key(&*port_id);
|
return message_ports.contains_key(port_id);
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -831,7 +831,7 @@ impl GlobalScope {
|
||||||
self.timers.setup_scheduling(timer_ipc_chan);
|
self.timers.setup_scheduling(timer_ipc_chan);
|
||||||
|
|
||||||
// Setup route from IPC to task-queue for the timer-task-source.
|
// Setup route from IPC to task-queue for the timer-task-source.
|
||||||
let context = Trusted::new(&*self);
|
let context = Trusted::new(self);
|
||||||
let (task_source, canceller) = (
|
let (task_source, canceller) = (
|
||||||
self.timer_task_source(),
|
self.timer_task_source(),
|
||||||
self.task_canceller(TaskSourceName::Timer),
|
self.task_canceller(TaskSourceName::Timer),
|
||||||
|
@ -1002,7 +1002,7 @@ impl GlobalScope {
|
||||||
&mut *self.message_port_state.borrow_mut()
|
&mut *self.message_port_state.borrow_mut()
|
||||||
{
|
{
|
||||||
for (port_id, entangled_id) in &[(port1, port2), (port2, port1)] {
|
for (port_id, entangled_id) in &[(port1, port2), (port2, port1)] {
|
||||||
match message_ports.get_mut(&*port_id) {
|
match message_ports.get_mut(port_id) {
|
||||||
None => {
|
None => {
|
||||||
return warn!("entangled_ports called on a global not managing the port.");
|
return warn!("entangled_ports called on a global not managing the port.");
|
||||||
},
|
},
|
||||||
|
@ -1043,7 +1043,7 @@ impl GlobalScope {
|
||||||
&mut *self.message_port_state.borrow_mut()
|
&mut *self.message_port_state.borrow_mut()
|
||||||
{
|
{
|
||||||
let mut port_impl = message_ports
|
let mut port_impl = message_ports
|
||||||
.remove(&*port_id)
|
.remove(port_id)
|
||||||
.map(|ref mut managed_port| {
|
.map(|ref mut managed_port| {
|
||||||
managed_port
|
managed_port
|
||||||
.port_impl
|
.port_impl
|
||||||
|
@ -1066,7 +1066,7 @@ impl GlobalScope {
|
||||||
if let MessagePortState::Managed(_id, message_ports) =
|
if let MessagePortState::Managed(_id, message_ports) =
|
||||||
&mut *self.message_port_state.borrow_mut()
|
&mut *self.message_port_state.borrow_mut()
|
||||||
{
|
{
|
||||||
let message_buffer = match message_ports.get_mut(&*port_id) {
|
let message_buffer = match message_ports.get_mut(port_id) {
|
||||||
None => panic!("start_message_port called on a unknown port."),
|
None => panic!("start_message_port called on a unknown port."),
|
||||||
Some(managed_port) => {
|
Some(managed_port) => {
|
||||||
if let Some(port_impl) = managed_port.port_impl.as_mut() {
|
if let Some(port_impl) = managed_port.port_impl.as_mut() {
|
||||||
|
@ -1079,7 +1079,7 @@ impl GlobalScope {
|
||||||
if let Some(message_buffer) = message_buffer {
|
if let Some(message_buffer) = message_buffer {
|
||||||
for task in message_buffer {
|
for task in message_buffer {
|
||||||
let port_id = port_id.clone();
|
let port_id = port_id.clone();
|
||||||
let this = Trusted::new(&*self);
|
let this = Trusted::new(self);
|
||||||
let _ = self.port_message_queue().queue(
|
let _ = self.port_message_queue().queue(
|
||||||
task!(process_pending_port_messages: move || {
|
task!(process_pending_port_messages: move || {
|
||||||
let target_global = this.root();
|
let target_global = this.root();
|
||||||
|
@ -1099,7 +1099,7 @@ impl GlobalScope {
|
||||||
if let MessagePortState::Managed(_id, message_ports) =
|
if let MessagePortState::Managed(_id, message_ports) =
|
||||||
&mut *self.message_port_state.borrow_mut()
|
&mut *self.message_port_state.borrow_mut()
|
||||||
{
|
{
|
||||||
match message_ports.get_mut(&*port_id) {
|
match message_ports.get_mut(port_id) {
|
||||||
None => panic!("close_message_port called on an unknown port."),
|
None => panic!("close_message_port called on an unknown port."),
|
||||||
Some(managed_port) => {
|
Some(managed_port) => {
|
||||||
if let Some(port_impl) = managed_port.port_impl.as_mut() {
|
if let Some(port_impl) = managed_port.port_impl.as_mut() {
|
||||||
|
@ -1133,7 +1133,7 @@ impl GlobalScope {
|
||||||
};
|
};
|
||||||
if let Some(entangled_id) = entangled_port {
|
if let Some(entangled_id) = entangled_port {
|
||||||
// Step 7
|
// Step 7
|
||||||
let this = Trusted::new(&*self);
|
let this = Trusted::new(self);
|
||||||
let _ = self.port_message_queue().queue(
|
let _ = self.port_message_queue().queue(
|
||||||
task!(post_message: move || {
|
task!(post_message: move || {
|
||||||
let global = this.root();
|
let global = this.root();
|
||||||
|
@ -1230,7 +1230,7 @@ impl GlobalScope {
|
||||||
// Step 10: Queue a task on the DOM manipulation task-source,
|
// Step 10: Queue a task on the DOM manipulation task-source,
|
||||||
// to fire the message event
|
// to fire the message event
|
||||||
let channel = Trusted::new(&*channel);
|
let channel = Trusted::new(&*channel);
|
||||||
let global = Trusted::new(&*self);
|
let global = Trusted::new(self);
|
||||||
let _ = self.dom_manipulation_task_source().queue(
|
let _ = self.dom_manipulation_task_source().queue(
|
||||||
task!(process_pending_port_messages: move || {
|
task!(process_pending_port_messages: move || {
|
||||||
let destination = channel.root();
|
let destination = channel.root();
|
||||||
|
@ -1247,7 +1247,7 @@ impl GlobalScope {
|
||||||
if let Ok(ports) = structuredclone::read(&global, data, message.handle_mut()) {
|
if let Ok(ports) = structuredclone::read(&global, data, message.handle_mut()) {
|
||||||
// Step 10.4, Fire an event named message at destination.
|
// Step 10.4, Fire an event named message at destination.
|
||||||
MessageEvent::dispatch_jsval(
|
MessageEvent::dispatch_jsval(
|
||||||
&*destination.upcast(),
|
destination.upcast(),
|
||||||
&global,
|
&global,
|
||||||
message.handle(),
|
message.handle(),
|
||||||
Some(&origin.ascii_serialization()),
|
Some(&origin.ascii_serialization()),
|
||||||
|
@ -1256,7 +1256,7 @@ impl GlobalScope {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Step 10.3, fire an event named messageerror at destination.
|
// Step 10.3, fire an event named messageerror at destination.
|
||||||
MessageEvent::dispatch_error(&*destination.upcast(), &global);
|
MessageEvent::dispatch_error(destination.upcast(), &global);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
self,
|
self,
|
||||||
|
@ -1332,7 +1332,7 @@ impl GlobalScope {
|
||||||
.collect();
|
.collect();
|
||||||
for id in to_be_added.iter() {
|
for id in to_be_added.iter() {
|
||||||
let managed_port = message_ports
|
let managed_port = message_ports
|
||||||
.get_mut(&*id)
|
.get_mut(id)
|
||||||
.expect("Collected port-id to match an entry");
|
.expect("Collected port-id to match an entry");
|
||||||
if !managed_port.pending {
|
if !managed_port.pending {
|
||||||
panic!("Only pending ports should be found in to_be_added")
|
panic!("Only pending ports should be found in to_be_added")
|
||||||
|
@ -1525,7 +1525,7 @@ impl GlobalScope {
|
||||||
|
|
||||||
// Queue a task to complete the transfer,
|
// Queue a task to complete the transfer,
|
||||||
// unless the port is re-transferred in the current task.
|
// unless the port is re-transferred in the current task.
|
||||||
let this = Trusted::new(&*self);
|
let this = Trusted::new(self);
|
||||||
let _ = self.port_message_queue().queue(
|
let _ = self.port_message_queue().queue(
|
||||||
task!(process_pending_port_messages: move || {
|
task!(process_pending_port_messages: move || {
|
||||||
let target_global = this.root();
|
let target_global = this.root();
|
||||||
|
@ -2634,7 +2634,7 @@ impl GlobalScope {
|
||||||
|| {
|
|| {
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
|
|
||||||
let ar = enter_realm(&*self);
|
let ar = enter_realm(self);
|
||||||
|
|
||||||
let _aes = AutoEntryScript::new(self);
|
let _aes = AutoEntryScript::new(self);
|
||||||
|
|
||||||
|
@ -3131,7 +3131,7 @@ impl GlobalScope {
|
||||||
) {
|
) {
|
||||||
// TODO: 2. If document is not null and is not allowed to use the "gamepad" permission,
|
// TODO: 2. If document is not null and is not allowed to use the "gamepad" permission,
|
||||||
// then abort these steps.
|
// then abort these steps.
|
||||||
let this = Trusted::new(&*self);
|
let this = Trusted::new(self);
|
||||||
self.gamepad_task_source().queue_with_canceller(
|
self.gamepad_task_source().queue_with_canceller(
|
||||||
task!(gamepad_connected: move || {
|
task!(gamepad_connected: move || {
|
||||||
let global = this.root();
|
let global = this.root();
|
||||||
|
@ -3157,7 +3157,7 @@ impl GlobalScope {
|
||||||
|
|
||||||
/// <https://www.w3.org/TR/gamepad/#dfn-gamepaddisconnected>
|
/// <https://www.w3.org/TR/gamepad/#dfn-gamepaddisconnected>
|
||||||
pub fn handle_gamepad_disconnect(&self, index: usize) {
|
pub fn handle_gamepad_disconnect(&self, index: usize) {
|
||||||
let this = Trusted::new(&*self);
|
let this = Trusted::new(self);
|
||||||
self.gamepad_task_source()
|
self.gamepad_task_source()
|
||||||
.queue_with_canceller(
|
.queue_with_canceller(
|
||||||
task!(gamepad_disconnected: move || {
|
task!(gamepad_disconnected: move || {
|
||||||
|
@ -3186,7 +3186,7 @@ impl GlobalScope {
|
||||||
|
|
||||||
/// <https://www.w3.org/TR/gamepad/#receiving-inputs>
|
/// <https://www.w3.org/TR/gamepad/#receiving-inputs>
|
||||||
pub fn receive_new_gamepad_button_or_axis(&self, index: usize, update_type: GamepadUpdateType) {
|
pub fn receive_new_gamepad_button_or_axis(&self, index: usize, update_type: GamepadUpdateType) {
|
||||||
let this = Trusted::new(&*self);
|
let this = Trusted::new(self);
|
||||||
|
|
||||||
// <https://w3c.github.io/gamepad/#dfn-update-gamepad-state>
|
// <https://w3c.github.io/gamepad/#dfn-update-gamepad-state>
|
||||||
self.gamepad_task_source()
|
self.gamepad_task_source()
|
||||||
|
|
|
@ -443,7 +443,7 @@ fn index_of_last_non_whitespace(value: &ByteString) -> Option<usize> {
|
||||||
|
|
||||||
// http://tools.ietf.org/html/rfc7230#section-3.2
|
// http://tools.ietf.org/html/rfc7230#section-3.2
|
||||||
fn is_field_name(name: &ByteString) -> bool {
|
fn is_field_name(name: &ByteString) -> bool {
|
||||||
is_token(&*name)
|
is_token(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://fetch.spec.whatg.org/#concept-header-value
|
// https://fetch.spec.whatg.org/#concept-header-value
|
||||||
|
|
|
@ -768,7 +768,7 @@ impl HTMLInputElement {
|
||||||
first_with_id
|
first_with_id
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|el| el.downcast::<HTMLDataListElement>())
|
.and_then(|el| el.downcast::<HTMLDataListElement>())
|
||||||
.map(|el| DomRoot::from_ref(&*el))
|
.map(|el| DomRoot::from_ref(el))
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#suffering-from-being-missing
|
// https://html.spec.whatwg.org/multipage/#suffering-from-being-missing
|
||||||
|
|
|
@ -967,7 +967,7 @@ impl HTMLMediaElement {
|
||||||
if let Some(ref src_object) = *self.src_object.borrow() {
|
if let Some(ref src_object) = *self.src_object.borrow() {
|
||||||
match src_object {
|
match src_object {
|
||||||
SrcObject::Blob(blob) => {
|
SrcObject::Blob(blob) => {
|
||||||
let blob_url = URL::CreateObjectURL(&self.global(), &*blob);
|
let blob_url = URL::CreateObjectURL(&self.global(), blob);
|
||||||
*self.blob_url.borrow_mut() =
|
*self.blob_url.borrow_mut() =
|
||||||
Some(ServoUrl::parse(&blob_url).expect("infallible"));
|
Some(ServoUrl::parse(&blob_url).expect("infallible"));
|
||||||
self.fetch_request(None, None);
|
self.fetch_request(None, None);
|
||||||
|
@ -1891,7 +1891,7 @@ impl HTMLMediaElement {
|
||||||
.SetTextContent(Some(DOMString::from(media_controls_script)));
|
.SetTextContent(Some(DOMString::from(media_controls_script)));
|
||||||
if let Err(e) = shadow_root
|
if let Err(e) = shadow_root
|
||||||
.upcast::<Node>()
|
.upcast::<Node>()
|
||||||
.AppendChild(&*script.upcast::<Node>())
|
.AppendChild(script.upcast::<Node>())
|
||||||
{
|
{
|
||||||
warn!("Could not render media controls {:?}", e);
|
warn!("Could not render media controls {:?}", e);
|
||||||
return;
|
return;
|
||||||
|
@ -1911,7 +1911,7 @@ impl HTMLMediaElement {
|
||||||
|
|
||||||
if let Err(e) = shadow_root
|
if let Err(e) = shadow_root
|
||||||
.upcast::<Node>()
|
.upcast::<Node>()
|
||||||
.AppendChild(&*style.upcast::<Node>())
|
.AppendChild(style.upcast::<Node>())
|
||||||
{
|
{
|
||||||
warn!("Could not render media controls {:?}", e);
|
warn!("Could not render media controls {:?}", e);
|
||||||
}
|
}
|
||||||
|
@ -2075,9 +2075,9 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
|
||||||
fn GetSrcObject(&self) -> Option<MediaStreamOrBlob> {
|
fn GetSrcObject(&self) -> Option<MediaStreamOrBlob> {
|
||||||
match *self.src_object.borrow() {
|
match *self.src_object.borrow() {
|
||||||
Some(ref src_object) => Some(match src_object {
|
Some(ref src_object) => Some(match src_object {
|
||||||
SrcObject::Blob(blob) => MediaStreamOrBlob::Blob(DomRoot::from_ref(&*blob)),
|
SrcObject::Blob(blob) => MediaStreamOrBlob::Blob(DomRoot::from_ref(blob)),
|
||||||
SrcObject::MediaStream(stream) => {
|
SrcObject::MediaStream(stream) => {
|
||||||
MediaStreamOrBlob::MediaStream(DomRoot::from_ref(&*stream))
|
MediaStreamOrBlob::MediaStream(DomRoot::from_ref(stream))
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
None => None,
|
None => None,
|
||||||
|
@ -2468,7 +2468,7 @@ pub trait LayoutHTMLMediaElementHelpers {
|
||||||
impl LayoutHTMLMediaElementHelpers for LayoutDom<'_, HTMLMediaElement> {
|
impl LayoutHTMLMediaElementHelpers for LayoutDom<'_, HTMLMediaElement> {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn data(self) -> HTMLMediaData {
|
fn data(self) -> HTMLMediaData {
|
||||||
let media = unsafe { &*self.unsafe_get() };
|
let media = unsafe { self.unsafe_get() };
|
||||||
HTMLMediaData {
|
HTMLMediaData {
|
||||||
current_frame: media.video_renderer.lock().unwrap().current_frame,
|
current_frame: media.video_renderer.lock().unwrap().current_frame,
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ fn finish_fetching_a_classic_script(
|
||||||
// Step 11, Asynchronously complete this algorithm with script,
|
// Step 11, Asynchronously complete this algorithm with script,
|
||||||
// which refers to step 26.6 "When the chosen algorithm asynchronously completes",
|
// which refers to step 26.6 "When the chosen algorithm asynchronously completes",
|
||||||
// of https://html.spec.whatwg.org/multipage/#prepare-a-script
|
// of https://html.spec.whatwg.org/multipage/#prepare-a-script
|
||||||
let document = document_from_node(&*elem);
|
let document = document_from_node(elem);
|
||||||
|
|
||||||
match script_kind {
|
match script_kind {
|
||||||
ExternalScriptKind::Asap => document.asap_script_loaded(elem, load),
|
ExternalScriptKind::Asap => document.asap_script_loaded(elem, load),
|
||||||
|
|
|
@ -41,13 +41,13 @@ impl From<&WindowProxyOrMessagePortOrServiceWorker> for SrcObject {
|
||||||
fn from(src_object: &WindowProxyOrMessagePortOrServiceWorker) -> SrcObject {
|
fn from(src_object: &WindowProxyOrMessagePortOrServiceWorker) -> SrcObject {
|
||||||
match src_object {
|
match src_object {
|
||||||
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(blob) => {
|
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(blob) => {
|
||||||
SrcObject::WindowProxy(Dom::from_ref(&*blob))
|
SrcObject::WindowProxy(Dom::from_ref(blob))
|
||||||
},
|
},
|
||||||
WindowProxyOrMessagePortOrServiceWorker::MessagePort(stream) => {
|
WindowProxyOrMessagePortOrServiceWorker::MessagePort(stream) => {
|
||||||
SrcObject::MessagePort(Dom::from_ref(&*stream))
|
SrcObject::MessagePort(Dom::from_ref(stream))
|
||||||
},
|
},
|
||||||
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(stream) => {
|
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(stream) => {
|
||||||
SrcObject::ServiceWorker(Dom::from_ref(&*stream))
|
SrcObject::ServiceWorker(Dom::from_ref(stream))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,13 +258,13 @@ impl MessageEventMethods for MessageEvent {
|
||||||
fn GetSource(&self) -> Option<WindowProxyOrMessagePortOrServiceWorker> {
|
fn GetSource(&self) -> Option<WindowProxyOrMessagePortOrServiceWorker> {
|
||||||
match &*self.source.borrow() {
|
match &*self.source.borrow() {
|
||||||
Some(SrcObject::WindowProxy(i)) => Some(
|
Some(SrcObject::WindowProxy(i)) => Some(
|
||||||
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(DomRoot::from_ref(&*i)),
|
WindowProxyOrMessagePortOrServiceWorker::WindowProxy(DomRoot::from_ref(i)),
|
||||||
),
|
),
|
||||||
Some(SrcObject::MessagePort(i)) => Some(
|
Some(SrcObject::MessagePort(i)) => Some(
|
||||||
WindowProxyOrMessagePortOrServiceWorker::MessagePort(DomRoot::from_ref(&*i)),
|
WindowProxyOrMessagePortOrServiceWorker::MessagePort(DomRoot::from_ref(i)),
|
||||||
),
|
),
|
||||||
Some(SrcObject::ServiceWorker(i)) => Some(
|
Some(SrcObject::ServiceWorker(i)) => Some(
|
||||||
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(DomRoot::from_ref(&*i)),
|
WindowProxyOrMessagePortOrServiceWorker::ServiceWorker(DomRoot::from_ref(i)),
|
||||||
),
|
),
|
||||||
None => None,
|
None => None,
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@ impl Transferable for MessagePort {
|
||||||
};
|
};
|
||||||
|
|
||||||
let transferred_port =
|
let transferred_port =
|
||||||
MessagePort::new_transferred(&*owner, id, port_impl.entangled_port_id());
|
MessagePort::new_transferred(owner, id, port_impl.entangled_port_id());
|
||||||
owner.track_message_port(&transferred_port, Some(port_impl));
|
owner.track_message_port(&transferred_port, Some(port_impl));
|
||||||
|
|
||||||
return_object.set(transferred_port.reflector().rootable().get());
|
return_object.set(transferred_port.reflector().rootable().get());
|
||||||
|
|
|
@ -785,7 +785,7 @@ impl Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_trusted_node_address(&self) -> TrustedNodeAddress {
|
pub fn to_trusted_node_address(&self) -> TrustedNodeAddress {
|
||||||
TrustedNodeAddress(&*self as *const Node as *const libc::c_void)
|
TrustedNodeAddress(self as *const Node as *const libc::c_void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the rendered bounding content box if the element is rendered,
|
/// Returns the rendered bounding content box if the element is rendered,
|
||||||
|
@ -1242,7 +1242,7 @@ impl Node {
|
||||||
|
|
||||||
/// <https://dom.spec.whatwg.org/#retarget>
|
/// <https://dom.spec.whatwg.org/#retarget>
|
||||||
pub fn retarget(&self, b: &Node) -> DomRoot<Node> {
|
pub fn retarget(&self, b: &Node) -> DomRoot<Node> {
|
||||||
let mut a = DomRoot::from_ref(&*self);
|
let mut a = DomRoot::from_ref(self);
|
||||||
loop {
|
loop {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let a_root = a.GetRootNode(&GetRootNodeOptions::empty());
|
let a_root = a.GetRootNode(&GetRootNodeOptions::empty());
|
||||||
|
@ -2970,7 +2970,7 @@ impl NodeMethods for Node {
|
||||||
attr2 = Some(a);
|
attr2 = Some(a);
|
||||||
attr2owner = a.GetOwnerElement();
|
attr2owner = a.GetOwnerElement();
|
||||||
node2 = match attr2owner {
|
node2 = match attr2owner {
|
||||||
Some(ref e) => Some(&*e.upcast()),
|
Some(ref e) => Some(e.upcast()),
|
||||||
None => None,
|
None => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ impl Drop for Promise {
|
||||||
|
|
||||||
impl Promise {
|
impl Promise {
|
||||||
pub fn new(global: &GlobalScope) -> Rc<Promise> {
|
pub fn new(global: &GlobalScope) -> Rc<Promise> {
|
||||||
let realm = enter_realm(&*global);
|
let realm = enter_realm(global);
|
||||||
let comp = InRealm::Entered(&realm);
|
let comp = InRealm::Entered(&realm);
|
||||||
Promise::new_in_current_realm(comp)
|
Promise::new_in_current_realm(comp)
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ impl Promise {
|
||||||
T: ToJSValConvertible,
|
T: ToJSValConvertible,
|
||||||
{
|
{
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
let _ac = enter_realm(&*self);
|
let _ac = enter_realm(self);
|
||||||
rooted!(in(*cx) let mut v = UndefinedValue());
|
rooted!(in(*cx) let mut v = UndefinedValue());
|
||||||
unsafe {
|
unsafe {
|
||||||
val.to_jsval(*cx, v.handle_mut());
|
val.to_jsval(*cx, v.handle_mut());
|
||||||
|
@ -198,7 +198,7 @@ impl Promise {
|
||||||
T: ToJSValConvertible,
|
T: ToJSValConvertible,
|
||||||
{
|
{
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
let _ac = enter_realm(&*self);
|
let _ac = enter_realm(self);
|
||||||
rooted!(in(*cx) let mut v = UndefinedValue());
|
rooted!(in(*cx) let mut v = UndefinedValue());
|
||||||
unsafe {
|
unsafe {
|
||||||
val.to_jsval(*cx, v.handle_mut());
|
val.to_jsval(*cx, v.handle_mut());
|
||||||
|
@ -209,7 +209,7 @@ impl Promise {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
pub fn reject_error(&self, error: Error) {
|
pub fn reject_error(&self, error: Error) {
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
let _ac = enter_realm(&*self);
|
let _ac = enter_realm(self);
|
||||||
rooted!(in(*cx) let mut v = UndefinedValue());
|
rooted!(in(*cx) let mut v = UndefinedValue());
|
||||||
unsafe {
|
unsafe {
|
||||||
error.to_jsval(*cx, &self.global(), v.handle_mut());
|
error.to_jsval(*cx, &self.global(), v.handle_mut());
|
||||||
|
|
|
@ -362,8 +362,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
.origin(origin);
|
.origin(origin);
|
||||||
|
|
||||||
let (_url, source) =
|
let (_url, source) =
|
||||||
match load_whole_resource(request, &resource_threads_sender, &*global.upcast())
|
match load_whole_resource(request, &resource_threads_sender, global.upcast()) {
|
||||||
{
|
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
println!("error loading script {}", serialized_worker_url);
|
println!("error loading script {}", serialized_worker_url);
|
||||||
scope.clear_js_runtime(context_for_interrupt);
|
scope.clear_js_runtime(context_for_interrupt);
|
||||||
|
@ -381,7 +380,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
|
|
||||||
{
|
{
|
||||||
// TODO: use AutoWorkerReset as in dedicated worker?
|
// TODO: use AutoWorkerReset as in dedicated worker?
|
||||||
let _ac = enter_realm(&*scope);
|
let _ac = enter_realm(scope);
|
||||||
scope.execute_script(DOMString::from(source));
|
scope.execute_script(DOMString::from(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,7 +444,7 @@ impl ServiceWorkerGlobalScope {
|
||||||
CommonWorker(WorkerScriptMsg::DOMMessage { data, .. }) => {
|
CommonWorker(WorkerScriptMsg::DOMMessage { data, .. }) => {
|
||||||
let scope = self.upcast::<WorkerGlobalScope>();
|
let scope = self.upcast::<WorkerGlobalScope>();
|
||||||
let target = self.upcast();
|
let target = self.upcast();
|
||||||
let _ac = enter_realm(&*scope);
|
let _ac = enter_realm(scope);
|
||||||
rooted!(in(*scope.get_cx()) let mut message = UndefinedValue());
|
rooted!(in(*scope.get_cx()) let mut message = UndefinedValue());
|
||||||
if let Ok(ports) = structuredclone::read(scope.upcast(), data, message.handle_mut())
|
if let Ok(ports) = structuredclone::read(scope.upcast(), data, message.handle_mut())
|
||||||
{
|
{
|
||||||
|
|
|
@ -4478,7 +4478,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext> {
|
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, WebGL2RenderingContext> {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
unsafe fn canvas_data_source(self) -> HTMLCanvasDataSource {
|
unsafe fn canvas_data_source(self) -> HTMLCanvasDataSource {
|
||||||
let this = &*self.unsafe_get();
|
let this = self.unsafe_get();
|
||||||
(*this.base.to_layout().unsafe_get()).layout_handle()
|
(*this.base.to_layout().unsafe_get()).layout_handle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ impl WebGLFramebuffer {
|
||||||
context: &WebGLRenderingContext,
|
context: &WebGLRenderingContext,
|
||||||
size: Size2D<i32, Viewport>,
|
size: Size2D<i32, Viewport>,
|
||||||
) -> Option<DomRoot<Self>> {
|
) -> Option<DomRoot<Self>> {
|
||||||
let framebuffer = Self::maybe_new(&*context)?;
|
let framebuffer = Self::maybe_new(context)?;
|
||||||
framebuffer.size.set(Some((size.width, size.height)));
|
framebuffer.size.set(Some((size.width, size.height)));
|
||||||
framebuffer.status.set(constants::FRAMEBUFFER_COMPLETE);
|
framebuffer.status.set(constants::FRAMEBUFFER_COMPLETE);
|
||||||
framebuffer.xr_session.set(Some(session));
|
framebuffer.xr_session.set(Some(session));
|
||||||
|
|
|
@ -830,7 +830,7 @@ impl WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(fb) = self.bound_draw_framebuffer.get() {
|
if let Some(fb) = self.bound_draw_framebuffer.get() {
|
||||||
fb.invalidate_texture(&*texture);
|
fb.invalidate_texture(texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -455,7 +455,7 @@ impl WorkerGlobalScope {
|
||||||
// https://github.com/servo/servo/issues/6422
|
// https://github.com/servo/servo/issues/6422
|
||||||
println!("evaluate_script failed");
|
println!("evaluate_script failed");
|
||||||
unsafe {
|
unsafe {
|
||||||
let ar = enter_realm(&*self);
|
let ar = enter_realm(self);
|
||||||
report_pending_exception(cx, true, InRealm::Entered(&ar));
|
report_pending_exception(cx, true, InRealm::Entered(&ar));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ impl XRInputSource {
|
||||||
global,
|
global,
|
||||||
);
|
);
|
||||||
|
|
||||||
let _ac = enter_realm(&*global);
|
let _ac = enter_realm(global);
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
unsafe {
|
unsafe {
|
||||||
rooted!(in(*cx) let mut profiles = UndefinedValue());
|
rooted!(in(*cx) let mut profiles = UndefinedValue());
|
||||||
|
|
|
@ -80,7 +80,7 @@ impl XRInputSourcesChangeEvent {
|
||||||
let event = changeevent.upcast::<Event>();
|
let event = changeevent.upcast::<Event>();
|
||||||
event.init_event(type_, bubbles, cancelable);
|
event.init_event(type_, bubbles, cancelable);
|
||||||
}
|
}
|
||||||
let _ac = enter_realm(&*global);
|
let _ac = enter_realm(global);
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
unsafe {
|
unsafe {
|
||||||
rooted!(in(*cx) let mut added_val = UndefinedValue());
|
rooted!(in(*cx) let mut added_val = UndefinedValue());
|
||||||
|
|
|
@ -43,7 +43,7 @@ impl XRViewerPose {
|
||||||
to_base: BaseTransform,
|
to_base: BaseTransform,
|
||||||
viewer_pose: &ViewerPose,
|
viewer_pose: &ViewerPose,
|
||||||
) -> DomRoot<XRViewerPose> {
|
) -> DomRoot<XRViewerPose> {
|
||||||
let _ac = enter_realm(&*global);
|
let _ac = enter_realm(global);
|
||||||
rooted_vec!(let mut views);
|
rooted_vec!(let mut views);
|
||||||
match &viewer_pose.views {
|
match &viewer_pose.views {
|
||||||
Views::Inline => views.push(XRView::new(
|
Views::Inline => views.push(XRView::new(
|
||||||
|
|
|
@ -409,7 +409,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
|
||||||
Some(None) => AtomString::default(),
|
Some(None) => AtomString::default(),
|
||||||
None => AtomString::from(&*self.element.get_lang_for_layout()),
|
None => AtomString::from(&*self.element.get_lang_for_layout()),
|
||||||
};
|
};
|
||||||
extended_filtering(&element_lang, &*value)
|
extended_filtering(&element_lang, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_html_document_body_element(&self) -> bool {
|
fn is_html_document_body_element(&self) -> bool {
|
||||||
|
@ -585,7 +585,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
|
||||||
NonTSPseudoClass::Link | NonTSPseudoClass::AnyLink => self.is_link(),
|
NonTSPseudoClass::Link | NonTSPseudoClass::AnyLink => self.is_link(),
|
||||||
NonTSPseudoClass::Visited => false,
|
NonTSPseudoClass::Visited => false,
|
||||||
|
|
||||||
NonTSPseudoClass::Lang(ref lang) => self.match_element_lang(None, &*lang),
|
NonTSPseudoClass::Lang(ref lang) => self.match_element_lang(None, lang),
|
||||||
|
|
||||||
NonTSPseudoClass::ServoNonZeroBorder => {
|
NonTSPseudoClass::ServoNonZeroBorder => {
|
||||||
match self
|
match self
|
||||||
|
|
|
@ -543,7 +543,7 @@ impl ModuleTree {
|
||||||
|
|
||||||
if let Some(exception) = &*module_error {
|
if let Some(exception) = &*module_error {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ar = enter_realm(&*global);
|
let ar = enter_realm(global);
|
||||||
JS_SetPendingException(
|
JS_SetPendingException(
|
||||||
*GlobalScope::get_cx(),
|
*GlobalScope::get_cx(),
|
||||||
exception.handle(),
|
exception.handle(),
|
||||||
|
|
|
@ -3463,7 +3463,7 @@ impl ScriptThread {
|
||||||
|
|
||||||
/// Reflows non-incrementally, rebuilding the entire layout tree in the process.
|
/// Reflows non-incrementally, rebuilding the entire layout tree in the process.
|
||||||
fn rebuild_and_force_reflow(&self, document: &Document, reason: ReflowReason) {
|
fn rebuild_and_force_reflow(&self, document: &Document, reason: ReflowReason) {
|
||||||
let window = window_from_node(&*document);
|
let window = window_from_node(document);
|
||||||
document.dirty_all_nodes();
|
document.dirty_all_nodes();
|
||||||
window.reflow(ReflowGoal::Full, reason);
|
window.reflow(ReflowGoal::Full, reason);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue