[webkit-reviews] review granted: [Bug 197894] Inserting a newline in contenteditable causes two characters to be added instead of one : [Attachment 370964] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 30 12:30:53 PDT 2019


Wenson Hsieh <wenson_hsieh at apple.com> has granted Andres Gonzalez
<andresg_22 at apple.com>'s request for review:
Bug 197894: Inserting a newline in contenteditable causes two characters to be
added instead of one
https://bugs.webkit.org/show_bug.cgi?id=197894

Attachment 370964: Patch

https://bugs.webkit.org/attachment.cgi?id=370964&action=review




--- Comment #34 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 370964
  --> https://bugs.webkit.org/attachment.cgi?id=370964
Patch

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

Seems reasonable, though I'm not familiar with the accessibility part of this
patch.

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1624
> +	   Node* node = this->node();

Nit - auto

>
LayoutTests/accessibility/ios-simulator/set-selected-text-range-after-newline.h
tml:35
> +	   shouldBecomeEqual("text.selectedTextRange", "'{5, 0}'", function() {
> +			     text.replaceTextInRange("\n", 5, 0);
> +
> +			     var t = text.stringForRange(0, 11);
> +			     t = t.replace(/(?:\r\n|\r|\n)/g, '[newline]');
> +			     debug("There must be only one [newline] between
hello and world: " + t);
> +
> +			     text.setSelectedTextRange(6, 0);
> +			     shouldBecomeEqual("text.selectedTextRange", "'{6,
0}'", function() {
> +					       var t = text.stringForRange(6,
5);
> +					       t = t.replace(/(?:\r\n|\r|\n)/g,
'[newline]');
> +					       debug("The text after the
newline should be world: " + t);
> +
> +					       finishJSTest();
> +					       });
> +			     });

Nit - indentation still looks off.


More information about the webkit-reviews mailing list