Bug 195244 - [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
Summary: [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-02 08:38 PST by zalan
Modified: 2019-03-02 16:15 PST (History)
4 users (show)

See Also:


Attachments
Patch (13.11 KB, patch)
2019-03-02 08:47 PST, zalan
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2019-03-02 08:38:12 PST
to be able to follow state changes.
Comment 1 Radar WebKit Bug Importer 2019-03-02 08:38:46 PST
<rdar://problem/48536737>
Comment 2 zalan 2019-03-02 08:47:13 PST
Created attachment 363422 [details]
Patch
Comment 3 Simon Fraser (smfr) 2019-03-02 13:27:28 PST
Comment on attachment 363422 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=363422&action=review

> LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html:3
> +<title>This test that we trigger hover when the content change starts as async but it turns into a sync style recalc.</title>

This tests that

> LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html:50
> +        document.body.offsetHeight;

Is this necessary?

> Source/WebCore/page/ios/ContentChangeObserver.cpp:143
>  void ContentChangeObserver::didContentVisibilityChange()

contentVisibilityDidChange? didContentVisibilityChange sounds like a question.

> Source/WebCore/page/ios/ContentChangeObserver.cpp:197
> +    if (event == Event::DidContentObservationStart) {

Use a switch so that you get warnings from the complier?

> Source/WebCore/page/ios/ContentChangeObserver.cpp:219
> +void ContentChangeObserver::signalContentChangeIfNeeded()

I think "notify" would be a better term to use.

> Source/WebCore/page/ios/ContentChangeObserver.h:93
> +    void addObservedDOMTimer(const DOMTimer&);
>      void removeObservedDOMTimer(const DOMTimer&);

Normally we'd say "startObservingFoo/stopObservingFoo".

> Source/WebCore/page/ios/ContentChangeObserver.h:115
> +    enum class Event {

Event is a bit of an overloaded term. Maybe OK here.

> Source/WebCore/page/ios/ContentChangeObserver.h:119
> +        DidContentObservationStart,
> +        DidInstallDOMTimer,
> +        DidRemoveDOMTimer,
> +        DidContentVisibilityChange

I think you can remove the "Did" from all these. Maybe use the past tense: Event::InstalledDOMTimer.
Comment 4 zalan 2019-03-02 16:15:17 PST
Committed r242321: <https://trac.webkit.org/changeset/242321>