aboutsummaryrefslogtreecommitdiffstats
path: root/components/webdriver_server
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-07-18 14:22:03 -0400
committerGitHub <noreply@github.com>2019-07-18 14:22:03 -0400
commit2dfbbd0ca24ae17cb282a0f02289b42e9334947b (patch)
treef5536a48f0272523911293987dc84ca279a16940 /components/webdriver_server
parentdc1da02aa427d91da4946cef2296b18f893a525f (diff)
parent571beec179fe9fd5fff2c12b3c5dfa0a5d93df01 (diff)
downloadservo-2dfbbd0ca24ae17cb282a0f02289b42e9334947b.tar.gz
servo-2dfbbd0ca24ae17cb282a0f02289b42e9334947b.zip
Auto merge of #23368 - gterzian:clean_up_navigation, r=asajeffrey
Clean-up navigation <!-- Please describe your changes on the following line: --> 1. Navigation as a result of following a hyperlink should be done in a task: https://html.spec.whatwg.org/multipage/links.html#following-hyperlinks:dom-manipulation-task-source 2. The javascript url navigation should also be done in a task: https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigating-across-documents:dom-manipulation-task-source 3. In `window.load_url`, it seems there is no need to send a message to the script-thread(the entirety of `load_url` should instead be done in a task when appropriate), so we can just do that last part "sync" by calling a method on the script, which will send a message to the constellation(for the parallel navigation steps), or queue task(for the JS navigation), as appropriate. 4. Separate the "normal" navigation flow from the handling of "navigate an iframe" message from constellation, since doing everything in one method as was previously done with `handle_navigate`, is confusing. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23368) <!-- Reviewable:end -->
Diffstat (limited to 'components/webdriver_server')
-rw-r--r--components/webdriver_server/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs
index de9e285037f..4df9e0d56b6 100644
--- a/components/webdriver_server/lib.rs
+++ b/components/webdriver_server/lib.rs
@@ -30,7 +30,7 @@ use script_traits::webdriver_msg::{LoadStatus, WebDriverCookieError, WebDriverFr
use script_traits::webdriver_msg::{
WebDriverJSError, WebDriverJSResult, WebDriverJSValue, WebDriverScriptCommand,
};
-use script_traits::{ConstellationMsg, LoadData, WebDriverCommandMsg};
+use script_traits::{ConstellationMsg, LoadData, LoadOrigin, WebDriverCommandMsg};
use serde::de::{Deserialize, Deserializer, MapAccess, Visitor};
use serde::ser::{Serialize, Serializer};
use serde_json::{json, Value};
@@ -593,7 +593,7 @@ impl Handler {
let (sender, receiver) = ipc::channel().unwrap();
- let load_data = LoadData::new(url, None, None, None);
+ let load_data = LoadData::new(LoadOrigin::WebDriver, url, None, None, None);
let cmd_msg =
WebDriverCommandMsg::LoadUrl(top_level_browsing_context_id, load_data, sender.clone());
self.constellation_chan