Bug 196670 - [iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
Summary: [iOS] Moving backwards by word granularity does not work if the previous line...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-05 22:52 PDT by Ryosuke Niwa
Modified: 2019-04-11 15:57 PDT (History)
6 users (show)

See Also:


Attachments
Fixes the bug (14.14 KB, patch)
2019-04-05 23:07 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixes the bug (13.41 KB, patch)
2019-04-05 23:08 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-highsierra (2.51 MB, application/zip)
2019-04-06 00:13 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-highsierra-wk2 (2.71 MB, application/zip)
2019-04-06 00:27 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews116 for mac-highsierra (2.36 MB, application/zip)
2019-04-06 00:55 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.56 MB, application/zip)
2019-04-06 01:02 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews206 for win-future (12.94 MB, application/zip)
2019-04-06 01:21 PDT, Build Bot
no flags Details
WIP (13.61 KB, patch)
2019-04-08 23:48 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixes the bug (30.43 KB, patch)
2019-04-09 16:58 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Added ForTesting suffix to plainTextUsingBackwardsTextIterator (30.45 KB, patch)
2019-04-10 22:25 PDT, Ryosuke Niwa
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2019-04-05 22:52:56 PDT
With the following markup, iOS WebKit fails to move backwards from the beginning of the second line by word granularity:

<div>first</div>
<div>second</div>

<rdar://problem/46880663>
Comment 1 Ryosuke Niwa 2019-04-05 23:07:36 PDT
Created attachment 366875 [details]
Fixes the bug
Comment 2 Ryosuke Niwa 2019-04-05 23:08:32 PDT
Created attachment 366876 [details]
Fixes the bug
Comment 3 Build Bot 2019-04-06 00:13:19 PDT
Comment on attachment 366876 [details]
Fixes the bug

Attachment 366876 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/11788918

New failing tests:
editing/text-iterator/backwards-text-iterator-basic.html
fast/dom/Range/range-expand.html
accessibility/mac/text-marker-sentence-nav.html
Comment 4 Build Bot 2019-04-06 00:13:20 PDT
Created attachment 366878 [details]
Archive of layout-test-results from ews103 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 5 Build Bot 2019-04-06 00:27:40 PDT
Comment on attachment 366876 [details]
Fixes the bug

Attachment 366876 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11788930

New failing tests:
editing/text-iterator/backwards-text-iterator-basic.html
accessibility/mac/text-marker-sentence-nav.html
fast/dom/Range/range-expand.html
Comment 6 Build Bot 2019-04-06 00:27:41 PDT
Created attachment 366879 [details]
Archive of layout-test-results from ews104 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 7 Build Bot 2019-04-06 00:55:14 PDT
Comment on attachment 366876 [details]
Fixes the bug

Attachment 366876 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11789034

New failing tests:
editing/text-iterator/backwards-text-iterator-basic.html
fast/dom/Range/range-expand.html
accessibility/mac/text-marker-sentence-nav.html
Comment 8 Build Bot 2019-04-06 00:55:16 PDT
Created attachment 366880 [details]
Archive of layout-test-results from ews116 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 9 Build Bot 2019-04-06 01:02:45 PDT
Comment on attachment 366876 [details]
Fixes the bug

Attachment 366876 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/11789045

New failing tests:
editing/text-iterator/backwards-text-iterator-basic.html
Comment 10 Build Bot 2019-04-06 01:02:47 PDT
Created attachment 366881 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 11 Build Bot 2019-04-06 01:21:10 PDT
Comment on attachment 366876 [details]
Fixes the bug

Attachment 366876 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/11789177

New failing tests:
fast/dom/Range/range-expand.html
Comment 12 Build Bot 2019-04-06 01:21:22 PDT
Created attachment 366882 [details]
Archive of layout-test-results from ews206 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews206  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 13 Ryosuke Niwa 2019-04-08 23:48:03 PDT
Created attachment 367030 [details]
WIP

The previous patch revealed a bug in startOfSentence. When I fix that, AXObjectCache::previousBoundary in turn reveals another bug about the way we're failing to take care of suffixLength affecting the text index within a text node.

So I'd have to fix 3-4 unrelated bugs that used to cancel one another before this patch at once :(
Comment 14 Ryosuke Niwa 2019-04-09 16:58:42 PDT
Created attachment 367084 [details]
Fixes the bug
Comment 15 Alexey Proskuryakov 2019-04-09 17:35:15 PDT
Comment on attachment 367084 [details]
Fixes the bug

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

> Source/WebCore/editing/TextIterator.h:53
> +// For testing.
> +WEBCORE_EXPORT String plainTextUsingBackwardsTextIterator(const Range&);

I didn't look at the rest of the patch, but this caught my eye. Why not add "ForTesting" to the function name?
Comment 16 Ryosuke Niwa 2019-04-09 19:10:48 PDT
(In reply to Alexey Proskuryakov from comment #15)
> Comment on attachment 367084 [details]
> Fixes the bug
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=367084&action=review
> 
> > Source/WebCore/editing/TextIterator.h:53
> > +// For testing.
> > +WEBCORE_EXPORT String plainTextUsingBackwardsTextIterator(const Range&);
> 
> I didn't look at the rest of the patch, but this caught my eye. Why not add
> "ForTesting" to the function name?

Sure, I can add that suffix.
Comment 17 Ryosuke Niwa 2019-04-10 22:25:07 PDT
Created attachment 367203 [details]
Added ForTesting suffix to plainTextUsingBackwardsTextIterator
Comment 18 Wenson Hsieh 2019-04-11 12:42:28 PDT
Comment on attachment 367203 [details]
Added ForTesting suffix to plainTextUsingBackwardsTextIterator

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

> Source/WebCore/ChangeLog:17
> +        make SimplifiedBackwardsTextIterator directly testable in layout tests.

Nit - s/make/to make/
Comment 19 Ryosuke Niwa 2019-04-11 15:57:04 PDT
Committed r244200: <https://trac.webkit.org/changeset/244200>