Summary: | [CSS 2.1 Conformance] [testcase] <object> or <img> specified with attribute specification width and height percentages or with css width and height percentages and with intrinsic ratio | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Gérard Talbot (no longer involved) <browserbugs2> |
Component: | khtml | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | CC: | maksim |
Priority: | NOR | Keywords: | reproducible, testcase |
Version: | 4.7.4 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
URL: | http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/object-width-height-percent-intrinsic-ratio.html | ||
Latest Commit: | Version Fixed In: |
Description
Gérard Talbot (no longer involved)
2011-06-02 23:03:24 UTC
Quick question: is this supposed to be the same or different than when using the <img> element? Quick answer: Yes. Additional information: 1- The testcase from W3C uses a XHTML 1.0 strict doctype and Konqueror does not handle CSS as expected in such case 2- In XHTML, body and root element have separate background and this may affect calculations. Safari 5.0.5 and Chrome 11.0.696.71 do not reach expected calculations and this may be because of the XHTML doctype. 3- <object> is an inline-block replaced element; <img> is an inline replaced element. They both should apply, follow the same rules in CSS 2.1 with regards to used width, used height, intrinsic ratio. 4- I know I can create 2 minimized testcases in HTML 4.01 strict which will avoid elegantly all of the above and also the differences in body margins. 5- Maksim, visit this webpage http://www.gtalbot.org/ , then resize viewport (horizontally and vertically) and then examine the code. <h1><img id="CatOnRoofLooking" src="GRAPHICS/PNG/CatOnRoofLooking.png" width="100%" alt=""><!-- 976w x 588h --></h1> The CatOnRoofLooking.png will always fill up the body's available width and the CatOnRoofLooking.png's used height will be rendered according to the image intrinsic ratio (976px width by 588px height giving a 588/976 == 0.602 intrinsic ratio). So, the image will never get distorted or stretched horizontally or vertically: the face of the cat will always look normal-looking for a cat and will not be distorted, not be stretched in an ugly manner. 6- IE8 and IE9 pass the test. regards, Gérard I have now an excellent testcase right here: http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/object-width-height-percent-intrinsic-ratio.html That test incorporates the <img src="[path/filename.ext]" width="x%" height="y%" ...> code situations where x and y are integers in the [1..99] range. Firefox 4.01 and Opera 11.11 pass this test. Chrome 11.0.696.71 and Konqueror 4.6.3 fail this test but they fail it for different implementation reasons/causes. I will check IE8, IE9 and Safari 5.0.5 in a few min. regards, Gérard > Quick question: is this supposed to be the same or different than when using > the <img> element? Yes, it is supposed to be the same when using the <img> element. The HTML4 attribute specification height="1%" can not be resolved since the height of the vertical space currently available from the body box is not specified explicitly (i.e., it depends on content height) and cannot be determined in advance, therefore it should be undefined; then, while computed CSS height value is 'auto', it should then be eventually resolved by rules in section 10.6.2. Same thing with inline style="height: 1%;": according to CSS 2.1, section 10.5, it should be computed as 'auto' and then resolved in section 10.6.2. --------- I have added more code scenarios into the http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/object-width-height-percent-intrinsic-ratio.html meta-testcase. Now with inline style (eg style="width: 10%; height: 1%;" for <img> and <object>). IE8, IE9, Firefox 4.0.1, Opera 11.11 pass this meta-test (3 sections of 10 tests each). Chrome 11.0.696.71 fails 12 tests out of 30 and passes 18 tests out of 30. Konqueror 4.6.3 fails 12 tests out of 30 and passes 18 tests out of 30. regards, Gérard I went over all of the testcases in section 10.6.2 of the CSS 2.1 test suite (RC6) http://test.csswg.org/suites/css2.1/20110323/html4/chapter-10.html#s10.6.2 and only the SVG test http://test.csswg.org/suites/css2.1/20110323/html4/replaced-intrinsic-004.htm is failed by Konqueror 4.6.3. The others are all passed (c43-rpl-bbx-002 and c43-rpl-ibx-000 have validation issues). So, the coverage of section 10.6.2 of the spec is not correct, not flawless. I will submit a few testcases to correct this. regards, Gérard > Quick question: is this supposed to be the same or different than when using
> the <img> element?
Section 10.6.2 covers mostly replaced elements: it covers
a) inline replaced elements (typically, an <img>),
b) block-level replaced elements in normal flow: (typically, an <object> or an <iframe> styled to be displayed as a block box),
c) 'inline-block' replaced elements in normal flow (typically, an <object>) and
d) floating replaced elements (a floated <img>).
So, the meta-testcase could easily get 30 more sub-tests.
Gérard
Additional testcases: http://www.gtalbot.org/BrowserBugsSection/css21testsuite/inline-block-replaced-height-008.html http://www.gtalbot.org/BrowserBugsSection/css21testsuite/inline-replaced-height-008.html http://www.gtalbot.org/BrowserBugsSection/css21testsuite/floating-replaced-height-008.html These 3 testcases will eventually be submitted for inclusion into the CSS 2.1 test suite. Gérard > 3 testcases will eventually be submitted for inclusion into the CSS 2.1 > test suite. http://test.csswg.org/suites/css2.1/nightly-unstable/html4/floating-replaced-height-008.htm http://test.csswg.org/suites/css2.1/nightly-unstable/html4/inline-block-replaced-height-008.htm http://test.csswg.org/suites/css2.1/nightly-unstable/html4/inline-replaced-height-008.htm Gérard http://test.csswg.org/suites/css2.1/nightly-unstable/html4/floating-replaced-height-008.htm http://test.csswg.org/suites/css2.1/nightly-unstable/html4/inline-block-replaced-height-008.htm http://test.csswg.org/suites/css2.1/nightly-unstable/html4/inline-replaced-height-008.htm Konqueror 4.7.4 fails 6 tests out of those 15 tests. CONFIRMING Firefox 9.0.1, Opera 11.60 and Chrome 16.0.912.75 pass all those 15 tests. Dear user, KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6. Please migrate to use a QWebEngine based HTML component. We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes. For security issues, please see: https://kde.org/info/security/ Sorry that we did not fix this issue during the life-time of KHTML. Greetings Christoph Cullmann |