|
|
Created:
3 years, 9 months ago by Changwan Ryu Modified:
3 years, 8 months ago Reviewers:
sgurun-gerrit only, aelias_OOO_until_Jul13, tkent, Avi (use Gerrit), dcheng, foolip, yosin_UTC9 CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionWorkaround for Samsung email issues
Samsung's email works around Range.getClientRects()'s behavior to return
an empty sequence for a collapsed range, and the workaround is to insert
a non-zero space, and call Range.getClientRects(), and then remove the
non-zero space. With the changes introduced in
https://codereview.chromium.org/2687273002, now inserting a non-zero
space triggers a selectionchanged event and it causes an infinite loop,
leading to issues with scroll, caret blink, and paste.
Because it is difficult for Samsung to update their email any time soon,
we undo the above changes only for WebView by adding a runtime
flag and set it. The rationale for generalizing this to WebView is:
1) Package name checks generally don't work very well - there may be
variants for different devices or beta channels.
2) JS library developers should still be concerned about out-of-date
WebView libraries anyways.
This should be fixed for version N and above, so we
limit the workaround to Android M and below.
BUG=698752, 699943
Review-Url: https://codereview.chromium.org/2776073002
Cr-Commit-Position: refs/heads/master@{#462173}
Committed: https://chromium.googlesource.com/chromium/src/+/e54ccdb9fbd84362cba3c5858deaad215e572f5c
Patch Set 1 #Patch Set 2 : remove unnecessary logging #Patch Set 3 : fix layout tests #Patch Set 4 : s/empty/collapsed #Patch Set 5 : switched to disabling tkent@'s CL #
Total comments: 5
Patch Set 6 : remove package name check #Patch Set 7 : fixed build #
Total comments: 2
Patch Set 8 : add comment in Settings, reformatted AwSettings #Patch Set 9 : add a test #
Total comments: 2
Patch Set 10 : add a comment to web_preferences.h #Messages
Total messages: 82 (52 generated)
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
yosin@chromium.org changed reviewers: + yosin@chromium.org
%s/empty range/collapsed range/g Could you check return value of Range#getClientRects() for collapsed Range of Firefox and Edge?
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Description was changed from ========== Make getClientRects return non-null object for empty Range According to https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface Range.getClientRects() should return a sequence with an empty DOMRect even for an empty Range. The current behavior is somewhat inconsistent - it returns an empty sequence when the range is an empty text node followed by <br>, and it returns DOMRect for the container of the range when the range is empty. Samsung's Email app tries to work around this behavior by inserting a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. However, with some recent selection behavior changes, inserting and removing non-zero space triggers selectionchanged events, causing an infinite loop that ended up with scrolling and blinking issues. Although this is not a perfect solution, we can return DOMRect for the range container, we can avoid these issues. BUG=698752, 699943 ========== to ========== Make getClientRects return non-null object for collapsed Range According to https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface Range.getClientRects() should return a sequence with an empty DOMRect even for a collapsed Range. The current behavior is somewhat inconsistent: 1) it returns an empty sequence when the range is an empty text node followed by <br> 2) and it returns DOMRect for the container of the range when the range is collapsed. 3) Moreover, if you start with empty text node followed by <br>, type a character, and then delete the character, then Range.getClientRects() return a sequence having ClientRect for the textbox. Samsung's Email app tries to work around this behavior by inserting a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. However, with some recent selection behavior changes, inserting and removing non-zero space triggers selectionchanged events, causing an infinite loop that ended up with scrolling and blinking issues. Although this is not a perfect solution, we can return DOMRect for the range container, we can avoid these issues. BUG=698752, 699943 ==========
changwan@chromium.org changed reviewers: + aelias@chromium.org
PTAL
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Make getClientRects return non-null object for collapsed Range According to https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface Range.getClientRects() should return a sequence with an empty DOMRect even for a collapsed Range. The current behavior is somewhat inconsistent: 1) it returns an empty sequence when the range is an empty text node followed by <br> 2) and it returns DOMRect for the container of the range when the range is collapsed. 3) Moreover, if you start with empty text node followed by <br>, type a character, and then delete the character, then Range.getClientRects() return a sequence having ClientRect for the textbox. Samsung's Email app tries to work around this behavior by inserting a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. However, with some recent selection behavior changes, inserting and removing non-zero space triggers selectionchanged events, causing an infinite loop that ended up with scrolling and blinking issues. Although this is not a perfect solution, we can return DOMRect for the range container, we can avoid these issues. BUG=698752, 699943 ========== to ========== Make getClientRects return non-null object for collapsed Range According to https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface Range.getClientRects() should return a sequence with an empty DOMRect even for a collapsed Range. The current behavior is somewhat inconsistent: 1) it returns an empty sequence when the range is an empty text node followed by <br> 2) and it returns DOMRect for the container of the range when the range is collapsed. 3) Moreover, if you start with empty text node followed by <br>, type a character, and then delete the character, then Range.getClientRects() return a sequence having ClientRect for the textbox. Samsung's Email app tries to work around this behavior by inserting a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. However, with some recent selection behavior changes, inserting and removing non-zero space triggers selectionchanged events, causing an infinite loop that ended up with scrolling and blinking issues. Although this is not a perfect solution, we can return DOMRect for the range container, we can avoid these issues. BUG=698752, 699943, 698682 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
yosin@chromium.org changed reviewers: + foolip@chromium.org, tkent@chromium.org
Code change it self is good shape. My question is about behavior change of public API. The spec[1] is still in Editor's draft and all browsers behave differently. foolip@, tkent@, WDYT? [1] https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface
How Firefox and Edge work in this case?
On 2017/03/30 02:01:36, tkent wrote: > How Firefox and Edge work in this case? Firefox is not well testable, but seems to return an empty sequence in certain case: https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c32 Edge returns a sequence of size 1, but the ClientRect has width of 0 (with this patch chrome's result has width of that of the container) https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c35
On 2017/03/30 at 02:11:27, changwan wrote: > On 2017/03/30 02:01:36, tkent wrote: > > How Firefox and Edge work in this case? > > Firefox is not well testable, but seems to return an empty sequence in certain case: > https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c32 > > Edge returns a sequence of size 1, but the ClientRect has width of 0 (with this patch chrome's result has width of that of the container) > https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c35 Discussed with yosin@ offline. In the collapsed case, neither elements nor text nodes are selected, the specification doesn't define the behavior for such case. IMO, Edge behavior looks reasonable, and we shouldn't return a rect with non-0 width for a collapsed range.
I wanted to test this a bit and wrote https://jsbin.com/seximeb/edit?html,output The test doesn't work in Edge because it doesn't have the Range constructor, filed https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11450614/ Anyway, it looks to me like this behavior should be testable using web-platform-tests, and https://github.com/w3c/web-platform-tests/tree/master/cssom-view is the right part of the test suite. Can you write a test exercising this change in LayoutTests/external/wpt/cssom-view? We'll have to import that test suite first, will do that and paste a link to the CL here.
I've sent https://codereview.chromium.org/2782423002 but you can go ahead and just add a test at the right path in the CL and it'll be fine as long as the next import lands before this CL.
On 2017/03/30 02:37:39, tkent wrote: > On 2017/03/30 at 02:11:27, changwan wrote: > > On 2017/03/30 02:01:36, tkent wrote: > > > How Firefox and Edge work in this case? > > > > Firefox is not well testable, but seems to return an empty sequence in certain > case: > > https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c32 > > > > Edge returns a sequence of size 1, but the ClientRect has width of 0 (with > this patch chrome's result has width of that of the container) > > https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c35 > > Discussed with yosin@ offline. > > In the collapsed case, neither elements nor text nodes are selected, the > specification doesn't define the behavior for such case. > IMO, Edge behavior looks reasonable, and we shouldn't return a rect with non-0 > width for a collapsed range. Please note that I’m not trying to fix this once and for all. Rather, this is a workaround for the Samsung email app, and also this is targeting M58. But we are already returning inconsistent return values [1], so I expect that webpages won’t be affected much. BTW, it is difficult to make this return zero-width ClientRect because LayoutText has no TextBox and fixing it would require significant changes in many other places. The alternative approach is to check whether we’re in Samsung email apk and behave differently only when it’s the case. If we believe that there may a side effect, I can narrow this down to Samsung email apk with extra plumbing. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c32
On 2017/03/30 at 15:19:53, changwan wrote: > Please note that I’m not trying to fix this once and for all. Rather, this is a workaround for the Samsung email app, and also this is targeting M58. But we are already returning inconsistent return values [1], so I expect that webpages won’t be affected much. BTW, it is difficult to make this return zero-width ClientRect because LayoutText has no TextBox and fixing it would require significant changes in many other places. The alternative approach is to check whether we’re in Samsung email apk and behave differently only when it’s the case. If we believe that there may a side effect, I can narrow this down to Samsung email apk with extra plumbing. > > [1] https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c32 Even though the current situation isn't interoperable, introducing another behavior isn't acceptable at all. Disabling https://codereview.chromium.org/2687273002 can fix all of the issues, right? Can we add a runtime flag for https://codereview.chromium.org/2687273002, and apply https://bugs.chromium.org/p/chromium/issues/detail?id=698752#c18 ?
On 2017/03/31 00:16:22, tkent wrote: > On 2017/03/30 at 15:19:53, changwan wrote: > > Please note that I’m not trying to fix this once and for all. Rather, this is > a workaround for the Samsung email app, and also this is targeting M58. But we > are already returning inconsistent return values [1], so I expect that webpages > won’t be affected much. BTW, it is difficult to make this return zero-width > ClientRect because LayoutText has no TextBox and fixing it would require > significant changes in many other places. The alternative approach is to check > whether we’re in Samsung email apk and behave differently only when it’s the > case. If we believe that there may a side effect, I can narrow this down to > Samsung email apk with extra plumbing. > > > > [1] https://bugs.chromium.org/p/chromium/issues/detail?id=698752&desc=2#c32 > > Even though the current situation isn't interoperable, introducing another > behavior isn't acceptable at all. > > Disabling https://codereview.chromium.org/2687273002 can fix all of the issues, > right? > Can we add a runtime flag for https://codereview.chromium.org/2687273002, and > apply https://bugs.chromium.org/p/chromium/issues/detail?id=698752#c18 ? Thanks for the clear answer on this. Let me look into what you suggested and get back to you soon.
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Description was changed from ========== Make getClientRects return non-null object for collapsed Range According to https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface Range.getClientRects() should return a sequence with an empty DOMRect even for a collapsed Range. The current behavior is somewhat inconsistent: 1) it returns an empty sequence when the range is an empty text node followed by <br> 2) and it returns DOMRect for the container of the range when the range is collapsed. 3) Moreover, if you start with empty text node followed by <br>, type a character, and then delete the character, then Range.getClientRects() return a sequence having ClientRect for the textbox. Samsung's Email app tries to work around this behavior by inserting a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. However, with some recent selection behavior changes, inserting and removing non-zero space triggers selectionchanged events, causing an infinite loop that ended up with scrolling and blinking issues. Although this is not a perfect solution, we can return DOMRect for the range container, we can avoid these issues. BUG=698752, 699943, 698682 ========== to ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for Samsung's email by adding a runtime flag and set it. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943, 698682 ==========
changwan@chromium.org changed reviewers: + aelias@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
changwan@chromium.org changed reviewers: + sgurun@chromium.org
tkent@ / sgurun@, could you take a look? Also adding aelias@ as he suggested https://bugs.chromium.org/p/chromium/issues/detail?id=698752#c18
https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:180: && mAppTargetSdkVersion <= Build.VERSION_CODES.M; Why M and below? I would've expected N and below. Some Samsung devices have already shipped N (some variants of Galaxy S7), have you checked this issue does not repro on them?
https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:180: && mAppTargetSdkVersion <= Build.VERSION_CODES.M; On 2017/03/31 23:25:41, aelias wrote: > Why M and below? I would've expected N and below. Some Samsung devices have > already shipped N (some variants of Galaxy S7), have you checked this issue does > not repro on them? Sorry I wasn't super clear about this. Samsung's initial test result indicates that this does not happen on Android N. But I'll confirm with them.
https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:177: final String samsungEmailPackageId = "com.samsung.android.email.provider"; I don't think an APK name check is called for here. Name-checks can cause mysterious problems (e.g. beta channel or derivative fork behaving different from main one) so I think they're only appropriate for particularly unsafe/crazy hacks. Since this is just restoring the previous behavior that we shipped before, I think it's cleaner to make it global all WebView with low enough targetSdkVersion. We can see that as a slower, safer way of rolling out this breaking change. https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:180: && mAppTargetSdkVersion <= Build.VERSION_CODES.M; On 2017/03/31 at 23:28:10, Changwan Ryu wrote: > On 2017/03/31 23:25:41, aelias wrote: > > Why M and below? I would've expected N and below. Some Samsung devices have > > already shipped N (some variants of Galaxy S7), have you checked this issue does > > not repro on them? > > Sorry I wasn't super clear about this. Samsung's initial test result indicates that this does not happen on Android N. But I'll confirm with them. OK sounds good. Targeting M is somewhat better if we can get away with it.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for Samsung's email by adding a runtime flag and set it. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943, 698682 ========== to ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for WebView by adding a runtime flag and set it. The rationale for generalizing this to WebView is: 1) Package name checks generally don't work very well - there may be variants for different devices or beta channels. 2) JS library developers should still be concerned about out-of-date WebView libraries anyways. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943, 698682 ==========
https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2776073002/diff/80001/android_webview/glue/ja... android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:177: final String samsungEmailPackageId = "com.samsung.android.email.provider"; On 2017/03/31 23:40:21, aelias wrote: > I don't think an APK name check is called for here. Name-checks can cause > mysterious problems (e.g. beta channel or derivative fork behaving different > from main one) so I think they're only appropriate for particularly unsafe/crazy > hacks. Since this is just restoring the previous behavior that we shipped > before, I think it's cleaner to make it global all WebView with low enough > targetSdkVersion. We can see that as a slower, safer way of rolling out this > breaking change. Done. Also checking with Samsung about the package name variants.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
third_party/WebKit lgtm. https://codereview.chromium.org/2776073002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/frame/Settings.json5 (right): https://codereview.chromium.org/2776073002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/core/frame/Settings.json5:929: // Whether we should not update selection attributes when mutating selection range. We should have a comment that we should remove the flag when we drop support of Android M(?) or older.
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2776073002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/frame/Settings.json5 (right): https://codereview.chromium.org/2776073002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/core/frame/Settings.json5:929: // Whether we should not update selection attributes when mutating selection range. On 2017/04/03 02:01:16, tkent wrote: > We should have a comment that we should remove the flag when we drop support of > Android M(?) or older. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
aelias@chromium.org changed reviewers: + avi@chromium.org
aelias@chromium.org changed reviewers: - avi@chromium.org
lgtm, adding avi@ for trivial settings change in content/common/public/
it is not super clear in the thread: Is it fixed on N because Samsung changed their app? Now we are introducing two paths, one for older devices < M and one for newer devices. Are there test coverage for both?
it is not super clear in the thread: Is it fixed on N because Samsung changed their app? Now we are introducing two paths, one for older devices < M and one for newer devices. Are there test coverage for both?
The CQ bit was checked by changwan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/04/04 15:07:25, sgurun wrote: > it is not super clear in the thread: Is it fixed on N because Samsung changed > their app? > > Now we are introducing two paths, one for older devices < M and one for newer > devices. Are there test coverage for both? Samsung confirmed that it is fixed on N: please check b/36460657 . I just added AwSettingsTest to cover the two paths.
Description was changed from ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for WebView by adding a runtime flag and set it. The rationale for generalizing this to WebView is: 1) Package name checks generally don't work very well - there may be variants for different devices or beta channels. 2) JS library developers should still be concerned about out-of-date WebView libraries anyways. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943, 698682 ========== to ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for WebView by adding a runtime flag and set it. The rationale for generalizing this to WebView is: 1) Package name checks generally don't work very well - there may be variants for different devices or beta channels. 2) JS library developers should still be concerned about out-of-date WebView libraries anyways. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
changwan@chromium.org changed reviewers: + avi@chromium.org
avi@chromium.org: could you take a look at content/public?
changwan@chromium.org changed reviewers: + dcheng@chromium.org
dcheng@, could you take a look at content/public/common/common_param_traits_macros.h ?
lgtm with issue addressed. https://codereview.chromium.org/2776073002/diff/160001/content/public/common/... File content/public/common/web_preferences.h (right): https://codereview.chromium.org/2776073002/diff/160001/content/public/common/... content/public/common/web_preferences.h:290: bool do_not_update_selection_on_mutating_selection_range; Needs a comment explaining what this does, why this is here, and when we're removing it. (We are eventually removing this, yes? Do we work around Samsung forever?)
ipc lgtm i'm sad to see we're adding another webview specific setting though--do we have some way of tracking these and eventually removing obsolete WebSettings?
dcheng@: this type of webview-specific workarounds are clustered in WebViewChromium.java, and should be removed altogether once Build.VERSION_CODES.N becomes meaningless in our code. (I know, it's quite unfortunate to have these in the first place...) https://codereview.chromium.org/2776073002/diff/160001/content/public/common/... File content/public/common/web_preferences.h (right): https://codereview.chromium.org/2776073002/diff/160001/content/public/common/... content/public/common/web_preferences.h:290: bool do_not_update_selection_on_mutating_selection_range; On 2017/04/05 14:30:01, Avi (slow and ooo 10-23 April) wrote: > Needs a comment explaining what this does, why this is here, and when we're > removing it. (We are eventually removing this, yes? Do we work around Samsung > forever?) Done.
The CQ bit was checked by changwan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tkent@chromium.org, aelias@chromium.org, sgurun@chromium.org, avi@chromium.org, dcheng@chromium.org Link to the patchset: https://codereview.chromium.org/2776073002/#ps180001 (title: "add a comment to web_preferences.h")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 180001, "attempt_start_ts": 1491413455584490, "parent_rev": "3d0402e4e0c59f228bedb8e20a62de48a8267a6f", "commit_rev": "e54ccdb9fbd84362cba3c5858deaad215e572f5c"}
Message was sent while issue was closed.
Description was changed from ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for WebView by adding a runtime flag and set it. The rationale for generalizing this to WebView is: 1) Package name checks generally don't work very well - there may be variants for different devices or beta channels. 2) JS library developers should still be concerned about out-of-date WebView libraries anyways. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943 ========== to ========== Workaround for Samsung email issues Samsung's email works around Range.getClientRects()'s behavior to return an empty sequence for a collapsed range, and the workaround is to insert a non-zero space, and call Range.getClientRects(), and then remove the non-zero space. With the changes introduced in https://codereview.chromium.org/2687273002, now inserting a non-zero space triggers a selectionchanged event and it causes an infinite loop, leading to issues with scroll, caret blink, and paste. Because it is difficult for Samsung to update their email any time soon, we undo the above changes only for WebView by adding a runtime flag and set it. The rationale for generalizing this to WebView is: 1) Package name checks generally don't work very well - there may be variants for different devices or beta channels. 2) JS library developers should still be concerned about out-of-date WebView libraries anyways. This should be fixed for version N and above, so we limit the workaround to Android M and below. BUG=698752, 699943 Review-Url: https://codereview.chromium.org/2776073002 Cr-Commit-Position: refs/heads/master@{#462173} Committed: https://chromium.googlesource.com/chromium/src/+/e54ccdb9fbd84362cba3c5858dea... ==========
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/e54ccdb9fbd84362cba3c5858dea... |