Changeset 188611 in webkit


Ignore:
Timestamp:
Aug 18, 2015 5:23:49 PM (9 years ago)
Author:
Wenson Hsieh
Message:

Search input results and clear icons are misaligned when padding is added
https://bugs.webkit.org/show_bug.cgi?id=148146
<rdar://problem/22310951>

Reviewed by Zalan Bujtas.

Source/WebCore:

Use content box rect to determine where to draw the results and cancel buttons
of a search field that has -webkit-appearance: textfield. Previously, we used
the bounding box, which caused the buttons to render in the input's padding
region.

Test: platform/mac/fast/forms/search/search-padding-cancel-results-buttons.html

  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::paintSearchFieldCancelButton): Use content box to

compute where to render cancel button.

(WebCore::RenderThemeMac::paintSearchFieldResultsButton): Use content box to

compute where to render results button.

LayoutTests:

Tests that for a search field with -webkit-appearance: textfield; and padding will not clip
its cancel and results buttons.

  • platform/mac/fast/forms/search/search-padding-cancel-results-buttons-expected.txt: Added.
  • platform/mac/fast/forms/search/search-padding-cancel-results-buttons.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r188604 r188611  
     12015-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Search input results and clear icons are misaligned when padding is added
     4        https://bugs.webkit.org/show_bug.cgi?id=148146
     5        <rdar://problem/22310951>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Tests that for a search field with -webkit-appearance: textfield; and padding will not clip
     10        its cancel and results buttons.
     11
     12        * platform/mac/fast/forms/search/search-padding-cancel-results-buttons-expected.txt: Added.
     13        * platform/mac/fast/forms/search/search-padding-cancel-results-buttons.html: Added.
     14
    1152015-08-18  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r188610 r188611  
     12015-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Search input results and clear icons are misaligned when padding is added
     4        https://bugs.webkit.org/show_bug.cgi?id=148146
     5        <rdar://problem/22310951>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Use content box rect to determine where to draw the results and cancel buttons
     10        of a search field that has -webkit-appearance: textfield. Previously, we used
     11        the bounding box, which caused the buttons to render in the input's padding
     12        region.
     13
     14        Test: platform/mac/fast/forms/search/search-padding-cancel-results-buttons.html
     15
     16        * rendering/RenderThemeMac.mm:
     17        (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Use content box to
     18            compute where to render cancel button.
     19        (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Use content box to
     20            compute where to render results button.
     21
    1222015-08-18  Dean Jackson  <dino@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r188577 r188611  
    17001700    float zoomLevel = o.style().effectiveZoom();
    17011701
    1702     FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(snappedIntRect(input->renderBox()->borderBoxRect()))];
     1702    FloatRect localBounds = [search cancelButtonRectForBounds:NSRect(snappedIntRect(input->renderBox()->contentBoxRect()))];
    17031703    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
    17041704
     
    18111811    float zoomLevel = o.style().effectiveZoom();
    18121812
    1813     FloatRect localBounds = [search searchButtonRectForBounds:NSRect(snappedIntRect(input->renderBox()->borderBoxRect()))];
     1813    FloatRect localBounds = [search searchButtonRectForBounds:NSRect(snappedIntRect(input->renderBox()->contentBoxRect()))];
    18141814    localBounds = convertToPaintingRect(*input->renderer(), o, localBounds, r);
    18151815
Note: See TracChangeset for help on using the changeset viewer.