[webkit-dev] Should Table Cell (TD) children inherit height?

Fady Samuel fsamuel at google.com
Tue Jun 29 07:29:18 PDT 2010


Yup, I just wanted to rule this out. Then this means that the div's height
is auto, correct? That means it sizes itself to fit its contents. Now,
consider a similar situation, suppose its contents have a percent instead,
say:

  <div id="div1" style="background-color: red; height:100%;">
      <div id="div2" style="background-color: blue;">
        <div id="div3" style="background-color: green; height:100%"></div>
      </div>
  </div>

Both Firefox and WebKit show the same behavior. The resulting color is
green. Why?  Why isn't it red? How does the height inheritance work here?

Thanks,

Fady



On Mon, Jun 28, 2010 at 10:11 PM, Maciej Stachowiak <mjs at apple.com> wrote:

>
> On Jun 28, 2010, at 6:32 PM, David Kilzer wrote:
>
> > How do Firefox and MSIE render the test case?
>
> Our rendering on this content matches Firefox in both quirks and standards
> mode. I also do not know if a reason per spec for the div to get 100%
> height. Height does not inherit.
>
>  - Maciej
>
> >
> > Dave
> > --
> > Sent from my iPhone 3GS
> >
> > On Jun 28, 2010, at 11:42 AM, Fady Samuel <fsamuel at chromium.org> wrote:
> >
> >> My understanding is that in quirks mode, <table height="100%"> causes
> the table to fill the entire client window. Now, I believe the height
> attribute should trickle down to the TR and TD tags, correct? What about
> children of a TD tag? If you add an empty div child to a table, should it
> fit the whole cell, or should it have a size of 0?
> >>
> >>
> >> <table width="100%" border="0" style="height:100%;">
> >>    <tr>
> >>        <td style="background-color: red;">
> >>      <div id="drawing" style="background-color: green;"></div>
> >>    </td>
> >>    </tr>
> >> </table>
> >>
> >>
> >> WebKit will show you red instead of green because the div does not have
> a height of 100%.
> >>
> >> Now if you make the div's height 100%, you get green.
> >>
> >> Should a cell's child inherit height?
> >>
> >> Thanks,
> >>
> >> Fady Samuel
> >
> > _______________________________________________
> > webkit-dev mailing list
> > webkit-dev at lists.webkit.org
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100629/2fbe2c78/attachment.html>


More information about the webkit-dev mailing list