Cannot select a canvas element at the beginning or the end of a document
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2013 06:52:33 +0000 (06:52 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2013 06:52:33 +0000 (06:52 +0000)
commit04b60b599641f977a3f0194bd20dc933466a2af5
tree910a63731d3e9a895962f9d362f180fe344dd510
parentb3fb879f9cae8c35d07cf7ac24f3959cb3e3c564
Cannot select a canvas element at the beginning or the end of a document
https://bugs.webkit.org/show_bug.cgi?id=112319

Reviewed by Eric Seidel.

Source/WebCore:

The bug was caused by the editing code treating canvas element as if an empty inline element.
Treat it as an "atomic" element for the purpose of determining whether selection can have
an end point in it or not.

Test: editing/pasteboard/copy-paste-content-starting-and-ending-canvas.html

* html/HTMLCanvasElement.h:
(WebCore::HTMLCanvasElement::canContainRangeEndPoint): Added.

LayoutTests:

Add a regression test to copy and paste a content with canvas elements.

* editing/pasteboard/copy-paste-content-starting-and-ending-canvas-expected.txt: Added.
* editing/pasteboard/copy-paste-content-starting-and-ending-canvas.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/copy-paste-content-starting-and-ending-canvas-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/copy-paste-content-starting-and-ending-canvas.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLCanvasElement.h