steven0lisa / flying-saucer

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

border and padding ignored by FSMouseListener #73

Open GoogleCodeExporter opened 9 years ago

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

It was reported by jamjim on 18.08.2008 18:26:33 +0200 and last updated in the 
previous bug tracker on 09.03.2009 21:07:51 +0100

Found in
Operating System: All
Platform: All

The priority for this issue at migration was Major.

Original description: 
When an element has a border, the border space appears to not be considered part
of the element.  This means when the mouse event is in a border, the reported
Box in FSMouseListener methods is the bordered box's parent.  The same goes
for padding.

The hover mouse listener demonstrates this easily when the borders,
padding and margins are massive:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <style type="text/css">
   .borders {background-color:red ; border-style: solid ;
border-color: green ; border-width: 20px ; margin: 20px ; padding:
20px}
   .borders:hover {background-color:blue ; border-style: solid ;
border-color: black ; border-width: 20px ; margin: 20px ; padding:
20px}
  </style>
 </head>
 <body>
    <div class="borders">
        Text starts
    </div>
  </body>
</html>

In a web browser, the style changes when the I hit the border.  In flying saucer
I have to travel 40 extra pixels to the text for the mouse listener to fire.

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

GoogleCodeExporter commented 9 years ago
pdoubleya wrote on 09.03.2009 21:07:51 +0100:
Annoying, but deferring for R9. Need to track down within the box-lookup code
starting from org.xhtmlrenderer.swing.RootPanel.find().

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