- From: Andrew Fedoniouk <news@terrainformatica.com>
- Date: Thu, 3 Jun 2010 09:48:36 -0700
- To: HåkonWium Lie <howcome@opera.com>, "Boris Zbarsky" <bzbarsky@mit.edu>
- Cc: "www-style list" <www-style@w3.org>
-------------------------------------------------- From: "HåkonWium Lie" <howcome@opera.com> Sent: Wednesday, June 02, 2010 2:09 PM To: "Boris Zbarsky" <bzbarsky@mit.edu> Cc: "HåkonWium Lie" <howcome@opera.com>; "www-style list" <www-style@w3.org> Subject: Re: [css3-text-layout] New editor's draft - margin-before/after/start/end etc. > Also sprach Boris Zbarsky: > > > > For example, 'margin-start: 10px' is an alias that is resolved when > > > the computed value of 'writing-mode' has been determined; > > > 'margin-start' is then resolved into 'margin-left: 10px', 'margin-top: > > > 10px', or 'margin-right: 10px' (as you show in [1]). > > > > So this is happening on the _computed_ style level, not specified style, > > right? > > nYes. "margin-start: 10px" is specified in the style sheets, but > thereafter everything done at the computed style level. That's the > only way I can see it work, at least. > > > > Likewise, when the value of 'margin-start' is queried through the DOM, > > > 'writing-mode' will be consulted to determine which of 'margin-left', > > > 'margin-top', 'margin-right' that should be consulted to determine the > > > value. (Or, alternatively, one could leave it to an external > > > script/library to do this job.) > > > > Is the above talking about getComputedStyle? I would certainly hope > > that given: > > > > <span style="margin-start: 20px;" > > onclick="alert(this.style.getPropertyValue('margin-start'));"> > > Click me > > </span> > > > > the value alerted doesn't depend on any computed writing-mode values! I > > would _especially_ hope that's the case for: > > > > <style id="x"> > > * { margin-start: 20px; } > > </style> > > <script> > > alert(document.getElementById("x").sheet.cssRules[0].style > > .getPropertyValue("margin-start")); > > </script> > > > > since in that case there's no way to even talk about "the value of > > writing-mode" in a sane way. > > getComputedStyle should work, no? > > > http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSview-getComputedStyle > > It seems fair that one cannot expect APIs meant for specified property > values to work for aliases -- 'margin-start' is an alias, not a > property. However, it also seems right that there should be a way to > get the computed value of 'margin-start' -- even if it involves going > through 'writing-mode'. > CSSOM/RTL discussion reminded me one question that I wanted to ask: Are we going to "virtualise" coordinate based DOM events also with respect of these -start/end properties? So MouseEvent.clientX/Y will get also MouseEvent.clientStart/???? logical, direction dependent cousins? Sorry in advance if you think that the question is out of scope of the discussion. Something tells me that solution that leads to combinatorial explosion of properties number in CSS is a "solution of bad quality" in technical terms. Such way of solving the task looks like trivial copy-pasting style of programming/design. Can we try to solve the problem some other way? E.g. by introducing something like single 'orientation' property instead of the whole bunch? -- Andrew Fedoniouk http://terrainformatica.com
Received on Thursday, 3 June 2010 16:49:06 UTC