Bug 122694 - Factor line box code from RenderText to a class
Summary: Factor line box code from RenderText to a class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-12 10:00 PDT by Antti Koivisto
Modified: 2013-10-12 10:54 PDT (History)
7 users (show)

See Also:


Attachments
patch (26.80 KB, patch)
2013-10-12 10:13 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-10-12 10:00:48 PDT
This code can be factored out.
Comment 1 Antti Koivisto 2013-10-12 10:13:07 PDT
Created attachment 214057 [details]
patch
Comment 2 Andreas Kling 2013-10-12 10:23:33 PDT
Comment on attachment 214057 [details]
patch

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

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:43
> +        m_first = m_last = textBox;

We should do this on two lines.

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:59
> +        m_first = 0;

nullptr

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:114
> +    m_first = m_last = 0;

nullptr
Also, we should do this on two lines.

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:117
> +InlineTextBox* RenderTextLineBoxes::findNext(int offset, int& pos) const

Crappy name: pos.

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:120
> +        return 0;

nullptr

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:129
> +    pos = (offset > currentOffset ? current->len() : current->len() - (currentOffset - offset) );

Extra space before last ')'

> Source/WebCore/rendering/RenderTextLineBoxes.cpp:143
> +    const InlineTextBox* prev = 0;

nullptr

> Source/WebCore/rendering/RenderTextLineBoxes.h:45
> +    void extract(InlineTextBox*);
> +    void attach(InlineTextBox*);
> +    void remove(InlineTextBox*);

Seems like these should really take references. Maybe in a later patch?
Comment 3 Antti Koivisto 2013-10-12 10:54:08 PDT
http://trac.webkit.org/changeset/157340