Bug 12691

Summary: Generated content and display: table-cell duplicates content on font size change
Product: WebKit Reporter: Elliott Sprehn <esprehn>
Component: CSSAssignee: Dave Hyatt <hyatt>
Severity: Normal CC: ddkilzer, mitz
Priority: P2 Keywords: HasReduction
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://enfinitystudios.thaposse.net/personal/bugs/table-cell-error.html
Description Flags
Test Case
Patch to fix the problem.
hyatt: review-
Better version of patch.
oliver: review+
Fix issues with table display types oliver: review+

Description Elliott Sprehn 2007-02-08 00:24:30 PST
An element that has display: table-cell and generated content (with :before or :after) will regenerate this content after a font size change.

Using Apple++ or Apple+- to increase and decrease the font size on the linked page the content specified in the css will be generated again with each increase or decrease in the font size.

This occurs when font is changed by Javascript or the User.

Reproducible with both Konqueror and Safari, official 2.0.4 (419.3) and latest nightly (Thu Feb 8 6:10:29 GMT 2007) builds.
Comment 1 Elliott Sprehn 2007-02-08 11:14:47 PST
Created attachment 13061 [details]
Test Case
Comment 2 Dave Hyatt 2007-04-30 20:40:21 PDT
Created attachment 14282 [details]
Patch to fix the problem.

This patch fixes the problem by making sure we drill into anonymous containers to find generated content that may have been wrapped.
Comment 3 Dave Hyatt 2007-04-30 20:42:01 PDT
Comment on attachment 14282 [details]
Patch to fix the problem.

There's a minor problem.  Need to fix.
Comment 4 Dave Hyatt 2007-04-30 20:57:48 PDT
Created attachment 14283 [details]
Better version of patch.

Fixed a mistake made later in the function where the innermost container was incorrectly used when doing the insertion of the content.  Go layout tests.
Comment 5 Dave Hyatt 2007-04-30 21:52:04 PDT
Created attachment 14284 [details]
Fix issues with table display types

Even though layout tests passed (and the reduction passed), my own further testing before landing caught some additional issues with table display types and generated content.  We weren't making the right kind of anonymous container for generated content even though we kept the table display type.
Comment 6 Darin Adler 2007-04-30 22:01:10 PDT
Comment on attachment 14284 [details]
Fix issues with table display types

+    bool oldContentPresent = child;

For MSVC that needs to be !!child instead of just child used as a boolean.

Comment 7 Dave Hyatt 2007-04-30 22:11:15 PDT