WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
209966
REGRESSION(
r259401
): [GTK] Check surroundingRange is not null
https://bugs.webkit.org/show_bug.cgi?id=209966
Summary
REGRESSION(r259401): [GTK] Check surroundingRange is not null
Diego Pino
Reported
2020-04-03 08:19:57 PDT
REGRESSION(
r259401
): [GTK] Check surroundingRange is not null
Attachments
Patch
(2.14 KB, patch)
2020-04-03 08:20 PDT
,
Diego Pino
no flags
Details
Formatted Diff
Diff
Patch
(2.12 KB, patch)
2020-04-03 09:00 PDT
,
Diego Pino
no flags
Details
Formatted Diff
Diff
Patch
(1.69 KB, patch)
2020-04-03 09:17 PDT
,
Diego Pino
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Diego Pino
Comment 1
2020-04-03 08:20:29 PDT
Created
attachment 395377
[details]
Patch
Philippe Normand
Comment 2
2020-04-03 08:34:21 PDT
Comment on
attachment 395377
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=395377&action=review
> Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:116 > + if (surroundingRange != nullptr)
We usually don't do explicit checks like this. Can you remove the `!= nullptr` part?
> Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:121 > + if (surroundingRange != nullptr)
Ditto
Diego Pino
Comment 3
2020-04-03 09:00:51 PDT
Created
attachment 395382
[details]
Patch
Darin Adler
Comment 4
2020-04-03 09:04:39 PDT
Comment on
attachment 395382
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=395382&action=review
> Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:117 > surroundingRange->setEnd(compositionRange->startPosition()); > clonedRange->setStart(compositionRange->endPosition()); > - postLayoutData.surroundingContext = plainText(*surroundingRange) + plainText(clonedRange); > + if (surroundingRange) > + postLayoutData.surroundingContext = plainText(*surroundingRange) + plainText(clonedRange);
This change isn’t needed. As you can see, surroundingRange is already used above and so it can’t be null by the time it gets here.
> Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:122 > - postLayoutData.surroundingContext = plainText(*surroundingRange); > + if (surroundingRange) > + postLayoutData.surroundingContext = plainText(*surroundingRange);
This change looks OK. Sorry for missing it. To preserve historical behavior, could instead write: postLayoutData.surroundingContext = surroundingRange ? plainText(*surroundingRange) : emptyString(); The old code set the string to empty string, rather than leaving it with its previous value.
Diego Pino
Comment 5
2020-04-03 09:17:05 PDT
Created
attachment 395383
[details]
Patch
EWS
Comment 6
2020-04-03 09:54:17 PDT
Committed
r259468
: <
https://trac.webkit.org/changeset/259468
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 395383
[details]
.
Radar WebKit Bug Importer
Comment 7
2020-04-03 09:55:14 PDT
<
rdar://problem/61263510
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug