Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Issue 357603003: Add functions searching a word boundary without VisualPosition to HTMLTextFormControlElement. (Closed)

Created:
6 years, 6 months ago by yoichio
Modified:
6 years, 5 months ago
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Add functions searching a word boundary without VisualPosition to HTMLTextFormControlElement. SpellChecker::respondToChangeClient is called by FrameSelection::SetSelection. We use VisiblePosition to find word and sentence boundaries and it cause synchronous layout. However we implement text field as a shadow element including only div and text nodes. It means we can find a word boundaries in a text field without VisiblePosition. This CL introduce new Position functions, HTMLTextFormControlElement::startOfWord, endOfWord, startOfSentence and endOfSentence. They doesn't cause synchronous layout and will be used from SpellChecher::respondToChangeClient to avoid synchronous layout. Following is an implementation detail. Source/core/html/HTMLTextFormControlElement.cpp/h: - We introduce new Position functions, startOfWord, endOfWord, startOfSentence and EndOfSentence. - They doesn't cause synchronous layout and be used from SpellChecher. - Each of them works same as a corresponding 'Visible' function in VisibleUnit except they can be used to only text fields implemented as TextFormControlElement. Source/core/html/HTMLTextFormControlElementTest.cpp: - To confirm those 4 functions, we introduce the HTMLTextFormControlElementTest::WordAndSentenceBoundary test. - It confirms each of them returns a same Position to a corresponding 'Visible' function in VisibleUnit on each Selection in a text field. Source/core/rendering/RenderTreeAsText.cpp/h: - We change visibility of the nodePosition function to debug DOM tree easily. - The function is used in HTMLTextFormControlElementTest::WordAndSentenceBoundary test. TEST=webkit_unit_tests --gtest_filter=*TextForm* BUG=382809 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177636

Patch Set 1 : Fix compile errors #

Patch Set 2 : Update #

Total comments: 3

Patch Set 3 : Remove the SpellChecker change #

Total comments: 12

Patch Set 4 : Fix nits #

Total comments: 4

Patch Set 5 : Fix nits #

Total comments: 38

Patch Set 6 : Update #

Total comments: 12

Patch Set 7 : Use StringBuilder #

Total comments: 8

Patch Set 8 : Change test cases. #

Total comments: 8

Patch Set 9 : Add comments #

Total comments: 2

