Bug 15371

Summary: white-space:nowrap makes <td> expand to fit <marquee> content
Product: WebKit Reporter: Anantha Keesara <anantha>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ap, mitz, rniwa, simon.fraser, zalan
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: PC   
OS: Windows XP   
URL: http://auto.qianlong.com/
Bug Depends on: 15218    
Bug Blocks:    
Attachments:
Description Flags
white-space:nowrap causes marquee to extend outside the border
none
reduced test case
none
even more reduced case (FF2 "passes", FF3 "fails", Safari3 "fails")
none
Safari 15.5 differs from other browsers none

Description Anantha Keesara 2007-10-04 08:13:08 PDT
I .Steps:
-----------
1. Go to: http://auto.qianlong.com/


II. Issue:
-----------------
Notice the heading of the sections outside the border. Also the marquee extends outside the border.

III. Other browsers:
-----------------
IE, FF, Opera: NO issue.
Safari: has above mentioned issue.
Comment 1 Anantha Keesara 2007-10-04 08:14:28 PDT
Created attachment 16533 [details]
white-space:nowrap causes marquee to extend outside the border
Comment 2 Eric Seidel (no email) 2008-01-11 15:53:44 PST
I wonder if this is relate to or even a duplicate of bug 15218.
Comment 3 Eric Seidel (no email) 2008-01-17 03:50:00 PST
Ok, I've reduced this further.  It looks like we don't correctly "disconnect" the <marquee> block from its parent, and thus allow it to force its parent cell to wider than it should be.
Comment 4 Eric Seidel (no email) 2008-01-17 03:50:16 PST
Created attachment 18498 [details]
reduced test case
Comment 5 Eric Seidel (no email) 2008-01-17 13:13:28 PST
Created attachment 18508 [details]
even more reduced case (FF2 "passes", FF3 "fails", Safari3 "fails")

Bah!  It looks like FF3 changed FF's behavior here to match ours.  I've reduced the test case to remove any whitespace from the marquee.
Comment 6 Eric Seidel (no email) 2008-01-17 13:17:09 PST
I've confirmed with the original page.  FF3 renders the <marquee> on the original page exactly like Safari3 does.  FF2 renders the marquee as the author intended.  To fix this, we'll need to understand why FF3 changed their <td>/<marquee> sizing behavior.
Comment 7 Eric Seidel (no email) 2008-01-17 14:42:57 PST
This was also interesting.  From Marquee::updateMarqueeStyle():

        // Hack alert: Set the white-space value to nowrap for horizontal marquees with inline children, thus ensuring
        // all the text ends up on one line by default.  Limit this hack to the <marquee> element to emulate
        // WinIE's behavior.  Someone using CSS3 can use white-space: nowrap on their own to get this effect.
        // Second hack alert: Set the text-align back to auto.  WinIE completely ignores text-align on the
        // marquee element.
        // FIXME: Bring these up with the CSS WG.
        if (isHorizontal() && m_layer->renderer()->childrenInline()) {
            s->setWhiteSpace(NOWRAP);
            s->setTextAlign(TAAUTO);
        }
Comment 8 Ahmad Saleem 2022-06-24 09:39:51 PDT
Created attachment 460481 [details]
Safari 15.5 differs from other browsers

I am able to reproduce this bug based on attached test case in Safari 15.5 on macOS 12.4

As can be seen in the screenshot, the table <td> width is enough to show bit text pass on due to <marquee> pass-on (by coincidence, I captured when there was no text in marquee) but other browser match each other (Chrome Canary and Firefox Nightly). Thanks!