AIUI, the issue is how it is possible, if at all, to use position:absolute or 
position:relative selectively in the DOM.  IIRC, it isn't a matter of creating 
a descendant selector for the object you want to position, it is setting the 
position style on all of its parents without affecting any other of the other 
children of those parents in the DOM that might not be expecting position to be 
set.  Because position not only changes the position, but it seems to affect 
what offsetWidth is of those parents.

I haven't looked at existing JS frameworks and successful JS websites.  Maybe 
position is an "all-or-nothing" kind of choice.  You have to decide to use it 
and deal with setting position!=static throughout the DOM, or use it in many 
places and pick a few offsetParents to base all of your math on, or not use it 
all and rely on margins and padding and other tricks.   Note that Flex does not 
support margins and Royale can, so maybe proper use of margin can eliminate 
some of the reliance on x,y in Royale.

So it may be that we need different groups of beads to allow these three 
choices.  If you choose position!=static you use a particular bead and it uses 
different handlers for x,y,width/height.  And maybe we should make a 
"RelativeToMeBead" that you stick on a UI widget and all children x,y is 
relative to that.

So maybe, Royale should provide choices.  What is really hard and not PAYG is 
trying to make one method handle all of these situations.

Just thinking out loud,
-Alex

On 6/11/18, 12:36 AM, "Harbs" <harbs.li...@gmail.com> wrote:

    We could always have a bead which sets:
    
    .foo *{
       position: static;
    }
    To reset the defaults of all elements below “foo” to static.
    
    Of course to change it to something else, you’d need:
    .foo .baz{
       position: absolute;
    }
    
    I’m not sure how well this would work with the Jewel layout beads. I’m not 
sure what the specificity is on that.
    
    Harbs
    
    > On Jun 11, 2018, at 10:11 AM, Alex Harui <aha...@adobe.com.INVALID> wrote:
    > 
    > The emulation Application is based on Container and thus creates a Div.  
It may not stay that way, but we did it so that the SystemManager can parent 
the app like it does in Flex.
    > 
    > Feel free to commit the bead.  It won't hurt anything and some folks will 
be able to use it.  I'm still wondering what the right answer is going to be 
for the emulation component sets.  Or what to do if someone does have some part 
of the DOM that they do not want style.position set.  There is no CSS way to 
specify "set style on all parents", AFAIK, which is would help reduce 
side-effects.
    > 
    > Later,
    > -Alex
    > 
    > On 6/8/18, 9:02 AM, "Harbs" <harbs.li...@gmail.com> wrote:
    > 
    >> Interesting idea, but I thought there was concern about the global 
selector affecting HTML around the app?
    > 
    >    Currently, we don’t have an Application class that attaches to regular 
divs It always controls the body element. Since we control the whole page, it’s 
not a problem. If we do get to the point where a Royale app can be injected 
into a random div, then setting a global selector might be a problem if there’s 
other HTML which relies on static. We can have heavier-duty beads to deal with 
setting relative positioning in those cases.
    > 
    >    Harbs
    > 
    
    

Reply via email to