Last Comment Bug 338554 - -moz-box-sizing is not applied to a table cell
: -moz-box-sizing is not applied to a table cell
Status: RESOLVED FIXED
: dev-doc-complete, testcase
Product: Core
Classification: Components
Component: Layout: Tables (show other bugs)
: 1.8 Branch
: All All
: -- normal with 3 votes (vote)
: mozilla16
Assigned To: Tal Aloni
:
Mentors:
http://vitaly.harisov.name/example/ge...
: 495117 (view as bug list)
Depends on: 248239 778413
Blocks: 243412
  Show dependency treegraph
 
Reported: 2006-05-19 08:50 PDT by Vitaly Harisov
Modified: 2012-07-28 11:41 PDT (History)
16 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (893 bytes, text/html)
2008-10-18 12:19 PDT, Bernd
no flags Details
ff_table_cell_width (962 bytes, text/html)
2012-01-25 13:44 PST, Alex Shilov
no flags Details
Table Cell Width Patch - v1 (2.34 KB, patch)
2012-07-02 13:40 PDT, Tal Aloni
dbaron: review+
Details | Diff | Splinter Review
Test Case 1 - Border Box (891 bytes, text/html)
2012-07-02 13:46 PDT, Tal Aloni
no flags Details
Test Case 1 - Content Box (893 bytes, text/html)
2012-07-02 13:47 PDT, Tal Aloni
no flags Details
Test Case 1 - Padding Box (893 bytes, text/html)
2012-07-02 13:48 PDT, Tal Aloni
no flags Details
Test Case 1 - Content Box (893 bytes, text/html)
2012-07-02 13:51 PDT, Tal Aloni
no flags Details
Test Case 1 - Border Box (890 bytes, text/html)
2012-07-02 13:54 PDT, Tal Aloni
no flags Details
Test Case 1 - Padding Box (893 bytes, text/html)
2012-07-02 13:55 PDT, Tal Aloni
no flags Details
Table Cell Width Patch - v2 (2.42 KB, patch)
2012-07-12 14:44 PDT, Tal Aloni
tal.aloni.il: review+
Details | Diff | Splinter Review
Box sizing causing text wrapping in small table (197 bytes, text/html)
2012-07-27 19:22 PDT, voracity
no flags Details

Description Vitaly Harisov 2006-05-19 08:50:41 PDT
-moz-box-sizing: border-box is applied to generic block-level element, but isn't applied to table cell. See test-case.

Tested on:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060505 Firefox/1.5.0.3

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Comment 1 Bernd 2008-10-18 12:19:45 PDT
Created attachment 343741 [details]
testcase
Comment 2 Bernd 2009-05-29 05:33:50 PDT
*** Bug 495117 has been marked as a duplicate of this bug. ***
Comment 3 Dave Townsend [:mossop] 2009-05-29 09:28:20 PDT
*** Bug 495117 has been marked as a duplicate of this bug. ***
Comment 4 Alex Shilov 2012-01-25 13:44:18 PST
Created attachment 591594 [details]
ff_table_cell_width
Comment 5 Tal Aloni 2012-07-02 13:40:23 PDT
Created attachment 638476 [details] [diff] [review]
Table Cell Width Patch - v1

Hi,
I've already took care of table cell height in bug 248239,
This one on the other hand is a feature.

The attached patch does not do anything different unless -moz-box-sizing is set to border-box or padding-box.
Comment 6 Tal Aloni 2012-07-02 13:46:52 PDT
Created attachment 638478 [details]
Test Case 1 - Border Box
Comment 7 Tal Aloni 2012-07-02 13:47:39 PDT
Created attachment 638479 [details]
Test Case 1 - Content Box
Comment 8 Tal Aloni 2012-07-02 13:48:21 PDT
Created attachment 638480 [details]
Test Case 1 - Padding Box
Comment 9 Tal Aloni 2012-07-02 13:51:50 PDT
Created attachment 638484 [details]
Test Case 1 - Content Box
Comment 10 Tal Aloni 2012-07-02 13:54:41 PDT
Created attachment 638485 [details]
Test Case 1 - Border Box
Comment 11 Tal Aloni 2012-07-02 13:55:15 PDT
Created attachment 638486 [details]
Test Case 1 - Padding Box
Comment 12 David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch) 2012-07-12 12:32:15 PDT
Comment on attachment 638476 [details] [diff] [review]
Table Cell Width Patch - v1

># User Tal Aloni <tal.aloni.il@gmail.com>
>honor -moz-box-sizing in standards mode (we ignore it in quirks mode). bug 338554

put "on table cells" somewhere in this sentence

>+        // In quirks mode, table cell width should be content-box,
>+        // but height should be border box.
>+        // because of this historic anomaly, we do not use quirk.css
>+        // (we can't speficy one value of box-sizing for width and another
>+        // for height)
>+        // For this reason, we also do not use box-sizing for just one of them,
>+        // as this may be confusing.

speficy -> specify

