Bug 11188

Summary: Setting hspace on a table overrides align=center
Product: WebKit Reporter: mitz
Component: TablesAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: eric
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.iloveindia.com/astrology/index.html
Attachments:
Description Flags
Test case
none
Patch that moves align=center into code instead of CSS mitz: review+

Description mitz 2006-10-06 02:06:31 PDT
A table with align=center is not centered if it also specifies hspace. See attached test case.
Comment 1 mitz 2006-10-06 02:07:23 PDT
Created attachment 10945 [details]
Test case
Comment 2 Eric Seidel (no email) 2008-01-10 11:23:35 PST
An example of this on a real website:
http://www.iloveindia.com/astrology/index.html
Comment 3 Dave Hyatt 2008-01-10 11:46:58 PST
Interesting.  Firefox appears to be somehow giving some mapped attributes a higher precedence than others.  In particular, it makes sure hspace gets mapped in before align does.

Comment 4 Dave Hyatt 2008-01-10 11:56:06 PST
The bug is that we implemented align=center in the CSS file.  This created a situation where hspace would always win (instead of allowing attribute order to determine the winner).

Comment 5 Dave Hyatt 2008-01-10 11:57:41 PST
Created attachment 18368 [details]
Patch that moves align=center into code instead of CSS

This patch will also improve the style sharing performance of tables, since the attribute selector rule in html4.css prevented tables from sharing style with one another.
Comment 6 mitz 2008-01-10 12:03:40 PST
Comment on attachment 18368 [details]
Patch that moves align=center into code instead of CSS

r=me. Add a test case if not covered by an existing one.
Comment 7 Dave Hyatt 2008-01-11 10:27:53 PST
Fixed in r29409.