[Webkit-unassigned] [Bug 22771] table with display: inline; does not work with proper DOCTYPE

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 24 23:20:52 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=22771


Mustafizur Rahaman <mustaf.here at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mustaf.here at gmail.com




--- Comment #2 from Mustafizur Rahaman <mustaf.here at gmail.com>  2011-05-24 23:20:52 PST ---
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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list