[Webkit-unassigned] [Bug 141725] An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 3 12:39:00 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=141725

--- Comment #8 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
Again I was wrong about the reduction of this bug. It is not about a non <svg> without intrinsic size inherits the container size instead of its viewport when calculating the viewport. Actually any element without intrinsic size can have the same bug. Here is the simplest reduction I could get:

<!DOCTYPE html>
<html>
<head>
  <style>
    div {
      background-color: lime;
      width: 50px;
      height: 50px;
    }
    svg {
      width: 50px;
      height: 50px;
    }
  </style>
</head>
<body>
  <div>
    <svg width='100' height='100'>
        <rect width='50%' height='50%' fill='red'/>
    </svg>
  </div>
</body>
</html>

In this example, the <svg> says its size = (100,100) but the css overrides that by forcing its size to be = (50, 50).  The <rect> width and height are 50% of the <svg> width and height. So it should be drawing a rectangle with size = (25,25). The bug is we draw the rectangle with size = (50, 50) as if the viewport of the svg is =(100, 100). So we end up having only a red rectangle.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150303/5ea5bb39/attachment-0002.html>


More information about the webkit-unassigned mailing list