Summary: | css styled input text changed via js events problems - testcase | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Andrea Iacovitti <aiacovitti> |
Component: | khtml | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | germain |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
testcase
new testcase - added textarea screenshot of form corruption |
Description
Andrea Iacovitti
2009-11-30 12:58:04 UTC
Created attachment 38709 [details]
testcase
SVN commit 1078782 by ggarand: Patch by Andrea Iacovitti <aiacovitti@libero.it> : .factor logic to determine if native widget borders should be turned off .rename method determining if painting CSS borders is necessary .use the former more systematically where needed .partial fix for #216795 CCBUG:216795 CCBUG:200795 M +6 -6 render_form.cpp M +6 -5 render_replaced.cpp M +6 -1 render_replaced.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1078782 SVN commit 1078783 by ggarand: make that restoration code a tad more thorough (other kind of frames should be dynamically restored too) CCBUG:216795 M +9 -6 render_replaced.cpp M +2 -0 render_replaced.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1078783 Thanks for patching, Germain. I made some test about revision 1078783 and it seems that restoration code doesn't work with other widget other than lineEdit. Possible fix would be to set m_nativeFrameShape only if frame->frameShape() != QFrame::NoFrame @@ -483,8 +483,10 @@ // Border: if (QFrame* frame = qobject_cast<QFrame*>(m_widget)) { if (shouldDisableNativeBorders()) { - m_nativeFrameShape = frame->frameShape(); - frame->setFrameShape(QFrame::NoFrame); + if (frame->frameShape() != QFrame::NoFrame) { + m_nativeFrameShape = frame->frameShape(); + frame->setFrameShape(QFrame::NoFrame); + } } else if (m_nativeFrameShape != QFrame::NoFrame) { frame->setFrameShape(m_nativeFrameShape); } It works for me. I will attach new testcase. Regards, Andrea. Created attachment 40201 [details]
new testcase - added textarea
thanks for the neat testcase!
and patch is fine of course, good catch, I'll apply it.
While here btw, I investigated on:
> 1- Bug related to the clear button
> Actually a clear button is shown on lineedit widget when it has no css border
> nor background image (function RenderLineEdit::setStyle in render_form.cpp). If
> you try to edit on the first input text, the style switches to the native one
> (no css border, no background image) then clear button have to be shown.
in fact, it's not a style cycle. It's a cycle of, most likely, update events or maybe key events.
our widgets are a bit special because of z-order management needs...
(look for the word "redirection" in khtmlview.cpp, and KHTMLView::eventFilter for the gory details)
e.g we need to handle things like data:text/html,<input type=text><div style=background-color:blue;width:20px;height:20px;position:relative;top:-10px;left:30px>
To achieve this, we notably need to install a common eventFilter on every widget, and every widget's children to redirect all events.
We do this when receiving a QEvent::ChildPolished in KHTMLView from every newly inserted widgets.
So here the problem is that the 'clear button' child widget is created dynamically when setting isClearButtonShown(), long after its parent has been inserted in the view. So it's eventFilter never gets installed and it wreak havocs on its event handling.
SVN commit 1079857 by ggarand: patch by Andrea Iacovitti to fix my flawed logic, thanks :-) CCBUG: 216795 M +5 -2 render_replaced.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1079857 SVN commit 1079858 by ggarand: fix event cycle happening on google-custom-search linedit widgets BUG: 216795 M +8 -1 render_form.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1079858 Created attachment 40356 [details]
screenshot of form corruption
r1079858 regressed, see screenshot.
oh no, thanks Tommi... I forgot that findChildren is recursive, so my isWindow() check is broken, the thing gets installed on window children's children ;-( SVN commit 1083713 by ggarand: fix nasty regression noticed by Tommi. This event filter was being installed recursively, causing linedit completion popups to appear corrupted. CCBUG: 216795 M +5 -3 render_form.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1083713 SVN commit 1083714 by ggarand: Backport this nasty RC3 regression fix ;-( ---------- automatically merged revision 1083713: fix nasty regression noticed by Tommi. This event filter was being installed recursively, causing linedit completion popups to appear corrupted. CCBUG: 216795 M +5 -3 render_form.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1083714 |