⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242679 in webkit


Ignore:
Timestamp:
Mar 9, 2019, 8:48:34 PM (7 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
https://bugs.webkit.org/show_bug.cgi?id=195520
<rdar://problem/48740098>

Reviewed by Simon Fraser.

Source/WebCore:

Unfortunately seriouseats has a 300ms hover intent delay to deal with accidental menupane pop-ups. This page also hides this
non-fixed width menupane using absolute positioning and negative left.

Test: fast/events/touch/ios/content-observation/move-content-from-offscreen.html

  • page/ios/ContentChangeObserver.cpp:

(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Content auhtors tend to use x - 1 values (where x = 10y)

LayoutTests:

  • fast/events/touch/ios/content-observation/move-content-from-offscreen-expected.txt: Added.
  • fast/events/touch/ios/content-observation/move-content-from-offscreen.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r242675 r242679  
     12019-03-09  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
     4        https://bugs.webkit.org/show_bug.cgi?id=195520
     5        <rdar://problem/48740098>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/events/touch/ios/content-observation/move-content-from-offscreen-expected.txt: Added.
     10        * fast/events/touch/ios/content-observation/move-content-from-offscreen.html: Added.
     11
    1122019-03-09  Zalan Bujtas  <zalan@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r242677 r242679  
     12019-03-09  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
     4        https://bugs.webkit.org/show_bug.cgi?id=195520
     5        <rdar://problem/48740098>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Unfortunately seriouseats has a 300ms hover intent delay to deal with accidental menupane pop-ups. This page also hides this
     10        non-fixed width menupane using absolute positioning and negative left. 
     11
     12        Test: fast/events/touch/ios/content-observation/move-content-from-offscreen.html
     13
     14        * page/ios/ContentChangeObserver.cpp:
     15        (WebCore::ContentChangeObserver::didInstallDOMTimer):
     16        (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
     17        (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Content auhtors tend to use x - 1 values (where x = 10^y)
     18
    1192019-03-09  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r242675 r242679  
    6767    if (m_document.activeDOMObjectsAreSuspended())
    6868        return;
    69     if (timeout > 250_ms || !singleShot)
     69    if (timeout > 300_ms || !singleShot)
    7070        return;
    7171    if (!isObservingDOMTimerScheduling())
     
    318318        return m_wasHidden && !isConsideredHidden();
    319319    };
    320    
     320
    321321    if (changedFromHiddenToVisible() && isConsideredClickable())
    322322        m_contentChangeObserver.contentVisibilityDidChange();
     
    335335        return true;
    336336
    337     auto width = style.width();
    338     auto height = style.height();
     337    auto width = style.logicalWidth();
     338    auto height = style.logicalHeight();
    339339    if ((width.isFixed() && !width.value()) || (height.isFixed() && !height.value()))
    340340        return true;
    341341
    342     auto top = style.top();
    343     auto left = style.left();
     342    auto top = style.logicalTop();
     343    auto left = style.logicalLeft();
    344344    // FIXME: This is trying to check if the element is outside of the viewport. This is incorrect for many reasons.
    345345    if (left.isFixed() && width.isFixed() && -left.value() >= width.value())
    346346        return true;
    347 
    348347    if (top.isFixed() && height.isFixed() && -top.value() >= height.value())
     348        return true;
     349
     350    // It's a common technique used to position content offscreen.
     351    if (style.hasOutOfFlowPosition() && left.isFixed() && left.value() <= -999)
    349352        return true;
    350353
Note: See TracChangeset for help on using the changeset viewer.