Bug 149723 - KHTML fails jQuery test suite
Summary: KHTML fails jQuery test suite
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: 3.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-10 09:28 UTC by alanic
Modified: 2012-06-18 17:23 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch (23.00 KB, patch)
2007-09-20 14:37 UTC, Allan Sandfeld
Details
Appending text with spaces test case (384 bytes, text/html)
2008-11-30 18:24 UTC, Harri Porten
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alanic 2007-09-10 09:28:23 UTC
Version:           3.5.7 (using KDE KDE 3.5.7)
Installed from:    Gentoo Packages

http://jquery.com/test/ goes up to 155 items in firefox and says test is completed. However in konqueror, it stops at 16 and says nothing else. 

JQuery is a major ajax library that should be supported.
Comment 1 Tommi Tervo 2007-09-10 10:21:33 UTC
For me it completes, kubuntu KDE 3.5.7

Tests completed in 179337 milliseconds.
43 tests of 816 failed.
Comment 2 Maksim Orlovich 2007-09-10 16:30:39 UTC
I can see a failure, and 2 reasons for it:
1) 3.5.x tip has a kio-http bug that messes things up (but you should not see it)

2) The server serves some XML w/o content-type. We report no content-type, so the library handles it as text/HTML. It then passes it to the HTML parser, which does what an HTML parser normally does and ignore a whole bunch of invalid tags, making a bunch of text node. The library then tries to query stuff, and blows up trying to work on text nodes.
Presumably we have a "feature" to emulate.

Comment 3 Maksim Orlovich 2007-09-10 16:37:33 UTC
Hmm, actually, it does send content-type... WTF does it get lost then?
Comment 4 Maksim Orlovich 2007-09-10 16:42:45 UTC
Seems like the cache loses the content-type... argh. 
Comment 5 alanic 2007-09-10 18:22:37 UTC
Thanks for the replies guys, I'm impressed and hopeful:)

Interestingly, the test stops at 12 right now. All tests up to that are successful but it just stops like that. I'll be more than happy to help track the problem if there is something specific I can do. (I won't mind compiling the whole thing with patches). 

Thanks again.
Comment 6 Maksim Orlovich 2007-09-10 18:47:35 UTC
That's again due to the cache... It requests a document first at 12 and then at 16. So the first time you ran it, 12 worked, and 16 failed since on cache/304 no content-type was provided by kio-http. Then the next time, 12 was cached as well. If you turn off the cache it'll mostly work --- most of the warnings are related to unsupported in 3.x opacity, and there are may be 1 or 2 other bugs in there. kio-http really worries me atm, though.
Comment 7 alanic 2007-09-10 19:17:06 UTC
You are absolutely right, it completes when I turn off the cache. I put together the ones that are not related to opacity for the sake of the bug report. 

22. core module: append(String|Element|Array<Element>|jQuery) (2, 16, 18)

- 7. Check for appending text with spaces

- 12. Test for appending a DOM node to the contents of an IFrame

66. selector module: attributes (1, 19, 20)

