relative dimension values.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Fedoniouk

    relative dimension values.

    As stated in CSS 2,
    Box model/Width:
    "The percentage is calculated with respect to the width of the generated
    box's containing block."

    This makes percentable values completely useless.

    If we will change this definition to:
    "The percentage is calculated with respect to the width of the generated
    box's containing block *minus widths of all fixed elements in the line*".

    Illustration:
    Lets say we have three blocks placed inline with widths 25%, 100px and 75%:
    |<---25%--->|<---fixed:100px--->|<----------75%--------->|

    Actual first and third block widths will be calculated from
    ContainerConten tWidth-100px weighted by their percentable values.

    Using proposed alghorithm it is possible to mix fixed and "spring" content
    without any tables.
    Same approach should apply to heights.

    Another illustration:
    <P>Here is first input element <INPUT width=100px> and <SPAN
    class=bigfont>h ere</SPAN> is another: <INPUT width=100%></P>
    If we will use new schema then last input element will occupy the rest of
    the line.
    Layout like this cannot be implemented even with <table> because of base
    line issues.

    I've implemented this alghorithm in my experimental rendering engine.
    Implementation is pretty simple and do not increase comlexity of layout
    alghorithms significantly.
    If anybody want to take a look just drop me message.

    Andrew Fedoniouk.


    PS: Does anybody know where is the best place to publish proposals like
    this?





  • David Dorward

    #2
    Re: relative dimension values.

    Andrew Fedoniouk wrote:
    [color=blue]
    > As stated in CSS 2,[/color]

    Did you miss comp.infosystem s.www.authoring.stylesheets?
    [color=blue]
    > Box model/Width:
    > "The percentage is calculated with respect to the width of the generated
    > box's containing block."
    >
    > This makes percentable values completely useless.[/color]

    In your opinion. I find them quite useful.
    [color=blue]
    > If we will change this definition to:
    > "The percentage is calculated with respect to the width of the generated
    > box's containing block *minus widths of all fixed elements in the line*".[/color]

    Yeah! Break backwards compatibility! Woo!
    [color=blue]
    > Illustration:
    > Lets say we have three blocks placed inline[/color]

    If they are blocks, then they are almost certainly not inline. (Unless you
    are using the supported-only-by-Opera display: inline-block.
    [color=blue]
    > with widths 25%, 100px and 75%:
    > |<---25%--->|<---fixed:100px--->|<----------75%--------->|[/color]

    What about floats?

    If that first element is floated, is it supposed to be part of that "line"?
    How is the UA supposed to tell?
    [color=blue]
    > Using proposed alghorithm it is possible to mix fixed and "spring" content
    > without any tables.[/color]

    Gosh, and here I was thinking that you could do that with display: table-*
    all this time.
    [color=blue]
    > PS: Does anybody know where is the best place to publish proposals like
    > this?[/color]



    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>

    Comment

    • Andrew Fedoniouk

      #3
      Re: relative dimension values.

      > > If we will change this definition to:[color=blue][color=green]
      > > "The percentage is calculated with respect to the width of the generated
      > > box's containing block *minus widths of all fixed elements in the[/color][/color]
      line*".[color=blue]
      >
      > Yeah! Break backwards compatibility! Woo![/color]

      It is enough to introduce %% size unit for that and let % stay as is.
      [color=blue]
      > If they are blocks, then they are almost certainly not inline. (Unless you
      > are using the supported-only-by-Opera display: inline-block.[/color]

      inline-blocks are already in W3C recomendations.
      Browsers which are not implementiong this cannot be treated
      as conformant browsers. Right?
      [color=blue]
      >[color=green]
      > > with widths 25%, 100px and 75%:
      > > |<---25%--->|<---fixed:100px--->|<----------75%--------->|[/color]
      >
      > What about floats?
      >
      > If that first element is floated, is it supposed to be part of that[/color]
      "line"?[color=blue]
      > How is the UA supposed to tell?[/color]

      I cannot see any problems with floats here.
      See the behavior of text line with text-align: justify in this case.
      You may think that each whitespace in the line is given percentable width
      value.
      [color=blue]
      >
      > Gosh, and here I was thinking that you could do that with display: table-*
      > all this time.
      >[/color]

      Yep, very clever - to regret <TABLE> as a layout instrument and to invent
      table-* styles.
      [color=blue]
      > http://lists.w3.org/Archives/Public/www-style/[/color]

      Thanks a lot,

      Andrew Fedoniouk.



      Comment

      • David Dorward

        #4
        Re: relative dimension values.

        Andrew Fedoniouk wrote:
        [color=blue]
        > Yep, very clever - to regret <TABLE> as a layout instrument and to invent
        > table-* styles.[/color]

        That would be because <table> says something about the data, while table-*
        styles simply describe how it should be laid out.

        --
        David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>

        Comment

        • Harlan Messinger

          #5
          Re: relative dimension values.


          "Andrew Fedoniouk" <news@terrainfo rmatica.com> wrote in message
          news:iuPlc.3469 41$Pk3.255804@p d7tw1no...[color=blue]
          >
          > Yep, very clever - to regret <TABLE> as a layout instrument and to invent
          > table-* styles.[/color]

          For the same reason that it's better to use CSS properties instead of FONT
          tags, ALIGN attributes, BGCOLOR attributes; instead of using BLOCKQUOTE to
          indent paragraphs that aren't quotes; and so on. The only reason not to
          right now is lack of support.

          Comment

          • Andrew Fedoniouk

            #6
            Re: relative dimension values.


            "David Dorward" <dorward@yahoo. com> wrote:[color=blue]
            > That would be because <table> says something about the data, while table-*
            > styles simply describe how it should be laid out.[/color]

            Did you try to use them practically? I suspect no.
            table-* styles do not help in most cases: no colspan/rowspan, no
            percentable/weighted width/height (similar to old <table> model).

            Andrew Fedoniouk.





            Comment

            Working...