REOPENED 205706
Enable the offset assertion in HTMLTextFormControlElement::indexForPosition
https://bugs.webkit.org/show_bug.cgi?id=205706
Summary Enable the offset assertion in HTMLTextFormControlElement::indexForPosition
Mark Lam
Reported 2020-01-02 19:16:38 PST
The assertion was guarded by a #ifndef ASSERT_DISABLED. ASSERT_DISABLED is always defined, either as 0 or 1. Hence, this assertion code is never ever built. Changing the #ifndef ASSERT_DISABLED to #if !ASSERT_DISABLED results in a build error. We should either fix this assertion, or remove it.
Attachments
proposed patch. (2.05 KB, patch)
2020-01-02 19:20 PST, Mark Lam
no flags
Enables the assertion (21.53 KB, patch)
2020-01-13 22:42 PST, Ryosuke Niwa
no flags
Fixed GTK+ builds (23.63 KB, patch)
2020-01-13 23:01 PST, Ryosuke Niwa
no flags
Updated (23.63 KB, patch)
2020-01-13 23:21 PST, Ryosuke Niwa
no flags
Patch for landing (23.90 KB, patch)
2020-01-14 19:34 PST, Ryosuke Niwa
no flags
Patch for landing (24.71 KB, patch)
2020-01-14 21:15 PST, Ryosuke Niwa
no flags
Mark Lam
Comment 1 2020-01-02 19:20:14 PST
Created attachment 386653 [details] proposed patch.
Darin Adler
Comment 2 2020-01-03 19:43:35 PST
Comment on attachment 386653 [details] proposed patch. I think this was valuable assertion code; too bad it was left turned off. I understand the code didn’t compile when enabled, but it shouldn’t be too hard to fix. I think it’s likely worth fixing rather than deleting.
Mark Lam
Comment 3 2020-01-03 19:50:04 PST
Comment on attachment 386653 [details] proposed patch. Let's fix the assertion instead of deleting it as Darin requested.
Darin Adler
Comment 4 2020-01-03 19:51:00 PST
By the way, there's a chance that when we turn on the assertion we'll see failures, which will mean we'll have to turn it back off again until someone can investigate!
Ryosuke Niwa
Comment 5 2020-01-13 22:42:02 PST
Created attachment 387618 [details] Enables the assertion
Ryosuke Niwa
Comment 6 2020-01-13 23:01:31 PST
Created attachment 387621 [details] Fixed GTK+ builds
Mark Lam
Comment 7 2020-01-13 23:04:21 PST
Comment on attachment 387621 [details] Fixed GTK+ builds View in context: https://bugs.webkit.org/attachment.cgi?id=387621&action=review > Source/WebCore/html/HTMLTextFormControlElement.cpp:647 > // https://bugs.webkit.org/show_bug.cgi?id=205706. Please remove the above FIXME and bug url comment now that you’re fixing it.
Ryosuke Niwa
Comment 8 2020-01-13 23:09:27 PST
(In reply to Mark Lam from comment #7) > Comment on attachment 387621 [details] > Fixed GTK+ builds > > View in context: > https://bugs.webkit.org/attachment.cgi?id=387621&action=review > > > Source/WebCore/html/HTMLTextFormControlElement.cpp:647 > > // https://bugs.webkit.org/show_bug.cgi?id=205706. > > Please remove the above FIXME and bug url comment now that you’re fixing it. Oh oops, removed that.
Ryosuke Niwa
Comment 9 2020-01-13 23:21:58 PST
Darin Adler
Comment 10 2020-01-14 09:07:37 PST
Comment on attachment 387625 [details] Updated View in context: https://bugs.webkit.org/attachment.cgi?id=387625&action=review > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2035 > + return WebCore::indexForVisiblePosition(*node, position, { TextIteratorLegnthOption::GenerateSpacesForReplacedElements }); Typo here: "legnth". > Source/WebCore/editing/TextIteratorBehavior.h:64 > typedef unsigned short TextIteratorBehavior; Should move this one to OptionSet too later, right?
Ryosuke Niwa
Comment 11 2020-01-14 19:34:03 PST
Created attachment 387747 [details] Patch for landing
Ryosuke Niwa
Comment 12 2020-01-14 19:34:28 PST
Comment on attachment 387747 [details] Patch for landing Wait for EWS.
Ryosuke Niwa
Comment 13 2020-01-14 21:07:21 PST
(In reply to Darin Adler from comment #10) > Comment on attachment 387625 [details] > Updated > > View in context: > https://bugs.webkit.org/attachment.cgi?id=387625&action=review > > > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2035 > > + return WebCore::indexForVisiblePosition(*node, position, { TextIteratorLegnthOption::GenerateSpacesForReplacedElements }); > > Typo here: "legnth". Fixed. > > Source/WebCore/editing/TextIteratorBehavior.h:64 > > typedef unsigned short TextIteratorBehavior; > > Should move this one to OptionSet too later, right? Yes, but in a separate patch.
Ryosuke Niwa
Comment 14 2020-01-14 21:15:50 PST
Created attachment 387751 [details] Patch for landing
Ryosuke Niwa
Comment 15 2020-01-14 21:16:07 PST
Comment on attachment 387751 [details] Patch for landing Wait for EWS again.
Ryosuke Niwa
Comment 16 2020-01-14 21:57:41 PST
Radar WebKit Bug Importer
Comment 17 2020-01-14 21:58:13 PST
WebKit Commit Bot
Comment 18 2020-02-13 15:17:21 PST
Re-opened since this is blocked by bug 207725
Note You need to log in before you can comment on or make changes to this bug.