mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
script: Remove HTMLAppletElement.
It was removed from the spec, there's no reason to keep it in tree.
This commit is contained in:
parent
42c8fd292a
commit
8b0f58c8af
17 changed files with 132 additions and 156 deletions
|
@ -10,7 +10,6 @@ use dom::document::Document;
|
|||
use dom::element::{CustomElementCreationMode, CustomElementState, Element, ElementCreator};
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlareaelement::HTMLAreaElement;
|
||||
use dom::htmlaudioelement::HTMLAudioElement;
|
||||
use dom::htmlbaseelement::HTMLBaseElement;
|
||||
|
@ -191,12 +190,13 @@ fn create_html_element(name: QualName,
|
|||
result
|
||||
}
|
||||
|
||||
pub fn create_native_html_element(name: QualName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document,
|
||||
creator: ElementCreator)
|
||||
-> DomRoot<Element> {
|
||||
assert!(name.ns == ns!(html));
|
||||
pub fn create_native_html_element(
|
||||
name: QualName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document,
|
||||
creator: ElementCreator,
|
||||
) -> DomRoot<Element> {
|
||||
assert_eq!(name.ns, ns!(html));
|
||||
|
||||
macro_rules! make(
|
||||
($ctor:ident) => ({
|
||||
|
@ -217,7 +217,6 @@ pub fn create_native_html_element(name: QualName,
|
|||
local_name!("abbr") => make!(HTMLElement),
|
||||
local_name!("acronym") => make!(HTMLElement),
|
||||
local_name!("address") => make!(HTMLElement),
|
||||
local_name!("applet") => make!(HTMLAppletElement),
|
||||
local_name!("area") => make!(HTMLAreaElement),
|
||||
local_name!("article") => make!(HTMLElement),
|
||||
local_name!("aside") => make!(HTMLElement),
|
||||
|
|
|
@ -47,7 +47,6 @@ use dom::forcetouchevent::ForceTouchEvent;
|
|||
use dom::globalscope::GlobalScope;
|
||||
use dom::hashchangeevent::HashChangeEvent;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlareaelement::HTMLAreaElement;
|
||||
use dom::htmlbaseelement::HTMLBaseElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
|
@ -413,14 +412,6 @@ impl CollectionFilter for AnchorsFilter {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
struct AppletsFilter;
|
||||
impl CollectionFilter for AppletsFilter {
|
||||
fn filter(&self, elem: &Element, _root: &Node) -> bool {
|
||||
elem.is::<HTMLAppletElement>()
|
||||
}
|
||||
}
|
||||
|
||||
impl Document {
|
||||
#[inline]
|
||||
pub fn loader(&self) -> Ref<DocumentLoader> {
|
||||
|
@ -3373,10 +3364,8 @@ impl DocumentMethods for Document {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-document-applets
|
||||
fn Applets(&self) -> DomRoot<HTMLCollection> {
|
||||
// FIXME: This should be return OBJECT elements containing applets.
|
||||
self.applets.or_init(|| {
|
||||
let filter = Box::new(AppletsFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
HTMLCollection::always_empty(&self.window, self.upcast())
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3530,17 +3519,6 @@ impl DocumentMethods for Document {
|
|||
None => return false,
|
||||
};
|
||||
match html_elem_type {
|
||||
HTMLElementTypeId::HTMLAppletElement => {
|
||||
match elem.get_attribute(&ns!(), &local_name!("name")) {
|
||||
Some(ref attr) if attr.value().as_atom() == name => true,
|
||||
_ => {
|
||||
match elem.get_attribute(&ns!(), &local_name!("id")) {
|
||||
Some(ref attr) => attr.value().as_atom() == name,
|
||||
None => false,
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
HTMLElementTypeId::HTMLFormElement => {
|
||||
match elem.get_attribute(&ns!(), &local_name!("name")) {
|
||||
Some(ref attr) => attr.value().as_atom() == name,
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
use dom::bindings::codegen::Bindings::HTMLAppletElementBinding;
|
||||
use dom::bindings::codegen::Bindings::HTMLAppletElementBinding::HTMLAppletElementMethods;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::document::Document;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::Node;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
use style::attr::AttrValue;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct HTMLAppletElement {
|
||||
htmlelement: HTMLElement
|
||||
}
|
||||
|
||||
impl HTMLAppletElement {
|
||||
fn new_inherited(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> HTMLAppletElement {
|
||||
HTMLAppletElement {
|
||||
htmlelement:
|
||||
HTMLElement::new_inherited(local_name, prefix, document)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLAppletElement> {
|
||||
Node::reflect_node(Box::new(HTMLAppletElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLAppletElementBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
impl HTMLAppletElementMethods for HTMLAppletElement {
|
||||
// https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
|
||||
make_getter!(Name, "name");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#the-applet-element:dom-applet-name
|
||||
make_atomic_setter!(SetName, "name");
|
||||
}
|
||||
|
||||
impl VirtualMethods for HTMLAppletElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
match name {
|
||||
&local_name!("name") => AttrValue::from_atomic(value.into()),
|
||||
_ => self.super_type().unwrap().parse_plain_attribute(name, value),
|
||||
}
|
||||
}
|
||||
}
|
|
@ -80,6 +80,19 @@ impl HTMLCollection {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a collection which is always empty.
|
||||
pub fn always_empty(window: &Window, root: &Node) -> DomRoot<Self> {
|
||||
#[derive(JSTraceable)]
|
||||
struct NoFilter;
|
||||
impl CollectionFilter for NoFilter {
|
||||
fn filter<'a>(&self, _: &'a Element, _: &'a Node) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
Self::new(window, root, Box::new(NoFilter))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, root: &Node, filter: Box<CollectionFilter + 'static>) -> DomRoot<HTMLCollection> {
|
||||
reflect_dom_object(Box::new(HTMLCollection::new_inherited(root, filter)),
|
||||
|
|
|
@ -301,7 +301,6 @@ pub mod hashchangeevent;
|
|||
pub mod headers;
|
||||
pub mod history;
|
||||
pub mod htmlanchorelement;
|
||||
pub mod htmlappletelement;
|
||||
pub mod htmlareaelement;
|
||||
pub mod htmlaudioelement;
|
||||
pub mod htmlbaseelement;
|
||||
|
|
|
@ -14,7 +14,6 @@ use dom::document::Document;
|
|||
use dom::element::{AttributeMutation, Element};
|
||||
use dom::event::Event;
|
||||
use dom::htmlanchorelement::HTMLAnchorElement;
|
||||
use dom::htmlappletelement::HTMLAppletElement;
|
||||
use dom::htmlareaelement::HTMLAreaElement;
|
||||
use dom::htmlbaseelement::HTMLBaseElement;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
|
@ -154,9 +153,6 @@ pub fn vtable_for(node: &Node) -> &VirtualMethods {
|
|||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) => {
|
||||
node.downcast::<HTMLAnchorElement>().unwrap() as &VirtualMethods
|
||||
}
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAppletElement)) => {
|
||||
node.downcast::<HTMLAppletElement>().unwrap() as &VirtualMethods
|
||||
}
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAreaElement)) => {
|
||||
node.downcast::<HTMLAreaElement>().unwrap() as &VirtualMethods
|
||||
}
|
||||
|
|
|
@ -171,6 +171,7 @@ partial interface Document {
|
|||
|
||||
[SameObject]
|
||||
readonly attribute HTMLCollection anchors;
|
||||
|
||||
[SameObject]
|
||||
readonly attribute HTMLCollection applets;
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#htmlappletelement
|
||||
// Note: intentionally not [HTMLConstructor]
|
||||
interface HTMLAppletElement : HTMLElement {
|
||||
// attribute DOMString align;
|
||||
// attribute DOMString alt;
|
||||
// attribute DOMString archive;
|
||||
// attribute DOMString code;
|
||||
// attribute DOMString codeBase;
|
||||
// attribute DOMString height;
|
||||
// attribute unsigned long hspace;
|
||||
attribute DOMString name;
|
||||
// attribute DOMString _object; // the underscore is not part of the identifier
|
||||
// attribute unsigned long vspace;
|
||||
// attribute DOMString width;
|
||||
};
|
|
@ -139,31 +139,31 @@ hr[color], hr[noshade] { border-style: solid; }
|
|||
|
||||
iframe[frameborder="0"], iframe[frameborder=no i] { border: none; }
|
||||
|
||||
applet[align=left i], embed[align=left i], iframe[align=left i], img[type=image i][align=left i], object[align=left i] {
|
||||
embed[align=left i], iframe[align=left i], img[type=image i][align=left i], object[align=left i] {
|
||||
float: left;
|
||||
}
|
||||
applet[align=right i], embed[align=right i], iframe[align=right i], img[type=image i][align=right i], object[align=right i] {
|
||||
embed[align=right i], iframe[align=right i], img[type=image i][align=right i], object[align=right i] {
|
||||
float: right;
|
||||
}
|
||||
applet[align=top i], embed[align=top i], iframe[align=top i], img[type=image i][align=top i], object[align=top i] {
|
||||
embed[align=top i], iframe[align=top i], img[type=image i][align=top i], object[align=top i] {
|
||||
vertical-align: top;
|
||||
}
|
||||
applet[align=baseline i], embed[align=baseline i], iframe[align=baseline i], img[type=image i][align=baseline i], object[align=baseline i] {
|
||||
embed[align=baseline i], iframe[align=baseline i], img[type=image i][align=baseline i], object[align=baseline i] {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
applet[align=texttop i], embed[align=texttop i], iframe[align=texttop i], img[type=image i][align=texttop i], object[align=texttop i] {
|
||||
embed[align=texttop i], iframe[align=texttop i], img[type=image i][align=texttop i], object[align=texttop i] {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
applet[align=absmiddle i], embed[align=absmiddle i], iframe[align=absmiddle i], img[type=image i][align=absmiddle i], object[align=absmiddle i],
|
||||
applet[align=abscenter i], embed[align=abscenter i], iframe[align=abscenter i], img[type=image i][align=abscenter i], object[align=abscenter i] {
|
||||
embed[align=absmiddle i], iframe[align=absmiddle i], img[type=image i][align=absmiddle i], object[align=absmiddle i],
|
||||
embed[align=abscenter i], iframe[align=abscenter i], img[type=image i][align=abscenter i], object[align=abscenter i] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
applet[align=bottom i], embed[align=bottom i], iframe[align=bottom i], img[type=image i][align=bottom i], object[align=bottom i] {
|
||||
embed[align=bottom i], iframe[align=bottom i], img[type=image i][align=bottom i], object[align=bottom i] {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
/*
|
||||
FIXME:
|
||||
:matches(applet, embed, iframe, img, input[type=image i], object):matches([align=center i], [align=middle i]) {
|
||||
:matches(embed, iframe, img, input[type=image i], object):matches([align=center i], [align=middle i]) {
|
||||
vertical-align: "aligns the vertical middle of the element with the parent element's baseline."
|
||||
}
|
||||
*/
|
||||
|
@ -235,14 +235,14 @@ hr
|
|||
legend
|
||||
align
|
||||
|
||||
applet, embed, iframe, img, input[type=image i], object
|
||||
embed, iframe, img, input[type=image i], object
|
||||
hspace
|
||||
vspace
|
||||
|
||||
img, input[type=image i], object
|
||||
border
|
||||
|
||||
applet, embed, iframe, img, input[type=image i], object, video
|
||||
embed, iframe, img, input[type=image i], object, video
|
||||
width
|
||||
height
|
||||
|
||||
|
|
|
@ -11,3 +11,4 @@
|
|||
|
||||
[Matrix for skew]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[nameditem-03.html]
|
||||
type: testharness
|
||||
[applet elements are (mostly) gone]
|
||||
expected: FAIL
|
||||
|
|
@ -1,17 +1,5 @@
|
|||
[historical.html]
|
||||
type: testharness
|
||||
[document.applets is always empty]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAppletElement is no more]
|
||||
expected: FAIL
|
||||
|
||||
[document.all cannot find applet]
|
||||
expected: FAIL
|
||||
|
||||
[document cannot find applet]
|
||||
expected: FAIL
|
||||
|
||||
[applet is not styled]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -16314,3 +16314,99 @@
|
|||
[font.tabIndex: IDL set to -2147483648]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: typeof IDL attribute]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL get with DOM attribute unset]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to ""]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to undefined]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to 7]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to 1.5]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to true]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to false]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to object "[object Object\]"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to NaN]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to Infinity]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to -Infinity]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to "\\0"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to null]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to object "test-toString"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: setAttribute() to object "test-valueOf"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to ""]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to undefined]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to 7]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to 1.5]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to true]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to false]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to object "[object Object\]"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to NaN]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to Infinity]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to -Infinity]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to "\\0"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to null]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to object "test-toString"]
|
||||
expected: FAIL
|
||||
|
||||
[applet.name: IDL set to object "test-valueOf"]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -72,9 +72,3 @@
|
|||
[Interfaces for TH]
|
||||
expected: FAIL
|
||||
|
||||
[Interfaces for applet]
|
||||
expected: FAIL
|
||||
|
||||
[Interfaces for APPLET]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -65606,7 +65606,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"mozilla/collections.html": [
|
||||
"aa060d1e5d1364224f2c2151e5f8b9580ac4427e",
|
||||
"d0bebe808ebb45b6c853f4b88e1a6ebbf9b91345",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/createEvent-storageevent.html": [
|
||||
|
@ -66342,7 +66342,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"mozilla/interfaces.html": [
|
||||
"66e66d3bdfa3bebd5bf3d711c0737fb394efe973",
|
||||
"ad914ab4c7a794b251c03f7b0f50aaef1ea78df0",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/interfaces.js": [
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
<p>pppppppppp</p>
|
||||
<q>qqqqqqqqqqqqqqqqqqqqqqqqqqq</q>
|
||||
<progress max="100" value="80">80%</progress>
|
||||
<applet></applet>
|
||||
<input type="text" value="input"/>
|
||||
<iframe></iframe>
|
||||
<ol type="1">
|
||||
|
@ -100,7 +99,6 @@ test(function() {
|
|||
check_collection(document.embeds, 1, [HTMLEmbedElement], "EMBED");
|
||||
check_collection(document.plugins, 1, [HTMLEmbedElement], "EMBED");
|
||||
check_collection(document.scripts, 3, [HTMLScriptElement], "SCRIPT");
|
||||
check_collection(document.applets, 1, [HTMLAppletElement], "APPLET");
|
||||
check_collection(document.forms, 1, [HTMLFormElement], "FORM");
|
||||
|
||||
check_collection(document.getElementsByTagName("nosuchtag"), 0);
|
||||
|
|
|
@ -67,7 +67,6 @@ test_interfaces([
|
|||
"Headers",
|
||||
"History",
|
||||
"HTMLAnchorElement",
|
||||
"HTMLAppletElement",
|
||||
"HTMLAreaElement",
|
||||
"HTMLAudioElement",
|
||||
"HTMLBaseElement",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue