Giter VIP home page Giter VIP logo

Comments (2)

cvan avatar cvan commented on May 12, 2024

We ought to allow composed DOM subtrees to be toggled via a subtree attribute/component.

<vr-scene>
  <vr-box color="green" position="0 2 0" rotation="-45 45 0"></vr-box>
</vr-scene>

<vr-element name="vr-box">
  <template>
    <vr-object mixin="cube" position="${position}" rotation="${rotation}" material="color: ${color}"></vr-object>
  </template>
</vr-element>

results in this composed (rendered) DOM:

<vr-scene>
  <vr-box color="green">
    <vr-object mixin="cube"  position="0 2 0" rotation="-45 45 0" color="green"></vr-object>
  </vr-box>
</vr-scene>

<vr-element name="vr-box">
  <template>
    <vr-object mixin="cube" position="${position}" rotation="${rotation}" material="color: ${color}"></vr-object>
  </template>
</vr-element>

with shadow DOM, it could be:

<vr-scene>
  <vr-box color="green">
  </vr-box>
</vr-scene>

<vr-element name="vr-box">
  <template>
    <vr-object mixin="cube" position="${position}" rotation="${rotation}" material="color: ${color}"></vr-object>
  </template>
</vr-element>

this bug is to toggle the subtree not to use shadow DOM (which requires quite a hefty polyfill for non-Chrome browsers):

<vr-scene>
  <vr-box color="green" subtree="false"></vr-box>
</vr-scene>

<vr-element name="vr-box">
  <template>
    <vr-object mixin="cube" position="${position}" rotation="${rotation}" material="color: ${color}"></vr-object>
  </template>
</vr-element>

compared with the following:

<vr-scene>
  <vr-box color="green" subtree="true">
    <vr-object mixin="cube"  position="0 2 0" rotation="-45 45 0" color="green"></vr-object>
  </vr-box>
</vr-scene>

<vr-element name="vr-box">
  <template>
    <vr-object mixin="cube" position="${position}" rotation="${rotation}" material="color: ${color}"></vr-object>
  </template>
</vr-element>

from aframe.

ngokevin avatar ngokevin commented on May 12, 2024

Issue looks outdated

from aframe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.