mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Support is
option when creating elements
This commit is contained in:
parent
6697f5469d
commit
2f36d3544f
9 changed files with 66 additions and 25 deletions
|
@ -20,7 +20,7 @@ use dom::htmltemplateelement::HTMLTemplateElement;
|
|||
use dom::node::Node;
|
||||
use dom::processinginstruction::ProcessingInstruction;
|
||||
use dom::virtualmethods::vtable_for;
|
||||
use html5ever::{Attribute, QualName, ExpandedName};
|
||||
use html5ever::{Attribute, LocalName, QualName, ExpandedName};
|
||||
use html5ever::buffer_queue::BufferQueue;
|
||||
use html5ever::tendril::StrTendril;
|
||||
use html5ever::tokenizer::{Tokenizer as HtmlTokenizer, TokenizerOpts, TokenizerResult};
|
||||
|
@ -245,7 +245,13 @@ impl Sink {
|
|||
self.insert_node(contents, JS::from_ref(template.Content().upcast()));
|
||||
}
|
||||
ParseOperation::CreateElement(id, name, attrs) => {
|
||||
let elem = Element::create(name, &*self.document,
|
||||
let is = attrs.iter()
|
||||
.find(|attr| attr.name.local.eq_str_ignore_ascii_case("is"))
|
||||
.map(|attr| LocalName::from(&*attr.value));
|
||||
|
||||
let elem = Element::create(name,
|
||||
is,
|
||||
&*self.document,
|
||||
ElementCreator::ParserCreated(self.current_line));
|
||||
for attr in attrs {
|
||||
elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue