In contenteditable, typing into <span> containing Tab char breaks <span> into two elements
Reported by
balp...@fb.com,
Jul 12 2017
|
|||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3149.0 Safari/537.36 Steps to reproduce the problem: 1. Make a contenteditable containing a span whose first child is a text node containing a Tab (\t, 	) character. 2. Type into it. What is the expected behavior? The text you typed should be inserted into that text node. What went wrong? The span is broken into two pieces. This only happens if the text node contains a span. Did this work before? Yes Does this work in other browsers? N/A Chrome version: 61.0.3149.0 Channel: beta OS Version: OS X 10.12.4 Flash Version: This is a recent regression. https://chromium.googlesource.com/chromium/src/+/013ac5eaf3%5E%21/ by joone.hur@intel.com broke it. I don't understand the full nuance of this change so it's hard for me to say what the proper fix was. This broke text entry on Facebook in some cases. I'm committing a workaround to our code for this particular bug but it would be nice to have an upstream fix.
,
Jul 13 2017
,
Jul 14 2017
Unable to reproduce the issue on Mac 10.12.5 with chrome #61.0.3149.0 with the provided html in comment #0, observed on typing text in contenteditable node didn't split into it two. Attaching the screen-cast for reference. balpert@ Could you please look into it and let us know your observations. Thank You...
,
Aug 2 2017
kkaluri: Thanks, please open the devtools to verify. You can see that there is one <span> tag before typing and there are two <span> tags after. The effect is not immediately user-visible but it makes no sense and can break JS event handlers relying on the DOM structure not changing.
,
Aug 4 2017
,
Aug 4 2017
,
Aug 8 2017
I've confirmed that we do split the content into two spans with an anonymous box between them with the newly typed content. Firefox simply modifies the string inside the <span> Moving to Untriaged so Blink editing team can investigate.
,
Aug 8 2017
Sorry, just noticed this is a regression. Assigning to CL's owner joone.hur@. PTAL.
,
Sep 6 2017
,
Sep 14 2017
Ping: joone.hur@, could you please take a look? This is a regression so it should be prioritised.
,
Sep 25 2017
yosin@, could you please triage this, I don't have relevant expertise here to know if this is serious? It looks like joone.hur's change had unintended consequences (it looks like it was just supposed to remove some non-standard features but the regression doesn't use any of them) and we should be prioiritising regressions in behavior. Thanks.
,
Sep 25 2017
From my perspective, this is slightly problematic because once the node is broken in half, document markers no longer draw/behave cleanly across the half (e.g. spellcheck replace no longer works properly, and composition underlines are drawn with a gap).
,
Oct 3 2017
In review: http://crrev.com/c/697044
,
Oct 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/52d55d36c78e4772e0e3499409dc6f6dcabde00e commit 52d55d36c78e4772e0e3499409dc6f6dcabde00e Author: Yoshifumi Inoue <yosin@chromium.org> Date: Thu Oct 05 08:59:01 2017 Make InsertText command not to split SPAN element containing TAB character Before this patch, "InsertText" command splits SPAN element containing TAB character when inserting text into it. For example: Before: <span>	a|c</span> Command: insertText "B" After: <span>	a</span>B|<span>c</span> This behavior is introduced by the patch[1], which replaces "class=apple-tab-span" to "style=white-space:pre". This patch changes |IsTabHTMLSpanElement()| to check "white-space:pre" CSS property to make "InsertText" command not to split SPAN element containing TAB character with "white-space: pre". Note: "apple-tab-span" CSS class is MacOS specific feature[2]. On MacOS, UITextView puts following HTML into pasteboard: <style>.Apple-Tab-Span { white-space: pre; }</style> <span class=Apple-Tab-Span>	</span> [1] http://crrev.com/2718543003 Remove EditingAppleTabSpan class handling [2] https://www.cocoanetics.com/2013/06/apple-tab-span/ Bug: 741826 Change-Id: I42d8d388e306b613fbe8ffa614b9e974db254c22 Reviewed-on: https://chromium-review.googlesource.com/697044 Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#506683} [modify] https://crrev.com/52d55d36c78e4772e0e3499409dc6f6dcabde00e/third_party/WebKit/Source/core/editing/EditingUtilities.cpp [modify] https://crrev.com/52d55d36c78e4772e0e3499409dc6f6dcabde00e/third_party/WebKit/Source/core/editing/commands/InsertTextCommandTest.cpp
,
Oct 5 2017
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by n...@fb.com
, Jul 12 2017