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
Created attachment 25905 [details] testcase
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.
Did you try following svn blame to find out when this code was added?
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?
Based on the discussion above, can someone please mark the issue as RESOLVED WONTFIX?