First, I assume that both the following two ways lead to the same result:

1. css:
</stylesheet>
    view.boxy {
      margin: 5;
    }
</stylesheet>
    <view name="ps" styleclass="boxy" width="200" height="200"
bgcolor="yellow"/>

2. attribute:
<view name="s2" margin="5" width="200" height="200" bgcolor="yellow"/>

Unluckily, Number 2 is not working at all in current build, which is the
question I need to confirm.

Second, I agree we should avoid mingling "CSS" and 'individual attribute' at
the same time.
But when it come to the case, the individual attribute should be overwritten
by 'css'?

-Fred

2011/1/2 P T Withington <[email protected]>

> On second thought, this may really be about how we handle CSS
> abbreviations.  I'm thinking that perhaps they cannot be handled as
> attributes, but instead need to be expanded when the CSS is read in.
>  Otherwise we are going to run into the same problem in CSS, that if the
> style bindings are not applied in the right order, an abbreviation that is
> less specific will end up clobbering an individual attribute that is more
> specific.
>
> Either we need to expand these abbreviations into the CSS, or we need to
> make sure that style bindings get applied in specificity order...
>
> On 2011-01-01, at 11:57, P T Withington wrote:
>
> > If you are talking about overriding a style binding with an attribute
> initialization, I think I see the problem.  If you have a style for
> `padding` (which sets all four values), since styles are applied _after_
> initialization, any individual attribute settings (like `paddingright`,
> etc.) will be overridden.  This can be a general problem in CSS too, but is
> solved by the cascading rules which determine which property 'wins'.
> >
> > This is more motivation for us to have something like:
> >
> >  <view ... style="padding-left: 3" ...>
> >
> > which would create a local style rule that would override any inherited
> bindings.
> >
> > As a work-around, you would have to consistently either use the
> abbreviation or the individual attributes in both your style sheet and in
> the LZX.
> >
> > On 2011-01-01, at 09:47, Captain Feng wrote:
> >
> >> Question:
> >> It works well when through stylesheet:
> >>   view.boxy {
> >>     padding: 1 3 5 7;
> >>     border-width: 2 4 6 8;
> >>     border-color: plum;
> >>     margin: 3 7 11 15;
> >>   }
> >>
> >> but it didn't work through tag attribute, e.g:
> >>       <view name="s1" with="boxmodel" width="60" height="60"
> bgcolor="red"
> >> paddingbottom="5" paddingleft="7" paddingright="3" paddingtop="1" />
> >> is that designated as expected?
> >>
> >> -Fred
> >>
> >> 2011/1/1 Captain Feng <[email protected]>
> >>
> >>> Happy new year to all!
> >>>
> >>> -Fred
> >>>
> >>> 2011/1/1 P T Withington <[email protected]>
> >>>
> >>> Change ptw-20101231-eeH by [email protected] on 2010-12-31 11:09:28 EST
> >>>>  in /Users/ptw/OpenLaszlo/trunk-3
> >>>>  for http://svn.openlaszlo.org/openlaszlo/trunk
> >>>>
> >>>> Summary: More complete boxmodel mixin
> >>>>
> >>>> New Features:
> >>>>
> >>>>  boxmmodel mixin now supports indpependently specifying
> >>>>  margin/border-width/padding for all four sides
> >>>>
> >>>> Bugs Fixed:
> >>>>  LPP-9079 Add discrete padding/margin/border top/left/right/bottom
> >>>>  LPP-8819 Doc tools not aware of <attribute style="..." ...>
> >>>>
> >>>> Technical Reviewer: [email protected] (pending)
> >>>> QA Reviewer: [email protected] (pending)
> >>>>
> >>>> Release Notes:
> >>>>
> >>>>  boxmmodel mixin now supports indpependently specifying
> >>>>  margin/border-width/padding for all four sides
> >>>>
> >>>>  When an attribute can be styled by a CSS property, the name of the
> >>>>  corresponding property is displayed in the attribute documentation.
> >>>>
> >>>> Details:
> >>>>  lfc-undeclared, LzNode, NodeModel: Install type information early
> >>>>  on.
> >>>>
> >>>>  LzSprite.*:  Support all four axes of
> >>>>  margin/border-width/padding.
> >>>>
> >>>>  Lz{,Text,InputText}Sprite.as: Remove gigantic #passthrough block
> >>>>  (using only where necessary) so our compiler can annotate slots
> >>>>  for debugging sprites.
> >>>>
> >>>>  TypeCompiler:  Install user-type names so they inspect correctly.
> >>>>
> >>>>  boxmodel:  Add a new type that can parse boxmodel side
> >>>>  dimensions.  Use that for the "abbreviated" boxmodel attributes.
> >>>>  The abbreviated setter unpacks and calls the actual individual
> >>>>  attribute setters.  Each of the individual setters also keeps the
> >>>>  abbreviated value up to date.
> >>>>
> >>>>  docbook.css:  Style the description of attribute CSS properties
> >>>>
> >>>>  js2doc2dbk:  Note the CSS property corresponding to an attribute
> >>>>  (if there is one).
> >>>>
> >>>>  lzx2js2doc:  Pull the style property out of attributes
> >>>>
> >>>> Tests:
> >>>>
> >>>>  example in the documentation
> >>>>
> >>>> Files:
> >>>> M       WEB-INF/lps/schema/lfc-undeclared.lzx
> >>>> M       WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
> >>>> M       WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
> >>>> M       WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
> >>>> M       WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
> >>>> M       WEB-INF/lps/lfc/core/LzNode.lzs
> >>>> M
> WEB-INF/lps/server/src/org/openlaszlo/compiler/TypeCompiler.java
> >>>> M       WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
> >>>> M       docs/includes/docbook.css
> >>>> M       docs/src/xsl/simple-driver.xsl
> >>>> M       docs/src/xsl/js2doc2dbk.xsl
> >>>> M       docs/src/xsl/lzx2js2doc.xsl
> >>>> M       lps/components/mixins/boxmodel.lzx
> >>>>
> >>>> Changeset:
> >>>> http://svn.openlaszlo.org/openlaszlo/patches/ptw-20101231-eeH.tar
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> captain
> >>>
> >>
> >>
> >>
> >> --
> >> captain
> >
>
>


-- 
captain

Reply via email to