aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-08-27 10:37:44 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-08-27 16:59:04 +0200
commit2a028f66a2e7ab56094cf856ebdc20bc49ab7d4d (patch)
treea87e4210d6aa606574dbb628a9f888ef7000e6d0 /components/script/dom/macros.rs
parentaa83643507c7b5022852c06826dfc1cbc48d3a6f (diff)
downloadservo-2a028f66a2e7ab56094cf856ebdc20bc49ab7d4d.tar.gz
servo-2a028f66a2e7ab56094cf856ebdc20bc49ab7d4d.zip
Remove AttributeHandlers
On components/script/*.rs: # Remove imports. /^ *use dom::element::\{.*AttributeHandlers/ { s/\{AttributeHandlers, /\{/ s/, AttributeHandlers//g s/\{([a-zA-Z]+)\}/\1/ /\{\}/d s/::self;$/;/ } /^ *use dom::element::\{?AttributeHandlers\}?;$/d # Remove AttributeHandlers. /^pub trait AttributeHandlers \{$/,/^\}$/D # Patch AttributeHandlers methods. /^impl<'a> AttributeHandlers for &'a Element \{/,/^\}$/ { s/^impl<'a> AttributeHandlers for &'a Element \{/impl Element {/ /^ *fn /s/\(self([,)])/\(\&self\1/ /^ *fn.*\(&self/s/fn/pub fn/ } The few error cases were then fixed by hand.
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index 580c2714018..1aab4027b64 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -7,7 +7,6 @@ macro_rules! make_getter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self) -> DOMString {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
element.get_string_attribute(&Atom::from_slice($htmlname))
@@ -23,7 +22,6 @@ macro_rules! make_bool_getter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self) -> bool {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not runtime.
@@ -40,7 +38,6 @@ macro_rules! make_uint_getter(
($attr:ident, $htmlname:expr, $default:expr) => (
fn $attr(self) -> u32 {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not runtime.
@@ -60,7 +57,6 @@ macro_rules! make_url_getter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self) -> DOMString {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not runtime.
@@ -78,7 +74,6 @@ macro_rules! make_url_or_base_getter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self) -> DOMString {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
let url = element.get_url_attribute(&Atom::from_slice($htmlname));
@@ -100,7 +95,6 @@ macro_rules! make_enumerated_getter(
( $attr:ident, $htmlname:expr, $default:expr, $(($choices: pat))|+) => (
fn $attr(self) -> DOMString {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use string_cache::Atom;
@@ -126,7 +120,6 @@ macro_rules! make_setter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self, value: DOMString) {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not at runtime.
@@ -140,7 +133,6 @@ macro_rules! make_bool_setter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self, value: bool) {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not at runtime.
@@ -154,7 +146,6 @@ macro_rules! make_uint_setter(
($attr:ident, $htmlname:expr, $default:expr) => (
fn $attr(self, value: u32) {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let value = if value > 2147483647 {
$default
@@ -176,7 +167,6 @@ macro_rules! make_limited_uint_setter(
($attr:ident, $htmlname:expr, $default:expr) => (
fn $attr(self, value: u32) -> $crate::dom::bindings::error::ErrorResult {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let value = if value == 0 {
return Err($crate::dom::bindings::error::Error::IndexSize);
@@ -204,7 +194,6 @@ macro_rules! make_atomic_setter(
( $attr:ident, $htmlname:expr ) => (
fn $attr(self, value: DOMString) {
use dom::bindings::codegen::InheritTypes::ElementCast;
- use dom::element::AttributeHandlers;
use string_cache::Atom;
let element = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not at runtime.