[Webkit-unassigned] [Bug 23248] CSS class change result in inconsistent layout

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 25 23:55:25 PST 2009


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





------- Comment #5 from neelima.web at gmail.com  2009-02-25 23:55 PDT -------
I have done some analysis on this bug. 
1)I found issue in Node::Diff()
I have done some changes in Node::Diff () by adding one more condition, which
will detach the previous node with their respective properties and again attach
with new properties to the node.
Node::StyleChange Node::diff( RenderStyle *s1, RenderStyle *s2 )
{
.........
.........
else  if (*s1 != *s2)
    ch = Detach; 
        OR
else  if (display1 == display2 || fl1 == fl2 ||
 (s1 && s2 && s1->contentDataEquivalent(s2)))
        ch = Detach;
.........
.........
}
        I have tested and the fix seems to be working fine. Kindly let me know
whether this is a correct approach?

2)Need Clarification: I tried with another approach to resolve the same issue.
Whenever  select  from left to right or Right to Top, the style is setting to
Block level in CSSStyleSelectos::adjustRenderStylefunction() of 
CSSStyleSelector.cpp,  I had  tried to change ‘setDisplay’ value to inline for
the ‘case :Top to Right’ but it’s not working. I found that in
CSSStyleSelectos::adjustRenderStylefunction() , they are forcefully setting
inline-level roots to  be block-level , if someone attempts to float an inline.
See the below code:
void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
{
// Mutate the display to BLOCK or TABLE for certain cases, e.g., if //someone
attempts to position or float an inline, compact, or run-in.  //Cache the
original display, since it may be needed for positioned //elements that have to
compute their static normal flow positions.  //We also force inline-level roots
to be block-level.
if (style->display() != BLOCK && style->display() != TABLE && style->display()
!= BOX && (style->position() == AbsolutePosition || style->position() ==
FixedPosition || style->floating() != FNONE ||
             (e && e->document()->documentElement() == e))) {
            if (style->display() == INLINE_TABLE)
                style->setDisplay(TABLE);
            else if (style->display() == INLINE_BOX)
                style->setDisplay(BOX);
            else if (style->display() == LIST_ITEM) {
  // It is a WinIE bug that floated list items lose their //bullets, so we'll
emulate the quirk, but only in quirks mode.
                if (!m_checker.m_strictParsing && style->floating() != FNONE)
                    style->setDisplay(BLOCK);
            }
else
         style->setDisplay(BLOCK); // This part of code is getting hit when I  
                                // change from left to right or right to top 


        }
Please let me know why it has been done like this?


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



More information about the webkit-unassigned mailing list