Bug #3287
openWebKit WPaintedWidget WAbstractArea problem...
0%
Description
Hi,
I'm implementing a WebKit-based client with Qt 4.8.6 using QWebKit. Wt detects it as a WebKit client and the WAbstractArea are handled differently than for example in Firefox-Mode using wt-3.3.2:
1. Clicking an WAbstractArea does not work
- Rendered texts overlap if some boxes with texts are rendered over each other.
Changing the "User-Agent" to Firefox everything works perfectly!
Attached you will find 2 screenshots. First the standard WebKit User-Agent string which has the above problems and second the Firefox User-Agent string which works perfectly!
Files
Updated by Koen Deforche about 10 years ago
- Status changed from New to Feedback
- Assignee set to Koen Deforche
- Target version set to 3.3.4
Hey,
Can you see a difference in generated markup? The only reliance on user-agent that I can spot has to do with the href attribute, which I cannot imagine to have such a signficant effect?
Koen
Updated by Stefan Ruppert about 10 years ago
- File WebView-map.html WebView-map.html added
- File Firefox-map.html Firefox-map.html added
Hi Koen,
no I can't see any difference in the markup. However is the image is rendered on the server side and referenced with the tag? Maybe there is something wrong?
Also the event code seems to me to be equal. Maybe the event gets filtered out in a WebKit environment?
Regards,
Stefan
Updated by Koen Deforche about 10 years ago
Hey,
I've got two hypotheses on where it goes wrong:
- (less likely) in WPaintedWidget::getMethod() there are heuristics to choose a method for rendering the graphics taking into account browser limitations. The default drawing method is 'HTML5Canvas'; is this being returned also for the native QT5 agent?
- (more likely) in WCanvasPaintDevice, we support different ways to render text based on browser support. Initially the HTML5 Canvas spec did not include text rendering and then we worked around this. I suspect that this is the problem: QT5 is detected as an agent without HTML5 rendering support. You can check this by changing the default textMethod_ = DomText to textMethod_ = HTML5Text inside the WCanvasPaintDevice constructor.
What's the exact default user agent string for Qt5?
Regards,
koen
Updated by Stefan Ruppert about 10 years ago
Here is the WebKit userAgent string. Note its not Qt5 its Qt 4.8!
"Mozilla/5.0 (X11; N; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) Manager Safari/534.34"
Regards,
Stefan
Updated by Koen Deforche about 10 years ago
Hey Stefan,
That would indicate the WCanvasPaintDevice hypothesis. Could you confirm that?
Koen
Updated by Stefan Ruppert about 10 years ago
Hi Koen,
yes, changing the default textMethod_ to Html5Text helps!
I'm patching 3.3.2 to use Html5Text as default!
Thanks,
Stefan