[x3d-public] CSS st5yle usage for Routes [was: id attribute proposal]
Leonard Daly
web3d at realism.com
Sun Mar 20 17:32:57 PDT 2016
Johns suggestion of supporting CSS-style references to source or
destination nodes is interesting. If the usage is restricted to ID
values (#foo), then it is essentially the same as existing X3D. If the
usage is for class values (.foo), then there is the possibility of
dynamically adding or removing nodes from fan-in or fan-out by adding or
removing CSS classes.
In normal CSS usage, the actual style applied can be a chain of specific
nodes, classes, and IDs. Would the same be done here? For example
<style>
x3d #main_scene .viewpoints
</style>
could refer to all viewpoint nodes in the main scene. An X3D ROUTE that
identified that string as the destination would change all viewpoints.
While this is not hard to do (for example jQuery does this), it can
cause considerable overhead if you have to check the entire scene graph
for matching nodes on every animation step.
My initial thought is to not go down this route; however, that just may
be my concern on run-time performance and not being creative enough to
see all of the good possibilities.
Leonard Daly
> I'll second the proposal. Also I'd like to propose adding CSS
> selectors for values of the fromNode and toNode attributes on ROUTEs
> if not already in the standard. Thus if you have a node with
> id="foo" you could use a route with toNode="#foo". Class attributes
> would work similarly for fan in fan out.
>
> John
>
> On Mar 20, 2016 11:23 AM, "Andreas Plesch" <andreasplesch at gmail.com
> <mailto:andreasplesch at gmail.com>> wrote:
>
> Since Don mentioned that nobody has proposed introducing an 'id'
> attribute, let me then propose adding an 'id' SFString attribute
> to all nodes for x3d 4.0.
>
> The reason is simply compatibility with the DOM on web pages in
> the case where x3d nodes are interpreted as DOM elements.
>
> Andreas
>
--
*Leonard Daly*
X3D Co-Chair
Cloud Consultant
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160320/9b98444f/attachment.html>
More information about the x3d-public
mailing list