Bug 38249 - Vertically shrinking flexbox has wrong height when padding is specified
Summary: Vertically shrinking flexbox has wrong height when padding is specified
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 01:15 PDT by Yoshiki Hayashi
Modified: 2010-05-01 00:07 PDT (History)
1 user (show)

See Also:


Attachments
HTML file to reproduce bug (830 bytes, text/html)
2010-04-28 01:15 PDT, Yoshiki Hayashi
no flags Details
Proposed Patch (6.73 KB, patch)
2010-04-28 01:25 PDT, Yoshiki Hayashi
no flags Details | Formatted Diff | Diff
2010-04-28 Eric Seidel <eric@webkit.org> (15.33 KB, patch)
2010-04-28 03:40 PDT, Yoshiki Hayashi
no flags Details | Formatted Diff | Diff
Proposed Patch 2 (6.92 KB, patch)
2010-04-28 03:49 PDT, Yoshiki Hayashi
hamaji: review+
hamaji: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshiki Hayashi 2010-04-28 01:15:40 PDT
Created attachment 54536 [details]
HTML file to reproduce bug

When a flexbox with non-zero box-flex property is resized to smaller size than the specified one, the height of the flexbox gets an unexpected value.

If you open the attached HTML file, 100x100 mostly green box rendered is the expected result.  However, current implementation renders 100x114 mostly green box.
Comment 1 Yoshiki Hayashi 2010-04-28 01:25:29 PDT
Created attachment 54538 [details]
Proposed Patch
Comment 2 Shinichiro Hamaji 2010-04-28 02:20:42 PDT
Comment on attachment 54538 [details]
Proposed Patch

Generally, this looks good. Putting r- for some style nitpicks.

LayoutTests/fast/flexbox/child-flexing.html:37
 +    overflow-y: auto;
Some properties are duplicated with verticalOuter. I'd write

div.outer {
  width: 100px;
  height: 100px;
  ...
}

Also, I'm not sure we are setting overflow-y. I think overflow: auto would be fine.


LayoutTests/fast/flexbox/child-flexing.html:35
 +    box-align: top;
I don't think box-align is necessary to check this behavior?

LayoutTests/fast/flexbox/child-flexing.html:43
 +    background-color: green;
We usually use greens to mean "the test passes". I think it's better to choose a different color.

LayoutTests/fast/flexbox/child-flexing.html:53
 +    border-left: 90px solid olive;
As the bug summary contains the word "padding", I think it's better to check paddings as well.

LayoutTests/fast/flexbox/child-flexing.html:124
 +  shouldBe("element.scrollHeight", "100");
I'd add debug("vertically expanding") above this line. In this way we can see which test is failing easily. Or, we can just change the shouldBe lines like

shouldBe("document.getElementById('expandVertical')", "100");



LayoutTests/fast/flexbox/child-flexing-expected.txt:9
 +  horizontally shrinking
These messages are unnecessary. It may be better to put all HTMLs above id="console" into a single <div> and remove the div if window.layoutTestController exists.

Please check printing/script-tests/pageNumerForElementById.js as an example.
Comment 3 Yoshiki Hayashi 2010-04-28 03:40:59 PDT
Created attachment 54544 [details]
2010-04-28  Eric Seidel  <eric@webkit.org>
Comment 4 Yoshiki Hayashi 2010-04-28 03:45:34 PDT
Argh, wrong command line arg ended up uploading unrelated patch.  Sorry for the noise.  Will upload updated patch shortly.
Comment 5 Yoshiki Hayashi 2010-04-28 03:49:55 PDT
Created attachment 54547 [details]
Proposed Patch 2
Comment 6 Shinichiro Hamaji 2010-04-30 01:47:53 PDT
Comment on attachment 54547 [details]
Proposed Patch 2

Looks good. The original C++ code was apparently wrong and the test case appropriately checks the code around the fix.

I'd land this manually so I'm setting cq-.
Comment 7 Shinichiro Hamaji 2010-05-01 00:07:21 PDT
Committed r58630: <http://trac.webkit.org/changeset/58630>