Also, could you format this comment a bit more neatly, capitalize "because" and put a "." at the end of that sentence, capitalize "we" and again put a "." at the end of the sentence, and wrap the entire comment at somewhere between 72 and 78 characters

r=dbaron with that; sorry for the delay getting to this
Comment 13 j.j. 2012-07-12 13:33:48 PDT
Note:  https://developer.mozilla.org/en/CSS/Box-sizing
has a hint to this bug, needs an update
Comment 14 Tal Aloni 2012-07-12 14:44:08 PDT
Created attachment 641606 [details] [diff] [review]
Table Cell Width Patch - v2
Comment 15 Tal Aloni 2012-07-12 14:50:40 PDT
Hi,
Since I don't have permissions to add the "checkin-needed" keyword, I would appreciate if someone would add it for me.

checkin-buddy, I've learned to use hg just for you!

Thanks!
Tal
Comment 16 Ryan VanderMeulen [:RyanVM] 2012-07-12 16:34:12 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/f0f359a74772

And somebody please give the man editbugs privs! Also, Tal, please follow the directions below for future patches you submit. It makes life easier for those committing on your behalf. Thanks!
https://developer.mozilla.org/en/Creating_a_patch_that_can_be_checked_in

Also, should this have reftests?
Comment 17 Tal Aloni 2012-07-12 23:53:37 PDT
(In reply to Ryan VanderMeulen from comment #16)
> Tal, please follow the directions below for future patches you submit. It makes
> life easier for those committing on your behalf.
> https://developer.mozilla.org/en/Creating_a_patch_that_can_be_checked_in

Thanks Ryan, sorry for the trouble!
This time I used TortoiseHG instead of WinMerge, so I'm making some progress.
To be honest I've had a hard time to understand from this page what's needed to be done, though perhaps I've given up too quickly.

> should this have reftests?
it does, I previously tweaked one test to have -moz-box-sizing:border-box, and other tests use the default content-box.
(There are no tests for padding-box, but that's not an official CSS property)
Comment 18 j.j. 2012-07-13 04:35:46 PDT
So this introduces a new quirks mode difference, since "box-sizing" applies to table cells in standards mode only, right?
Comment 19 Tal Aloni 2012-07-13 04:45:56 PDT
(In reply to j.j. (inactive in 2012) from comment #18)
> "box-sizing" applies to table cells in standards mode only, right?
Yes.

> So this introduces a new quirks mode difference
quirks mode will continue to behave as it did, its behavior was not modified in any way.

However, if you specifically set -moz-box-sizing:border-box, then yes, it will not apply to quirks mode, but will apply to standards mode.
Comment 20 Ed Morley [:emorley] 2012-07-13 05:31:02 PDT
https://hg.mozilla.org/mozilla-central/rev/f0f359a74772
Comment 21 David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch) 2012-07-13 11:11:40 PDT
(In reply to Ryan VanderMeulen from comment #16)
> And somebody please give the man editbugs privs!

Done.  See https://developer.mozilla.org/en/What_to_do_and_what_not_to_do_in_Bugzilla

(In reply to Tal Aloni from comment #17)
> (In reply to Ryan VanderMeulen from comment #16)
> > should this have reftests?
> it does, I previously tweaked one test to have -moz-box-sizing:border-box,
> and other tests use the default content-box.
> (There are no tests for padding-box, but that's not an official CSS property)

I don't see this in the patch.  Which test?
Comment 22 Tal Aloni 2012-07-13 13:14:40 PDT
(In reply to David Baron [:dbaron] from comment #21)
> I don't see this in the patch.  Which test?
494667-2.html
incidentally, it now doubles as a test for border-box sizing, I already had to switch it to border-box in my previous patch because the original reftest violated the css specs, and now I fixed the width.
Comment 23 Jean-Yves Perrier [:teoli] 2012-07-18 14:11:48 PDT
I mentioned it on:
https://developer-new.mozilla.org/en-US/docs/Firefox_16_for_developers
and on
https://developer-new.mozilla.org/en-US/docs/CSS/box-sizing (though this one may be obsolete once we unprefix).
Comment 24 voracity 2012-07-27 19:22:11 PDT
Created attachment 646803 [details]
Box sizing causing text wrapping in small table

I think the fix for this is causing a wrapping problem in shrink-to-fit tables. (Or perhaps it's meant to work this way, but I hope not.)

In the attachment, the words are wrapped when I would not expect them to be.
Comment 25 Tal Aloni 2012-07-28 01:08:08 PDT
Voracity,
I can confirm the issue you are seeing with the newly implemented "box-sizing:border-box".
The wrapping behavior should indeed be similar to "content-box", I am currently trying to figure this out.
Comment 26 j.j. 2012-07-28 01:30:03 PDT
Please open a new bug if there are regressions.
Comment 27 Tal Aloni 2012-07-28 02:47:31 PDT
voracity, The issue you reported is now bug 778413, patch is coming soon.

Note You need to log in before you can comment on or make changes to this bug.