[Webkit-unassigned] [Bug 24413] border of <td> not displayed when border-color and border-style are used in CSS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 19 00:37:20 PDT 2011


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


mustaf.here at gmail.com changed:

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




--- Comment #2 from mustaf.here at gmail.com  2011-05-19 00:37:20 PST ---
I have done preliminary investigation of the issue.

Primarily I have found that the border width for the style element corresponding to 1st table cell element [(((*((((*((m_style).m_ptr)).surround).m_data).m_ptr)).border).m_left).m_width] is zero, where as the same value for the second table cell element is 3(I guess that is default value) & therefore, the 1st table cell border is not being drawn.

Upon further investigation I found that, while parsing value in CSSParser for the 1st Cell element,CSSParser::parseValue() is called with propId = 1038 (CSSPropertyBorderColor) & 1049 (CSSPropertyBorderStyle)

The same call flow for second cell element is called with propId=1030 (CSSPropertyBorder) & it internally includes BorderWidth property as follows

    case CSSPropertyBorder:
        // [ 'border-width' || 'border-style' || <color> ] | inherit
    {
        const int properties[3] = { CSSPropertyBorderWidth, CSSPropertyBorderStyle,
                                    CSSPropertyBorderColor };
        return parseShorthand(propId, properties, 3, important);
    }

i.e. the CSSMutableStyleDeclaration created for 1st cell element does not have BorderWidth where as the second CSSMutableStyleDeclaration does have the value. Therefore, in CSSStyleSelector::styleForElement(), while calling applyDeclarations with different rule does NOT add the BorderWidth to the StyleElement for the 1st cell, but the borderwidth for the style element for the second cell gets added
=========================================================

Then the question comes why it is the problem with Table cell ement only, because same style syntax for a paragraph element works perfectly fine.
td.borderCHex //Does not Work    
{
border-color:red;
border-style:solid;
}

p.borderCHex //Perfectly works
{
border-color:red;
border-style:solid;
}

Upon going into further details, I found that while calling 
applyDeclarations<false>(false, lastUARule + 1, m_matchedDecls.size() - 1); in CSSStyleSelector::styleForElement(), 

For table cell element, while running through all the matched declarations, first all the width value are set to zero & then it is again set to default value of 3px if CSSPropertyBorder was used as discussed above.

For paragraph element, it does not have any matching declaration except one & therefore no one sets the value to zero.Then I found that those extra matching declaration for table cell element are populated in the code with the following comments in
CSSStyleSelector::styleForElement()
// Now we check additional mapped declarations.
// Tables and table cells share an additional mapped rule that must be applied
// after all attributes, since their mapped style depends on the values of multiple attributes.

I kind of gave up here, Can any one help me with some more details to proceed further?

-- 
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