[Webkit-unassigned] [Bug 85823] Cleanup use of virtualChildren() calls

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 7 14:24:42 PDT 2012


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





--- Comment #1 from Abhishek Arya <inferno at chromium.org>  2012-05-07 14:24:42 PST ---
>From https://bugs.webkit.org/show_bug.cgi?id=85759
Comment #10 From Darin Adler 2012-05-07 13:15:17 PST (-) [reply] 
I don’t think it’s ever correct to call the virtualChildren function directly. Why is this doing that?

I looked at this code

void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* currentChild)
{
    RenderObject* firstLetter = currentChild->parent();
    RenderObject* firstLetterContainer = firstLetter->parent();
    RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);

and added assert to see if firstLetterContainer is always a renderblock, it is not. it can be an inline (e.g. fast/css-generated-content/002.html). Since type is not known in advance, does it make sense to keep virtualChildren() call. I don't understand how we can fix this. Same for this case in RenderObjectChildList.cpp

    if (oldContentPresent && (!newContentWanted || Node::diff(child->style(), pseudoElementStyle, owner->document()) == Node::Detach)) {
        // Nuke the child. 
        if (child->style()->styleType() == type) {
            oldContentPresent = false;
            child->destroy();
            child = (type == BEFORE) ? owner->virtualChildren()->firstChild() : owner->virtualChildren()->lastChild();
        }
    }

Place where type is known should be definitely fixed, like
// An anonymous block must be made to wrap this inline.
            RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock();
            RenderObjectChildList* childlist = parent()->virtualChildren();
            childlist->insertChildNode(parent(), block, this);

What do you think Darin ?

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