Bug 120402

Summary: Don't use NodeRenderingContext when attaching text renderers
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, kangil.han, kling, WebkitBugTracker
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch kling: review+

Description Antti Koivisto 2013-08-28 04:46:58 PDT
Simplify.
Comment 1 Antti Koivisto 2013-08-28 05:00:48 PDT
Created attachment 209865 [details]
patch
Comment 2 Andreas Kling 2013-08-28 05:31:49 PDT
Comment on attachment 209865 [details]
patch

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

r=me

> Source/WebCore/style/StyleResolveTree.cpp:210
> +static void crateTextRendererIfNeeded(Text* textNode)

Typo, cr_e_ate.

> Source/WebCore/style/StyleResolveTree.cpp:276
> +    RenderText* textRenderer = toRenderText(textNode->renderer());

We could add a tightly-typed override and avoid casts like this:
RenderText* Text::renderer() const;

> Source/WebCore/style/StyleResolveTree.h:56
> +void attachTextRenderer(Text*);
> +void detachTextRenderer(Text*);
> +void updateTextRendererAfterContentChange(Text*, unsigned offsetOfReplacedData, unsigned lengthOfReplacedData);

Can we make these take Text& instead? They shouldn't have to deal with null inputs.
Comment 3 Antti Koivisto 2013-08-28 06:13:02 PDT
https://trac.webkit.org/r154738