mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Remove target and data fields from parse_node_data
This commit is contained in:
parent
e41b7d06b4
commit
48e04d8d8f
1 changed files with 6 additions and 19 deletions
|
@ -138,8 +138,6 @@ pub struct ParseNode {
|
||||||
|
|
||||||
#[derive(JSTraceable, HeapSizeOf)]
|
#[derive(JSTraceable, HeapSizeOf)]
|
||||||
struct ParseNodeData {
|
struct ParseNodeData {
|
||||||
target: Option<String>,
|
|
||||||
data: Option<String>,
|
|
||||||
contents: Option<ParseNode>,
|
contents: Option<ParseNode>,
|
||||||
is_integration_point: bool,
|
is_integration_point: bool,
|
||||||
}
|
}
|
||||||
|
@ -147,8 +145,6 @@ struct ParseNodeData {
|
||||||
impl Default for ParseNodeData {
|
impl Default for ParseNodeData {
|
||||||
fn default() -> ParseNodeData {
|
fn default() -> ParseNodeData {
|
||||||
ParseNodeData {
|
ParseNodeData {
|
||||||
target: None,
|
|
||||||
data: None,
|
|
||||||
contents: None,
|
contents: None,
|
||||||
is_integration_point: false,
|
is_integration_point: false,
|
||||||
}
|
}
|
||||||
|
@ -169,7 +165,7 @@ enum ParseOperation {
|
||||||
MarkScriptAlreadyStarted(ParseNodeID),
|
MarkScriptAlreadyStarted(ParseNodeID),
|
||||||
ReparentChildren(ParseNodeID, ParseNodeID),
|
ReparentChildren(ParseNodeID, ParseNodeID),
|
||||||
AssociateWithForm(ParseNodeID, ParseNodeID),
|
AssociateWithForm(ParseNodeID, ParseNodeID),
|
||||||
CreatePI(ParseNodeID),
|
CreatePI(ParseNodeID, StrTendril, StrTendril),
|
||||||
Pop(ParseNodeID),
|
Pop(ParseNodeID),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,15 +325,11 @@ impl Sink {
|
||||||
ParseOperation::Pop(node) => {
|
ParseOperation::Pop(node) => {
|
||||||
vtable_for(self.get_node(&node)).pop();
|
vtable_for(self.get_node(&node)).pop();
|
||||||
}
|
}
|
||||||
ParseOperation::CreatePI(node) => {
|
ParseOperation::CreatePI(node, target, data) => {
|
||||||
let pi;
|
let pi = ProcessingInstruction::new(
|
||||||
{
|
DOMString::from(String::from(target)),
|
||||||
let data = self.get_parse_node_data(&node);
|
DOMString::from(String::from(data)),
|
||||||
pi = ProcessingInstruction::new(
|
|
||||||
DOMString::from(data.target.clone().unwrap()),
|
|
||||||
DOMString::from(data.data.clone().unwrap()),
|
|
||||||
document);
|
document);
|
||||||
}
|
|
||||||
self.insert_node(node, JS::from_ref(pi.upcast()));
|
self.insert_node(node, JS::from_ref(pi.upcast()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -411,12 +403,7 @@ impl TreeSink for Sink {
|
||||||
|
|
||||||
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> ParseNode {
|
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> ParseNode {
|
||||||
let node = self.new_parse_node();
|
let node = self.new_parse_node();
|
||||||
{
|
self.process_operation(ParseOperation::CreatePI(node.id, target, data));
|
||||||
let mut node_data = self.get_parse_node_data_mut(&node.id);
|
|
||||||
node_data.target = Some(String::from(target));
|
|
||||||
node_data.data = Some(String::from(data));
|
|
||||||
}
|
|
||||||
self.process_operation(ParseOperation::CreatePI(node.id));
|
|
||||||
node
|
node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue