From a48fe732ce14327dc5aa8fbeca00f5904fb76b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Fri, 11 Sep 2026 15:12:11 +0200 Subject: [PATCH] Node identity and parentage are XPath, not DOM calls Nine reads reached through ixsl:call/ixsl:get for facts the data model already exposes, so the module asked JavaScript a question XPath answers. isSameNode($a, $b) is `$a is $b`; parentNode is `..`; parentElement, which is null when the parent is not an element, is exactly `parent::*`; and a Range container's nodeType = 3 test is `instance of text()`. The event targets that carried two of the identity tests take `as="node()?"` so the comparison has a node to compare - the same typing relatedTarget already had in navigate.xsl, and the reason `is` was reachable there and not here. Two constructions follow: Object() through ixsl:call is ixsl:new('Object', []), the extension that exists for it; and typeahead's three-line scroll options object - allocate, set `block`, pass - is one XDM map literal, the form navigate.xsl was already passing to the same scrollIntoView on the line above its own call. Nothing moves in the DOM layer proper. Building detached subtrees through rdfae:element and splicing them with insertNode/appendChild/before stays: xsl:result-document emits at a location and returns nothing to hold, and the insertion model hands the constructed node onward to be spliced, to receive the caret and to seed a Range. That is an architecture, not a workaround, and converting it would be a redesign of the editing core. make sef compiles both entries; make test passes 52; make test-browser reports 532 assertions true with the two pre-existing canonicalSource paste-probe values unchanged. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01BSRUJBNKKjdgJeP3qRZTPd --- src/annotate.xsl | 14 +++++++------- src/edit.xsl | 7 ++++--- src/index.xsl | 2 +- src/navigate.xsl | 2 +- src/typeahead.xsl | 4 +--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/annotate.xsl b/src/annotate.xsl index 6d40458..ca6e509 100644 --- a/src/annotate.xsl +++ b/src/annotate.xsl @@ -85,11 +85,10 @@ version="3.0"> - - - + + + - + + diff --git a/src/edit.xsl b/src/edit.xsl index d4c9019..b838e05 100644 --- a/src/edit.xsl +++ b/src/edit.xsl @@ -896,7 +896,8 @@ version="3.0"> - + + @@ -1193,7 +1194,7 @@ version="3.0"> - + @@ -1710,7 +1711,7 @@ version="3.0"> - + diff --git a/src/index.xsl b/src/index.xsl index ae7e71e..31fe9cd 100644 --- a/src/index.xsl +++ b/src/index.xsl @@ -60,7 +60,7 @@ version="3.0"> LinkedDataHub's window.LinkedDataHub); reached everywhere via rdfae:editor-state(). Hosts with their own initial template call this from there instead of main --> - + - - - - +