Patch Set 10 : Wrap comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -10 lines) Patch
M Source/core/html/HTMLTextFormControlElement.h View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElement.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +241 lines, -0 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElementTest.cpp View 1 2 3 4 5 6 7 3 chunks +86 lines, -4 lines 0 comments Download
M Source/core/rendering/RenderTreeAsText.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M Source/core/rendering/RenderTreeAsText.cpp View 1 2 3 4 5 2 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
yoichio
6 years, 5 months ago (2014-07-02 08:32:08 UTC) #1
yosin_UTC9
I think it is better to create plaint text version of {start,end}Of{Word,Sentence} rather than handling ...
6 years, 5 months ago (2014-07-02 09:44:03 UTC) #2
yosin_UTC9
You can split this patch further, one for {start,end}Of{Word,Sentence} and another for integrating into spell ...
6 years, 5 months ago (2014-07-02 09:45:54 UTC) #3
yoichio
Split out the SpellChecker change. On 2014/07/02 09:44:03, Yosi_UTC9 wrote: > I think it is ...
6 years, 5 months ago (2014-07-03 02:13:23 UTC) #4
yoichio
kent-san, do you know why text field consists of text node and div element? why ...
6 years, 5 months ago (2014-07-03 02:17:37 UTC) #5
yosin_UTC9
On 2014/07/03 02:17:37, yoichio wrote: > kent-san, do you know why text field consists of ...
6 years, 5 months ago (2014-07-03 02:24:37 UTC) #6
yosin_UTC9
https://codereview.chromium.org/357603003/diff/180001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/180001/Source/core/html/HTMLTextFormControlElement.cpp#newcode699 Source/core/html/HTMLTextFormControlElement.cpp:699: static Position findWordBoundary(const HTMLElement* innerText, const Position& startPosition, const ...
6 years, 5 months ago (2014-07-03 04:05:10 UTC) #7
yoichio
https://codereview.chromium.org/357603003/diff/180001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/180001/Source/core/html/HTMLTextFormControlElement.cpp#newcode699 Source/core/html/HTMLTextFormControlElement.cpp:699: static Position findWordBoundary(const HTMLElement* innerText, const Position& startPosition, const ...
6 years, 5 months ago (2014-07-03 04:32:19 UTC) #8
yosin_UTC9
LGTM with tiny nit. https://codereview.chromium.org/357603003/diff/200001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/200001/Source/core/html/HTMLTextFormControlElement.cpp#newcode675 Source/core/html/HTMLTextFormControlElement.cpp:675: { nit: We don't need ...
6 years, 5 months ago (2014-07-03 05:17:07 UTC) #9
yoichio
https://codereview.chromium.org/357603003/diff/200001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/200001/Source/core/html/HTMLTextFormControlElement.cpp#newcode675 Source/core/html/HTMLTextFormControlElement.cpp:675: { On 2014/07/03 05:17:07, Yosi_UTC9 wrote: > nit: We ...
6 years, 5 months ago (2014-07-03 05:31:41 UTC) #10
Yuta Kitamura
Ran out of time. Let me publish the comments for the part I have looked ...
6 years, 5 months ago (2014-07-03 08:39:27 UTC) #11
yoichio
https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp#newcode666 Source/core/html/HTMLTextFormControlElement.cpp:666: HTMLElement* element = toHTMLElement(innerPosition.anchorNode()); On 2014/07/03 08:39:27, Yuta Kitamura ...
6 years, 5 months ago (2014-07-04 01:29:45 UTC) #12
Yuta Kitamura
https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp#newcode680 Source/core/html/HTMLTextFormControlElement.cpp:680: default: On 2014/07/04 01:29:43, yoichio wrote: > In our ...
6 years, 5 months ago (2014-07-04 05:23:34 UTC) #13
yoichio
https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp#newcode680 Source/core/html/HTMLTextFormControlElement.cpp:680: default: On 2014/07/04 05:23:34, Yuta Kitamura wrote: > On ...
6 years, 5 months ago (2014-07-04 05:44:41 UTC) #14
Yuta Kitamura
I'm kinda hesitant to put such a fat editing-specific functionality into html/ classes... https://codereview.chromium.org/357603003/diff/220001/Source/core/html/HTMLTextFormControlElement.cpp File ...
6 years, 5 months ago (2014-07-04 06:12:35 UTC) #15
yosin_UTC9
https://codereview.chromium.org/357603003/diff/260001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/260001/Source/core/html/HTMLTextFormControlElement.cpp#newcode804 Source/core/html/HTMLTextFormControlElement.cpp:804: Text* textNode = toText(prev); nit: Could you remove |textNode| ...
6 years, 5 months ago (2014-07-04 06:14:50 UTC) #16
yoichio
yutak@, you might have seen a previous patch set and commented. https://codereview.chromium.org/357603003/diff/240001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): ...
6 years, 5 months ago (2014-07-04 07:25:27 UTC) #17
yoichio
yutak@ is gardening in this week. tkent@, could you review as OWNER? Thanks.
6 years, 5 months ago (2014-07-07 08:29:36 UTC) #18
tkent
https://codereview.chromium.org/357603003/diff/280001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/280001/Source/core/html/HTMLTextFormControlElement.cpp#newcode713 Source/core/html/HTMLTextFormControlElement.cpp:713: // Trace text nodes. nit: We don't use the ...
6 years, 5 months ago (2014-07-07 23:54:18 UTC) #19
yoichio
https://codereview.chromium.org/357603003/diff/280001/Source/core/html/HTMLTextFormControlElement.cpp File Source/core/html/HTMLTextFormControlElement.cpp (right): https://codereview.chromium.org/357603003/diff/280001/Source/core/html/HTMLTextFormControlElement.cpp#newcode713 Source/core/html/HTMLTextFormControlElement.cpp:713: // Trace text nodes. On 2014/07/07 23:54:18, tkent wrote: ...
6 years, 5 months ago (2014-07-08 01:46:13 UTC) #20
tkent
lgtm. Please wrap long lines in the CL description in 80 columns. https://codereview.chromium.org/357603003/diff/300001/Source/core/html/HTMLTextFormControlElement.h File Source/core/html/HTMLTextFormControlElement.h ...
6 years, 5 months ago (2014-07-08 01:50:10 UTC) #21
yoichio
The CQ bit was checked by yoichio@chromium.org
6 years, 5 months ago (2014-07-08 02:29:12 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoichio@chromium.org/357603003/320001
6 years, 5 months ago (2014-07-08 02:30:19 UTC) #23
yoichio
https://codereview.chromium.org/357603003/diff/300001/Source/core/html/HTMLTextFormControlElement.h File Source/core/html/HTMLTextFormControlElement.h (right): https://codereview.chromium.org/357603003/diff/300001/Source/core/html/HTMLTextFormControlElement.h#newcode90 Source/core/html/HTMLTextFormControlElement.h:90: // These functions doesn't cause synchronous layout and will ...
6 years, 5 months ago (2014-07-08 02:31:23 UTC) #24
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_blink_rel on tryserver.blink ...
6 years, 5 months ago (2014-07-08 03:29:22 UTC) #25
commit-bot: I haz the power
6 years, 5 months ago (2014-07-08 03:59:39 UTC) #26
Message was sent while issue was closed.
Change committed as 177636

Powered by Google App Engine
This is Rietveld 408576698