Bug 40073 - [Qt] rendering error in mediawiki
Summary: [Qt] rendering error in mediawiki
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Other Linux
: P3 Normal
Assignee: Nobody
URL: http://www.debianclusters.org/index.p...
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-06-02 11:07 PDT by Adrian von Bidder
Modified: 2011-04-19 05:15 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.91 KB, patch)
2010-06-08 11:24 PDT, Dawit A.
kenneth: review-
kenneth: commit-queue-
Details | Formatted Diff | Diff
Patch - rev. #2 (2.73 KB, patch)
2010-06-08 11:54 PDT, Dawit A.
kenneth: review-
kenneth: commit-queue-
Details | Formatted Diff | Diff
Patch - rev. #3 (2.70 KB, patch)
2010-06-11 22:33 PDT, Dawit A.
no flags Details | Formatted Diff | Diff
Same patch vs trunk... (2.64 KB, patch)
2010-06-12 09:13 PDT, Dawit A.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian von Bidder 2010-06-02 11:07:07 PDT
See KDE: https://bugs.kde.org/show_bug.cgi?id=240465 and the attached screenshot.

happens with many mediawiki sites, not only debianclusters.  khtml and other browsers work fine; webkit doesn't have this problem with wikipedia or some other mediawiki sites, so it seems to be a particular version of their template that causes the bug.

