RESOLVED INVALID22771
table with display: inline; does not work with proper DOCTYPE
https://bugs.webkit.org/show_bug.cgi?id=22771
Summary table with display: inline; does not work with proper DOCTYPE
jasneet
Reported 2008-12-09 17:04:17 PST
I Steps: Go to attached testcase II Issue: The table should be next to the input because it has "display: inline;" III Other Browsers: IE7: ok FF3: ok IV Nightly tested: 39088 Bug in Chromium : http://code.google.com/p/chromium/issues/detail?id=2032
Attachments
testcase (728 bytes, application/zip)
2008-12-09 17:04 PST, jasneet
no flags
jasneet
Comment 1 2008-12-09 17:04:36 PST
Created attachment 25905 [details] testcase
Mustafizur Rahaman (rahaman)
Comment 2 2011-05-24 23:20:52 PDT
The issue description (Bug in Chromium : http://code.google.com/p/chromium/issues/detail?id=2032 ) mentions that the issue is present if we have the DOCTYPE, removing the DOCTYPE renders the table inline as expected. Upon investigation, it is found that RenderStyle for RenderObject (Table element ) is noninherited_flags._effectiveDisplay = 7 (INLINE_TABLE) , when DOCTYPE is NOT mentioned & table renders inline. But when DOCTYPE is mentioned, the same property has value 0 (INLINE) & the table does not render inline. The display type setting is done in CSSStyleSelector::adjustRenderStyle() { if (style->display() != NONE) { // If we have a <td> that specifies a float property, in quirks mode we just drop the float // property. // Sites also commonly use display:inline/block on <td>s and <table>s. In quirks mode we force // these tags to retain their display types. if (!m_checker.m_strictParsing && e) { if (e->hasTagName(tdTag)) { style->setDisplay(TABLE_CELL); style->setFloating(FNONE); } else if (e->hasTagName(tableTag)) style->setDisplay(style->isDisplayInlineType() ? INLINE_TABLE : TABLE); } } Further analysis found that when DOCTYPE is mentioned, the document m_compatibilityMode = LimitedQuirksMode, therefore m_checker.m_strictParsing = TRUE. When DOCTYPE is NOT mentioned m_compatibilityMode == QuirksMode, therefore m_checker.m_strictParsing = FALSE So, as we can see from above, when m_checker.m_strictParsing = FALSE, we set the display for table element as INLINE_TABLE. If m_checker.m_strictParsing == TRUE (DOCTYPE is mentioned), the if block is ommitted & the display is NOT set to INLINE. Can any one help me understand why this code is present in CSSStyleSelector::adjustRenderStyle(), I think if we remove this, the issue would be fixed.
Alexey Proskuryakov
Comment 3 2011-05-25 14:19:14 PDT
Did you try following svn blame to find out when this code was added?
Mustafizur Rahaman (rahaman)
Comment 4 2011-05-25 21:25:22 PDT
Thanks Alexey. I got some info as to when this code was added by using svn blame. However, I finally found that it is the problem with the test case. To make a table display inline, "display:inline" is not enough, we have to specify "display:inline-table" (enum INLINE_TABLE in the code). Please refer to http://www.webkit.org/blog/115/webcore-rendering-ii-blocks-and-inlines/ as well http://www.w3schools.com/css/pr_class_display.asp When DOCTYPE is not mentioned i.e. in Quirk mode, the code applies lesser strictness, therefore allow "display:inline" to be displayed as inline table. But when we mention DOCTYPE, applying of style becomes more strict & it displays an inline table if & only if we mention "display:inline-table". I have verified by making the following changes in the test case & now the table is rendered inline in Winlauncher & Safari. <table style="display:inline-table"> Therefore, it is a test case issue, no problem with the code. Can I change the status of the bug & How?
Mustafizur Rahaman( :rahaman)
Comment 5 2012-01-29 21:53:50 PST
Based on the discussion above, can someone please mark the issue as RESOLVED WONTFIX?
Note You need to log in before you can comment on or make changes to this bug.