mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Allow element prefix to be set
Implements step 6.1.10 of https://dom.spec.whatwg.org/#concept-create-element
This commit is contained in:
parent
dd9bb0550b
commit
37e8b89377
6 changed files with 26 additions and 17 deletions
|
@ -24,7 +24,7 @@ use dom::node::Node;
|
|||
use dom::promise::Promise;
|
||||
use dom::window::Window;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::LocalName;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
use js::conversions::ToJSValConvertible;
|
||||
use js::jsapi::{Construct1, IsConstructor, HandleValueArray, HandleObject};
|
||||
use js::jsapi::{JS_GetProperty, JSAutoCompartment, JSContext};
|
||||
|
@ -281,7 +281,7 @@ impl CustomElementDefinition {
|
|||
|
||||
/// https://dom.spec.whatwg.org/#concept-create-element Step 6.1
|
||||
#[allow(unsafe_code)]
|
||||
pub fn create_element(&self, document: &Document) -> Fallible<Root<Element>> {
|
||||
pub fn create_element(&self, document: &Document, prefix: Option<Prefix>) -> Fallible<Root<Element>> {
|
||||
let window = document.window();
|
||||
let cx = window.get_cx();
|
||||
// Step 2
|
||||
|
@ -320,6 +320,9 @@ impl CustomElementDefinition {
|
|||
return Err(Error::NotSupported);
|
||||
}
|
||||
|
||||
// Step 10
|
||||
element.set_prefix(prefix);
|
||||
|
||||
// Step 11
|
||||
// Element's `is` is None by default
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue