Bug 121882

Summary: Clean up some uses of first/lastChildSlow
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch kling: review+

Description Antti Koivisto 2013-09-24 17:14:28 PDT
tighten typing
Comment 1 Antti Koivisto 2013-09-24 17:20:47 PDT
Created attachment 212525 [details]
patch
Comment 2 Andreas Kling 2013-09-24 17:31:28 PDT
Comment on attachment 212525 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=212525&action=review

r=me

> Source/WebCore/dom/Position.cpp:857
> +    for (RenderObject *o = renderer.firstChild(); o && o != stop; o = o->nextInPreOrder())

* placement

> Source/WebCore/rendering/RenderBlock.cpp:1074
> +    if (anonymousBlock->continuation() || anonymousBlock->beingDestroyed())
>          return false;

We should postpone the continuation() check if possible, since it does a hash lookup.

> Source/WebCore/rendering/RenderBlock.cpp:5956
> -    RenderObject* firstLetterBlock = findFirstLetterBlock(this);
> +    RenderElement* firstLetterBlock = findFirstLetterBlock(this);

I think we can make findFirstLetterBlock() return RenderBlock*.
Comment 3 Antti Koivisto 2013-09-24 18:00:32 PDT
https://trac.webkit.org/r156377