RE: [CSS21] Overconstraint issue in Section 10.3.8

Mozilla, IE, Opera, and HP & Epson printers all seem to ignore the spec
and use the right (and bottom) position(s).  Don't know about others...
The test case I used follows.

Melinda

<?xml version="1.0" encoding="UTF-8"?>
<!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>
  <title>CSS 2.1 10.3.8 Test Case</title>
  <style type="text/css">
   * {margin: 0; border-width: 0; padding: 0;}
   .mainbox {
    position: relative;
    width: 400px;
    height: 300px;
    border: solid 1px blue;
   }
   .img1 {
    position: absolute;
    right: 100px;
    bottom: 100px;
    width: 100px;
    height: 100px;
   }
   .greenspot {
    position: absolute;
    top: 95px;
    left: 195px;
    width: 100px;
    height: 100px;
    border: solid 5px green;
    }
    .redspot {
    width: 100px;
    height: 100px;
    border: solid 5px red;
    }
   </style>
 </head>
<body>
 <div class="mainbox">
    <img src="sample.jpg" class="img1" alt="image goes here"/>

    <div class='greenspot'></div>
  <div class='redspot'></div>
  </div>
  <p>Image should be placed inside the green box.</p>
</body>
</html>

-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
Behalf Of L. David Baron
Sent: Wednesday, January 12, 2005 3:27 PM
To: www-style@w3.org
Subject: Re: [CSS21] Overconstraint issue in Section 10.3.8


On Wednesday 2005-01-12 15:09 -0800, Grant, Melinda wrote:
> When an object is absolutely positioned using the 'bottom' and 'right'

> properties and direction is ltr, step 2 of the current algorithm in 
> Section 10.3.8 seems to inappropriately set 'left' to the static 
> position when the intrinsic width of the object implies a different 
> left position.  (Essentially the 'right' offset is overridden by 
> setting 'left' to the static position.)  And the analogous issue for 
> rtl also applies, I believe.

This seems like a reasonable complaint.  What do existing
implementations do?

The alternative wording I can think of that would fix this problem and
seems most likely to match implementations if they aren't doing what the
spec currently says is replacing (2) and (3) with:

If both 'left' and 'right' are 'auto', then:
  * If 'direction' is 'ltr', replace 'left' with the <a>static
position</a>.
  * If 'direction' is 'rtl', replace 'right' with the <a>static
position</a>.

10.3.7 and 10.6.5 have the same problem.  I think 10.6.4 does not (which
might suggest another alternative).

(It's also a possibility that the group agreed to changes to these rules
that never made it back into the spec.)

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >

Received on Friday, 14 January 2005 22:02:36 UTC