Bug 156467 - Unify selectionStartEnd() methods.
Summary: Unify selectionStartEnd() methods.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2016-04-11 10:41 PDT by zalan
Modified: 2016-04-11 10:41 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2016-04-11 10:41:18 PDT
see https://bugs.webkit.org/show_bug.cgi?id=156448#c5

> Source/WebCore/rendering/InlineTextBox.cpp:607
> +    renderer().selectionStartEnd(selectionStart, selectionEnd);
Peculiar that this uses two out arguments and doesn’t even have get in its name. Should fix that.
> Source/WebCore/rendering/InlineTextBox.h:123
> +    std::pair<int, int> selectionStartEnd() const;
In other cases like this we sometimes use structures with names for the members rather than using a tuple. Sure would be nice to get rid of some those pairs of local variables and arguments using the same structure.

void SelectionSubtreeRoot::selectionStartEndPositions(int& startPos, int& endPos) const
void RenderObject::selectionStartEnd(int& spos, int& epos) const
std::pair<int, int> InlineTextBox::selectionStartEnd() const