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

Changeset 243413 in webkit


Ignore:
Timestamp:
Mar 23, 2019, 1:47:47 PM (7 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] Check if the transitioned content is visible at onAnimationEnd
https://bugs.webkit.org/show_bug.cgi?id=196171

Reviewed by Simon Fraser.

Source/WebCore:

At onAnimationEnd we don't yet have the final computed style for the transitioned content.
However the current state (before computing the final style) might already be qualified to be visible.
Introduce "CompletedTransition" to indicate that the transition is all set as far observing is concerned
(as opposed to "EndedTransition" where we still need to observe the content for the final style change).

Test: fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html

  • page/ios/ContentChangeObserver.cpp:

(WebCore::ContentChangeObserver::didFinishTransition):
(WebCore::ContentChangeObserver::adjustObservedState):

  • page/ios/ContentChangeObserver.h:

LayoutTests:

  • fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end-expected.txt: Added.
  • fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243405 r243413  
     12019-03-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Check if the transitioned content is visible at onAnimationEnd
     4        https://bugs.webkit.org/show_bug.cgi?id=196171
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end-expected.txt: Added.
     9        * fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html: Added.
     10
    1112019-03-22  Devin Rousso  <drousso@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r243409 r243413  
     12019-03-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Check if the transitioned content is visible at onAnimationEnd
     4        https://bugs.webkit.org/show_bug.cgi?id=196171
     5
     6        Reviewed by Simon Fraser.
     7
     8        At onAnimationEnd we don't yet have the final computed style for the transitioned content.
     9        However the current state (before computing the final style) might already be qualified to be visible.
     10        Introduce "CompletedTransition" to indicate that the transition is all set as far observing is concerned
     11        (as opposed to "EndedTransition" where we still need to observe the content for the final style change).
     12
     13        Test: fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html
     14
     15        * page/ios/ContentChangeObserver.cpp:
     16        (WebCore::ContentChangeObserver::didFinishTransition):
     17        (WebCore::ContentChangeObserver::adjustObservedState):
     18        * page/ios/ContentChangeObserver.h:
     19
    1202019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
    221
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r243315 r243413  
    153153    LOG_WITH_STREAM(ContentObservation, stream << "didFinishTransition: transition finished (" << &element << ").");
    154154
    155     adjustObservedState(Event::EndedTransition);
     155    adjustObservedState(isConsideredHidden(element) ? Event::EndedTransition : Event::CompletedTransition);
    156156}
    157157
     
    435435    case Event::EndedTransition:
    436436        // onAnimationEnd can be called while in the middle of resolving the document (synchronously) or
    437         // asynchronously right before the style update is issued.
     437        // asynchronously right before the style update is issued. It also means we don't know whether this animation ends up producing visible content yet.
    438438        if (m_document.inStyleRecalc()) {
    439439            // We need to start observing this style change synchronously.
     
    441441        } else
    442442            setShouldObserveNextStyleRecalc(true);
     443        break;
     444    case Event::CompletedTransition:
     445        // Set visibility flag on and report visible change synchronously or asynchronously depending whether we are in the middle of style recalc.
     446        contentVisibilityDidChange();
     447        if (m_document.inStyleRecalc())
     448            m_isInObservedStyleRecalc = true;
     449        else if (!isObservationTimeWindowActive())
     450            adjustStateAndNotifyContentChangeIfNeeded();
    443451        break;
    444452    case Event::EndedFixedObservationTimeWindow:
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.h

    r243315 r243413  
    174174        AddedTransition,
    175175        EndedTransition,
     176        CompletedTransition,
    176177        CanceledTransition,
    177178        StartedFixedObservationTimeWindow,
Note: See TracChangeset for help on using the changeset viewer.