mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove and allow some dead code.
This commit is contained in:
parent
8f2d624cbf
commit
1bc0862214
28 changed files with 20 additions and 152 deletions
|
@ -31,7 +31,7 @@ impl<T: DomObject> SimpleWorkerErrorHandler<T> {
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct SharedRt {
|
pub struct SharedRt {
|
||||||
pub rt: *mut JSRuntime
|
rt: *mut JSRuntime
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SharedRt {
|
impl SharedRt {
|
||||||
|
@ -47,10 +47,6 @@ impl SharedRt {
|
||||||
JS_RequestInterruptCallback(self.rt);
|
JS_RequestInterruptCallback(self.rt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rt(&self) -> *mut JSRuntime {
|
|
||||||
self.rt
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
unsafe impl Send for SharedRt {}
|
unsafe impl Send for SharedRt {}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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 http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use dom::bindings::cell::DOMRefCell;
|
use dom::bindings::cell::DOMRefCell;
|
||||||
use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding;
|
use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding;
|
||||||
use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
|
use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
|
||||||
|
|
|
@ -20,6 +20,7 @@ pub struct ConstantSpec {
|
||||||
|
|
||||||
/// Representation of an IDL constant value.
|
/// Representation of an IDL constant value.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum ConstantVal {
|
pub enum ConstantVal {
|
||||||
/// `long` constant.
|
/// `long` constant.
|
||||||
IntVal(i32),
|
IntVal(i32),
|
||||||
|
|
|
@ -157,7 +157,7 @@ pub mod weakref;
|
||||||
pub mod xmlname;
|
pub mod xmlname;
|
||||||
|
|
||||||
/// Generated JS-Rust bindings.
|
/// Generated JS-Rust bindings.
|
||||||
#[allow(missing_docs, non_snake_case)]
|
#[allow(dead_code, missing_docs, non_snake_case)]
|
||||||
pub mod codegen {
|
pub mod codegen {
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
pub mod Bindings {
|
pub mod Bindings {
|
||||||
|
|
|
@ -2,17 +2,15 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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 http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::CSSGroupingRuleBinding;
|
|
||||||
use dom::bindings::codegen::Bindings::CSSGroupingRuleBinding::CSSGroupingRuleMethods;
|
use dom::bindings::codegen::Bindings::CSSGroupingRuleBinding::CSSGroupingRuleMethods;
|
||||||
use dom::bindings::error::{ErrorResult, Fallible};
|
use dom::bindings::error::{ErrorResult, Fallible};
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::js::{MutNullableJS, Root};
|
use dom::bindings::js::{MutNullableJS, Root};
|
||||||
use dom::bindings::reflector::{DomObject, reflect_dom_object};
|
use dom::bindings::reflector::DomObject;
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::cssrule::CSSRule;
|
use dom::cssrule::CSSRule;
|
||||||
use dom::cssrulelist::{CSSRuleList, RulesSource};
|
use dom::cssrulelist::{CSSRuleList, RulesSource};
|
||||||
use dom::cssstylesheet::CSSStyleSheet;
|
use dom::cssstylesheet::CSSStyleSheet;
|
||||||
use dom::window::Window;
|
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::stylesheets::CssRules as StyleCssRules;
|
use style::stylesheets::CssRules as StyleCssRules;
|
||||||
|
@ -35,14 +33,6 @@ impl CSSGroupingRule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
|
||||||
rules: Arc<RwLock<StyleCssRules>>) -> Root<CSSGroupingRule> {
|
|
||||||
reflect_dom_object(box CSSGroupingRule::new_inherited(parent_stylesheet, rules),
|
|
||||||
window,
|
|
||||||
CSSGroupingRuleBinding::Wrap)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn rulelist(&self) -> Root<CSSRuleList> {
|
fn rulelist(&self) -> Root<CSSRuleList> {
|
||||||
let parent_stylesheet = self.upcast::<CSSRule>().parent_stylesheet();
|
let parent_stylesheet = self.upcast::<CSSRule>().parent_stylesheet();
|
||||||
self.rulelist.or_init(|| CSSRuleList::new(self.global().as_window(),
|
self.rulelist.or_init(|| CSSRuleList::new(self.global().as_window(),
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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 http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::CSSRuleBinding;
|
|
||||||
use dom::bindings::codegen::Bindings::CSSRuleBinding::CSSRuleMethods;
|
use dom::bindings::codegen::Bindings::CSSRuleBinding::CSSRuleMethods;
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::js::{JS, Root};
|
use dom::bindings::js::{JS, Root};
|
||||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
use dom::bindings::reflector::Reflector;
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::cssfontfacerule::CSSFontFaceRule;
|
use dom::cssfontfacerule::CSSFontFaceRule;
|
||||||
use dom::cssimportrule::CSSImportRule;
|
use dom::cssimportrule::CSSImportRule;
|
||||||
|
@ -43,13 +42,6 @@ impl CSSRule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet) -> Root<CSSRule> {
|
|
||||||
reflect_dom_object(box CSSRule::new_inherited(parent_stylesheet),
|
|
||||||
window,
|
|
||||||
CSSRuleBinding::Wrap)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn as_specific(&self) -> &SpecificCSSRule {
|
pub fn as_specific(&self) -> &SpecificCSSRule {
|
||||||
if let Some(rule) = self.downcast::<CSSStyleRule>() {
|
if let Some(rule) = self.downcast::<CSSStyleRule>() {
|
||||||
rule as &SpecificCSSRule
|
rule as &SpecificCSSRule
|
||||||
|
|
|
@ -40,10 +40,6 @@ impl CSSStyleRule {
|
||||||
window,
|
window,
|
||||||
CSSStyleRuleBinding::Wrap)
|
CSSStyleRuleBinding::Wrap)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn style_rule(&self) -> Arc<RwLock<StyleRule>> {
|
|
||||||
self.stylerule.clone()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SpecificCSSRule for CSSStyleRule {
|
impl SpecificCSSRule for CSSStyleRule {
|
||||||
|
|
|
@ -29,13 +29,11 @@ pub enum DOMErrorName {
|
||||||
SecurityError = DOMExceptionConstants::SECURITY_ERR,
|
SecurityError = DOMExceptionConstants::SECURITY_ERR,
|
||||||
NetworkError = DOMExceptionConstants::NETWORK_ERR,
|
NetworkError = DOMExceptionConstants::NETWORK_ERR,
|
||||||
AbortError = DOMExceptionConstants::ABORT_ERR,
|
AbortError = DOMExceptionConstants::ABORT_ERR,
|
||||||
URLMismatchError = DOMExceptionConstants::URL_MISMATCH_ERR,
|
|
||||||
TypeMismatchError = DOMExceptionConstants::TYPE_MISMATCH_ERR,
|
TypeMismatchError = DOMExceptionConstants::TYPE_MISMATCH_ERR,
|
||||||
QuotaExceededError = DOMExceptionConstants::QUOTA_EXCEEDED_ERR,
|
QuotaExceededError = DOMExceptionConstants::QUOTA_EXCEEDED_ERR,
|
||||||
TimeoutError = DOMExceptionConstants::TIMEOUT_ERR,
|
TimeoutError = DOMExceptionConstants::TIMEOUT_ERR,
|
||||||
InvalidNodeTypeError = DOMExceptionConstants::INVALID_NODE_TYPE_ERR,
|
InvalidNodeTypeError = DOMExceptionConstants::INVALID_NODE_TYPE_ERR,
|
||||||
DataCloneError = DOMExceptionConstants::DATA_CLONE_ERR,
|
DataCloneError = DOMExceptionConstants::DATA_CLONE_ERR,
|
||||||
EncodingError,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
@ -62,11 +60,7 @@ impl DOMException {
|
||||||
impl DOMExceptionMethods for DOMException {
|
impl DOMExceptionMethods for DOMException {
|
||||||
// https://heycam.github.io/webidl/#dfn-DOMException
|
// https://heycam.github.io/webidl/#dfn-DOMException
|
||||||
fn Code(&self) -> u16 {
|
fn Code(&self) -> u16 {
|
||||||
match self.code {
|
self.code as u16
|
||||||
// https://heycam.github.io/webidl/#dfn-throw
|
|
||||||
DOMErrorName::EncodingError => 0,
|
|
||||||
code => code as u16,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://heycam.github.io/webidl/#idl-DOMException-error-names
|
// https://heycam.github.io/webidl/#idl-DOMException-error-names
|
||||||
|
@ -93,14 +87,12 @@ impl DOMExceptionMethods for DOMException {
|
||||||
DOMErrorName::SecurityError => "The operation is insecure.",
|
DOMErrorName::SecurityError => "The operation is insecure.",
|
||||||
DOMErrorName::NetworkError => "A network error occurred.",
|
DOMErrorName::NetworkError => "A network error occurred.",
|
||||||
DOMErrorName::AbortError => "The operation was aborted.",
|
DOMErrorName::AbortError => "The operation was aborted.",
|
||||||
DOMErrorName::URLMismatchError => "The given URL does not match another URL.",
|
|
||||||
DOMErrorName::TypeMismatchError => "The given type does not match any expected type.",
|
DOMErrorName::TypeMismatchError => "The given type does not match any expected type.",
|
||||||
DOMErrorName::QuotaExceededError => "The quota has been exceeded.",
|
DOMErrorName::QuotaExceededError => "The quota has been exceeded.",
|
||||||
DOMErrorName::TimeoutError => "The operation timed out.",
|
DOMErrorName::TimeoutError => "The operation timed out.",
|
||||||
DOMErrorName::InvalidNodeTypeError =>
|
DOMErrorName::InvalidNodeTypeError =>
|
||||||
"The supplied node is incorrect or has an incorrect ancestor for this operation.",
|
"The supplied node is incorrect or has an incorrect ancestor for this operation.",
|
||||||
DOMErrorName::DataCloneError => "The object can not be cloned.",
|
DOMErrorName::DataCloneError => "The object can not be cloned.",
|
||||||
DOMErrorName::EncodingError => "The encoding operation (either encoded or decoding) failed."
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DOMString::from(message)
|
DOMString::from(message)
|
||||||
|
|
|
@ -85,10 +85,6 @@ impl HTMLFormElement {
|
||||||
document,
|
document,
|
||||||
HTMLFormElementBinding::Wrap)
|
HTMLFormElementBinding::Wrap)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generation_id(&self) -> GenerationId {
|
|
||||||
self.generation_id.get()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HTMLFormElementMethods for HTMLFormElement {
|
impl HTMLFormElementMethods for HTMLFormElement {
|
||||||
|
@ -662,6 +658,7 @@ impl HTMLFormElement {
|
||||||
|
|
||||||
#[derive(JSTraceable, HeapSizeOf, Clone)]
|
#[derive(JSTraceable, HeapSizeOf, Clone)]
|
||||||
pub enum FormDatumValue {
|
pub enum FormDatumValue {
|
||||||
|
#[allow(dead_code)]
|
||||||
File(Root<File>),
|
File(Root<File>),
|
||||||
String(DOMString)
|
String(DOMString)
|
||||||
}
|
}
|
||||||
|
@ -701,6 +698,7 @@ pub enum FormMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(HeapSizeOf)]
|
#[derive(HeapSizeOf)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum FormSubmittableElement {
|
pub enum FormSubmittableElement {
|
||||||
ButtonElement(Root<HTMLButtonElement>),
|
ButtonElement(Root<HTMLButtonElement>),
|
||||||
InputElement(Root<HTMLInputElement>),
|
InputElement(Root<HTMLInputElement>),
|
||||||
|
|
|
@ -77,10 +77,6 @@ impl HTMLLinkElement {
|
||||||
HTMLLinkElementBinding::Wrap)
|
HTMLLinkElementBinding::Wrap)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parser_inserted(&self) -> bool {
|
|
||||||
self.parser_inserted.get()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_stylesheet(&self, s: Arc<Stylesheet>) {
|
pub fn set_stylesheet(&self, s: Arc<Stylesheet>) {
|
||||||
assert!(self.stylesheet.borrow().is_none());
|
assert!(self.stylesheet.borrow().is_none());
|
||||||
*self.stylesheet.borrow_mut() = Some(s);
|
*self.stylesheet.borrow_mut() = Some(s);
|
||||||
|
|
|
@ -243,11 +243,6 @@ impl HTMLMediaElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn htmlelement(&self) -> &HTMLElement {
|
|
||||||
&self.htmlelement
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#internal-pause-steps
|
// https://html.spec.whatwg.org/multipage/#internal-pause-steps
|
||||||
fn internal_pause_steps(&self) {
|
fn internal_pause_steps(&self) {
|
||||||
// Step 1
|
// Step 1
|
||||||
|
|
|
@ -33,11 +33,6 @@ impl HTMLTableCellElement {
|
||||||
htmlelement: HTMLElement::new_inherited(tag_name, prefix, document),
|
htmlelement: HTMLElement::new_inherited(tag_name, prefix, document),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn htmlelement(&self) -> &HTMLElement {
|
|
||||||
&self.htmlelement
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HTMLTableCellElementMethods for HTMLTableCellElement {
|
impl HTMLTableCellElementMethods for HTMLTableCellElement {
|
||||||
|
|
|
@ -285,11 +285,6 @@ impl HTMLTextAreaElementMethods for HTMLTextAreaElement {
|
||||||
|
|
||||||
|
|
||||||
impl HTMLTextAreaElement {
|
impl HTMLTextAreaElement {
|
||||||
// https://html.spec.whatwg.org/multipage/#concept-fe-mutable
|
|
||||||
pub fn mutable(&self) -> bool {
|
|
||||||
// https://html.spec.whatwg.org/multipage/#the-textarea-element:concept-fe-mutable
|
|
||||||
!(self.Disabled() || self.ReadOnly())
|
|
||||||
}
|
|
||||||
pub fn reset(&self) {
|
pub fn reset(&self) {
|
||||||
// https://html.spec.whatwg.org/multipage/#the-textarea-element:concept-form-reset-control
|
// https://html.spec.whatwg.org/multipage/#the-textarea-element:concept-form-reset-control
|
||||||
self.SetValue(self.DefaultValue());
|
self.SetValue(self.DefaultValue());
|
||||||
|
|
|
@ -26,12 +26,6 @@ pub struct MediaQueryListEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MediaQueryListEvent {
|
impl MediaQueryListEvent {
|
||||||
pub fn new_uninitialized(global: &GlobalScope) -> Root<MediaQueryListEvent> {
|
|
||||||
MediaQueryListEvent::new_initialized(global,
|
|
||||||
DOMString::new(),
|
|
||||||
false)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_initialized(global: &GlobalScope,
|
pub fn new_initialized(global: &GlobalScope,
|
||||||
media: DOMString,
|
media: DOMString,
|
||||||
matches: bool) -> Root<MediaQueryListEvent> {
|
matches: bool) -> Root<MediaQueryListEvent> {
|
||||||
|
|
|
@ -79,7 +79,6 @@ impl NodeIteratorMethods for NodeIterator {
|
||||||
match self.filter {
|
match self.filter {
|
||||||
Filter::None => None,
|
Filter::None => None,
|
||||||
Filter::Callback(ref nf) => Some((*nf).clone()),
|
Filter::Callback(ref nf) => Some((*nf).clone()),
|
||||||
Filter::Native(_) => panic!("Cannot convert native node filter to DOM NodeFilter")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +199,6 @@ impl NodeIterator {
|
||||||
// Step 3-5.
|
// Step 3-5.
|
||||||
match self.filter {
|
match self.filter {
|
||||||
Filter::None => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
Filter::None => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
||||||
Filter::Native(f) => Ok((f)(node)),
|
|
||||||
Filter::Callback(ref callback) => callback.AcceptNode_(self, node, Rethrow)
|
Filter::Callback(ref callback) => callback.AcceptNode_(self, node, Rethrow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,6 +208,5 @@ impl NodeIterator {
|
||||||
#[derive(JSTraceable)]
|
#[derive(JSTraceable)]
|
||||||
pub enum Filter {
|
pub enum Filter {
|
||||||
None,
|
None,
|
||||||
Native(fn (node: &Node) -> u16),
|
|
||||||
Callback(Rc<NodeFilter>)
|
Callback(Rc<NodeFilter>)
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,6 @@ impl RadioNodeList {
|
||||||
RadioNodeList::new(window, NodeListType::Simple(iter.map(|r| JS::from_ref(&*r)).collect()))
|
RadioNodeList::new(window, NodeListType::Simple(iter.map(|r| JS::from_ref(&*r)).collect()))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn empty(window: &Window) -> Root<RadioNodeList> {
|
|
||||||
RadioNodeList::new(window, NodeListType::Simple(vec![]))
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: This shouldn't need to be implemented here since NodeList (the parent of
|
// FIXME: This shouldn't need to be implemented here since NodeList (the parent of
|
||||||
// RadioNodeList) implements Length
|
// RadioNodeList) implements Length
|
||||||
// https://github.com/servo/servo/issues/5875
|
// https://github.com/servo/servo/issues/5875
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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 http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::SVGElementBinding;
|
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::js::Root;
|
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::document::Document;
|
use dom::document::Document;
|
||||||
use dom::element::Element;
|
use dom::element::Element;
|
||||||
use dom::node::Node;
|
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever_atoms::LocalName;
|
||||||
use style::element_state::ElementState;
|
use style::element_state::ElementState;
|
||||||
|
@ -19,11 +16,6 @@ pub struct SVGElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SVGElement {
|
impl SVGElement {
|
||||||
pub fn new_inherited(tag_name: LocalName, prefix: Option<DOMString>,
|
|
||||||
document: &Document) -> SVGElement {
|
|
||||||
SVGElement::new_inherited_with_state(ElementState::empty(), tag_name, prefix, document)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_inherited_with_state(state: ElementState, tag_name: LocalName,
|
pub fn new_inherited_with_state(state: ElementState, tag_name: LocalName,
|
||||||
prefix: Option<DOMString>, document: &Document)
|
prefix: Option<DOMString>, document: &Document)
|
||||||
-> SVGElement {
|
-> SVGElement {
|
||||||
|
@ -32,13 +24,6 @@ impl SVGElement {
|
||||||
Element::new_inherited_with_state(state, tag_name, ns!(svg), prefix, document),
|
Element::new_inherited_with_state(state, tag_name, ns!(svg), prefix, document),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn new(local_name: LocalName, prefix: Option<DOMString>, document: &Document) -> Root<SVGElement> {
|
|
||||||
Node::reflect_node(box SVGElement::new_inherited(local_name, prefix, document),
|
|
||||||
document,
|
|
||||||
SVGElementBinding::Wrap)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VirtualMethods for SVGElement {
|
impl VirtualMethods for SVGElement {
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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 http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::SVGGraphicsElementBinding;
|
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::js::Root;
|
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::document::Document;
|
use dom::document::Document;
|
||||||
use dom::node::Node;
|
|
||||||
use dom::svgelement::SVGElement;
|
use dom::svgelement::SVGElement;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever_atoms::LocalName;
|
||||||
|
@ -32,13 +29,6 @@ impl SVGGraphicsElement {
|
||||||
SVGElement::new_inherited_with_state(state, tag_name, prefix, document),
|
SVGElement::new_inherited_with_state(state, tag_name, prefix, document),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn new(local_name: LocalName, prefix: Option<DOMString>, document: &Document) -> Root<SVGGraphicsElement> {
|
|
||||||
Node::reflect_node(box SVGGraphicsElement::new_inherited(local_name, prefix, document),
|
|
||||||
document,
|
|
||||||
SVGGraphicsElementBinding::Wrap)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VirtualMethods for SVGGraphicsElement {
|
impl VirtualMethods for SVGGraphicsElement {
|
||||||
|
|
|
@ -10,8 +10,8 @@ use dom::element::Element;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#validity-states
|
// https://html.spec.whatwg.org/multipage/#validity-states
|
||||||
#[derive(JSTraceable)]
|
#[derive(JSTraceable, HeapSizeOf)]
|
||||||
#[derive(HeapSizeOf)]
|
#[allow(dead_code)]
|
||||||
pub enum ValidityStatus {
|
pub enum ValidityStatus {
|
||||||
ValueMissing,
|
ValueMissing,
|
||||||
TypeMismatch,
|
TypeMismatch,
|
||||||
|
|
|
@ -3,10 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
||||||
use dom::bindings::codegen::Bindings::WebGLObjectBinding;
|
use dom::bindings::reflector::Reflector;
|
||||||
use dom::bindings::js::Root;
|
|
||||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
|
||||||
use dom::window::Window;
|
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct WebGLObject {
|
pub struct WebGLObject {
|
||||||
|
@ -19,8 +16,4 @@ impl WebGLObject {
|
||||||
reflector_: Reflector::new(),
|
reflector_: Reflector::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(window: &Window) -> Root<WebGLObject> {
|
|
||||||
reflect_dom_object(box WebGLObject::new_inherited(), window, WebGLObjectBinding::Wrap)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2829,39 +2829,4 @@ impl UniformSetterType {
|
||||||
UniformSetterType::FloatMat4 => 16,
|
UniformSetterType::FloatMat4 => 16,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_compatible_with(&self, gl_type: u32) -> bool {
|
|
||||||
gl_type == self.as_gl_constant() || match *self {
|
|
||||||
// Sampler uniform variables have an index value (the index of the
|
|
||||||
// texture), and as such they have to be set as ints
|
|
||||||
UniformSetterType::Int => gl_type == constants::SAMPLER_2D ||
|
|
||||||
gl_type == constants::SAMPLER_CUBE,
|
|
||||||
// Don't ask me why, but it seems we must allow setting bool
|
|
||||||
// uniforms with uniform1f.
|
|
||||||
//
|
|
||||||
// See the WebGL conformance test
|
|
||||||
// conformance/uniforms/gl-uniform-bool.html
|
|
||||||
UniformSetterType::Float => gl_type == constants::BOOL,
|
|
||||||
UniformSetterType::FloatVec2 => gl_type == constants::BOOL_VEC2,
|
|
||||||
UniformSetterType::FloatVec3 => gl_type == constants::BOOL_VEC3,
|
|
||||||
UniformSetterType::FloatVec4 => gl_type == constants::BOOL_VEC4,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn as_gl_constant(&self) -> u32 {
|
|
||||||
match *self {
|
|
||||||
UniformSetterType::Int => constants::INT,
|
|
||||||
UniformSetterType::IntVec2 => constants::INT_VEC2,
|
|
||||||
UniformSetterType::IntVec3 => constants::INT_VEC3,
|
|
||||||
UniformSetterType::IntVec4 => constants::INT_VEC4,
|
|
||||||
UniformSetterType::Float => constants::FLOAT,
|
|
||||||
UniformSetterType::FloatVec2 => constants::FLOAT_VEC2,
|
|
||||||
UniformSetterType::FloatVec3 => constants::FLOAT_VEC3,
|
|
||||||
UniformSetterType::FloatVec4 => constants::FLOAT_VEC4,
|
|
||||||
UniformSetterType::FloatMat2 => constants::FLOAT_MAT2,
|
|
||||||
UniformSetterType::FloatMat3 => constants::FLOAT_MAT3,
|
|
||||||
UniformSetterType::FloatMat4 => constants::FLOAT_MAT4,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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 http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
||||||
use dom::bindings::codegen::Bindings::WebGLShaderPrecisionFormatBinding;
|
use dom::bindings::codegen::Bindings::WebGLShaderPrecisionFormatBinding;
|
||||||
use dom::bindings::codegen::Bindings::WebGLShaderPrecisionFormatBinding::WebGLShaderPrecisionFormatMethods;
|
use dom::bindings::codegen::Bindings::WebGLShaderPrecisionFormatBinding::WebGLShaderPrecisionFormatMethods;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://drafts.csswg.org/cssom/#the-cssgroupingrule-interface
|
// https://drafts.csswg.org/cssom/#the-cssgroupingrule-interface
|
||||||
[Exposed=Window]
|
[Abstract, Exposed=Window]
|
||||||
interface CSSGroupingRule : CSSRule {
|
interface CSSGroupingRule : CSSRule {
|
||||||
[SameObject] readonly attribute CSSRuleList cssRules;
|
[SameObject] readonly attribute CSSRuleList cssRules;
|
||||||
[Throws] unsigned long insertRule(DOMString rule, unsigned long index);
|
[Throws] unsigned long insertRule(DOMString rule, unsigned long index);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://drafts.csswg.org/cssom/#the-cssrule-interface
|
// https://drafts.csswg.org/cssom/#the-cssrule-interface
|
||||||
[Exposed=Window]
|
[Abstract, Exposed=Window]
|
||||||
interface CSSRule {
|
interface CSSRule {
|
||||||
const unsigned short STYLE_RULE = 1;
|
const unsigned short STYLE_RULE = 1;
|
||||||
const unsigned short CHARSET_RULE = 2; // historical
|
const unsigned short CHARSET_RULE = 2; // historical
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement
|
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement
|
||||||
[Pref="dom.svg.enabled"]
|
[Abstract, Pref="dom.svg.enabled"]
|
||||||
interface SVGElement : Element {
|
interface SVGElement : Element {
|
||||||
|
|
||||||
//[SameObject] readonly attribute SVGAnimatedString className;
|
//[SameObject] readonly attribute SVGAnimatedString className;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGraphicsElement
|
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGGraphicsElement
|
||||||
[Pref="dom.svg.enabled"]
|
|
||||||
//dictionary SVGBoundingBoxOptions {
|
//dictionary SVGBoundingBoxOptions {
|
||||||
// boolean fill = true;
|
// boolean fill = true;
|
||||||
// boolean stroke = false;
|
// boolean stroke = false;
|
||||||
|
@ -11,6 +10,7 @@
|
||||||
// boolean clipped = false;
|
// boolean clipped = false;
|
||||||
//};
|
//};
|
||||||
|
|
||||||
|
[Abstract, Pref="dom.svg.enabled"]
|
||||||
interface SVGGraphicsElement : SVGElement {
|
interface SVGGraphicsElement : SVGElement {
|
||||||
//[SameObject] readonly attribute SVGAnimatedTransformList transform;
|
//[SameObject] readonly attribute SVGAnimatedTransformList transform;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.3
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.3
|
||||||
//
|
//
|
||||||
|
|
||||||
[Exposed=Window]
|
[Abstract, Exposed=Window]
|
||||||
interface WebGLObject {
|
interface WebGLObject {
|
||||||
};
|
};
|
||||||
|
|
|
@ -142,8 +142,6 @@ pub enum ReflowReason {
|
||||||
ElementStateChanged,
|
ElementStateChanged,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type ScrollPoint = Point2D<Au>;
|
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct Window {
|
pub struct Window {
|
||||||
globalscope: GlobalScope,
|
globalscope: GlobalScope,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue