mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement CDATASection interface and createCDATASection method
This commit is contained in:
parent
431423388e
commit
4b8282b3b1
18 changed files with 106 additions and 112 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue