Bug 15371 - white-space:nowrap makes <td> expand to fit <marquee> content
Summary: white-space:nowrap makes <td> expand to fit <marquee> content
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL: http://auto.qianlong.com/
Depends on: 15218
  Show dependency treegraph
Reported: 2007-10-04 08:13 PDT by Anantha Keesara
Modified: 2022-06-24 17:14 PDT (History)
6 users (show)

See Also:

white-space:nowrap causes marquee to extend outside the border (1.38 KB, text/html)
2007-10-04 08:14 PDT, Anantha Keesara
no flags Details
reduced test case (262 bytes, text/html)
2008-01-17 03:50 PST, Eric Seidel (no email)
no flags Details
even more reduced case (FF2 "passes", FF3 "fails", Safari3 "fails") (198 bytes, text/html)
2008-01-17 13:13 PST, Eric Seidel (no email)
no flags Details
Safari 15.5 differs from other browsers (390.46 KB, image/png)
2022-06-24 09:39 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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()) {
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!