Responding to review comments.

This commit is contained in:
Alan Jeffrey 2017-05-26 12:42:45 -05:00
parent 79743b5358
commit 3f761bed53
4 changed files with 5 additions and 5 deletions

View file

@ -903,7 +903,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.handle_init_load(url); self.handle_init_load(url);
} }
// Handle a forward or back request // Handle a forward or back request
// Handle a forward or back request
FromCompositorMsg::TraverseHistory(top_level_browsing_context_id, direction) => { FromCompositorMsg::TraverseHistory(top_level_browsing_context_id, direction) => {
debug!("constellation got traverse history message from compositor"); debug!("constellation got traverse history message from compositor");
self.handle_traverse_history_msg(top_level_browsing_context_id, direction); self.handle_traverse_history_msg(top_level_browsing_context_id, direction);
@ -2800,7 +2799,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
let top_level_browsing_context_id = self.browsing_contexts.get(&pipeline.browsing_context_id) let top_level_browsing_context_id = self.browsing_contexts.get(&pipeline.browsing_context_id)
.map(|browsing_context| browsing_context.top_level_id) .map(|browsing_context| browsing_context.top_level_id)
.unwrap_or(self.root_browsing_context_id); .unwrap_or(self.root_browsing_context_id);
let url = pipeline.url.clone(); let url = pipeline.url.to_string();
let can_go_forward = !self.joint_session_future_is_empty(top_level_browsing_context_id); let can_go_forward = !self.joint_session_future_is_empty(top_level_browsing_context_id);
let can_go_back = !self.joint_session_past_is_empty(top_level_browsing_context_id); let can_go_back = !self.joint_session_past_is_empty(top_level_browsing_context_id);
let event = MozBrowserEvent::LocationChange(url, can_go_back, can_go_forward); let event = MozBrowserEvent::LocationChange(url, can_go_back, can_go_forward);

View file

@ -498,7 +498,7 @@ unsafe fn build_mozbrowser_event_detail(event: MozBrowserEvent,
} }
MozBrowserEvent::LocationChange(url, can_go_back, can_go_forward) => { MozBrowserEvent::LocationChange(url, can_go_back, can_go_forward) => {
BrowserElementLocationChangeEventDetail { BrowserElementLocationChangeEventDetail {
url: Some(DOMString::from(url.as_str())), url: Some(DOMString::from(url)),
canGoBack: Some(can_go_back), canGoBack: Some(can_go_back),
canGoForward: Some(can_go_forward), canGoForward: Some(can_go_forward),
}.to_jsval(cx, rval); }.to_jsval(cx, rval);

View file

@ -602,7 +602,7 @@ pub enum MozBrowserEvent {
/// Sent when the browser `<iframe>` starts to load a new page. /// Sent when the browser `<iframe>` starts to load a new page.
LoadStart, LoadStart,
/// Sent when a browser `<iframe>`'s location changes. /// Sent when a browser `<iframe>`'s location changes.
LocationChange(ServoUrl, bool, bool), LocationChange(String, bool, bool),
/// Sent when a new tab is opened within a browser `<iframe>` as a result of the user /// Sent when a new tab is opened within a browser `<iframe>` as a result of the user
/// issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) /// issuing a command to open a link target in a new tab (for example ctrl/cmd + click.)
/// Includes the URL. /// Includes the URL.

View file

@ -782,7 +782,8 @@ impl Handler {
let keys = try!(keycodes_to_keys(&keys.value).or_else(|_| let keys = try!(keycodes_to_keys(&keys.value).or_else(|_|
Err(WebDriverError::new(ErrorStatus::UnsupportedOperation, "Failed to convert keycodes")))); Err(WebDriverError::new(ErrorStatus::UnsupportedOperation, "Failed to convert keycodes"))));
// TODO: there's a race condition caused by these being two separate messages, // TODO: there's a race condition caused by the focus command and the
// send keys command being two separate messages,
// so the constellation may have changed state between them. // so the constellation may have changed state between them.
let cmd_msg = WebDriverCommandMsg::SendKeys(browsing_context_id, keys); let cmd_msg = WebDriverCommandMsg::SendKeys(browsing_context_id, keys);
self.constellation_chan.send(ConstellationMsg::WebDriverCommand(cmd_msg)).unwrap(); self.constellation_chan.send(ConstellationMsg::WebDriverCommand(cmd_msg)).unwrap();