Bug 120402 - Don't use NodeRenderingContext when attaching text renderers
Summary: Don't use NodeRenderingContext when attaching text renderers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-28 04:46 PDT by Antti Koivisto
Modified: 2013-08-28 06:13 PDT (History)
5 users (show)

See Also:


Attachments
patch (26.37 KB, patch)
2013-08-28 05:00 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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