[Modern Media Controls] Scrubber stops moving while scrubbing on macOS
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2017 01:55:05 +0000 (01:55 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2017 01:55:05 +0000 (01:55 +0000)
commit5d4c0f2c72b23cd81c6ec55dd28b8d9a92493363
treed438452415e70397703a68026f976b6fa588f4d2
parent7ae9e7a30d4ff991cf0ca747f8f523cb7640c317
[Modern Media Controls] Scrubber stops moving while scrubbing on macOS
https://bugs.webkit.org/show_bug.cgi?id=168518
<rdar://problem/30577637>

Reviewed by Dean Jackson.

Source/WebCore:

As we start to scrub, controlValueWillStartChanging() is called on
ScrubberSupport and pauses the media if it's not already paused. This
causes the play/pause button to change icon and for layout() to be
called on MacOSInlineMediaControls. This in turns sets the .children
property on the .controlsBar and eventually yields a DOM manipulation
which re-inserts the scrubber's DOM hierarchy, causing stutters during
user interaction.

Our solution is to make the .children setter smarter about identifying
that the children list hasn't changed and that no DOM invalidation is
necessary.

* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):

LayoutTests:

Add assertions to check that setting children to a copy of itself doesn't
mark nodes as needing layout.

* media/modern-media-controls/layout-node/children-expected.txt:
* media/modern-media-controls/layout-node/children.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/modern-media-controls/layout-node/children-expected.txt
LayoutTests/media/modern-media-controls/layout-node/children.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/modern-media-controls/controls/layout-node.js