REOPENED 93735
Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width
https://bugs.webkit.org/show_bug.cgi?id=93735
Summary Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width
Robert Hogan
Reported 2012-08-10 11:57:06 PDT
.
Attachments
Test Case (334 bytes, text/html)
2012-08-10 11:58 PDT, Robert Hogan
no flags
TestCase (310 bytes, text/html)
2012-08-17 00:50 PDT, Pravin D
no flags
Reduction - Other browsers do not stretch the input element to fill the viewport (181 bytes, text/html)
2013-05-21 12:43 PDT, Robert Hogan
no flags
Patch (15.59 KB, patch)
2013-05-27 12:47 PDT, Robert Hogan
no flags
Patch (15.56 KB, patch)
2013-05-27 13:04 PDT, Robert Hogan
no flags
Patch (15.55 KB, patch)
2013-05-27 13:59 PDT, Robert Hogan
no flags
Patch (15.54 KB, patch)
2013-06-01 00:33 PDT, Robert Hogan
no flags
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 (712.63 KB, application/zip)
2013-06-02 03:31 PDT, Build Bot
no flags
Patch (15.59 KB, patch)
2013-06-02 09:17 PDT, Robert Hogan
no flags
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 (559.43 KB, application/zip)
2013-06-02 10:06 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion (625.58 KB, application/zip)
2013-06-02 10:58 PDT, Build Bot
no flags
Patch (28.69 KB, patch)
2013-06-05 14:16 PDT, Robert Hogan
no flags
Patch (30.70 KB, patch)
2013-06-07 02:48 PDT, Robert Hogan
no flags
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion (514.44 KB, application/zip)
2013-06-07 05:11 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 (524.21 KB, application/zip)
2013-06-08 07:02 PDT, Build Bot
no flags
Patch (26.35 KB, patch)
2013-06-25 11:03 PDT, Robert Hogan
no flags
Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2 (516.71 KB, application/zip)
2013-06-25 12:51 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion (533.76 KB, application/zip)
2013-06-25 14:12 PDT, Build Bot
no flags
Archive of layout-test-results from APPLE-EWS-2 for win-future (836.81 KB, application/zip)
2013-06-25 17:54 PDT, Build Bot
no flags
Patch (19.01 KB, patch)
2013-07-01 12:01 PDT, Robert Hogan
no flags
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion (784.31 KB, application/zip)
2013-07-01 13:00 PDT, Build Bot
no flags
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 (540.46 KB, application/zip)
2013-07-02 00:43 PDT, Build Bot
no flags
Archive of layout-test-results from APPLE-EWS-5 for win-future (841.81 KB, application/zip)
2013-07-02 15:35 PDT, Build Bot
no flags
Patch (21.17 KB, patch)
2013-08-26 11:57 PDT, Robert Hogan
no flags
Robert Hogan
Comment 1 2012-08-10 11:58:42 PDT
Created attachment 157784 [details] Test Case
Pravin D
Comment 2 2012-08-17 00:50:59 PDT
Created attachment 159030 [details] TestCase There was a extra script tag in the previous testcase which was causing the page not to render anything on the view port.
Robert Hogan
Comment 3 2013-05-21 12:43:10 PDT
Created attachment 202459 [details] Reduction - Other browsers do not stretch the input element to fill the viewport
Robert Hogan
Comment 4 2013-05-27 12:47:23 PDT
Robert Hogan
Comment 5 2013-05-27 13:04:31 PDT
kov's GTK+ EWS bot
Comment 6 2013-05-27 13:14:18 PDT
EFL EWS Bot
Comment 7 2013-05-27 13:17:24 PDT
Build Bot
Comment 8 2013-05-27 13:31:26 PDT
Build Bot
Comment 9 2013-05-27 13:34:51 PDT
Build Bot
Comment 10 2013-05-27 13:53:57 PDT
Robert Hogan
Comment 11 2013-05-27 13:59:54 PDT
Robert Hogan
Comment 12 2013-06-01 00:33:49 PDT
Build Bot
Comment 13 2013-06-02 03:31:50 PDT
Comment on attachment 203480 [details] Patch Attachment 203480 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/679301 New failing tests: media/media-fullscreen-inline.html http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html fullscreen/empty-anonymous-block-continuation-crash.html http/tests/fullscreen/fullscreenelement-same-origin.html plugins/fullscreen-plugins-dont-reload.html fullscreen/full-screen-css.html fullscreen/full-screen-fixed-pos-parent.html fullscreen/full-screen-keyboard-disabled.html media/video-controls-visible-exiting-fullscreen.html media/video-controls-fullscreen-volume.html http/tests/inspector/inspect-element.html editing/pasteboard/copy-image-with-alt-text.html fast/regions/full-screen-video-from-region.html editing/pasteboard/smart-paste-001.html fullscreen/full-screen-element-stack.html fullscreen/anonymous-block-merge-crash.html fast/forms/onselect-textfield.html fullscreen/full-screen-inline-split-crash.html fullscreen/full-screen-iframe-with-mixed-allow-webkitallow-attribute.html fast/forms/option-mouseevents.html fullscreen/full-screen-crash-offsetLeft.html fast/forms/button-positioned.html http/tests/fullscreen/fullscreenelement-different-origin.html fullscreen/full-screen-cancel.html fast/forms/input-appearance-preventDefault.html fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 14 2013-06-02 03:31:53 PDT
Created attachment 203511 [details] Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-11 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Robert Hogan
Comment 15 2013-06-02 09:17:15 PDT
Build Bot
Comment 16 2013-06-02 10:06:53 PDT
Comment on attachment 203537 [details] Patch Attachment 203537 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/706691 New failing tests: fast/forms/button-positioned.html fast/forms/option-mouseevents.html fast/forms/input-appearance-preventDefault.html fast/forms/onselect-textfield.html fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 17 2013-06-02 10:06:57 PDT
Created attachment 203540 [details] Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-11 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Build Bot
Comment 18 2013-06-02 10:58:01 PDT
Comment on attachment 203537 [details] Patch Attachment 203537 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/691307 New failing tests: fast/forms/button-positioned.html fast/forms/option-mouseevents.html fast/forms/input-appearance-preventDefault.html fast/forms/onselect-textfield.html fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 19 2013-06-02 10:58:04 PDT
Created attachment 203542 [details] Archive of layout-test-results from webkit-ews-08 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Dave Hyatt
Comment 20 2013-06-05 12:07:21 PDT
Comment on attachment 203537 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=203537&action=review I would use intrinsicSize() subclassing more. You might want to investigate how intrinsicSize() is called. It may be worthwhile to turn it into intrinsicLogicalSize() to simplify subclassing, especially if nobody is really using the physical version of it. > Source/WebCore/rendering/RenderBox.cpp:2447 > + // Some replaced renderers, such as text controls, need to calculate their 'intrinsic' height during layout. > + updateIntrinsicLogicalHeight(); I don't get why you had to add this. Can't you just do this inside RenderTextControl's computeLogicalHeight? > Source/WebCore/rendering/RenderBox.cpp:3052 > +static bool isReplacedElement(const RenderBox* child) > +{ > + return child->isReplaced() || (child->node() && child->node()->isElementNode() && toElement(child->node())->isFormControlElement() && !child->isFieldset()); > +} Let's add a FIXME about how we'd like this to just be isReplaced() eventually and file a followup bug about it too. > Source/WebCore/rendering/RenderBox.cpp:3056 > - if (isReplaced()) { > + if (isReplacedElement(this)) { I think it's worth a comment about why we're not just using isReplaced. > Source/WebCore/rendering/RenderBox.cpp:3398 > - if (isReplaced()) { > + if (isReplacedElement(this)) { Ditto. > Source/WebCore/rendering/RenderBox.h:405 > + virtual LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); } > + virtual LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); } I don't get why these have to become virtual. Can't you just override the already virtual intrinsicSize()? When someone queries for the height on objects that only subclassed to provide a width, you now have two virtual function calls (one to call intrinsicLogicalHeight(), and then a second virtual function call to intrinsicSize()(. > Source/WebCore/rendering/RenderBox.h:406 > + virtual void updateIntrinsicLogicalHeight() { }; Don't get why this is needed. > Source/WebCore/rendering/RenderButton.h:61 > +protected: > + virtual LayoutUnit intrinsicLogicalWidth() const { return maxPreferredLogicalWidth(); } Just subclass intrinsicSize() instead. > Source/WebCore/rendering/RenderMenuList.h:61 > +protected: > + virtual LayoutUnit intrinsicLogicalWidth() const { return maxPreferredLogicalWidth(); } Just subclass intrinsicSize() instead. > Source/WebCore/rendering/RenderTextControl.cpp:146 > -void RenderTextControl::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const > +void RenderTextControl::updateIntrinsicLogicalHeight() Seems like you could have just done the update in computeLogicalHeight without an extra function? > Source/WebCore/rendering/RenderTextControl.h:69 > + virtual void updateIntrinsicLogicalHeight() OVERRIDE; > + virtual LayoutUnit intrinsicLogicalHeight() const { return m_intrinsicLogicalHeight; } > + virtual LayoutUnit intrinsicLogicalWidth() const { return maxPreferredLogicalWidth(); } Definitely could just subclass intrinsicSize() here.
Robert Hogan
Comment 21 2013-06-05 14:16:50 PDT
Darin Adler
Comment 22 2013-06-05 17:45:29 PDT
Comment on attachment 203884 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=203884&action=review > Source/WebCore/rendering/RenderBox.cpp:3050 > + return child->isReplaced() || (toElement(child->node())->isFormControlElement() && !child->isFieldset()); What guarantees that child->node() is an Element? Can’t we do this check entirely on the rendering side of things? > Source/WebCore/rendering/RenderButton.h:60 > + virtual LayoutSize intrinsicSize() const { return LayoutSize(maxPreferredLogicalWidth(), LayoutUnit()); } Can this be private instead of public? Can this use OVERRIDE and FINAL? > Source/WebCore/rendering/RenderListBox.h:60 > + virtual LayoutSize intrinsicSize() const { return LayoutSize(maxPreferredLogicalWidth(), m_intrinsicLogicalHeight); } Can this be private instead of public? Can this use OVERRIDE and FINAL? > Source/WebCore/rendering/RenderMenuList.h:60 > + virtual LayoutSize intrinsicSize() const { return LayoutSize(maxPreferredLogicalWidth(), logicalHeight()); } Can this be private instead of public? Can this use OVERRIDE and FINAL? > Source/WebCore/rendering/RenderTextControl.h:67 > + virtual LayoutSize intrinsicSize() const { return LayoutSize(maxPreferredLogicalWidth(), m_intrinsicLogicalHeight); } Can this be private instead of public? Can this use OVERRIDE and FINAL?
Robert Hogan
Comment 23 2013-06-07 02:48:37 PDT
Build Bot
Comment 24 2013-06-07 05:11:10 PDT
Comment on attachment 204020 [details] Patch Attachment 204020 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/794033 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 25 2013-06-07 05:11:13 PDT
Created attachment 204028 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Build Bot
Comment 26 2013-06-08 07:02:23 PDT
Comment on attachment 204020 [details] Patch Attachment 204020 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/734443 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 27 2013-06-08 07:02:29 PDT
Created attachment 204091 [details] Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-12 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Robert Hogan
Comment 28 2013-06-11 12:03:39 PDT
Beth Dakin
Comment 29 2013-06-18 11:27:47 PDT
This change caused a regression on the iCloud.com login page. https://bugs.webkit.org/show_bug.cgi?id=117744
Simon Fraser (smfr)
Comment 30 2013-06-19 18:08:04 PDT
This also broke buttons at http://mint.com (misplaced labels in the buttons in top right corner).
WebKit Commit Bot
Comment 31 2013-06-20 13:42:12 PDT
Re-opened since this is blocked by bug 117848
Robert Hogan
Comment 32 2013-06-25 11:03:35 PDT
Build Bot
Comment 33 2013-06-25 12:51:24 PDT
Comment on attachment 205412 [details] Patch Attachment 205412 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/978644 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 34 2013-06-25 12:51:27 PDT
Created attachment 205418 [details] Archive of layout-test-results from webkit-ews-15 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-15 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Build Bot
Comment 35 2013-06-25 14:12:46 PDT
Comment on attachment 205412 [details] Patch Attachment 205412 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/917076 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 36 2013-06-25 14:12:51 PDT
Created attachment 205422 [details] Archive of layout-test-results from webkit-ews-06 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-06 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Build Bot
Comment 37 2013-06-25 17:54:43 PDT
Comment on attachment 205412 [details] Patch Attachment 205412 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/848547 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 38 2013-06-25 17:54:47 PDT
Created attachment 205433 [details] Archive of layout-test-results from APPLE-EWS-2 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: APPLE-EWS-2 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Robert Hogan
Comment 39 2013-07-01 12:01:24 PDT
Build Bot
Comment 40 2013-07-01 13:00:31 PDT
Comment on attachment 205827 [details] Patch Attachment 205827 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/1012389 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 41 2013-07-01 13:00:36 PDT
Created attachment 205830 [details] Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Build Bot
Comment 42 2013-07-02 00:43:02 PDT
Comment on attachment 205827 [details] Patch Attachment 205827 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/1019033 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 43 2013-07-02 00:43:07 PDT
Created attachment 205875 [details] Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-12 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Build Bot
Comment 44 2013-07-02 15:35:06 PDT
Comment on attachment 205827 [details] Patch Attachment 205827 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/1016453 New failing tests: fast/replaced/width-and-height-of-positioned-replaced-elements.html
Build Bot
Comment 45 2013-07-02 15:35:11 PDT
Created attachment 205949 [details] Archive of layout-test-results from APPLE-EWS-5 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: APPLE-EWS-5 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Robert Hogan
Comment 46 2013-08-26 11:57:32 PDT
Dave Hyatt
Comment 47 2013-08-28 11:38:33 PDT
Comment on attachment 209668 [details] Patch r=me
WebKit Commit Bot
Comment 48 2013-08-29 11:37:42 PDT
Comment on attachment 209668 [details] Patch Clearing flags on attachment: 209668 Committed r154826: <http://trac.webkit.org/changeset/154826>
WebKit Commit Bot
Comment 49 2013-08-29 11:37:49 PDT
All reviewed patches have been landed. Closing bug.
Tim Horton
Comment 50 2013-08-30 02:09:29 PDT
This change *once again* caused vertical centering issues on the iCloud.com login page (https://bugs.webkit.org/show_bug.cgi?id=117744).
Robert Hogan
Comment 51 2013-08-30 02:23:55 PDT
(In reply to comment #50) > This change *once again* caused vertical centering issues on the iCloud.com login page (https://bugs.webkit.org/show_bug.cgi?id=117744). Thanks for checking - I'll roll it out.
WebKit Commit Bot
Comment 52 2013-08-30 02:28:02 PDT
Re-opened since this is blocked by bug 120517
Ahmad Saleem
Comment 53 2022-07-01 10:03:04 PDT
I am still able to reproduce this bug in Safari 15.5 on macOS 12.4 and Safari TP 148 using "Reduction..." test case. The input field is stretched out while in other browser, Chrome Canary 105 is also stretching it but Firefox is not. Firefox is just showing it is as normal 184*16 computed size. If I am testing it incorrectly, please retest accordingly and ignore my comment. Thanks!
Note You need to log in before you can comment on or make changes to this bug.