Implement CDATASection interface and createCDATASection method

This commit is contained in:
George Roman 2019-02-13 22:21:52 +02:00
parent 431423388e
commit 4b8282b3b1
18 changed files with 106 additions and 112 deletions

View file

@ -40,7 +40,9 @@ use net_traits::image::base::{Image, ImageMetadata};
use range::Range;
use script::layout_exports::NodeFlags;
use script::layout_exports::PendingRestyle;
use script::layout_exports::{CharacterDataTypeId, ElementTypeId, HTMLElementTypeId, NodeTypeId};
use script::layout_exports::{
CharacterDataTypeId, ElementTypeId, HTMLElementTypeId, NodeTypeId, TextTypeId,
};
use script::layout_exports::{Document, Element, Node, Text};
use script::layout_exports::{LayoutCharacterDataHelpers, LayoutDocumentHelpers};
use script::layout_exports::{
@ -153,7 +155,8 @@ impl<'ln> NodeInfo for ServoLayoutNode<'ln> {
}
fn is_text_node(&self) -> bool {
self.script_type_id() == NodeTypeId::CharacterData(CharacterDataTypeId::Text)
self.script_type_id() ==
NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text))
}
}
@ -765,7 +768,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
.dom_children()
.all(|node| match node.script_type_id() {
NodeTypeId::Element(..) => false,
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => unsafe {
NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text)) => unsafe {
node.node.downcast().unwrap().data_for_layout().is_empty()
},
_ => true,