|
@@ -168,7 +168,7 @@ namespace Spry {
|
|
|
final_instance.body.inner_html = template_fragment;
|
|
final_instance.body.inner_html = template_fragment;
|
|
|
|
|
|
|
|
// Do regular transform
|
|
// Do regular transform
|
|
|
- yield transform_document(final_instance);
|
|
|
|
|
|
|
+ yield transform_document(final_instance, true);
|
|
|
return final_instance;
|
|
return final_instance;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -220,7 +220,7 @@ namespace Spry {
|
|
|
return component;
|
|
return component;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private async void transform_document(MarkupDocument doc) throws Error {
|
|
|
|
|
|
|
+ private async void transform_document(MarkupDocument doc, bool is_rendering_dynamic = false) throws Error {
|
|
|
transform_unique_attributes(doc); // Done first so as to ensure the tracking numbers don't change
|
|
transform_unique_attributes(doc); // Done first so as to ensure the tracking numbers don't change
|
|
|
transform_if_attributes(doc); // Outputs spry-hidden attributes
|
|
transform_if_attributes(doc); // Outputs spry-hidden attributes
|
|
|
remove_hidden_blocks(doc); // Removes tags with spry-hidden attributes
|
|
remove_hidden_blocks(doc); // Removes tags with spry-hidden attributes
|
|
@@ -233,7 +233,7 @@ namespace Spry {
|
|
|
transform_target_nodes(doc);
|
|
transform_target_nodes(doc);
|
|
|
transform_global_nodes(doc);
|
|
transform_global_nodes(doc);
|
|
|
transform_resource_nodes(doc);
|
|
transform_resource_nodes(doc);
|
|
|
- transform_dynamic_attributes(doc);
|
|
|
|
|
|
|
+ transform_dynamic_attributes(doc, is_rendering_dynamic);
|
|
|
transform_continuation_nodes(doc);
|
|
transform_continuation_nodes(doc);
|
|
|
remove_internal_sids(doc);
|
|
remove_internal_sids(doc);
|
|
|
yield append_globals(doc);
|
|
yield append_globals(doc);
|
|
@@ -369,18 +369,12 @@ namespace Spry {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void transform_dynamic_attributes(MarkupDocument doc) throws Error {
|
|
|
|
|
|
|
+ private void transform_dynamic_attributes(MarkupDocument doc, bool is_rendering_dynamic) throws Error {
|
|
|
var nodes = doc.select("//*[@spry-dynamic]");
|
|
var nodes = doc.select("//*[@spry-dynamic]");
|
|
|
foreach (var node in nodes) {
|
|
foreach (var node in nodes) {
|
|
|
var name = node.get_attribute("spry-dynamic");
|
|
var name = node.get_attribute("spry-dynamic");
|
|
|
|
|
|
|
|
- MarkupNode parent = node;
|
|
|
|
|
- while((parent = parent.parent) != null) {
|
|
|
|
|
- if(parent.has_attribute("spry-continuation")) {
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if(parent == null) {
|
|
|
|
|
|
|
+ if(!is_rendering_dynamic && !has_any_parent_where(node, n => n.has_attribute("spry-continuation"))) {
|
|
|
throw new ComponentError.INVALID_TEMPLATE("A tag with a spry-dynamic attribute must be the child of a tag with a spry-continuation attribute");
|
|
throw new ComponentError.INVALID_TEMPLATE("A tag with a spry-dynamic attribute must be the child of a tag with a spry-continuation attribute");
|
|
|
}
|
|
}
|
|
|
|
|
|