# HG changeset patch # User Edouard Tisserant # Date 1615491965 -3600 # Node ID 1e9b9d7451cdaeeab7109586b78dd140214538ec # Parent 50d0fef791d5aa6b73d1bb78a7d19d876f5ddd8c SVGHMI: Ensure that when a HMI:List is refered, none of its refered elements are discarded. diff -r 50d0fef791d5 -r 1e9b9d7451cd svghmi/detachable_pages.ysl2 --- a/svghmi/detachable_pages.ysl2 Wed Mar 10 19:29:49 2021 +0100 +++ b/svghmi/detachable_pages.ysl2 Thu Mar 11 20:46:05 2021 +0100 @@ -85,9 +85,18 @@ } } +const "required_page_elements", + "func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*"; + +const "hmi_lists_descs", "$parsed_widgets/widget[@type = 'List']"; +const "hmi_lists", "$hmi_elements[@id = $hmi_lists_descs/@id]"; + +const "required_list_elements", "func:refered_elements($hmi_lists[@id = $required_page_elements/@id])"; + const "required_elements", """//svg:defs/descendant-or-self::svg:* - | func:required_elements($hmi_pages | $keypads)/ancestor-or-self::svg:*"""; + | $required_list_elements + | $required_page_elements"""; const "discardable_elements", "//svg:*[not(@id = $required_elements/@id)]"; diff -r 50d0fef791d5 -r 1e9b9d7451cd svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Wed Mar 10 19:29:49 2021 +0100 +++ b/svghmi/gen_index_xhtml.xslt Thu Mar 11 20:46:05 2021 +0100 @@ -1,6 +1,6 @@ - - + + @@ -472,7 +472,11 @@ - + + + + + @@ -740,8 +744,6 @@ - - @@ -1693,7 +1695,7 @@ - + @@ -6808,7 +6810,7 @@ - + diff -r 50d0fef791d5 -r 1e9b9d7451cd svghmi/inline_svg.ysl2 --- a/svghmi/inline_svg.ysl2 Wed Mar 10 19:29:49 2021 +0100 +++ b/svghmi/inline_svg.ysl2 Thu Mar 11 20:46:05 2021 +0100 @@ -55,8 +55,6 @@ // For now, clone unlinkink applies to descendants of all widget except HMI:Page // TODO: narrow application of clone unlinking to active elements, // while keeping static decoration cloned -const "hmi_lists_descs", "$parsed_widgets/widget[@type = 'List']"; -const "hmi_lists", "$hmi_elements[@id = $hmi_lists_descs/@id]"; const "targets_not_to_unlink", "$hmi_lists/descendant-or-self::svg:*"; const "to_unlink", "$hmi_elements[not(@id = $hmi_pages/@id)]/descendant-or-self::svg:use";