From 6c518c89b969d1e9a96c3c5b9fe0da6cfc3637d1 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 2 May 2017 11:10:49 +0200 Subject: Upgrade to html5ever 0.16 --- components/script/dom/htmldivelement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index e4d8bf669ef..d89e0cfa8c1 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDivElement { -- cgit v1.2.3 From 875e422fe67f68bdf57bd3635279e224b0c90996 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Wed, 3 May 2017 10:17:42 -0500 Subject: Changed all prefixes from DOMString to the atomic Prefix from html5ever --- components/script/dom/htmldivelement.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index e4d8bf669ef..ea5d8f39f02 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever_atoms::{LocalName, Prefix}; #[dom_struct] pub struct HTMLDivElement { @@ -18,7 +18,7 @@ pub struct HTMLDivElement { impl HTMLDivElement { fn new_inherited(local_name: LocalName, - prefix: Option, + prefix: Option, document: &Document) -> HTMLDivElement { HTMLDivElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document) @@ -27,7 +27,7 @@ impl HTMLDivElement { #[allow(unrooted_must_root)] pub fn new(local_name: LocalName, - prefix: Option, + prefix: Option, document: &Document) -> Root { Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document), document, -- cgit v1.2.3 From 0e3c54c1911ba2c3bf305ee04f04fcd9bf2fc2fe Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 25 Sep 2017 23:30:24 +0200 Subject: Rename dom::bindings::js to dom::bindings::root --- components/script/dom/htmldivelement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 6e20b3796f5..5f152d770ad 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods}; -use dom::bindings::js::Root; +use dom::bindings::root::Root; use dom::bindings::str::DOMString; use dom::document::Document; use dom::htmlelement::HTMLElement; -- cgit v1.2.3 From f87c2a8d7616112ca924e30292db2d244cf87eec Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 26 Sep 2017 01:53:40 +0200 Subject: Rename Root to DomRoot In a later PR, DomRoot will become a type alias of Root>, where Root will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned. --- components/script/dom/htmldivelement.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 5f152d770ad..001ca7c5ca5 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods}; -use dom::bindings::root::Root; +use dom::bindings::root::DomRoot; use dom::bindings::str::DOMString; use dom::document::Document; use dom::htmlelement::HTMLElement; @@ -28,7 +28,7 @@ impl HTMLDivElement { #[allow(unrooted_must_root)] pub fn new(local_name: LocalName, prefix: Option, - document: &Document) -> Root { + document: &Document) -> DomRoot { Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document), document, HTMLDivElementBinding::Wrap) -- cgit v1.2.3 From aa15dc269f41503d81ad44cd7e85d69e6f4aeac7 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 16 Oct 2017 14:35:30 +0200 Subject: Remove use of unstable box syntax. http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl Box { #[inline(always)] pub fn new(x: T) -> Box { box x } } ``` With inlining, it should compile to the same as box syntax. --- components/script/dom/htmldivelement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 001ca7c5ca5..48fd3afb951 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -29,7 +29,7 @@ impl HTMLDivElement { pub fn new(local_name: LocalName, prefix: Option, document: &Document) -> DomRoot { - Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document), + Node::reflect_node(Box::new(HTMLDivElement::new_inherited(local_name, prefix, document)), document, HTMLDivElementBinding::Wrap) } -- cgit v1.2.3 From c37a345dc9f4dda6ea29c42f96f6c7201c42cbac Mon Sep 17 00:00:00 2001 From: chansuke Date: Tue, 18 Sep 2018 23:24:15 +0900 Subject: Format script component --- components/script/dom/htmldivelement.rs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 48fd3afb951..3de1af4e568 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -13,25 +13,31 @@ use html5ever::{LocalName, Prefix}; #[dom_struct] pub struct HTMLDivElement { - htmlelement: HTMLElement + htmlelement: HTMLElement, } impl HTMLDivElement { - fn new_inherited(local_name: LocalName, - prefix: Option, - document: &Document) -> HTMLDivElement { + fn new_inherited( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> HTMLDivElement { HTMLDivElement { - htmlelement: HTMLElement::new_inherited(local_name, prefix, document) + htmlelement: HTMLElement::new_inherited(local_name, prefix, document), } } #[allow(unrooted_must_root)] - pub fn new(local_name: LocalName, - prefix: Option, - document: &Document) -> DomRoot { - Node::reflect_node(Box::new(HTMLDivElement::new_inherited(local_name, prefix, document)), - document, - HTMLDivElementBinding::Wrap) + pub fn new( + local_name: LocalName, + prefix: Option, + document: &Document, + ) -> DomRoot { + Node::reflect_node( + Box::new(HTMLDivElement::new_inherited(local_name, prefix, document)), + document, + HTMLDivElementBinding::Wrap, + ) } } -- cgit v1.2.3 From 45f7199eee82c66637ec68287eafa40a651001c4 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 1 Nov 2018 23:45:06 +0100 Subject: `cargo fix --edition` --- components/script/dom/htmldivelement.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 3de1af4e568..90d462dcc35 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods}; -use dom::bindings::root::DomRoot; -use dom::bindings::str::DOMString; -use dom::document::Document; -use dom::htmlelement::HTMLElement; -use dom::node::Node; +use crate::dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods}; +use crate::dom::bindings::root::DomRoot; +use crate::dom::bindings::str::DOMString; +use crate::dom::document::Document; +use crate::dom::htmlelement::HTMLElement; +use crate::dom::node::Node; use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; -- cgit v1.2.3 From a1a14459c141afc6ac6771b8a6c9ca374537edf2 Mon Sep 17 00:00:00 2001 From: Jan Andre Ikenmeyer Date: Mon, 19 Nov 2018 14:47:12 +0100 Subject: Update MPL license to https (part 3) --- components/script/dom/htmldivelement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 90d462dcc35..3c8bc187614 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -1,6 +1,6 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods}; use crate::dom::bindings::root::DomRoot; -- cgit v1.2.3 From 3ea6d87bcc37167464e856949a4b9b77d0e9318a Mon Sep 17 00:00:00 2001 From: YUAN LYU Date: Fri, 20 Mar 2020 22:14:18 -0400 Subject: Add trait DomObjectWrap to provide WRAP function --- components/script/dom/htmldivelement.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'components/script/dom/htmldivelement.rs') diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index 3c8bc187614..0bd558210a0 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -use crate::dom::bindings::codegen::Bindings::HTMLDivElementBinding::{self, HTMLDivElementMethods}; +use crate::dom::bindings::codegen::Bindings::HTMLDivElementBinding::HTMLDivElementMethods; use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::str::DOMString; use crate::dom::document::Document; @@ -36,7 +36,6 @@ impl HTMLDivElement { Node::reflect_node( Box::new(HTMLDivElement::new_inherited(local_name, prefix, document)), document, - HTMLDivElementBinding::Wrap, ) } } -- cgit v1.2.3