Changeset 243414 in webkit


Ignore:
Timestamp:
Mar 23, 2019 1:58:37 PM (5 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] Add support for observing opacity.
https://bugs.webkit.org/show_bug.cgi?id=196172

Reviewed by Simon Fraser.

Source/WebCore:

This patch adds support for observing opacity changes. At this point we only track one transition at a time.
if the page registers transition on both left and opacity, the first is getting observed only.

Tests: fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html

fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html

  • page/ios/ContentChangeObserver.cpp:

(WebCore::isConsideredHidden):
(WebCore::ContentChangeObserver::didAddTransition):

  • page/ios/ContentChangeObserver.h:

(WebCore::ContentChangeObserver::isObservedPropertyForTransition const):

LayoutTests:

  • fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-expected.txt: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left-expected.txt: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition-expected.txt: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-expected.txt: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition-expected.txt: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html: Added.
  • fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html: Added.
Location:
trunk
Files:
10 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243413 r243414  
     12019-03-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Add support for observing opacity.
     4        https://bugs.webkit.org/show_bug.cgi?id=196172
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-expected.txt: Added.
     9        * fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left-expected.txt: Added.
     10        * fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html: Added.
     11        * fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition-expected.txt: Added.
     12        * fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html: Added.
     13        * fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html: Added.
     14        * fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-expected.txt: Added.
     15        * fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition-expected.txt: Added.
     16        * fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html: Added.
     17        * fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html: Added.
     18
    1192019-03-23  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r243413 r243414  
     12019-03-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Add support for observing opacity.
     4        https://bugs.webkit.org/show_bug.cgi?id=196172
     5
     6        Reviewed by Simon Fraser.
     7
     8        This patch adds support for observing opacity changes. At this point we only track one transition at a time.
     9        if the page registers transition on both left and opacity, the first is getting observed only.
     10
     11        Tests: fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html
     12               fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html
     13               fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html
     14               fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html
     15               fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html
     16
     17        * page/ios/ContentChangeObserver.cpp:
     18        (WebCore::isConsideredHidden):
     19        (WebCore::ContentChangeObserver::didAddTransition):
     20        * page/ios/ContentChangeObserver.h:
     21        (WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
     22
    1232019-03-23  Zalan Bujtas  <zalan@apple.com>
    224
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r243413 r243414  
    5555        return true;
    5656
     57    if (!style.opacity())
     58        return true;
     59
    5760    auto width = style.logicalWidth();
    5861    auto height = style.logicalHeight();
     
    138141        return;
    139142    if (!isConsideredHidden(element))
     143        return;
     144    // In case of multiple transitions, the first tranistion wins (and it has to produce a visible content change in order to show up as hover).
     145    if (m_elementsWithTransition.contains(&element))
    140146        return;
    141147    LOG_WITH_STREAM(ContentObservation, stream << "didAddTransition: transition created on " << &element << " (" << transitionEnd.milliseconds() << "ms).");
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.h

    r243413 r243414  
    124124    void setShouldObserveTransitions(bool observe) { m_isObservingTransitions = observe; }
    125125    bool isObservingTransitions() const { return m_isObservingTransitions; }
    126     bool isObservedPropertyForTransition(CSSPropertyID propertyId) const { return propertyId == CSSPropertyLeft; }
     126    bool isObservedPropertyForTransition(CSSPropertyID propertyId) const { return propertyId == CSSPropertyLeft || propertyId == CSSPropertyOpacity; }
    127127    void domTimerExecuteDidStart(const DOMTimer&);
    128128    void domTimerExecuteDidFinish(const DOMTimer&);
Note: See TracChangeset for help on using the changeset viewer.