Bug 24402 - Copying from trac.webkit.org source tables does not maintain table cell width
Summary: Copying from trac.webkit.org source tables does not maintain table cell width
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-05 14:17 PST by Eric Seidel (no email)
Modified: 2022-12-16 16:21 PST (History)
6 users (show)

See Also:


Attachments
test case (1.50 KB, text/html)
2009-03-05 14:17 PST, Eric Seidel (no email)
no flags Details
test case which includes instructions (1.70 KB, text/html)
2009-03-05 14:19 PST, Eric Seidel (no email)
no flags Details
Testcase with instructions that uses a contentEditable div. (1.65 KB, text/html)
2009-03-06 17:11 PST, Ojan Vafai
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-03-05 14:17:40 PST
Copying from trac.webkit.org source tables does not maintain table cell width

See test case.

It turns out that the cell width is caused by the table header cells having a fixed width.  I'm not sure if the copied content should include that width information or not.  Currently we don't, which results in strange paste behavior.
Comment 1 Eric Seidel (no email) 2009-03-05 14:17:55 PST
Created attachment 28323 [details]
test case
Comment 2 Eric Seidel (no email) 2009-03-05 14:19:29 PST
Created attachment 28325 [details]
test case which includes instructions
Comment 3 Ojan Vafai 2009-03-06 17:11:47 PST
Created attachment 28380 [details]
Testcase with instructions that uses a contentEditable div.

Now the inline style="" on the TH elements is overriding the CSS stylesheet in the page.
Comment 4 Ojan Vafai 2009-03-06 17:18:22 PST
It looks to me like webkit is trying to figure out what styling applies to each node and maintain that in the copy-paste. This seems less good to me than just copying the raw html. 

Here are the use cases I see for copying:
1. You are copying within the same page, in which case, all the CSS selectors would continue to apply and you don't want all the bloat of inlining all the CSS.
2. You are copying from a web page and don't actually want all the styling from the page.
3. You are copying from this page to another program.
4. You are copying from a web page and wanting all the styling seems to me the rare case.

1 and 2 seem like the common cases to me. Although it might be a nice compromise to provide a copy that keeps all the styling, e.g., when you cmd+shift+c.
Comment 5 Ahmad Saleem 2022-12-16 16:21:20 PST
I am able to reproduce this issue in both attached test case in Safari Technology Preview 160 but it seems that it is intended behavior where the cell width is expanded since other browsers like Chrome Canary 110 and Firefox Nightly 110 also do this. (NOTE - "first" attachment from Eric does not work in Firefox Nightly 110).

Do we need to do more while all other browser matches each other?