Skip to content
  • adele's avatar
    LayoutTests: · 05abee33
    adele authored
            Reviewed by Hyatt.
    
            New tests and updated tests for styled selects.
    
            * fast/borders/borderRadiusInvalidColor-expected.checksum: Added.
            * fast/borders/borderRadiusInvalidColor-expected.png: Added.
            * fast/borders/borderRadiusInvalidColor-expected.txt: Added.
            * fast/borders/borderRadiusInvalidColor.html: Added.
    
            * fast/forms/select-baseline-expected.checksum: Added.
            * fast/forms/select-baseline-expected.png: Added.
            * fast/forms/select-baseline-expected.txt: Added.
            * fast/forms/select-baseline.html: Added.
    
            * editing/pasteboard/4641033-expected.txt:
            * editing/selection/replaced-boundaries-3-expected.txt:
            * editing/selection/select-box-expected.txt:
            * fast/block/margin-collapse/103-expected.txt:
            * fast/forms/001-expected.checksum:
            * fast/forms/001-expected.png:
            * fast/forms/001-expected.txt:
            * fast/forms/003-expected.txt:
            * fast/forms/004-expected.txt:
            * fast/forms/HTMLOptionElement_label01-expected.txt:
            * fast/forms/HTMLOptionElement_label02-expected.txt:
            * fast/forms/HTMLOptionElement_label03-expected.txt:
            * fast/forms/HTMLOptionElement_label04-expected.txt:
            * fast/forms/HTMLOptionElement_label06-expected.txt:
            * fast/forms/HTMLOptionElement_label07-expected.txt:
            * fast/forms/form-element-geometry-expected.checksum:
            * fast/forms/form-element-geometry-expected.png:
            * fast/forms/form-element-geometry-expected.txt:
            * fast/forms/option-script-expected.txt:
            * fast/forms/option-text-clip-expected.txt:
            * fast/forms/select-change-listbox-to-popup-expected.txt:
            * fast/forms/select-selected-expected.txt:
            * fast/forms/select-style-expected.txt:
            * fast/forms/select-visual-hebrew-expected.txt:
            * fast/invalid/014-expected.txt:
            * fast/parser/document-write-option-expected.txt:
            * fast/replaced/width100percent-expected.txt:
            * http/tests/navigation/anchor-basic-expected.txt:
            * http/tests/navigation/anchor-frames-expected.txt:
            * http/tests/navigation/anchor-goback-expected.txt:
            * http/tests/navigation/anchor-subframeload-expected.txt:
            * http/tests/navigation/javascriptlink-basic-expected.txt:
            * http/tests/navigation/javascriptlink-frames-expected.txt:
            * http/tests/navigation/javascriptlink-goback-expected.txt:
            * http/tests/navigation/javascriptlink-subframeload-expected.txt:
            * http/tests/navigation/metaredirect-basic-expected.txt:
            * http/tests/navigation/metaredirect-frames-expected.txt:
            * http/tests/navigation/metaredirect-goback-expected.txt:
            * http/tests/navigation/metaredirect-subframeload-expected.txt:
            * http/tests/navigation/post-goback2-expected.txt:
            * http/tests/navigation/postredirect-goback2-expected.txt:
            * http/tests/navigation/redirect302-basic-expected.txt:
            * http/tests/navigation/redirect302-frames-expected.txt:
            * http/tests/navigation/redirect302-goback-expected.txt:
            * http/tests/navigation/redirect302-subframeload-expected.txt:
            * http/tests/navigation/relativeanchor-basic-expected.txt:
            * http/tests/navigation/relativeanchor-frames-expected.txt:
            * http/tests/navigation/relativeanchor-goback-expected.txt:
            * http/tests/navigation/slowmetaredirect-basic-expected.txt:
            * http/tests/navigation/slowtimerredirect-basic-expected.txt:
            * http/tests/navigation/success200-basic-expected.txt:
            * http/tests/navigation/success200-frames-expected.txt:
            * http/tests/navigation/success200-frames-loadsame-expected.txt:
            * http/tests/navigation/success200-goback-expected.txt:
            * http/tests/navigation/success200-loadsame-expected.txt:
            * http/tests/navigation/success200-reload-expected.txt:
            * http/tests/navigation/success200-subframeload-expected.txt:
            * http/tests/navigation/timerredirect-basic-expected.txt:
            * http/tests/navigation/timerredirect-frames-expected.txt:
            * http/tests/navigation/timerredirect-goback-expected.txt:
            * http/tests/navigation/timerredirect-subframeload-expected.txt:
            * tables/mozilla/bugs/bug1188-expected.txt:
            * tables/mozilla/bugs/bug18359-expected.txt:
            * tables/mozilla/bugs/bug2479-3-expected.txt:
            * tables/mozilla/bugs/bug2479-4-expected.txt:
            * tables/mozilla/bugs/bug29326-expected.txt:
            * tables/mozilla/bugs/bug33855-expected.txt:
            * tables/mozilla/bugs/bug4382-expected.txt:
            * tables/mozilla/bugs/bug96334-expected.txt:
            * tables/mozilla/core/margins-expected.txt:
            * tables/mozilla/dom/tableDom-expected.txt:
            * tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt:
    
    WebCore:
    
            Reviewed by Hyatt.
    
            Enable styling for popup menus. Also fixed baseline calculation for buttons and selects.
    
            Tests:   fast/forms/select-baseline.html
                     fast/borders/borderRadiusInvalidColor.html
            updated: fast/forms/select-style-expected.txt and more...
    
            * css/html4.css: Added style rules for styled select elements.
    
            * platform/GraphicsContext.h: Added argument for antialiasing.
            * platform/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawConvexPolygon): ditto.
            * platform/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawConvexPolygon): ditto.
    
            * rendering/RenderObject.cpp:
            (WebCore::RenderObject::drawBorderArc): Added textColor argument so this can be used when the border color is invalid.
            (WebCore::RenderObject::drawBorder): Removed invalidisInvert since its dead code 
             (any callers that set this to true were already ensuring that their color was valid).
             Updated drawConvexPolygon call to use FloatPoints instead of IntPoints.
            (WebCore::RenderObject::paintBorder): Updated to remove invalidisInvert argument from drawBorder call.
            (WebCore::RenderObject::paintOutline): ditto.
            * rendering/RenderFlow.cpp: (WebCore::RenderFlow::paintOutlineForLine): ditto.
            * rendering/RenderObject.h: Updated arguments for drawBorder and drawBorderArc.
    
            * rendering/RenderBlock.cpp: (WebCore::RenderBlock::getBaselineOfLastLineBox): Changed isRootLineBox argument to true when setting line height.
              Added case for when there's no children to check for hasLineIfEmpty.
            * rendering/RenderBlock.h:
            * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): Changed isRootLineBox argument to true when setting line height.
            * rendering/RenderButton.h: (WebCore::RenderButton::hasLineIfEmpty): Added so buttons always get a line height.
            * rendering/RenderMenuList.h: (WebCore::RenderMenuList::hasLineIfEmpty): ditto.
            * rendering/RenderFlexibleBox.cpp:
            (WebCore::RenderFlexibleBox::layoutHorizontalBox): Added code to check hasLineIfEmpty to give flex boxes line height.
            (WebCore::RenderFlexibleBox::layoutVerticalBox): ditto.
    
            * css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::adjustRenderStyle): Moved the appearance adjustment code into adjust style.
            * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): Lets the theme paint "decorations", like the arrow control and gradients
             immediately after painting the background.
    
            * rendering/RenderTheme.cpp:
            (WebCore::RenderTheme::adjustStyle): This now checks whether the control is styled, and adjusts the appearance property appropriately.
            For styled selects, instead of setting the appearance to none, which is what we do for other styled controls, we set the appearance
            to MenulistButtonAppearance, which indicates that we will draw the arrow controls and button appearance in the engine.
            (WebCore::RenderTheme::paintDecorations): Added. Paints MenulistButtonAppearance in a different function, 
             so the arrow control will draw at the right time (after the background).
            (WebCore::RenderTheme::paint): Added case for MenulistButtonAppearance.
            (WebCore::RenderTheme::paintBorderOnly): ditto.
            (WebCore::RenderTheme::isControlContainer): Removed cases for MenuListAppearance and MenulistButtonAppearance since the baseline is no longer provided by the theme.
            (WebCore::RenderTheme::adjustMenuListButtonStyle): Added.
            * rendering/RenderTheme.h: (WebCore::RenderTheme::paintMenuListButton): Added.
    
            * rendering/RenderThemeMac.h:
            * rendering/RenderThemeMac.mm:
            (WebCore::RenderThemeMac::isControlStyled): Removed code that made selects unstyle-able.
            (WebCore::RenderThemeMac::baselinePosition): Removed cases for MenuListAppearance and MenulistButtonAppearance.
            (WebCore::RenderThemeMac::popupButtonPadding): Added top and bottom padding so empty popups have the right baseline.
            (WebCore::TopGradientInterpolate): Added.
            (WebCore::BottomGradientInterpolate): Added.
            (WebCore::MainGradientInterpolate): Added.
            (WebCore::RenderThemeMac::paintMenuListButtonGradients): Added.  Draws gradients for styled popup menu button appearance.
            (WebCore::RenderThemeMac::paintMenuListButton): Calls paintMenuListButtonGradients, and draws arrow control.
            (WebCore::RenderThemeMac::adjustMenuListButtonStyle): Added to set padding and border radius to account for the arrow control size and font size.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    05abee33