[webkit-dev] incorrect webkit-margin-collapse behaviour

Nick Menere nick at atlassian.com
Thu Nov 20 15:46:40 PST 2008

Hi all,

We have recently moved from quirks to strict doctype and wanted to  
revert the behaviour of paragraph margins in table cells.
I found the webkit-margin-collapse property and from the description,  
it looks exactly what I want -
"This property allows you to emulate the behavior of some browsers in  
quirks mode where table cell margins are collapsed into the borders of  
vertically adjacent cells."

Setting it to "separate", it does what it is meant to (non collapsed  
margins).  However, setting it to discard has no effect what so ever.

I just wanted to confirm its intended behaviour before I raised a bug.

Below is the simplest example of the problem.  When viewed (on trunk  
and stable) you will notice that the first paragraph has a top-margin,  
and the bottom paragraph has a bottom margin.  Change the doctype to  
quirks (remove - "http://www.w3.org/TR/html4/loose.dtd") and the  
margins disappear.

Cheers guys,

JIRA Developer

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<style type="text/css">
     table, tr, td {
     p {
         -webkit-margin-top-collapse: discard;
         -webkit-margin-bottom-collapse: discard;
                 <p>Test paragraph 1</p>
                 <p>Test paragraph 2</p>
                 <p>Test paragraph 3</p>

More information about the webkit-dev mailing list