[Webkit-unassigned] [Bug 81084] Fix rendering of replaced elements with relative dimensions within a table cell.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 3 06:47:26 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81084





--- Comment #14 from arpitabahuguna at gmail.com  2012-04-03 06:47:25 PST ---
(In reply to comment #13)

Thanks for once again reviewing the patch Julien. Would appreciate your opinion on the following:

> 
> > Source/WebCore/rendering/RenderReplaced.cpp:436
> > +        if (cb->isTable()) {
> 
> Shouldn't we be looking for a table cell not a table here?
> 
The logic here is that if we get any containing block (up to table i.e. either table cell or table) with fixed dimensions then our replaced inner element (with relative dimensions) should get rendered with respect to those fixed dimensions.
Otherwise, we should go ahead with the (intrinsic) size of the replaced element and expand our (relative) table cell dimensions accordingly.

For scenarios which have a fixed (dimension) table but a relative table cell containing relative replaced element within, the earlier patch would have rendered the replaced element with its full size and would have also expanded the table cell accordingly. But since the table has fixed dimensions this would have resulted in an incorrect layout. Thus, we should check for any fixed containing block up to table.

Also, the previous patch with the tableCell() check was failing an existing layout test case table-percent-width.html (under fast/replaced) for the cases which have a fixed table width.
table-percent-width-actual.txt with tableCell() check instead of table()
FAIL getWidth('img-3') should be 40px. Was 105px. 
FAIL getHeight('img-3') should be 40px. Was 105px.
FAIL getWidth('img-5') should be 40px. Was 105px. 


> > LayoutTests/platform/qt/fast/replaced/table-cell-width-percent-expected.txt:30
> > +FAIL getWidth('canvas-td-width-percent') should be 300px. Was 530px.
> 
> Why is it failing? What are we testing here that we do not match? Is this expected?
This is the case in which the replaced element has height 100% and the containing table cell has width 100%. The only restriction is on the width of the table which is 600px.
Here too we would be expecting a width of 300px (the intrinsic size width) but instead get 530px which is due to the table cell's 100% width being considered (wrt table width 600px).
This behavior is the same with or without my fix.
Also, we get similar values on Firefox as well.

I shall incorporate the remaining review comments into the next patch.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list