| Summary: | HTMLTextFormControlElement::setSelectionRange shouldn't use VisiblePosition | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
| Component: | Forms | Assignee: | Ryosuke Niwa <rniwa> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ap, barraclough, darin, enrica, sam | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 127832 | ||||||
| Attachments: |
|
||||||
|
Description
Ryosuke Niwa
2014-02-08 15:35:50 PST
Created attachment 223594 [details]
Cleanup
Comment on attachment 223594 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=223594&action=review > Source/WebCore/html/HTMLTextFormControlElement.cpp:55 > +static Position positionForIndex(TextControlInnerTextElement*, unsigned); I suggest taking a reference here rather than a pointer. > Source/WebCore/html/HTMLTextFormControlElement.cpp:324 > int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& pos) const Why not rename pos to position while you are changing this entire function? > Source/WebCore/html/HTMLTextFormControlElement.cpp:569 > + Text* text = toText(node); This should be: Text& text = toText(*node); Because we know node is non-null. Committed r163825: <http://trac.webkit.org/changeset/163825> Oops, I somehow missed these review comments. Fixed them in http://trac.webkit.org/changeset/163846 (In reply to comment #2) > (From update of attachment 223594 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=223594&action=review > > > Source/WebCore/html/HTMLTextFormControlElement.cpp:55 > > +static Position positionForIndex(TextControlInnerTextElement*, unsigned); > > I suggest taking a reference here rather than a pointer. Unfortunately the pointer could be null in all 3 call sites :( > > Source/WebCore/html/HTMLTextFormControlElement.cpp:324 > > int HTMLTextFormControlElement::indexForVisiblePosition(const VisiblePosition& pos) const > > Why not rename pos to position while you are changing this entire function? Done. > > Source/WebCore/html/HTMLTextFormControlElement.cpp:569 > > + Text* text = toText(node); > > This should be: > > Text& text = toText(*node); > > Because we know node is non-null. Done. |