XML Patch For FOUC

David Hyatt hyatt@apple.com
Wed, 15 Jan 2003 11:17:16 -0800


When "display: none" is used, it's very similar to what happens with 
the FOUC patch.  You go ahead and attach all the descendants of the 
display: none element, even though none of them create render objects.  
  So asserting that you have to have a parentNode->renderer() at the top 
of attach methods is incorrect IMO and should be removed, since it's 
wrong in the "display: none" case even without the FOUC fixes.

dave

On Wednesday, January 15, 2003, at 03:15 AM, Alexander Kellett wrote:

> On Wed, Jan 15, 2003 at 10:22:32PM +1030, Peter Kelly wrote:
>> On Wed, 15 Jan 2003, Alexander Kellett wrote:
>>> quick question to cvs khtml people, why is parentNode()->renderer()
>>> asserted in some attach() methods but not in others?, bugs?
>>
>> IIRC, The way that the attaching process works is that children are
>> always suposed to be attached after their parents, and detached before
>> their parents. So you can never have a situation where a child is 
>> attached
>> but not a parent.
>>
>> So the asserts could probably be put in all places - it's probably 
>> just
>> been overlooked when some methods were written.
>
> okay now i'm really confused :). why are there lots of 
> parentNode()->renderer()
> codepaths being added in that case?. from what i see parentNode() is 
> the
> parent (logically :)), and therefore given how you describe the attach 
> process
> (thanks for the explanation btw!)
>
> but the parentNode()->renderer() otoh is not always there from what i 
> see.
> therefore the renderer()'s are created in a delayed fashion once all 
> the
> pending stylesheets are loaded. thus, the attach() methods are called 
> twice?
> once for the addChild and once for the rendering style addition? or 
> are the
> setStyle's done via some other hierarchical/recursive process once the
> stylesheets are available?, is this maybe the purpose of the addition 
> to
>
>    +++ html/html_documentimpl.cpp  15 Jan 2003 11:57:47 -0000
>    @@ -302,6 +302,13 @@ void HTMLDocumentImpl::close()
>                 
> getDocument()->dispatchWindowEvent(EventImpl::LOAD_EVENT, false, 
> false);
>
>             updateRendering();
>    +
>    +        // Always do a layout/repaint after loading.
>    +        if (renderer()) {
>    +            if (!renderer()->layouted())
>    +                renderer()->layout();
>    +            renderer()->repaint();
>    +        }
>         }
>     }
>
> okay, so, i'm quite amazingly confused now :)
>
> Alex
>
> p.s: code pointers are just as good as explanations :)
>
> -- 
> "[...] Konqueror open source project. Weighing in at less than
>             one tenth the size of another open source renderer"
> Apple,  Jan 2003 (http://www.apple.com/safari/)
> _______________________________________________
> Khtml-devel@mail.kde.org
> http://mail.kde.org/mailman/listinfo/khtml-devel