[webkit-reviews] review granted: [Bug 213746] [iOS 14] A couple of tests in editing/selection/ios fail after <rdar://problem/60978283> : [Attachment 403116] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jun 29 15:12:33 PDT 2020
Devin Rousso <drousso at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 213746: [iOS 14] A couple of tests in editing/selection/ios fail after
<rdar://problem/60978283>
https://bugs.webkit.org/show_bug.cgi?id=213746
Attachment 403116: Patch
https://bugs.webkit.org/attachment.cgi?id=403116&action=review
--- Comment #2 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 403116
--> https://bugs.webkit.org/attachment.cgi?id=403116
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=403116&action=review
r=me, with some NITs
> LayoutTests/editing/selection/ios/select-text-in-existing-selection.html:28
> +editor = document.querySelector("div[contenteditable]");
> +target = document.getElementById("target");
NIT: `let`?
> LayoutTests/resources/ui-helper.js:135
> + const x = element.offsetLeft + element.offsetWidth / 2;
> + const y = element.offsetTop + element.offsetHeight / 2;
NIT: I'd add parenthesis around the `/ 2` to avoid ambiguity/complexity while
reading
> LayoutTests/resources/ui-helper.js:1103
> + new Promise(resolve => target.addEventListener(eventName, e
=> {
NIT: for readability, I usually avoid using inlined arrow functions unless I am
intentionally using the implicit return value
```
new Promise((eventListenerResolve) => {
target.addEventListener(eventName, (e) => {
event = e;
eventListenerResolve();
}, {once: true})
}),
```
NIT: I'd also recommend using a different variable name other than `resolve` to
avoid shadowing
More information about the webkit-reviews
mailing list