Bug 14849 - Setting valign on a table in JavaScript has no effect
: Setting valign on a table in JavaScript has no effect
Status: NEW
: WebKit
Tables
: 523.x (Safari 3)
: All All
: P2 Normal
Assigned To:
:
: HasReduction
:
:
  Show dependency treegraph
 
Reported: 2007-08-01 09:18 PST by
Modified: 2010-07-22 16:01 PST (History)


Attachments
Testcase (556 bytes, text/html)
2007-08-01 09:18 PST, Brett Wilson (Google)
no flags Details
Test case for the underlying bug. (288 bytes, text/html)
2007-08-01 12:42 PST, mitz@webkit.org
no flags Details
Proposed Patch (835 bytes, patch)
2010-06-17 05:17 PST, kushalsingla2k5@gmail.com
no flags Review Patch | Details | Formatted Diff | Diff
Proposed Path with change log (1.56 KB, patch)
2010-06-24 09:24 PST, kushalsingla2k5@gmail.com
ojan: review-
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-08-01 09:18:21 PST
vAlign="top" on a table row has no effect from JavaScript (although it works if set in the source HTML, of course). This may be true for other alignments as well, but I'm not sure.

This may be related to several other JS table bugs I filed: bug 14848 and bug 14846.
------- Comment #1 From 2007-08-01 09:18:54 PST -------
Created an attachment (id=15781) [details]
Testcase

Pressing the button should valign the rows, but does not. It works in IE and Firefox.
------- Comment #2 From 2007-08-01 12:42:24 PST -------
Created an attachment (id=15788) [details]
Test case

vertical-align is not an inherited property, so recalcStyle does not continue to descendants. What recalcStyle does not know is that table rows and table cells have 'vertical-align: inherit' by default, so they do need a recalc.

The issue is not limited to mapped attributes, as this test case demonstrates.
------- Comment #3 From 2008-01-16 12:25:43 PST -------
We basically need to find a way to retain the (very useful) performance optimization of avoiding propagation to decendants for non-inherited properties while still being correct.  One idea would be to just propagate non-inherited properties when we see an inherit keyword used on any stylesheet used by the document.
------- Comment #4 From 2008-01-16 12:31:14 PST -------
As discussed on IRC: this would mean adding a HashSet of properties which used the inherit keyword at any time during the document's lifetime.  We would do a lookup in that set after setting any non-inherited CSS property, if the lookup returned true, then we'd force a style re-calc just as though the property was an inherited property.
------- Comment #5 From 2008-01-16 13:19:58 PST -------
We can also just hack valign in the table DOM code.
------- Comment #6 From 2010-06-17 05:17:35 PST -------
Created an attachment (id=58983) [details]
Proposed Patch

If vAlign property of the table row or table cell is changed through javascript,this patch will propagate the effect down the hierarchy.
------- Comment #7 From 2010-06-24 09:24:12 PST -------
Created an attachment (id=59661) [details]
Proposed Path with change log

If vAlign property of the table row or table cell is changed through javascript,this patch will propagate the effect down the hierarchy.
------- Comment #8 From 2010-07-10 11:36:11 PST -------
(From update of attachment 58983 [details])
Removing r? from redundant patch.
------- Comment #9 From 2010-07-22 16:01:32 PST -------
(From update of attachment 59661 [details])
I'm not sure about the correctness of this code, but it needs a layout test before it can be committed.