- 14. Select options via [@selected] (#select1 option[@selected]) expected: [ option#option1a ] result: [ ]

67. selector module: pseudo (:) selectors (1, 29, 30)

- 8. Selected Option Element (option:selected) expected: [ option#option1a, option#option2d, option#option3b, option#option3c ] result: [ option#option2d, option#option3b, option#option3c ]

82. ajax module: load(String, Function) - check scripts (1, 6, 7)

- 6. Check if script src was evaluated after load expected: bar actual: null

83. ajax module: load(String, Function) - check file with only a script tag (1, 2, 3)

- 3. Check if script was evaluated after load

86. ajax module: $.getScript(String, Function) - with callback (1, 1, 2)

- 2. Check if script was evaluated expected: bar actual: null

92. ajax module: $.ajax - dataType html (1, 4, 5)

- 5. Check if script src was evaluated for datatype html

105. fx module: CSS Overflow and Display (2, 0, 2)

- 1. Overflow should be visible:

- 2. Display shouldn't be tampered with.

147. fx module: Chain fadeIn fadeOut (1, 4, 5)

- 4. Make sure that display is reset (Old: Cur: none)

147-155 all have the same one failing (4)

Comment 8 Allan Sandfeld 2007-09-20 14:37:43 UTC
Created attachment 21663 [details]
Patch

This is a patch that ensures the http-headers are cached and reproduced
properly. With this patch disabling cache is no longer necessary.
Comment 9 Maksim Orlovich 2007-09-20 17:14:58 UTC
 m_request.responseHeader << buffer;
Doesn't have the same 4K-limit type problems that the original parser code has?
Comment 10 Allan Sandfeld 2007-10-15 23:41:59 UTC
SVN commit 725638 by carewolf:

Store all http-headers in the cache. 
Helps bad PHP -> JavaScript abuse like jQuery
CCBUG: 149723


 M  +1 -1      kio/kio/http_slave_defaults.h  
 M  +105 -148  kioslave/http/http.cpp  
 M  +3 -4      kioslave/http/http.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=725638
Comment 11 Allan Sandfeld 2007-12-05 11:28:40 UTC
Okay, the test runs now. So how much works, and how much fails, and why?
Comment 12 Tiago Freire 2008-01-15 13:04:57 UTC
This is a list of tests from the Test Suite where Konqueror 4.0 Final fails. Test was done on Kubuntu-64.

22. core module: css(String|Hash) (7, 12, 19)
  2. Modifying CSS display: Assert element is visible
  11. Assert opacity is 0.25 as a String
  12. Assert opacity is 0.25 as a Number
  13. Assert opacity is 0.5 as a String
  14. Assert opacity is 0.5 as a Number
  15. Assert opacity is 0.75 as a String
  16. Assert opacity is 0.75 as a Number
23. core module: css(String, Object) (7, 14, 21)
  1. Modifying CSS display: Assert element is visible
  10. Assert opacity is 0.25 as a String
  11. Assert opacity is 0.25 as a Number
  12. Assert opacity is 0.5 as a String
  13. Assert opacity is 0.5 as a Number
  14. Assert opacity is 0.75 as a String
  15. Assert opacity is 0.75 as a Number
25. core module: width() (2, 7, 9)
  7. Test padding specified with percent expected: 30 actual: 92
  8. Test hidden div expected: 30 actual: 92
26. core module: height() (2, 6, 8)
  7. Test padding specified with percent expected: 30 actual: 92
  8. Test hidden div expected: 30 actual: 92
31. core module: append(String|Element|Array<Element>|jQuery) (2, 19, 21)
  7. Check for appending text with spaces
  12. Test for appending a DOM node to the contents of an IFrame
48. core module: val(String) (2, 4, 6)
  5. Died on test #5: Error: DOM Exception 8
  6. Expected 4 assertions, but 5 were run
74. core module: contents() (2, 1, 3)
  2. Died on test #2: TypeError: Undefined value
  3. Expected 12 assertions, but 2 were run
82. selector module: attributes (1, 19, 20)
  14. Select options via [selected] (#select1 option[selected]) expected: [ option#option1a ] result: [ ]
83. selector module: pseudo (:) selectors (3, 32, 35)
  8. Selected Option Element (#form option:selected) expected: [ option#option1a, option#option2d, option#option3b, option#option3c ] result: [ option#option2d, option#option3b, option#option3c ]
  25. Is Visible (#form input:visible) expected: [ input#text1, input#text2, input#radio1, input#radio2, input#check1, input#check2, input#name ] result: [ ]
  26. Is Hidden (#form input:hidden) expected: [ input#hidden1, input#hidden2 ] result: [ input#text1, input#text2, input#radio1, input#radio2, input#check1, input#check2, input#hidden1, input#hidden2, input#name ]
  
Comment 13 Maksim Orlovich 2008-01-15 20:03:27 UTC
I've fixed all those opacity ones the other day, BTW.
Comment 14 Maksim Orlovich 2008-01-15 22:39:10 UTC
"Test padding specified with percent expected: 30 actual: 92" is iffy because 
it expects computed value of "2%" to be the integer and not "2%", however CSS2.1 specified that the computed value is the specified value. OTOH, DOM2 CSS says that the computed value must be what CSS specifies, but also always an absolutely value. Whee.
Comment 15 Maksim Orlovich 2008-01-15 23:02:52 UTC
The below fixes that case... But we probably also want this for marginTop, etc., too. In general, I think all uses of valueForLength need auditing...

diff --git a/css/css_renderstyledeclarationimpl.cpp b/css/css_renderstyledeclarationimpl.cpp
index bc478d6..b292d13 100644
--- a/css/css_renderstyledeclarationimpl.cpp
+++ b/css/css_renderstyledeclarationimpl.cpp
@@ -819,13 +819,13 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID )
         return 0;
     }
     case CSS_PROP_PADDING_TOP:
-        return valueForLength(style->paddingTop(), renderer->contentHeight());
+        return new CSSPrimitiveValueImpl(renderer->paddingTop(), CSSPrimitiveValue::CSS_PX);
     case CSS_PROP_PADDING_RIGHT:
-        return valueForLength(style->paddingRight(), renderer->contentWidth());
+        return new CSSPrimitiveValueImpl(renderer->paddingRight(), CSSPrimitiveValue::CSS_PX);
     case CSS_PROP_PADDING_BOTTOM:
-        return valueForLength(style->paddingBottom(), renderer->contentHeight());
+        return new CSSPrimitiveValueImpl(renderer->paddingBottom(), CSSPrimitiveValue::CSS_PX);
     case CSS_PROP_PADDING_LEFT:
-        return valueForLength(style->paddingLeft(), renderer->contentWidth());
+        return new CSSPrimitiveValueImpl(renderer->paddingLeft(), CSSPrimitiveValue::CSS_PX);
     case CSS_PROP_PAGE_BREAK_AFTER:
         switch (style->pageBreakAfter()) {
         case PBAUTO:
Comment 16 Linus Östberg 2008-04-19 19:40:12 UTC
Konqueror 3.5.9:
Test stops at 105.

4 (trunk, r798696):
Test finished, 63/1161 failed.
Comment 17 Zayed Al-Saidi 2008-10-06 12:42:04 UTC
I run the test by using konqueror 4.1.2 and I get this result:
Tests completed in 66518 milliseconds.
61 tests of 1271 failed.
Comment 18 Harri Porten 2008-10-12 16:08:59 UTC
I reduced the failing "element is visible" test of the css(String|Hash) to the following:

 	<div id="main" style="display: none;">
		<div id="foo">Foo</div>
        </div>

<script>
        var x = document.getElementById('foo');
        var s = document.defaultView.getComputedStyle(x, null);
        alert("visibility: " + s.getPropertyValue( "visibility" ));
</script>

where others show "visible" while we return an empty string because renderer is NULL.
Comment 19 Maksim Orlovich 2008-10-12 16:55:31 UTC
I have that half-fixed in my tree. Just need to wrap that up.
(We have ability to pick up RenderStyle on display:none entries now, but some of the properties use the Renderer).
Comment 20 Maksim Orlovich 2008-11-29 20:21:32 UTC
SVN commit 890661 by orlovich:

Make sure that option's selected bit is up-to-date.
Fixes a couple of jQuery testcases; the only thing left 
are 9 copies of the same failure on some effect.
(When did we fix so many --- or did they put in workarounds for us?)

CCBUG:149723


 M  +16 -7     html/html_formimpl.cpp  
 M  +5 -1      html/html_formimpl.h  
 M  +2 -2      rendering/render_form.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=890661
Comment 21 Harri Porten 2008-11-30 18:24:23 UTC
Created attachment 28955 [details]
Appending text with spaces test case

Simplified version of the "check for appending text with spaces" (core module: append()).
Comment 22 Anguo 2012-04-06 07:43:59 UTC
When I go to the afore mentioned test page, I get the title 'jquery test suite' and the rest of the page is completely blank, both in Konqueror and Firefox. Maybe they're experiencing server problems or the test suite is no longer maintained.

In any case, Konqueror *does* have problems with javascript.
Comment 23 Janek Bevendorff 2012-06-18 17:23:21 UTC
Message from the Bugsquad and Konqueror teams: This bug is closed as outdated, as we do not have the manpower to maintain the KDE3 version anymore. If you still can reproduce this issue with Konqueror 4.8.4 or later, please open a new report. Thank you for your understanding.