Bug 108134 - min/max-content as min/max-width is not set properly
Summary: min/max-content as min/max-width is not set properly
Status: RESOLVED DUPLICATE of bug 106143
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: KyungTae Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-28 16:57 PST by KyungTae Kim
Modified: 2013-01-28 18:30 PST (History)
6 users (show)

See Also:


Attachments
Patch (5.17 KB, patch)
2013-01-28 17:02 PST, KyungTae Kim
ojan: review-
Details | Formatted Diff | Diff
testcase screenshot(current) (9.97 KB, image/png)
2013-01-28 17:22 PST, KyungTae Kim
no flags Details
testcase screenshot(expected) (6.88 KB, image/png)
2013-01-28 17:23 PST, KyungTae Kim
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description KyungTae Kim 2013-01-28 16:57:26 PST
Currently, min/max-content as min/max-width  is not set properly when the width is fixed.
It's because the preferredWidth is not properly updated when the width is fixed.
The preferredWidth should be updated when the min/max-width is min/max-content.
Comment 1 KyungTae Kim 2013-01-28 17:02:16 PST
Created attachment 185109 [details]
Patch
Comment 2 KyungTae Kim 2013-01-28 17:22:47 PST
Created attachment 185113 [details]
testcase screenshot(current)
Comment 3 KyungTae Kim 2013-01-28 17:23:18 PST
Created attachment 185114 [details]
testcase screenshot(expected)
Comment 4 Ojan Vafai 2013-01-28 18:29:56 PST
Comment on attachment 185109 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185109&action=review

> Source/WebCore/rendering/RenderBlock.cpp:5671
> +        && !styleToUse->logicalMinWidth().isMinContent() && !styleToUse->logicalMaxWidth().isMinContent()
> +        && !styleToUse->logicalMinWidth().isMaxContent() && !styleToUse->logicalMaxWidth().isMaxContent())

This isn't quite right. See http://dev.w3.org/csswg/css3-sizing/#block-intrinsic. Specifically, see the difference between the min/max-measure vs. the min/max-measure *contribution*. Translating those terms into WebKit terms, the preferred width is the min/max measure contribution. The newly added concept of intrinsic with is the min/max measure. This is a bit confusing, because there's lots of old code that treats intrinsic widths and preferred widths as the same.

In this patch, you're changed both, but you only want to be changing the min/max measure.

I've been working on this in pieces. Look at my recent patches adding computeIntrinsicLogicalWidths. We basically need to make changes like that for all the computePreferredLogicalWidths overrides and then in the end, we change min-content/max-content to use the intrinsic widths and not the preferred widths.
Comment 5 Ojan Vafai 2013-01-28 18:30:32 PST

*** This bug has been marked as a duplicate of bug 106143 ***