mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Add a with_imm_element_like() method.
… gives a generic element from a generic node.
This commit is contained in:
parent
62f1f03c16
commit
6c41be9c13
3 changed files with 19 additions and 7 deletions
|
@ -120,12 +120,12 @@ pub enum ElementTypeId {
|
|||
// Element methods
|
||||
//
|
||||
|
||||
impl<'self> ElementLike<'self> for Element {
|
||||
fn get_local_name(&'self self) -> &'self str {
|
||||
impl ElementLike for Element {
|
||||
fn get_local_name<'a>(&'a self) -> &'a str {
|
||||
self.tag_name.as_slice()
|
||||
}
|
||||
|
||||
fn get_attr(&'self self, name: &str) -> Option<&'self str> {
|
||||
fn get_attr<'a>(&'a self, name: &str) -> Option<&'a str> {
|
||||
// FIXME: Need an each() that links lifetimes in Rust.
|
||||
for attr in self.attrs.iter() {
|
||||
// FIXME: only case-insensitive in the HTML namespace (as opposed to SVG, etc.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue