| Summary: | CSS2 violation - percentage height of iframe is ignored and substituted with constant instead | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | kavol |
| Component: | khtml | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | normal | CC: | finex, pivo |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
testcase part - iframetest-child.html
testcase part - iframetest-parent-block.html testcase part - iframetest-parent-inline.html another testcase - comparsion of iframe with img |
||
|
Description
kavol
2005-06-19 09:52:48 UTC
Created attachment 11511 [details]
testcase part - iframetest-child.html
Created attachment 11512 [details]
testcase part - iframetest-parent-block.html
Created attachment 11513 [details]
testcase part - iframetest-parent-inline.html
The devil lies in the intrinsic dimensions definition, which equal to "The width and height as defined by the element itself, NOT IMPOSED BY THE SURROUNDINGS." Both width and height of a html document are imposed by the surroundings, that is the viewport. Notice how block level elements stretch all the way to the right and span the whole width of their parent. And so does the root element span the width of the viewport. Height of the viewport also has an impact on the rendered document. The only way to make intrinsic dimensions computable is to set width and height explicitly on the root element itself, as you already pointed. Now, what's the difference between setting the dimensions on the embeded root element and setting the same dimensions on the iframe element? "Now, what's the difference between setting the dimensions on the embedded root element and setting the same dimensions on the iframe element?" reusability, for example - what if I want to have the same iframe included in two documents with different sizes? - then the iframe elements will have different dimensions for the same size of the embeded content or, what if I want to show the whole iframe content, but the parent does not know about the actual dimensions of the iframe content (the file may be replaced irregulary, on another server ...) - so it would be natural to set 100% I think that the problem with the viewport has an easy solution for most cases - let the specified (percentage) width of the iframe be computed from its parent element (as its whole width) rather then guessing it from the iframe content (if it is not set explicitly on the root element), then this value is passed to the rendering of the iframe content as the "viewport" width; this is in most cases sufficient to compute height and this value may be passed back to the parent, allowing to compute the width and height of the iframe with the CSS formula It is a little bit tricky, but I do not think that it is in violation with (the spirit of) CSS, because, as you said before, the "best practice" is to have document width set by the viewport and we just define how the viewport of the embeded document is wide ... you may disagree and say that this is great violation of CSS, but I say that is no greater violation than if you use fixed value for height and, in any case, the rendering SHOULD BE THE SAME for the same type of element, so until img gets scaled by percentage and iframe with dimensions explicitly set on root element does not get scaled, something is rotten ... I just want to say that the newer Konqueror (3.5) has this problem too ... Please, note that this problem has two parts - the first one being problem with CSS itself, but the second one (different behaviour for the same element class) is clearly problem of the browser; if the iframe dimensions are set (see the stylesheet within the last part of the original post), they have to be respected. Created attachment 14667 [details]
another testcase - comparsion of iframe with img
see the height of the inline img element and the height of the inline iframe
element ... both the png and the child html have the size of 400*400 pixels,
but they are rendered differently
(actually, the image has "1:1 pixels" while the html should have "CSS pixels"
but KHTML treats that the same, AFAIK)
Bug confirmed on 4.0.3 this bug is actually invalid. HTML Iframes have no intrinsic dimensions because they host a viewport, that maybe of any size, independantly of the inner document's own size. There is no css-defined way of selecting the viewport, so you cannot set intrinsic dimensions of an HTML Iframe from the inner document. Therefore Iframes with auto dimensions revert to standard fallback of 300x150 dimensions. I wish the developers would actually read the bugreports instead of just calling the bugs "features" ... I've referred to the CSS standard, I've refined some testcases, and all I got is "you cannot" ... of course I can, and in comment #5 I say how the bug has two parts - when the iframe content dimensions are not defined and when they are (see comment #6) as for the first one, I strongly disagree with your conclusion; as I said in comment #5, what you call "standard fallback" really is NOT any better than what I would prefer, if we talk about standards compliance (in fact, it goes against the spirit of CSS ...) and it is a shame to call it "standard" - can you support your words by a reference to CSS2 specification? however, although very sad and dissatisfied I can live with that solution, because Gecko does this the same stupid way, so implementing it any else would lead to another unnecessary battle of the "browser wars" as for the second one, the actual (Konqueror 4.0.3) behaviour is to scale the iframe the same way as img (which looks a bit funny because the inner contents are not scaled), so I would consider it FIXED so, if you really want to close it, the proper state would be "FIXED" (although just partially) rather than "INVALID" ... but it would take too much time to actually examine the testcase, and since KDE 4 epoch the quantity is what matters, not the quality, right? :-( > I wish the developers would actually read the bugreports instead of just calling the bugs "features" ? I read your report in full extent of course. > I've referred to the CSS standard, I've refined some testcases, and all I got > is "you cannot" ... of course I can, and in comment #5 I say how No I can assure you you cannot. Specifying the dimensions of the root element does not help.The root element is contained inside a viewport. The viewport itself is not selectable by CSS. Not at all. All you can gather about the viewport from CSS is specified in the CSS3 Media Queries module, and it is read only knowledge. The 300x150 fallback is of course specified in CSS 2.1 - 10.3.2 and 10.6.2. We are not doing guess work. I'm sorry you are not pleased by the outcome ot this, but we are not making the standards. You may try to plead your case on the w3c mailing lists. > as for the second one, the actual (Konqueror 4.0.3) behaviour is to scale Images have most of the time known intrinsic dimensions. Iframes never have. Your #7 testcase is rendered with both elements having the size of the viewport because it doesn't have a strict doctype, so your height: 100% on replaced elements percolate down to the viewport. That is a quirk. In strict mode, 100% height of a container with no specified height will revert to auto, and your element sizes will be different (intrinsic height for the image, default intrinsic height .i.e. 150px for the iframe). |