Changeset 208565 in webkit


Ignore:
Timestamp:
Nov 10, 2016 2:21:35 PM (7 years ago)
Author:
rniwa@webkit.org
Message:

Copied text would contain text inside CDATA sections and comments
https://bugs.webkit.org/show_bug.cgi?id=164578
Source/WebCore:

<rdar://problem/19834542>

Reviewed by Darin Adler.

The bug was caused by HTMLConverter::_traverseNode always including the content of a Text node.
Since Comment and CDataSection nodes are also Text nodes, we need to exclude them.

In the long term, we should check the visibility of the text as done in MarkupAccumulator.

Test: editing/mac/attributed-string/comment-cdata-section.html

  • editing/cocoa/HTMLConverter.mm:

(HTMLConverter::_traverseNode):

LayoutTests:

Reviewed by Darin Adler.

Added a regression test for creating an attributed string from different kinds of Text nodes.
Comment and CDataSection should not be included in the attributed string.

  • editing/mac/attributed-string/comment-cdata-section-expected.txt: Added.
  • editing/mac/attributed-string/comment-cdata-section.html: Added.
  • platform/mac-yosemite/editing/mac/attributed-string/comment-cdata-section-expected.txt: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208564 r208565  
     12016-11-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Copied text would contain text inside CDATA sections and comments
     4        https://bugs.webkit.org/show_bug.cgi?id=164578
     5
     6        Reviewed by Darin Adler.
     7
     8        Added a regression test for creating an attributed string from different kinds of Text nodes.
     9        Comment and CDataSection should not be included in the attributed string.
     10
     11        * editing/mac/attributed-string/comment-cdata-section-expected.txt: Added.
     12        * editing/mac/attributed-string/comment-cdata-section.html: Added.
     13        * platform/mac-yosemite/editing/mac/attributed-string/comment-cdata-section-expected.txt: Added.
     14
    1152016-11-10  Joseph Pecoraro  <pecoraro@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r208559 r208565  
     12016-11-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Copied text would contain text inside CDATA sections and comments
     4        https://bugs.webkit.org/show_bug.cgi?id=164578
     5        <rdar://problem/19834542>
     6
     7        Reviewed by Darin Adler.
     8
     9        The bug was caused by HTMLConverter::_traverseNode always including the content of a Text node.
     10        Since Comment and CDataSection nodes are also Text nodes, we need to exclude them.
     11
     12        In the long term, we should check the visibility of the text as done in MarkupAccumulator.
     13
     14        Test: editing/mac/attributed-string/comment-cdata-section.html
     15
     16        * editing/cocoa/HTMLConverter.mm:
     17        (HTMLConverter::_traverseNode):
     18
    1192016-11-10  Eric Carlson  <eric.carlson@apple.com>
    220
  • trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm

    r208455 r208565  
    23282328            }
    23292329        }
    2330     } else if (is<CharacterData>(node))
     2330    } else if (node.nodeType() == Node::TEXT_NODE)
    23312331        _processText(downcast<CharacterData>(node));
    23322332
Note: See TracChangeset for help on using the changeset viewer.