Changeset 228062 in webkit


Ignore:
Timestamp:
Feb 4, 2018 6:19:01 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r227974. rdar://problem/37145538

Location:
branches/safari-605-branch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/LayoutTests/ChangeLog

    r228058 r228062  
     12018-02-04  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r227974. rdar://problem/37145538
     4
     5    2018-02-01  Dean Jackson  <dino@apple.com>
     6
     7            REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
     8            https://bugs.webkit.org/show_bug.cgi?id=182394
     9            <rdar://problem/34840816>
     10
     11            Reviewed by Simon Fraser.
     12
     13            Add a test for a scaled down page.
     14
     15            * fast/dom/elementFromPoint-scaled-scrolled-expected.txt:
     16            * fast/dom/elementFromPoint-scaled-scrolled.html:
     17
    1182018-02-04  Jason Marcell  <jmarcell@apple.com>
    219
  • branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt

    r219342 r228062  
    1515PASS document.elementFromPoint(-85, 15) is null
    1616PASS document.elementFromPoint(215, 315) is b2
     17PASS document.elementFromPoint(525, 425) is b2
    1718PASS successfullyParsed is true
    1819
  • branches/safari-605-branch/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html

    r219342 r228062  
    5353    shouldBe("document.elementFromPoint(215, 315)", "b2");
    5454
     55    window.scrollTo(0, 0);
     56    if (window.internals)
     57        window.internals.setPageScaleFactor(0.5, 0, 0);
     58    // b2 is now technically outside the 800x600 scaled viewport rect,
     59    // but should still be found.
     60
     61    shouldBe("document.elementFromPoint(525, 425)", "b2");
     62
    5563    finishJSTest();
    5664}
  • branches/safari-605-branch/Source/WebCore/ChangeLog

    r228061 r228062  
     12018-02-04  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r227974. rdar://problem/37145538
     4
     5    2018-02-01  Dean Jackson  <dino@apple.com>
     6
     7            REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
     8            https://bugs.webkit.org/show_bug.cgi?id=182394
     9            <rdar://problem/34840816>
     10
     11            Reviewed by Simon Fraser.
     12
     13            If a scale < 1 is applied to the page, then the visual viewport will be bigger
     14            than the layout viewport. Our hit testing code would then ignore any hits
     15            that were outside the layout viewport.
     16
     17            The fix is to only apply a hit testing clip if the page is scaling up, not down.
     18
     19            Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.
     20
     21            * page/FrameView.cpp:
     22            (WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
     23            no longer used, and it would have probably been more confusing to have it accept
     24            a flag to ignore the scale if it is less than 1.
     25            * page/FrameView.h:
     26            * rendering/RenderLayer.cpp:
     27            (WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
     28            and pass it to a helper that added the origin back. The only thing the helper was
     29            doing for us was applying a scale factor, which we only want to do if it was
     30            scaling up.
     31
    1322018-02-04  Jason Marcell  <jmarcell@apple.com>
    233
  • branches/safari-605-branch/Source/WebCore/page/FrameView.cpp

    r227654 r228062  
    45254525}
    45264526
    4527 FloatRect FrameView::layoutViewportToAbsoluteRect(FloatRect rect) const
    4528 {
    4529     ASSERT(frame().settings().visualViewportEnabled());
    4530     rect.moveBy(layoutViewportRect().location());
    4531     rect.scale(frame().frameScaleFactor());
    4532     return rect;
    4533 }
    4534 
    45354527FloatPoint FrameView::layoutViewportToAbsolutePoint(FloatPoint p) const
    45364528{
  • branches/safari-605-branch/Source/WebCore/page/FrameView.h

    r226491 r228062  
    474474    WEBCORE_EXPORT FloatPoint clientToDocumentPoint(FloatPoint) const;
    475475
    476     FloatRect layoutViewportToAbsoluteRect(FloatRect) const;
    477476    FloatPoint layoutViewportToAbsolutePoint(FloatPoint) const;
    478477
  • branches/safari-605-branch/Source/WebCore/rendering/RenderLayer.cpp

    r226491 r228062  
    49344934        if (renderer().settings().visualViewportEnabled()) {
    49354935            auto& frameView = renderer().view().frameView();
    4936             LayoutRect layoutViewportBounds({ }, frameView.layoutViewportRect().size());
    4937             LayoutRect absoluteLayoutViewportRect = LayoutRect(frameView.layoutViewportToAbsoluteRect(layoutViewportBounds));
     4936            LayoutRect absoluteLayoutViewportRect = frameView.layoutViewportRect();
     4937            auto scaleFactor = frameView.frame().frameScaleFactor();
     4938            if (scaleFactor > 1)
     4939                absoluteLayoutViewportRect.scale(scaleFactor);
    49384940            hitTestArea.intersect(absoluteLayoutViewportRect);
    49394941        } else
Note: See TracChangeset for help on using the changeset viewer.