REOPENED 69631
Towards making PopupMenuClient more testable
https://bugs.webkit.org/show_bug.cgi?id=69631
Summary Towards making PopupMenuClient more testable
Fady Samuel
Reported 2011-10-07 08:45:33 PDT
Towards making PopupMenuClient more testable
Attachments
Patch (18.92 KB, patch)
2011-10-07 08:49 PDT, Fady Samuel
no flags
Patch (19.80 KB, patch)
2011-10-11 15:42 PDT, Fady Samuel
no flags
Patch for landing (19.64 KB, patch)
2011-10-11 16:32 PDT, Fady Samuel
no flags
Patch (30.55 KB, patch)
2011-10-13 15:50 PDT, Fady Samuel
no flags
Patch (30.61 KB, patch)
2011-10-13 16:25 PDT, Fady Samuel
no flags
Patch (32.77 KB, patch)
2011-10-13 22:10 PDT, Fady Samuel
no flags
Patch (32.77 KB, patch)
2011-10-13 22:13 PDT, Fady Samuel
no flags
Patch (33.46 KB, patch)
2011-10-14 01:37 PDT, Fady Samuel
no flags
Patch (33.46 KB, patch)
2011-10-14 07:39 PDT, Fady Samuel
no flags
Patch (34.09 KB, patch)
2011-10-14 12:40 PDT, Fady Samuel
no flags
Fady Samuel
Comment 1 2011-10-07 08:49:58 PDT
WebKit Review Bot
Comment 2 2011-10-07 09:29:08 PDT
Comment on attachment 110151 [details] Patch Attachment 110151 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/10007233 New failing tests: fast/dom/select-element-height.html
Simon Fraser (smfr)
Comment 3 2011-10-11 11:55:01 PDT
Comment on attachment 110151 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110151&action=review I like the general pattern, but see comments for nits. > Source/WebCore/rendering/RenderObject.h:301 > + virtual PopupMenuClient* popupMenuClient() { return 0; } popupMenuClient() should only be present in derived classes, not here. > Source/WebCore/rendering/RenderTextControlSingleLine.cpp:618 > + return absoluteBoundingBoxRect(true); Aren't we using an enum now? > Source/WebCore/testing/Internals.idl:69 > + int popupClientPaddingLeft(in Element element) raises (DOMException); > + int popupClientPaddingRight(in Element element) raises (DOMException); Is it really useful to test paddingLeft and paddingRight?
Fady Samuel
Comment 4 2011-10-11 12:27:56 PDT
Comment on attachment 110151 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110151&action=review >> Source/WebCore/rendering/RenderObject.h:301 >> + virtual PopupMenuClient* popupMenuClient() { return 0; } > > popupMenuClient() should only be present in derived classes, not here. I'm not sure how to get around this. There is an issue with casting and multiple inheritance. RenderMenuList uses multiple inheritance. If I cast RenderObject to PopupMenuClient in Internals.cpp, it might not do the necessary thunking: http://en.wikipedia.org/wiki/Virtual_method_table because it has no idea where the appropriate vtable is. I suppose if I rearrange public RenderDeprecatedFlexibleBox, public ListPopupMenuClient to public ListPopupMenuClient, public RenderDeprecatedFlexibleBox the problem will fix itself (depending on compiler) but this would make the code very sensitive to breakage in the future that will be very hard to debug. >> Source/WebCore/rendering/RenderTextControlSingleLine.cpp:618 >> + return absoluteBoundingBoxRect(true); > > Aren't we using an enum now? No. The signature is absoluteBoundingBoxRect(bool useTransforms = true), alternatively there's an absoluteBoundingBoxRectIgnoringTransforms(). See https://bugs.webkit.org/show_bug.cgi?id=69009 >> Source/WebCore/testing/Internals.idl:69 >> + int popupClientPaddingRight(in Element element) raises (DOMException); > > Is it really useful to test paddingLeft and paddingRight? I believe so, at some point you asked me to make sure they take page scale factor into account for this patch: https://bugs.webkit.org/show_bug.cgi?id=66062
Fady Samuel
Comment 5 2011-10-11 15:42:22 PDT
Simon Fraser (smfr)
Comment 6 2011-10-11 16:11:25 PDT
Comment on attachment 110592 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110592&action=review > Source/WebCore/rendering/RenderMenuList.cpp:307 > + m_popup->show(boundingBoxRect(), document()->view(), > select->optionToListIndex(select->selectedIndex())); You could unwrap this line. > Source/WebCore/testing/Internals.cpp:457 > + return reinterpret_cast<PopupMenuClient*>(object); This should be a static_cast too. > Source/WebCore/testing/Internals.cpp:472 > + return 0; > + > +} Extra blank line. > Source/WebCore/testing/Internals.h:107 > + static const PopupMenuClient* toPopupMenuClient(RenderObject*); I don't think there's any benefit in this being a class method. It could just be static in the impl.
Fady Samuel
Comment 7 2011-10-11 16:32:44 PDT
Created attachment 110601 [details] Patch for landing
Fady Samuel
Comment 8 2011-10-11 16:34:25 PDT
Comment on attachment 110592 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110592&action=review >> Source/WebCore/rendering/RenderMenuList.cpp:307 >> select->optionToListIndex(select->selectedIndex())); > > You could unwrap this line. Done. >> Source/WebCore/testing/Internals.cpp:457 >> + return reinterpret_cast<PopupMenuClient*>(object); > > This should be a static_cast too. This can't be a static cast. A PopupMenuClient is not a subclass of RenderObject. >> Source/WebCore/testing/Internals.cpp:472 >> +} > > Extra blank line. Done. >> Source/WebCore/testing/Internals.h:107 >> + static const PopupMenuClient* toPopupMenuClient(RenderObject*); > > I don't think there's any benefit in this being a class method. It could just be static in the impl. Done.
WebKit Review Bot
Comment 9 2011-10-11 17:18:37 PDT
Comment on attachment 110601 [details] Patch for landing Clearing flags on attachment: 110601 Committed r97202: <http://trac.webkit.org/changeset/97202>
WebKit Review Bot
Comment 10 2011-10-11 17:18:42 PDT
All reviewed patches have been landed. Closing bug.
Ryosuke Niwa
Comment 11 2011-10-11 18:12:28 PDT
This patch broke Chromium Windows build. Build fix attempted in http://trac.webkit.org/changeset/97207.
Ryosuke Niwa
Comment 12 2011-10-11 19:01:28 PDT
This patch also broke Mac builds: http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20%28Build%29/builds/34669/steps/compile-webkit/logs/stdio Undefined symbols: "__ZN7WebCore9InlineBox14selectionStateEv", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultERKNS_8IntPointES8_ii", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox11extractLineEv", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox5paintERNS_9PaintInfoERKNS_8IntPointEii", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox7destroyEPNS_11RenderArenaE", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox14adjustPositionEff", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBoxdlEPvm", referenced from: __ZN7WebCore9InlineBoxD0Ev in Internals.o "__ZNK7WebCore9InlineBox14caretMaxOffsetEv", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox22canAccommodateEllipsisEbii", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox10attachLineEv", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox16placeEllipsisBoxEbfffRb", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZN7WebCore9InlineBox10deleteLineEPNS_11RenderArenaE", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o "__ZNK7WebCore9InlineBox14caretMinOffsetEv", referenced from: __ZTVN7WebCore9InlineBoxE in Internals.o I don't think we wan to expose all these symbols from WebCore.
Ryosuke Niwa
Comment 14 2011-10-11 19:27:06 PDT
Apparently including RenderMenuList.h causes Internals.cpp to use InlineBox's destructor.
Ryosuke Niwa
Comment 15 2011-10-11 19:48:09 PDT
Reopen the bug since the patch was rolled out.
Collabora GTK+ EWS bot
Comment 16 2011-10-12 04:42:41 PDT
Comment on attachment 110601 [details] Patch for landing Attachment 110601 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/10028827
Fady Samuel
Comment 17 2011-10-12 13:03:34 PDT
(In reply to comment #12) > This patch also broke Mac builds: > http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20%28Build%29/builds/34669/steps/compile-webkit/logs/stdio > > Undefined symbols: > "__ZN7WebCore9InlineBox14selectionStateEv", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultERKNS_8IntPointES8_ii", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox11extractLineEv", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox5paintERNS_9PaintInfoERKNS_8IntPointEii", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox7destroyEPNS_11RenderArenaE", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox14adjustPositionEff", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBoxdlEPvm", referenced from: > __ZN7WebCore9InlineBoxD0Ev in Internals.o > "__ZNK7WebCore9InlineBox14caretMaxOffsetEv", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox22canAccommodateEllipsisEbii", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox10attachLineEv", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox16placeEllipsisBoxEbfffRb", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZN7WebCore9InlineBox10deleteLineEPNS_11RenderArenaE", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > "__ZNK7WebCore9InlineBox14caretMinOffsetEv", referenced from: > __ZTVN7WebCore9InlineBoxE in Internals.o > > I don't think we wan to expose all these symbols from WebCore. Odd this seems to only happen on release builds. Ryosuke and I had a discussion last night to move access to RenderMenuList to HTMLSelectElement and then export those symbols.. rather than export the symbols above.
Fady Samuel
Comment 18 2011-10-13 15:50:25 PDT
Fady Samuel
Comment 19 2011-10-13 16:25:28 PDT
Fady Samuel
Comment 20 2011-10-13 22:10:37 PDT
Fady Samuel
Comment 21 2011-10-13 22:13:04 PDT
Fady Samuel
Comment 22 2011-10-14 01:37:00 PDT
Fady Samuel
Comment 23 2011-10-14 07:39:40 PDT
Fady Samuel
Comment 24 2011-10-14 12:40:34 PDT
Note You need to log in before you can comment on or make changes to this bug.