WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
106143
min-width/max-width of min-content/max-content don't work correctly if the width set
https://bugs.webkit.org/show_bug.cgi?id=106143
Summary
min-width/max-width of min-content/max-content don't work correctly if the wi...
Ojan Vafai
Reported
2013-01-04 16:04:51 PST
Created
attachment 181400
[details]
test case See test case. Mozilla nightly gets this right. This is the same root cause as
bug 97747
. I think we might need to add a concept of minContent/maxContent in addition to min/maxPreferredLogicalWidth. The former is not be affected by the width being set, the latter is.
Attachments
test case
(321 bytes, text/html)
2013-01-04 16:04 PST
,
Ojan Vafai
no flags
Details
screenshot of different browsers
(43.98 KB, image/png)
2013-01-07 10:47 PST
,
Ojan Vafai
no flags
Details
better test case
(458 bytes, text/html)
2013-01-07 10:47 PST
,
Ojan Vafai
no flags
Details
another test case
(568 bytes, text/html)
2013-01-22 16:38 PST
,
Ojan Vafai
no flags
Details
Patch
(28.90 KB, patch)
2013-03-19 19:30 PDT
,
Ojan Vafai
no flags
Details
Formatted Diff
Diff
Patch
(29.83 KB, patch)
2013-03-19 20:34 PDT
,
Ojan Vafai
no flags
Details
Formatted Diff
Diff
Patch
(31.09 KB, patch)
2013-03-29 12:15 PDT
,
Ojan Vafai
tony
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Ojan Vafai
Comment 1
2013-01-07 10:47:00 PST
Created
attachment 181529
[details]
screenshot of different browsers Browsers disagree about how to render this.
Ojan Vafai
Comment 2
2013-01-07 10:47:38 PST
That was IE9, FF17 and Chrome at WebKit
r136968
.
Ojan Vafai
Comment 3
2013-01-07 10:47:57 PST
Created
attachment 181530
[details]
better test case
Ojan Vafai
Comment 4
2013-01-07 13:29:23 PST
Thread on www-style:
http://lists.w3.org/Archives/Public/www-style/2013Jan/0046.html
Ojan Vafai
Comment 5
2013-01-22 16:38:21 PST
Created
attachment 184072
[details]
another test case fixed width applies when done to a flexbox that is a flex-item. Should be the same root cause.
Ojan Vafai
Comment 6
2013-01-28 18:30:32 PST
***
Bug 108134
has been marked as a duplicate of this bug. ***
Ojan Vafai
Comment 7
2013-03-19 19:30:36 PDT
Created
attachment 193970
[details]
Patch
WebKit Review Bot
Comment 8
2013-03-19 20:17:15 PDT
Comment on
attachment 193970
[details]
Patch
Attachment 193970
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://webkit-commit-queue.appspot.com/results/17230223
New failing tests: css3/flexbox/box-sizing.html
Build Bot
Comment 9
2013-03-19 20:30:16 PDT
Comment on
attachment 193970
[details]
Patch
Attachment 193970
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-commit-queue.appspot.com/results/17137524
New failing tests: css3/flexbox/box-sizing.html
Ojan Vafai
Comment 10
2013-03-19 20:34:18 PDT
Created
attachment 193975
[details]
Patch
Elliott Sprehn
Comment 11
2013-03-19 22:04:09 PDT
Comment on
attachment 193975
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=193975&action=review
What's the benefit of passing all these values around as ref params?
> Source/WebCore/rendering/RenderBlock.cpp:5750 > +void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
It's pretty weird to have this method be "const" but take ref params to instance members so it's not const at all :/
> Source/WebCore/rendering/RenderBlock.cpp:5768 > + Length w = toRenderTableCell(this)->styleOrColLogicalWidth();
Would be nice to ditch the single letter variables.
> Source/WebCore/rendering/RenderBlock.h:904 > + void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const;
Block is const but inline isnt?
Ojan Vafai
Comment 12
2013-03-19 22:21:09 PDT
(In reply to
comment #11
)
> (From update of
attachment 193975
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=193975&action=review
> > What's the benefit of passing all these values around as ref params?
Tried to explain this in the ChangeLog. computeInstrinsicLogicalWidths needs to pass these values in because it's not always setting the preferred width member variable.
> > Source/WebCore/rendering/RenderBlock.cpp:5750 > > +void RenderBlock::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const > > It's pretty weird to have this method be "const" but take ref params to instance members so it's not const at all :/
The method is const. Sometimes you pass in member variables as the out params and sometimes you pass stack variables.
> > Source/WebCore/rendering/RenderBlock.cpp:5768 > > + Length w = toRenderTableCell(this)->styleOrColLogicalWidth(); > > Would be nice to ditch the single letter variables.
I was just moving the code, but I may as well fix the name while I'm changing the code.
> > Source/WebCore/rendering/RenderBlock.h:904 > > + void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const; > > Block is const but inline isnt?
Yeah, I started down the rabbit-hole of trying to make computeInlinePreferredLogicalWidths const and it was a tangled web that I didn't want to dive into right now. For now, I have a FIXME in the calling location. I suppose the FIXME should be here as well.
Tony Chang
Comment 13
2013-03-21 12:10:55 PDT
Comment on
attachment 193975
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=193975&action=review
This looks OK to me, but I would address Elliott's feedback as well (single letter variable and FIXME in RenderBlock.h.
> LayoutTests/ChangeLog:15 > + * platform/chromium-win/fast/table/overflowHidden-expected.txt: > + The new result correctly adds the scrollbar width to the table cell intrinsic width.
Why is there no updated pixel result for this?
> LayoutTests/ChangeLog:25 > + * scrollbars/custom-scrollbar-table-cell-expected.png: > + The new result correctly adds the scrollbar width to the table cell intrinsic width.
Is this test still testing what it's supposed to be testing? Certainly the comment in the test about there being 2 grey scrollbars with a black thumb needs to be updated.
Ojan Vafai
Comment 14
2013-03-29 12:13:56 PDT
Comment on
attachment 193975
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=193975&action=review
>> LayoutTests/ChangeLog:15 >> + The new result correctly adds the scrollbar width to the table cell intrinsic width. > > Why is there no updated pixel result for this?
The elements that changed are below the fold, so they don't show up in the pixel dump.
>> LayoutTests/ChangeLog:25 >> + The new result correctly adds the scrollbar width to the table cell intrinsic width. > > Is this test still testing what it's supposed to be testing? Certainly the comment in the test about there being 2 grey scrollbars with a black thumb needs to be updated.
Good catch. I'm pretty sure the new result is correct and the comment is wrong. Updated the comment.
Ojan Vafai
Comment 15
2013-03-29 12:15:46 PDT
Created
attachment 195777
[details]
Patch
Tony Chang
Comment 16
2013-03-29 12:49:58 PDT
Comment on
attachment 195777
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=195777&action=review
> Source/WebCore/ChangeLog:3 > + min-width/max-width of min-content/max-content don't work correctly if the width set
"if the width set" is awkward. Maybe "if width is specified"
> Source/WebCore/rendering/RenderBlock.cpp:5756 > + // FIXME: Remove this const_casts.
Nit: const_casts -> const_cast
> LayoutTests/ChangeLog:15 > + * platform/chromium-win/fast/table/overflowHidden-expected.txt: > + The new result correctly adds the scrollbar width to the table cell intrinsic width.
I would make a note why the pixel result isn't updated.
Ojan Vafai
Comment 17
2013-03-29 13:10:30 PDT
Committed
r147245
: <
http://trac.webkit.org/changeset/147245
>
Benjamin Poulain
Comment 18
2013-04-02 12:56:47 PDT
Committed
r147488
: <
http://trac.webkit.org/changeset/147488
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug