We should get rid of StyledMarkupAccumulator::RenderedText() |
|||||
Issue description
We should use DOM text for DOM to HTML serialization to copy raw characters
instead of collapsed and text-transform'ed characters.
Here is call stack:
- PlainText(); this is a kind of "rendered text"
- StyledMarkupAccumulator::RenderedText()
- StyledMarkupAccumulator::AppendTextWithInlineStyle()
Here is code snippet:
void StyledMarkupAccumulator::AppendTextWithInlineStyle(
Text& text,
EditingStyle* inline_style) {
...
if (!ShouldAnnotate()) {
AppendText(text);
} else {
// We use |RenderedText()| for |Text| in SELECT element
// Why?
const bool use_rendered_text = !EnclosingElementWithTag(
Position::FirstPositionInNode(&text), selectTag);
String content =
use_rendered_text ? RenderedText(text) : StringValueForRange(text);
StringBuilder buffer;
MarkupFormatter::AppendCharactersReplacingEntities(
buffer, content, 0, content.length(), kEntityMaskInPCDATA);
result_.Append(ConvertHTMLTextToInterchangeFormat(buffer.ToString(), text));
}
...
}
,
May 22 2017
It seems we use rendered text from beginning[1], 2004-12-13. Using StringValueForRange() is introduced by patch[2]. [1] https://trac.webkit.org/changeset/8198/webkit moved markup-related functions into new sources files in the editing directory [2] https://trac.webkit.org/changeset/17532/webkit Copy/paste of a select element fails to include the options
,
May 22 2017
,
May 22 2017
Using rendered text is introduce by patch[1]. The comment is Some improvements for paste, including some new code to annotate whitespace when writing to the pasteboard to ensure that the meaning of the markup on the pasteboard is unambiguous. [1] https://trac.webkit.org/changeset/8096/webkit/trunk/WebCore/khtml/xml/dom_nodeimpl.cpp
,
May 22 2017
Following tests are failed in LayoutTests/editing when using StringValuseForRange() instead of RenderedText(). When we have hard time to adjust Layout NG version of TextIterator, we may want to consider using StringValueForRange() rather than adjusting Layout NG version. Regressions: Unexpected text-only failures (33) editing/inserting/insert-3786362-fix.html [ Failure ] editing/pasteboard/19644-1.html [ Failure ] editing/pasteboard/19644-2.html [ Failure ] editing/pasteboard/4944770-1.html [ Failure ] editing/pasteboard/block-wrappers-necessary.html [ Failure ] editing/pasteboard/copy-backslash-with-euc.html [ Failure ] editing/pasteboard/copy-resolves-urls.html [ Failure ] editing/pasteboard/display-block-on-spans.html [ Failure ] editing/pasteboard/paste-4039777-fix.html [ Failure ] editing/pasteboard/paste-and-sanitize.html [ Failure ] editing/pasteboard/paste-blockquote-and-paragraph-break.html [ Failure ] editing/pasteboard/paste-blockquote-before-blockquote.html [ Failure ] editing/pasteboard/paste-double-nested-blockquote-before-blockquote.html [ Failure ] editing/pasteboard/paste-list-002.html [ Failure ] editing/pasteboard/paste-list-003.html [ Failure ] editing/pasteboard/paste-list-004.html [ Failure ] editing/pasteboard/paste-noplugin.html [ Failure ] editing/pasteboard/paste-noscript.html [ Failure ] editing/pasteboard/paste-sanitize-crash-1.html [ Failure ] editing/pasteboard/paste-sanitize-crash-2.html [ Failure ] editing/pasteboard/paste-table-002.html [ Failure ] editing/pasteboard/paste-table-cells.html [ Failure ] editing/pasteboard/paste-text-012.html [ Failure ] editing/pasteboard/paste-text-017.html [ Failure ] editing/pasteboard/paste-text-with-style.html [ Failure ] editing/pasteboard/paste-unrendered-select.html [ Failure ] editing/pasteboard/paste-visible-script.html [ Failure ] editing/pasteboard/paste-wrapped-blockquote-into-nonblockquote.html [ Failure ] editing/pasteboard/paste_line_endings.html [ Failure ] editing/pasteboard/paste_text.html [ Failure ] editing/pasteboard/preserve-line-break-at-end-of-pasted-content.html [ Failure ] editing/pasteboard/smart-drag-drop.html [ Failure ] editing/style/non-inheritable-styles.html [ Failure ] Regressions: Unexpected image-only failures (1) editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html [ Failure ] Regressions: Unexpected image and text failures (1) editing/pasteboard/paste-text-016.html [ Failure ]
,
Jun 29 2017
,
Jan 10 2018
,
Jan 10
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||
►
Sign in to add a comment |
|||||
Comment 1 Deleted