prasath-ideas2it / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

Text Selection Fails with Embedded Elements #83

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*** This issue was imported from http://java.net/jira/browse/XHTMLRENDERER-211

It was reported by chrisw1229 on 29.01.2008 21:05:15 +0100 and last updated in 
the previous bug tracker on 20.07.2008 21:33:30 +0200

Found in
Operating System: All
Platform: All

The priority for this issue at migration was Major.
The original issue had attachments to it; see comments below.

Original description: 
The selection will only go to the second to last character if there is another
element like "img" in the middle of the line. Here is a screenshot to
demonstrate what I mean: 
http://img108.imageshack.us/img108/1457/highlighterlk5.png

The first line shows selecting everything but the last character, the second
line shows what happens when you try to select the last character too. I have
included an example document below:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <link href="default.css" rel="stylesheet" type="text/css"/>
   </head>
   <body>
      <div class="item-me">
         <span class="stamp">(5:29 PM) </span>
         <span class="user">Ward, Chris: </span>
         <span class="msg">This is a test <img src="EmoteSmile.png"/> of the
selection highlighter.</span>
      </div>
   </body>
</html>

Original issue reported on code.google.com by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
Attachment by chrisw1229 on 28.02.2008 00:11:26 +0100:  SelectionTest.java, 
size 4279 bytes
Download: http://java.net/jira/secure/attachment/27347/SelectionTest.java

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
nitsk wrote on 27.02.2008 18:12:31 +0100:
I couldn't reproduce the failure to select (at least if you waved the mouse
around a little), but I have improved the selection code for when you're
actually clicking on an inline image

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
chrisw1229 wrote on 27.02.2008 18:31:30 +0100:
I didn't think to include the CSS content at the time...Is your selection code
affected by the CSS or do you only need to work with the document content? I can
test again and try to create a better test case if needed.

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
chrisw1229 wrote on 28.02.2008 00:11:26 +0100:
Created an attachment (id=46)
A test case for selection highlighting with an embedded element.

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
chrisw1229 wrote on 28.02.2008 00:15:58 +0100:
This problem only seems to occur when the document is created dynamically in
code. It took a while to isolate the test case because every time I pasted the
document content as printed from my application into the test case it worked
fine. So I'm not sure why building the same document in memory would be causing
a problem. Also, you don't have to actually bother to have a valid image file
for the bug to show up.

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
pdoubleya wrote on 20.07.2008 21:25:42 +0200:
Need to re-evaluate with the latest patches to selection; will decide before R8
final if it's fixed or will be deferred.

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54

GoogleCodeExporter commented 8 years ago
pdoubleya wrote on 20.07.2008 21:33:30 +0200:
Assigning to me, at least to verify if this is still a problem.

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:54