Browser: kpart-webkit 0.9svn1129464-1 (Debian version, it's the current unstable package update to a newer svn snapshot) and libqt4-webkit 4:4.6.2-5.

cheers
-- vbi
Comment 1 Dawit A. 2010-06-02 16:35:08 PDT
FYI. This reproducible using QtTestBrowser in QtWebKit 2.0 as well...
Comment 2 Alexey Proskuryakov 2010-06-03 00:51:01 PDT
I cannot reproduce this with ToT WebKit, so I suspect that Qt has an old version of WebKit. Issues like this have been addressed in bug 28350, bug 29792, and bug 35507.
Comment 3 Csaba Osztrogonác 2010-06-03 12:41:26 PDT
I can reproduce it with QtTestBrowser (WebKit trunk r60630)
Comment 4 Csaba Osztrogonác 2010-06-03 12:46:51 PDT
(In reply to comment #3)
> I can reproduce it with QtTestBrowser (WebKit trunk r60630)
It is the ToT of WebKit and I tried with Qt-4.6.0 and Qt-4.7 trunk.
Comment 5 Kenneth Rohde Christiansen 2010-06-03 12:53:31 PDT
Luiz, can you check this with pure Mac and Qt Mac build? Would be nice to know if this is a Qt only issue or not
Comment 6 Csaba Osztrogonác 2010-06-03 12:56:09 PDT
(In reply to comment #5)
> Luiz, can you check this with pure Mac and Qt Mac build? Would be nice to know if this is a Qt only issue or not

I tried with an old Safari on Windows and works as we expect.
Comment 7 Kenneth Rohde Christiansen 2010-06-03 12:57:51 PDT
as far as I remember, the mediawiki pages import illegal css when the user agent contain "KHTML" and we (WebKit community) had to make a quirk. Could it be that this quirk is not enabled for Qt?
Comment 8 Kenneth Rohde Christiansen 2010-06-03 12:59:27 PDT
Is this setting set for Qt?

document()->settings()->needsSiteSpecificQuirks()
Comment 9 Csaba Osztrogonác 2010-06-03 13:05:40 PDT
I cc-ed Andras, he is our CSS parser guru. Have you got any idea?
Comment 10 Dawit A. 2010-06-03 13:16:30 PDT
(In reply to comment #2)
> I cannot reproduce this with ToT WebKit, so I suspect that Qt has an old version of WebKit. Issues like this have been addressed in bug 28350, bug 29792, and bug 35507.

I checked and the fixes from all of those reports are there in QtWebKit 2.0 ; so something else is causing or preventing those fixes from having any effect in QtWebKit... Perhaps the suggestion in comment #8 ?? Dunno.
Comment 11 Alexey Proskuryakov 2010-06-03 13:18:34 PDT
Yes, comment 8 sounds like the best explanation.
Comment 12 Dawit A. 2010-06-08 11:24:44 PDT
Created attachment 58162 [details]
Patch

Here is a patch that fixes the problem.
Comment 13 Dawit A. 2010-06-08 11:26:13 PDT
(In reply to comment #8)
> Is this setting set for Qt?
> 
> document()->settings()->needsSiteSpecificQuirks()

Nope, it is not... See patch.
Comment 14 Kenneth Rohde Christiansen 2010-06-08 11:29:03 PDT
Comment on attachment 58162 [details]
Patch

WebKit/qt/Api/qwebsettings.cpp:434
 +          sites that use certain frameworks, such as the older versions of MediaWiki, may not render properly.
I'm not sure if we really want references to MediaWiki here. Also, I do not like "not render or display properly in it", as the case is actually that is is a workaround for broken sites, not just sites that do not look good.

WebKit/qt/Api/qwebsettings.h:77
 +          SiteSpecificQuirksModeEnabled
We might want a more understanding setting, Let's see what Simon says.

Apart from that, the idea is fine. R- due to semi-optimal documentation.
Comment 15 Dawit A. 2010-06-08 11:54:21 PDT
Created attachment 58165 [details]
Patch - rev. #2

Fixed the attribute documentation based on review in comment #14...
Comment 16 Kenneth Rohde Christiansen 2010-06-08 12:13:15 PDT
Comment on attachment 58165 [details]
Patch - rev. #2

r=me, as we can still change the name etc before cherry-picking this change.
Comment 17 Antonio Gomes 2010-06-08 12:18:09 PDT
no commit message? should be the same as in ChangeLog.

> diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
> index a5fc794..9631f05 100644
> --- a/WebKit/qt/Api/qwebsettings.cpp
> +++ b/WebKit/qt/Api/qwebsettings.cpp
> +    \value SiteSpecificQuirksModeEnabled This setting enables WebKit's workaround for broken sites. It is 
> +        enabled by default.

I do not think it is about WebKit workarounds. CSS Quirk Mode is a way that browsers (not only WebKit) support the old and broken CSS use that works for IE6 and family.

http://www.quirksmode.org/css/quirksmode.html

You are not mentioning about CSS in the setting name. Should you? or at least in the documentation. It is a CSS Mode and has Quirk and Strict modes.

I would not commit it as is :-( due to the documentation and the setting name.
Comment 18 Kenneth Rohde Christiansen 2010-06-08 12:47:10 PDT
Safari has it enabled by default and there is a menu for disabling it

Safari->Develop->Disable Site-Specific Hacks

Antonio, this has nothing to do with CSS Quirks and Strict mode, but are work around for broken sites.
Comment 19 Kenneth Rohde Christiansen 2010-06-08 12:49:43 PDT
(In reply to comment #18)
> Safari has it enabled by default and there is a menu for disabling it
> 
> Safari->Develop->Disable Site-Specific Hacks
> 
> Antonio, this has nothing to do with CSS Quirks and Strict mode, but are work around for broken sites.

I guess the QuicksMode in the name is confusing and maybe we should go for SiteSpecificHacksEnabled instead ? Let me cq-
Comment 20 Alexey Proskuryakov 2010-06-08 12:50:19 PDT
The reason to have a way to disable these workarounds is to give developers of those specific sites a way to test how their sites would work without the workarounds. Users never need to disable these workarounds.
Comment 21 Kenneth Rohde Christiansen 2010-06-11 18:44:18 PDT
Comment on attachment 58165 [details]
Patch - rev. #2

Can you supply a new patch where this is renamed QWebSettings:SiteSpecificQuirksEnabled due remove the Mode; then I will re-review.
Comment 22 Dawit A. 2010-06-11 22:33:25 PDT
Created attachment 58541 [details]
Patch - rev. #3

Renamed attribute to 'SiteSpecificQuirksEnabled' as requested...
Comment 23 Dawit A. 2010-06-11 22:49:14 PDT
(In reply to comment #21)
> (From update of attachment 58165 [details])
> Can you supply a new patch where this is renamed QWebSettings:SiteSpecificQuirksEnabled due remove the Mode; then I will re-review.

Done... Note that this version will not cleanly apply to the trunk version of qtwebkit since a new WebGLEnabled option is present there.
Comment 24 Kenneth Rohde Christiansen 2010-06-12 04:30:24 PDT
Can you supply a version that will?
Comment 25 Dawit A. 2010-06-12 09:13:23 PDT
Created attachment 58553 [details]
Same patch vs trunk...

Patch against the current trunk version of webkit...
Comment 26 WebKit Commit Bot 2010-06-12 11:05:21 PDT
Comment on attachment 58553 [details]
Same patch vs trunk...

Clearing flags on attachment: 58553

Committed r61064: <http://trac.webkit.org/changeset/61064>
Comment 27 Simon Hausmann 2010-06-13 14:15:51 PDT
Dawit, are you saying that in the KDE webkit integration you need to disable these site specific quirks, because of the user agent that you're sending?
Comment 28 Dawit A. 2010-06-13 15:02:48 PDT
(In reply to comment #27)
> Dawit, are you saying that in the KDE webkit integration you need to disable these site specific quirks, because of the user agent that you're sending?

Nope. This is not a KDE webkit specific issue. It is a QtWebKit bug that affects all QtWebKit based browser. See comments #1-3 above...
Comment 29 Simon Hausmann 2010-06-15 01:22:23 PDT
(In reply to comment #28)
> (In reply to comment #27)
> > Dawit, are you saying that in the KDE webkit integration you need to disable these site specific quirks, because of the user agent that you're sending?
> 
> Nope. This is not a KDE webkit specific issue. It is a QtWebKit bug that affects all QtWebKit based browser. See comments #1-3 above...

Right, but what I'd like to find out _who_ is going to use this web setting and disable the site specific quirks?
Comment 30 Antonio Gomes 2010-06-15 06:11:24 PDT
(In reply to comment #29)
> (In reply to comment #28)
> > (In reply to comment #27)
> > > Dawit, are you saying that in the KDE webkit integration you need to disable these site specific quirks, because of the user agent that you're sending?
> > 
> > Nope. This is not a KDE webkit specific issue. It is a QtWebKit bug that affects all QtWebKit based browser. See comments #1-3 above...
> 
> Right, but what I'd like to find out _who_ is going to use this web setting and disable the site specific quirks?

that is a good question. why to disable it at all or why its value in Settings.cpp|h is not true by default already?

fwiw, mac, win, gtk and chromium ports also have this setting as a public api.
Comment 31 Dawit A. 2010-06-15 06:30:49 PDT
(In reply to comment #29)
> (In reply to comment #28)
> > (In reply to comment #27)
> > > Dawit, are you saying that in the KDE webkit integration you need to disable these site specific quirks, because of the user agent that you're sending?
> > 
> > Nope. This is not a KDE webkit specific issue. It is a QtWebKit bug that affects all QtWebKit based browser. See comments #1-3 above...
> 
> Right, but what I'd like to find out _who_ is going to use this web setting and disable the site specific quirks?

Developers. The patch is implemented that way because other browsers provide a means of enabling/disabling this feature. See comment #18 and comment #20. It is only applicable to developers...
Comment 32 Kenneth Rohde Christiansen 2010-06-15 06:36:29 PDT
Site authors of sites currently affected by quirks who want to make their site standard compliant.
Comment 33 Simon Hausmann 2010-06-16 04:36:42 PDT
Makes sense, thanks :)

I'll swap the last two enums in qwebsettings.h to ensure binary compatibility when including it in the release branch.
Comment 34 Simon Hausmann 2010-06-16 04:54:00 PDT
Revision r61064 cherry-picked into qtwebkit-2.0 with commit 815815940c24badaefd9b4deeb1851534bd677e0
Comment 35 Simon Hausmann 2010-06-16 04:54:21 PDT
http://trac.webkit.org/changeset/61251 corrects the enum order