mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #5969 - jgraham:webdriver_select_css, r=jdm
Also adds example support for getting the name and text properties of the elements. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5969) <!-- Reviewable:end -->
This commit is contained in:
commit
8df824998f
5 changed files with 163 additions and 10 deletions
|
@ -975,20 +975,17 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
|
|||
|
||||
fn get_unique_id(self) -> String {
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
if self.unique_id.borrow().is_empty() {
|
||||
let mut unique_id = self.unique_id.borrow_mut();
|
||||
*unique_id = uuid::Uuid::new_v4().to_simple_string();
|
||||
}
|
||||
let id = self.unique_id.borrow();
|
||||
id.clone()
|
||||
}
|
||||
|
||||
fn summarize(self) -> NodeInfo {
|
||||
if self.unique_id.borrow().is_empty() {
|
||||
let mut unique_id = self.unique_id.borrow_mut();
|
||||
*unique_id = uuid::Uuid::new_v4().to_simple_string();
|
||||
}
|
||||
|
||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let unique_id = self.unique_id.borrow();
|
||||
NodeInfo {
|
||||
uniqueId: unique_id.clone(),
|
||||
uniqueId: self.get_unique_id(),
|
||||
baseURI: self.GetBaseURI().unwrap_or("".to_owned()),
|
||||
parent: self.GetParentNode().root().map(|node| node.r().get_unique_id()).unwrap_or("".to_owned()),
|
||||
nodeType: self.NodeType(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue