RESOLVED FIXED110393
Positioned, replaced elements with intrinsic width keywords compute the wrong width
https://bugs.webkit.org/show_bug.cgi?id=110393
Summary Positioned, replaced elements with intrinsic width keywords compute the wrong...
Ojan Vafai
Reported 2013-02-20 15:12:43 PST
Positioned, replaced elements with intrinsic width keywords compute the wrong width
Attachments
Patch (10.20 KB, patch)
2013-02-20 15:18 PST, Ojan Vafai
no flags
Patch (10.61 KB, patch)
2013-02-20 16:17 PST, Ojan Vafai
eae: review+
eflews.bot: commit-queue-
Ojan Vafai
Comment 1 2013-02-20 15:18:17 PST
Emil A Eklund
Comment 2 2013-02-20 15:33:25 PST
Comment on attachment 189392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189392&action=review > Source/WebCore/rendering/RenderBox.cpp:2594 > + LayoutUnit containerLogicalWidth = 0; This temporary variable isn't needed. If you feel it is needed for readability reason then at last match the name of the argument (availableLogicalWidth). > LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html:19 > + <iframe class="child" style="width: -webkit-max-content;" data-expected-width="310"></iframe> Where did you get the number 310 from?
Ojan Vafai
Comment 3 2013-02-20 15:38:04 PST
Comment on attachment 189392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189392&action=review >> Source/WebCore/rendering/RenderBox.cpp:2594 >> + LayoutUnit containerLogicalWidth = 0; > > This temporary variable isn't needed. If you feel it is needed for readability reason then at last match the name of the argument (availableLogicalWidth). I think it's needed for readablity. I'll rename it. >> LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html:19 >> + <iframe class="child" style="width: -webkit-max-content;" data-expected-width="310"></iframe> > > Where did you get the number 310 from? The intrinsic width of an iframe is 300px and it has a 10px border.
Tony Chang
Comment 4 2013-02-20 15:41:12 PST
Comment on attachment 189392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189392&action=review > Source/WebCore/rendering/RenderBox.cpp:2617 > } Nit: It would be nice to remove the default: case and enumerate the remaining types (Auto, Relative, and Undefined, I think).
Emil A Eklund
Comment 5 2013-02-20 15:41:53 PST
(In reply to comment #3) > (From update of attachment 189392 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=189392&action=review > > >> Source/WebCore/rendering/RenderBox.cpp:2594 > >> + LayoutUnit containerLogicalWidth = 0; > > > > This temporary variable isn't needed. If you feel it is needed for readability reason then at last match the name of the argument (availableLogicalWidth). > > I think it's needed for readablity. I'll rename it. Fair enough. > > >> LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html:19 > >> + <iframe class="child" style="width: -webkit-max-content;" data-expected-width="310"></iframe> > > > > Where did you get the number 310 from? > > The intrinsic width of an iframe is 300px and it has a 10px border. Could you add a variable for that? I.e. defaultIframeWidth = 300 and then use that to compute the expected width? Would make the test a lot easier to understand.
Elliott Sprehn
Comment 6 2013-02-20 15:43:13 PST
Comment on attachment 189392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189392&action=review >>>> LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html:19 >>>> + <iframe class="child" style="width: -webkit-max-content;" data-expected-width="310"></iframe> >>> >>> Where did you get the number 310 from? >> >> The intrinsic width of an iframe is 300px and it has a 10px border. > > Could you add a variable for that? I.e. defaultIframeWidth = 300 and then use that to compute the expected width? Would make the test a lot easier to understand. The whole point of these new style data-expected tests is there's no need for script running. Lets just use a comment to explain that instead.
Ojan Vafai
Comment 7 2013-02-20 15:43:55 PST
Comment on attachment 189392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189392&action=review >>>> LayoutTests/fast/css-intrinsic-dimensions/intrinsic-sized-replaced-absolutes.html:19 >>>> + <iframe class="child" style="width: -webkit-max-content;" data-expected-width="310"></iframe> >>> >>> Where did you get the number 310 from? >> >> The intrinsic width of an iframe is 300px and it has a 10px border. > > Could you add a variable for that? I.e. defaultIframeWidth = 300 and then use that to compute the expected width? Would make the test a lot easier to understand. It would make this test considerably more complicated. Now I need script to set an attribute, but some of these widths are different. I mean...I can do it, but it doesn't seem worth it. I could add a comment though and get the same benefit I think.
Emil A Eklund
Comment 8 2013-02-20 15:48:05 PST
(In reply to comment #6) > > Could you add a variable for that? I.e. defaultIframeWidth = 300 and then use that to compute the expected width? Would make the test a lot easier to understand. > > The whole point of these new style data-expected tests is there's no need for script running. Lets just use a comment to explain that instead. It still runs a script. It just happens that you declare the expectations in html instead of js. While it might make sense in many cases it doesn't here as it provides values without any explanation and makes the test harder to understand. Perhaps we should change resources/check-layout.js to allow named constants and simple arithmetic. (In reply to comment #7) A comment would do nicely. Thanks.
Ojan Vafai
Comment 9 2013-02-20 16:17:40 PST
EFL EWS Bot
Comment 10 2013-02-20 16:24:01 PST
Early Warning System Bot
Comment 11 2013-02-20 16:24:41 PST
Early Warning System Bot
Comment 12 2013-02-20 16:26:26 PST
Emil A Eklund
Comment 13 2013-02-20 16:31:36 PST
Comment on attachment 189403 [details] Patch Thanks!
Ojan Vafai
Comment 14 2013-02-20 17:09:39 PST
Note You need to log in before you can comment on or make changes to this bug.