[whatwg] overflow of seamless iframes

Robert O'Callahan robert at ocallahan.org
Mon Aug 18 01:53:44 PDT 2008


On Mon, Aug 18, 2008 at 6:45 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Mon, 18 Aug 2008, Robert O'Callahan wrote:
> > On Mon, Aug 18, 2008 at 4:40 PM, Ian Hickson <ian at hixie.ch> wrote:
> > > On Mon, 18 Aug 2008, Robert O'Callahan wrote:
> > > > > Note that the default width and height are adjusted for seamless
> > > > > iframes to match the width that the element would have if it was a
> > > > > non-replaced block-level element with 'width: auto', and the
> > > > > height of the bounding box around the content rendered in the
> > > > > iframe at its current width, respectively.
> > > >
> > > > "The bounding box" is a bit ambiguous. If the content overflows
> > > > vertically above the iframe's viewport, does that contribute to the
> > > > height of the bounding box?
> > >
> > > As far as I can tell there is no ambiguity to the concept of the
> > > bounding box of the content in the canvas, especially given the way
> > > the initial containing block is forced to zero height.
> >
> > What's the answer to my question then? Should I have been able to derive
> > it somehow?
>
> I don't understand the question. How does the viewport affect the bounding
> box?


Suppose the iframe's document is
<body style="position:relative; top:-100px; height:500px;
background:yellow;"></body>
What's the height of the bounding box? 400px or 500px?

I just thought of another problem with allowing the contents of a
> "seamless" iframe to overflow outside the iframe box.
>
> One of the main uses for this will be to sandbox blog comments, using the
> yet-to-be-defined doc="" attribute, as in:
>
>   <iframe doc="<!DOCTYPE HTML><p>You suck"
>           seamless sandbox="allow-same-origin"></iframe>
>
> If we allow the contents to flow out of the box, then we also allow blog
> comments to start overlapping other content on the page.


Yeah, although setting overflow:hidden on the iframe could be used to
prevent that.

> I'm concerned about the use case of very wide content in the iframe
> > (i.e. content overflowing the root element horizontally); for example a
> > forum with many wide messages, each of which is a seamless iframe. Right
> > now it seems the choices are to either have a horizontal scrollbar in
> > each message or clip each message horizontally, there's no way to make
> > it work like a forum page.
>
> The way forum pages work now is that the content ends up screwing up the
> rest of the page, so I think that's a good thing. :-) People work around
> this now by forcing line break opportunities to exist in long URLs, etc,
> or by setting overflow:auto on user-submitted content.


Yes, although it would be nice to offer authors a choice. Oh well, I suppose
it doesn't matter too much.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080818/90804a59/attachment.htm>


More information about the whatwg mailing list