Changeset 227346 in webkit


Ignore:
Timestamp:
Jan 22, 2018, 12:07:29 PM (7 years ago)
Author:
Antti Koivisto
Message:

REGRESSION (Safari 11): Buttons inside a fieldset legend cannot be clicked on in Safari 11
https://bugs.webkit.org/show_bug.cgi?id=179666
<rdar://problem/35534292>

Reviewed by Zalan Bujtas.

Source/WebCore:

The legend element of a fieldset is in the border area, outside the clip rect.
With overflow:hidden mouse events won't reach it.

Test case by Dhaya Benmessaoud.

Test: fast/forms/legend-overflow-hidden-hit-test.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::nodeAtPoint):
(WebCore::RenderBlock::hitTestExcludedChildrenInBorder):

Add a special case to hit testing to handle legend, similarly to what is done for painting.

  • rendering/RenderBlock.h:

LayoutTests:

  • fast/forms/legend-overflow-hidden-hit-test-expected.txt: Added.
  • fast/forms/legend-overflow-hidden-hit-test.html: Added.
  • platform/ios/TestExpectations:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r227344 r227346  
     12018-01-22  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (Safari 11): Buttons inside a fieldset legend cannot be clicked on in Safari 11
     4        https://bugs.webkit.org/show_bug.cgi?id=179666
     5        <rdar://problem/35534292>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * fast/forms/legend-overflow-hidden-hit-test-expected.txt: Added.
     10        * fast/forms/legend-overflow-hidden-hit-test.html: Added.
     11        * platform/ios/TestExpectations:
     12
    1132018-01-22  Joanmarie Diggs  <jdiggs@igalia.com>
    214
  • trunk/LayoutTests/platform/ios/TestExpectations

    r227295 r227346  
    559559fast/forms/input-select-on-click.html [ Skip ]
    560560fast/forms/input-step-as-double.html [ Skip ]
     561fast/forms/legend-overflow-hidden-hit-test.html [ Skip ]
    561562fast/forms/listbox-deselect-scroll.html [ Skip ]
    562563fast/forms/listbox-scrollbar-hit-test.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r227344 r227346  
     12018-01-22  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (Safari 11): Buttons inside a fieldset legend cannot be clicked on in Safari 11
     4        https://bugs.webkit.org/show_bug.cgi?id=179666
     5        <rdar://problem/35534292>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        The legend element of a fieldset is in the border area, outside the clip rect.
     10        With overflow:hidden mouse events won't reach it.
     11
     12        Test case by Dhaya Benmessaoud.
     13
     14        Test: fast/forms/legend-overflow-hidden-hit-test.html
     15
     16        * rendering/RenderBlock.cpp:
     17        (WebCore::RenderBlock::nodeAtPoint):
     18        (WebCore::RenderBlock::hitTestExcludedChildrenInBorder):
     19
     20        Add a special case to hit testing to handle legend, similarly to what is done for painting.
     21
     22        * rendering/RenderBlock.h:
     23
    1242018-01-22  Joanmarie Diggs  <jdiggs@igalia.com>
    225
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r226516 r227346  
    22262226    }
    22272227
     2228    if (!checkChildren && hitTestExcludedChildrenInBorder(request, result, locationInContainer, adjustedLocation, hitTestAction))
     2229        return true;
     2230
    22282231    // Check if the point is outside radii.
    22292232    if (!isRenderView() && style().hasBorderRadius()) {
     
    36573660    box->paintAsInlineBlock(paintInfo, childPoint);
    36583661}
     3662
     3663bool RenderBlock::hitTestExcludedChildrenInBorder(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
     3664{
     3665    if (!isFieldset())
     3666        return false;
     3667
     3668    auto* legend = findFieldsetLegend();
     3669    if (!legend || !legend->isExcludedFromNormalLayout() || legend->hasSelfPaintingLayer())
     3670        return false;
     3671
     3672    HitTestAction childHitTest = hitTestAction;
     3673    if (hitTestAction == HitTestChildBlockBackgrounds)
     3674        childHitTest = HitTestChildBlockBackground;
     3675    LayoutPoint childPoint = flipForWritingModeForChild(legend, accumulatedOffset);
     3676    return legend->nodeAtPoint(request, result, locationInContainer, childPoint, childHitTest);
     3677}
    36593678   
    36603679} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r226516 r227346  
    456456    virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&) { return false; }
    457457    virtual bool hitTestInlineChildren(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&, HitTestAction) { return false; }
     458    bool hitTestExcludedChildrenInBorder(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
    458459
    459460    virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset);
Note: See TracChangeset for help on using the changeset viewer.