Skip to content
  • commit-queue@webkit.org's avatar
    Convert old flexbox uses in html.css to new flexbox (non-<select>) · a393490f
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=110837
    
    Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-03-15
    Reviewed by Ojan Vafai.
    
    Source/WebCore:
    
    Covered by existing tests.
    
    * rendering/RenderTextControlSingleLine.cpp:
    (WebCore::RenderTextControlSingleLine::layout):
    After we set our descendants' heights, we need to mark them for
    layout.
    (WebCore::RenderTextControlSingleLine::createInnerBlockStyle):
    Use new-flexbox style setters.
    
    * css/html.css:
    (input::-webkit-textfield-decoration-container):
    (input[type="search"]::-webkit-search-cancel-button):
    (input[type="search"]::-webkit-search-decoration):
    (input[type="search"]::-webkit-search-results-decoration):
    (input[type="search"]::-webkit-search-results-button):
    (input::-webkit-inner-spin-button):
    (input::-webkit-input-speech-button):
    (textarea):
    (input[type="file"]):
    (input[type="color"]::-webkit-color-swatch-wrapper):
    (input[type="color"]::-webkit-color-swatch):
    (::-webkit-validation-bubble-message):
    (::-webkit-validation-bubble-text-block):
    * css/themeWin.css:
    (input[type="search"]::-webkit-search-results-decoration):
    (input[type="search"]::-webkit-search-results-button):
    Convert -webkit-box to -webkit-flex and adjust related properties.
    Notably switch to auto margins for centering the speech button as well
    as the search result and cancel buttons to stay compatible with the
    previous centering behaviour. This does not produce visible
    differences but eliminates the render tree dump changes.
    * html/TextFieldInputType.cpp:
    (WebCore::TextFieldInputType::createShadowSubtree):
    * html/shadow/TextControlInnerElements.cpp:
    (WebCore::TextControlInnerContainer::TextControlInnerContainer):
    (WebCore):
    (WebCore::TextControlInnerContainer::create):
    (WebCore::TextControlInnerContainer::createRenderer):
    * html/shadow/TextControlInnerElements.h:
    (TextControlInnerContainer):
    (WebCore):
    * rendering/RenderTextControl.cpp:
    (WebCore::RenderTextControlInnerContainer::RenderTextControlInnerContainer):
    (WebCore):
    (WebCore::RenderTextControlInnerContainer::~RenderTextControlInnerContainer):
    * rendering/RenderTextControl.h:
    (WebCore):
    (RenderTextControlInnerContainer):
    Create a new DOM element & renderer type for the textfield-decoration
    div (the direct child of the <input> in the shadow dom if we have a
    special input field). This is necessary because new-flexbox uses a
    different algorithm for calculating the baseline, which would
    otherwise cause an <input> and an <input type=search> to not be
    aligned with each other.
    The new renderer just calls back to RenderBlock for calculating the
    baseline.
    * rendering/RenderTextControlSingleLine.cpp:
    (WebCore::RenderTextControlSingleLine::layout):
    Make sure to mark renderers as needing layout when we change their
    style. This didn't use to be necessary because old-flexbox relayouts
    children even when they are not marked for needing layout.
    (WebCore::RenderTextControlSingleLine::createInnerBlockStyle):
    Use new-flexbox CSS properties.
    * html/shadow/TextFieldDecorationElement.cpp:
    (WebCore::TextFieldDecorationElement::decorate):
    Use new-flexbox CSS properties.
    
    LayoutTests:
    
    * fast/forms/placeholder-position-expected.txt:
    * platform/chromium-linux/fast/css/input-search-padding-expected.txt:
    * platform/chromium-linux/fast/forms/box-shadow-override-expected.txt:
    * platform/chromium-linux/fast/forms/control-restrict-line-height-expected.txt:
    * platform/chromium-linux/fast/forms/input-appearance-height-expected.txt:
    * platform/chromium-linux/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/chromium-linux/fast/forms/search-styled-expected.txt:
    * platform/chromium-linux/fast/forms/searchfield-heights-expected.txt:
    * platform/chromium-linux/fast/forms/validation-message-appearance-expected.txt:
    * platform/chromium-linux/fast/speech/input-appearance-numberandspeech-expected.txt:
    * platform/chromium-linux/fast/speech/input-appearance-searchandspeech-expected.txt:
    * platform/chromium-linux/fast/speech/input-appearance-speechbutton-expected.txt:
    * platform/chromium-mac-lion/fast/forms/search-rtl-expected.txt:
    * platform/chromium-mac-snowleopard/fast/forms/search-rtl-expected.txt:
    * platform/chromium-mac-snowleopard/fast/repaint/search-field-cancel-expected.txt:
    * platform/chromium-mac/fast/css/text-overflow-input-expected.txt:
    * platform/chromium-mac/fast/forms/box-shadow-override-expected.txt:
    * platform/chromium-mac/fast/forms/control-restrict-line-height-expected.txt:
    * platform/chromium-mac/fast/forms/input-appearance-height-expected.txt:
    * platform/chromium-mac/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/chromium-mac/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/chromium-mac/fast/forms/search-rtl-expected.txt:
    * platform/chromium-mac/fast/forms/search-vertical-alignment-expected.txt:
    * platform/chromium-mac/fast/forms/searchfield-heights-expected.txt:
    * platform/chromium-mac/fast/forms/validation-message-appearance-expected.txt:
    * platform/chromium-mac/fast/speech/input-appearance-numberandspeech-expected.txt:
    * platform/chromium-mac/fast/speech/input-appearance-searchandspeech-expected.txt:
    * platform/chromium-mac/fast/speech/input-appearance-speechbutton-expected.txt:
    * platform/chromium-win-xp/fast/forms/search-styled-expected.txt:
    * platform/chromium-win/fast/css/input-search-padding-expected.txt:
    * platform/chromium-win/fast/css/text-input-with-webkit-border-radius-expected.txt:
    * platform/chromium-win/fast/css/text-overflow-input-expected.txt:
    * platform/chromium-win/fast/forms/box-shadow-override-expected.txt:
    * platform/chromium-win/fast/forms/control-restrict-line-height-expected.txt:
    * platform/chromium-win/fast/forms/input-appearance-height-expected.txt:
    * platform/chromium-win/fast/forms/number/number-appearance-rtl-expected.txt:
    * platform/chromium-win/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/chromium-win/fast/forms/number/number-appearance-spinbutton-layer-expected.txt:
    * platform/chromium-win/fast/forms/placeholder-position-expected.txt:
    * platform/chromium-win/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/chromium-win/fast/forms/search-cancel-button-style-sharing-expected.txt:
    * platform/chromium-win/fast/forms/search-display-none-cancel-button-expected.txt:
    * platform/chromium-win/fast/forms/search-rtl-expected.txt:
    * platform/chromium-win/fast/forms/search-styled-expected.txt:
    * platform/chromium-win/fast/forms/search-vertical-alignment-expected.txt:
    * platform/chromium-win/fast/forms/searchfield-heights-expected.txt:
    * platform/chromium-win/fast/forms/validation-message-appearance-expected.txt:
    * platform/chromium-win/fast/repaint/search-field-cancel-expected.txt:
    * platform/chromium-win/fast/replaced/width100percent-searchfield-expected.txt:
    * platform/chromium-win/fast/speech/input-appearance-numberandspeech-expected.txt:
    * platform/chromium-win/fast/speech/input-appearance-searchandspeech-expected.txt:
    * platform/chromium-win/fast/speech/input-appearance-speechbutton-expected.txt:
    * platform/chromium-win/fast/speech/speech-bidi-rendering-expected.txt:
    * platform/chromium/fast/css/input-search-padding-expected.txt:
    * platform/chromium/fast/css/text-input-with-webkit-border-radius-expected.txt:
    * platform/chromium/fast/forms/number/number-appearance-rtl-expected.txt:
    * platform/chromium/fast/forms/number/number-appearance-spinbutton-layer-expected.txt:
    * platform/chromium/fast/forms/search-cancel-button-style-sharing-expected.txt:
    * platform/chromium/fast/forms/search-display-none-cancel-button-expected.txt:
    * platform/chromium/fast/forms/search-rtl-expected.txt:
    * platform/chromium/fast/forms/search-styled-expected.txt:
    * platform/chromium/fast/repaint/search-field-cancel-expected.txt:
    * platform/chromium/fast/replaced/width100percent-searchfield-expected.txt:
    * platform/chromium/fast/speech/speech-bidi-rendering-expected.txt:
    * platform/efl/fast/css/input-search-padding-expected.txt:
    * platform/efl/fast/css/text-input-with-webkit-border-radius-expected.txt:
    * platform/efl/fast/css/text-overflow-input-expected.txt:
    * platform/efl/fast/forms/box-shadow-override-expected.txt:
    * platform/efl/fast/forms/control-restrict-line-height-expected.txt:
    * platform/efl/fast/forms/input-appearance-height-expected.txt:
    * platform/efl/fast/forms/number/number-appearance-rtl-expected.txt:
    * platform/efl/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/efl/fast/forms/number/number-appearance-spinbutton-layer-expected.txt:
    * platform/efl/fast/forms/placeholder-position-expected.txt:
    * platform/efl/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/efl/fast/forms/search-cancel-button-style-sharing-expected.txt:
    * platform/efl/fast/forms/search-display-none-cancel-button-expected.txt:
    * platform/efl/fast/forms/search-rtl-expected.txt:
    * platform/efl/fast/forms/search-styled-expected.txt:
    * platform/efl/fast/forms/search-vertical-alignment-expected.txt:
    * platform/efl/fast/forms/searchfield-heights-expected.txt:
    * platform/efl/fast/forms/validation-message-appearance-expected.txt:
    * platform/efl/fast/repaint/search-field-cancel-expected.txt:
    * platform/efl/fast/replaced/width100percent-searchfield-expected.txt:
    * platform/gtk/fast/css/input-search-padding-expected.txt:
    * platform/gtk/fast/css/text-input-with-webkit-border-radius-expected.txt:
    * platform/gtk/fast/css/text-overflow-input-expected.txt:
    * platform/gtk/fast/forms/box-shadow-override-expected.txt:
    * platform/gtk/fast/forms/control-restrict-line-height-expected.txt:
    * platform/gtk/fast/forms/input-appearance-height-expected.txt:
    * platform/gtk/fast/forms/number/number-appearance-rtl-expected.txt:
    * platform/gtk/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/gtk/fast/forms/number/number-appearance-spinbutton-layer-expected.txt:
    * platform/gtk/fast/forms/placeholder-position-expected.txt:
    * platform/gtk/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/gtk/fast/forms/search-cancel-button-style-sharing-expected.txt:
    * platform/gtk/fast/forms/search-display-none-cancel-button-expected.txt:
    * platform/gtk/fast/forms/search-rtl-expected.txt:
    * platform/gtk/fast/forms/search-styled-expected.txt:
    * platform/gtk/fast/forms/search-vertical-alignment-expected.txt:
    * platform/gtk/fast/forms/searchfield-heights-expected.txt:
    * platform/gtk/fast/forms/validation-message-appearance-expected.txt:
    * platform/gtk/fast/repaint/search-field-cancel-expected.txt:
    * platform/gtk/fast/replaced/width100percent-searchfield-expected.txt:
    * platform/gtk/fast/speech/input-appearance-searchandspeech-expected.txt:
    * platform/mac/fast/css/input-search-padding-expected.txt:
    * platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt:
    * platform/mac/fast/css/text-overflow-input-expected.txt:
    * platform/mac/fast/forms/box-shadow-override-expected.txt:
    * platform/mac/fast/forms/control-restrict-line-height-expected.txt:
    * platform/mac/fast/forms/input-appearance-height-expected.txt:
    * platform/mac/fast/forms/number/number-appearance-rtl-expected.txt:
    * platform/mac/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/mac/fast/forms/number/number-appearance-spinbutton-layer-expected.txt:
    * platform/mac/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/mac/fast/forms/search-cancel-button-style-sharing-expected.txt:
    * platform/mac/fast/forms/search-display-none-cancel-button-expected.txt:
    * platform/mac/fast/forms/search-rtl-expected.txt:
    * platform/mac/fast/forms/search-styled-expected.txt:
    * platform/mac/fast/forms/search-vertical-alignment-expected.txt:
    * platform/mac/fast/forms/searchfield-heights-expected.txt:
    * platform/mac/fast/forms/validation-message-appearance-expected.txt:
    * platform/mac/fast/repaint/search-field-cancel-expected.txt:
    * platform/mac/fast/replaced/width100percent-searchfield-expected.txt:
    * platform/mac/fast/speech/speech-bidi-rendering-expected.txt:
    * platform/qt-5.0/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/qt/fast/css/input-search-padding-expected.txt:
    * platform/qt/fast/css/text-input-with-webkit-border-radius-expected.txt:
    * platform/qt/fast/css/text-overflow-input-expected.txt:
    * platform/qt/fast/forms/box-shadow-override-expected.txt:
    * platform/qt/fast/forms/control-restrict-line-height-expected.txt:
    * platform/qt/fast/forms/number/number-appearance-rtl-expected.txt:
    * platform/qt/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt:
    * platform/qt/fast/forms/number/number-appearance-spinbutton-layer-expected.txt:
    * platform/qt/fast/forms/placeholder-position-expected.txt:
    * platform/qt/fast/forms/placeholder-pseudo-style-expected.txt:
    * platform/qt/fast/forms/search-cancel-button-style-sharing-expected.txt:
    * platform/qt/fast/forms/search-display-none-cancel-button-expected.txt:
    * platform/qt/fast/forms/search-rtl-expected.txt:
    * platform/qt/fast/forms/search-styled-expected.txt:
    * platform/qt/fast/forms/search-vertical-alignment-expected.txt:
    * platform/qt/fast/repaint/search-field-cancel-expected.txt:
    * platform/qt/fast/replaced/width100percent-searchfield-expected.txt:
    * platform/qt/fast/speech/input-appearance-searchandspeech-expected.txt:
    Automated search & replace of RenderDeprecatedFlexibleBox ->
    RenderFlexibleBox
    * platform/mac/fast/forms/color/input-appearance-color-expected.txt:
    * platform/chromium-mac/fast/forms/color/input-appearance-color-expected.txt:
    * platform/chromium-win/fast/forms/color/input-appearance-color-expected.txt:
    * platform/chromium-linux/fast/forms/color/input-appearance-color-expected.png:
    This test shows a minor layout difference (less spacing between
    paragraphs with an <input type=color>). The underlying reason is
    alignment/baseline-differences with the new flexbox code, and the new
    behaviour makes more sense in general (this becomes obvious when
    putting text or a <input type=text> next to an <input type=color>).
    * platform/chromium/TestExpectations:
    Mark input-appearance-color as needing rebaseline on Mac/Win. All
    non-Chromium ports ignore fast/forms/color because the feature isn't
    enabled, so their TestExpectations need no update.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a393490f