Bug 25558 - Rendering fix for <select> elements.
Summary: Rendering fix for <select> elements.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Adam Langley
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-04 19:38 PDT by Adam Langley
Modified: 2009-05-05 22:30 PDT (History)
0 users

See Also:


Attachments
patch (5.45 KB, patch)
2009-05-04 19:41 PDT, Adam Langley
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Langley 2009-05-04 19:38:30 PDT
Rendering fix for <select> elements.

When switching a <select> element from display:none to default
display, we would fail to invalidate the parent's pref widths in some
situations:

When attaching the element, RenderMenuList::updateOptionsWidth would
call setNeedsLayoutAndPrefWidthsRecalc before the parent pointer was
set. This would mark the pref widths as dirty, but not for any parent
objects.

When RenderObjectChildList::appendChildNode later calls
setNeedsLayoutAndPrefWidthsRecalc again, with a valid parent pointer,
nothing would be done because the pref widths were already dirty for
the RenderMenuList.

Without this patch, the <select> element will spill outside of the
table in the layout test.

This issue was often hidden because, depending on whitespace,
the presence of <option> elements etc, there would often be an empty
RenderText node after the <select> element. This could do the job of
invalidating the parent's pref widths. It's only when this element
isn't present that the bug bites.
Comment 1 Adam Langley 2009-05-04 19:41:09 PDT
Created attachment 30007 [details]
patch
Comment 2 Darin Adler 2009-05-04 20:01:20 PDT
Comment on attachment 30007 [details]
patch

Looks fine, r=me
Comment 3 Eric Seidel (no email) 2009-05-05 22:30:57 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/forms/select-dirty-parent-pref-widths.html
	A	LayoutTests/platform/mac/fast/forms/select-dirty-parent-pref-widths-expected.checksum
	A	LayoutTests/platform/mac/fast/forms/select-dirty-parent-pref-widths-expected.txt
	M	WebCore/ChangeLog
	M	WebCore/rendering/RenderMenuList.cpp
Committed r43278