aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-03-18 17:22:55 -0400
committerGitHub <noreply@github.com>2019-03-18 17:22:55 -0400
commit34fda66dfa5528f2b10a873e9a67417c6986c712 (patch)
tree8994cc26cc41a45bbc189622871b4a1c0b378f18 /components/layout_thread
parent0fac8f2f62aff22897a0ca657a840333827cabf0 (diff)
parent4b8282b3b164771e3351c2a85890167ab6d0ab7f (diff)
downloadservo-34fda66dfa5528f2b10a873e9a67417c6986c712.tar.gz
servo-34fda66dfa5528f2b10a873e9a67417c6986c712.zip
Auto merge of #22891 - georgeroman:implement_cdatasection, r=Manishearth
Implement CDATASection interface and createCDATASection method <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22846 <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22891) <!-- Reviewable:end -->
Diffstat (limited to 'components/layout_thread')
-rw-r--r--components/layout_thread/dom_wrapper.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs
index baaaaf5c730..3a7f088a246 100644
--- a/components/layout_thread/dom_wrapper.rs
+++ b/components/layout_thread/dom_wrapper.rs
@@ -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,