gecko-dev/layout/base
Hiroyuki Ikezoe 54a0194045 Bug 1237454 - Throttle animations on visibility:hidden element. r=birtles,boris,emilio
This patch does basically throttle animations on visibility:hidden element
and unthrottle it once the animating element became visible or a child of the
animating element became visible.  But still there are some cases that we don't
throttle such animations perfectly.  For example;

  div.style.visibility = 'hidden'; // the 'div' has no children at this moment
  div.animate(..);
  // The animation is throttled

  div.appendChild(visibleChild);
  // The animation isn't throttled

  visibleChild.style.visibility = 'hidden';
  // Now the animation should be throttled again, but actually it's not.

To throttle this case properly, when the |visibleChild|'s visibility changed
to hidden, we would need to do either

 1) Check all siblings of the |visibleChild| have no visible children

or

 2) The parent element stores visible children count somewhere and decrease it
    and check whether the count is zero

To achieve 1) we need to walk up ancestors and their siblings, actually it's
inefficient.

2) is somewhat similar to what we already do for animating images but it's hard
to reuse it for CSS animations since it does not take into account that
descendants' visibilities.

Another example that this patch does not optimize is the the case where
animating element has children whose visibility is inherited and the element
itself initially visible something like this;

  let child = document.createElement('div'); // child visibility is 'inherit'
  div.appendChild(child);

  div.animate(..); // the 'div' is visible
  // The animation isn't throttled since the animating element is visible

  div.style.visiblily = 'hidden';
  // Now the animation should be throttled, but it's not since this patch does
  // not descend down all descendants to check they are invisible or not when the
  // animating element visibility changed to hidden.

This patch adds a test case for this case introduced with todo_is().

Another test case added in this patch fails if we don't use
nsPlaceholderFrame::GetRealFrameFor() in HasNoVisibleDescendants().

MozReview-Commit-ID: BJwzQvP9Yc4

--HG--
extra : rebase_source : e56505706bb2799b59bbfb3bbcce4a9ce86892f4
2018-02-09 10:43:10 +09:00
..
crashtests Bug 1435015: Unbreak display: contents on unknown MathML elements. r=mats 2018-02-02 20:52:54 +01:00
doc
gtest Backout changeset 5ca278d8c1af (Bug 1433671) for not handling all callers in all platforms. r=backout 2018-01-30 12:17:04 +01:00
tests Bug 1379117 Part 1: MOZ_ASSERT when not retrieving nsIWebBrowserPrint through docshell for Print Preview. r=jwatt 2018-02-08 08:59:20 +00:00
AccessibleCaret.cpp Bug 1426649: Remove nsCSSFrameConstructor updates. r=mats 2017-12-21 19:34:48 +01:00
AccessibleCaret.h
AccessibleCaretEventHub.cpp Backout changeset 5ca278d8c1af (Bug 1433671) for not handling all callers in all platforms. r=backout 2018-01-30 12:17:04 +01:00
AccessibleCaretEventHub.h Backout changeset 5ca278d8c1af (Bug 1433671) for not handling all callers in all platforms. r=backout 2018-01-30 12:17:04 +01:00
AccessibleCaretLogger.h
AccessibleCaretManager.cpp Bug 1434819 part 7. Remove the SHOW_* constants from nsIDOMNodeFilter. r=qdot 2018-02-01 14:26:12 -05:00
AccessibleCaretManager.h Backout changeset 5ca278d8c1af (Bug 1433671) for not handling all callers in all platforms. r=backout 2018-01-30 12:17:04 +01:00
ArenaObjectID.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
ArenaRefPtr.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
ArenaRefPtrInlines.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
CaretAssociationHint.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
FrameProperties.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
GeckoRestyleManager.cpp Bug 1436508 part 13. Remove nsIDOMMutationEvent constants. r=masayuki 2018-02-09 11:17:10 -05:00
GeckoRestyleManager.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
GeometryUtils.cpp Bug 1413361: EnsureFrameForTextNode shouldn't reconstruct synchronously without up-to-date styles. r=bz 2017-11-01 20:06:28 +01:00
GeometryUtils.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
LayoutLogging.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
LayoutLogging.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
MobileViewportManager.cpp Bug 1420056 - Use #defines for MobileViewportManager / ZoomConstraintsClient constants. r=kats 2017-11-23 14:06:15 +08:00
MobileViewportManager.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
moz.build Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn 2018-02-01 15:04:04 +11:00
nsAutoLayoutPhase.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsAutoLayoutPhase.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsBidi.cpp Bug 1288761 part 1 - Use level-based algorithm for nsBidi::GetLogicalRun. r=jfkthame 2017-10-05 18:11:50 +11:00
nsBidi.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsBidiPresUtils.cpp Bug 1431025 - Use encoding_rs::mem::is_utf16_bidi() as the implementation of HasRTLChars(). r=jfkthame 2018-01-18 14:28:15 +02:00
nsBidiPresUtils.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsCaret.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsCaret.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsChangeHint.h Bug 1237454 - Add VisibilityChange change hint. r=emilio 2018-02-09 10:43:10 +09:00
nsCompatibility.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsCounterManager.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsCounterManager.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsCSSColorUtils.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsCSSColorUtils.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsCSSFrameConstructor.cpp Backed out changeset c074e2c4b2ed (bug 1435658) for failing in layout/generic/test/test_bug632379.xul on a CLOSED TREE 2018-02-05 22:39:07 +02:00
nsCSSFrameConstructor.h Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn 2018-02-01 15:04:04 +11:00
nsDocumentViewer.cpp Bug 1437173 - Remove warning that node is null in GetInLink. r=bz 2018-02-09 13:10:13 -08:00
nsFrameManager.cpp Bug 1428353: Allow undisplayed maps to be queried for elements out of the document. r=mats 2018-01-06 00:50:58 +01:00
nsFrameManager.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsFrameManagerBase.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsFrameTraversal.cpp Bug 1413834 - part 4: Limit frame traversal inside scope owned by document root when shadow host has no frame , r=smaug, emilio 2018-01-26 17:49:47 +02:00
nsFrameTraversal.h Bug 1413834 - part 1: Limit frame traversal and getting of next tabindex inside scope owned by document root, r=smaug 2018-01-26 17:47:44 +02:00
nsGenConList.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsGenConList.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsIDocumentViewerPrint.h Bug 1430686 - Rename the document viewer "DestroyRefCount" member and methods. r=bobowen 2018-01-08 16:59:31 +00:00
nsIFrameTraversal.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsILayoutDebugger.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsILayoutHistoryState.idl
nsIPercentBSizeObserver.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsIPreloadedStyleSheet.idl
nsIPresShell.h Bug 1426728 - Don't cache the event target of pointer events when they are generated from touch. r=smaug. 2017-12-22 12:27:05 +08:00
nsIPresShellInlines.h Bug 1350930 - Move profiler markers for reflow and style flushes from the refresh driver into the PresShell. r=bz 2017-11-15 16:10:32 -05:00
nsIReflowCallback.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsIStyleSheetService.idl
nsLayoutDebugger.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsLayoutHistoryState.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsLayoutUtils.cpp Backed out changeset 9eb8652389f2 (bug 1427635) for clipboard failures at dom/browser-element/mochitest/test_browserElement_oop_CopyPaste.html 2018-02-12 13:44:46 +02:00
nsLayoutUtils.h Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn 2018-02-01 15:04:04 +11:00
nsPresArena.cpp Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn 2018-02-01 15:04:04 +11:00
nsPresArena.h Backed out changeset 0f783930e1b2 (bug 1406727) for GTest failures on ArenaAllocator. r=backout on a CLOSED TREE 2017-11-16 07:45:06 +02:00
nsPresArenaObjectList.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsPresContext.cpp merge mozilla-central to autoland. CLOSED TREE 2018-02-12 14:36:51 +02:00
nsPresContext.h merge mozilla-central to autoland. CLOSED TREE 2018-02-12 14:36:51 +02:00
nsPresState.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsQuoteList.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsQuoteList.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsRefreshDriver.cpp Bug 1435634 - Stop refresh driver's timer and bail out if either the prescontext or the presshell was destroyed in resize event callbacks. r=tnikkel 2018-02-05 06:24:16 +09:00
nsRefreshDriver.h Bug 1415780 - Let AnimationEventDispatcher observe nsRefreshDriver. r=birtles 2018-01-27 21:17:27 +09:00
nsStyleChangeList.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsStyleChangeList.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
nsStyleSheetService.cpp Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn 2018-02-01 15:04:04 +11:00
nsStyleSheetService.h Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn 2018-02-01 15:04:04 +11:00
OverflowChangedTracker.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
PositionedEventTargeting.cpp Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz 2017-12-25 17:50:10 +01:00
PositionedEventTargeting.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
PresShell.cpp Bug 1435643 - Remove no longer needed layer flattening code. r=mstange 2018-02-12 19:03:09 +13:00
PresShell.h Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn 2018-02-01 15:04:04 +11:00
RestyleLogging.h Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn 2018-02-01 15:04:04 +11:00
RestyleManager.cpp Bug 1237454 - Throttle animations on visibility:hidden element. r=birtles,boris,emilio 2018-02-09 10:43:10 +09:00
RestyleManager.h Bug 1421197 - use 64-bit for restyle generation counters to avoid overflow issues. r=heycam 2017-11-28 17:42:22 +08:00
RestyleManagerInlines.h Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn 2018-02-01 15:04:04 +11:00
RestyleTracker.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
RestyleTracker.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
RestyleTrackerInlines.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
ScrollbarStyles.cpp Bug 951793 - Add overscroll-behavior attributes to ScrollbarStyles. r=mstange 2017-11-25 01:28:59 +01:00
ScrollbarStyles.h Bug 951793 - Add overscroll-behavior attributes to ScrollbarStyles. r=mstange 2017-11-25 01:28:59 +01:00
ServoRestyleManager.cpp Bug 1433591: Update the style of child anon box wrapper after owned anon boxes. r=bz 2018-01-28 05:11:07 +01:00
ServoRestyleManager.h Bug 1422654: stylo: Avoid restyling XBL-bound element if the binding doesn't have stylesheets. r=heycam 2017-12-04 02:47:54 +01:00
ShapeUtils.cpp Bug 1418905 - Move nsRuleNode::ComputeCoordPercentCalc() into nsStyleCoord. r=heycam 2017-11-20 14:05:19 +08:00
ShapeUtils.h Bug 1404243 Part 3 - Remove refcount for StyleBasicShape, and use UniquePtr to hold it. r=heycam 2017-09-25 18:50:24 +08:00
StackArena.cpp Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
StackArena.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
StaticPresData.cpp Bug 90440 - Remove the font.size.unit pref. r=dbaron. 2017-11-16 09:54:17 +11:00
StaticPresData.h Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
TouchManager.cpp Bug 1426388 - Crash in mozilla::TouchManager::SuppressInvalidPointsAndGetTargetedFrame. r=smaug. 2017-12-20 23:32:52 +08:00
TouchManager.h Bug 1420589 Part6: Keep those touch points that are not in the same document so that we can use them to dispatch pointer events. 2017-12-09 10:06:18 +08:00
Units.h Bug 1434250 - Infrastructure for working with Box types in Gecko code. r=kats 2018-02-07 12:52:37 -05:00
UnitTransforms.h Bug 1409856 - Update all the WebRender code to use LayoutDevice units instead of Layer units. r=jrmuizel 2017-10-18 22:25:11 -04:00
WordMovementType.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00
ZoomConstraintsClient.cpp Bug 1420056 - Use #defines for MobileViewportManager / ZoomConstraintsClient constants. r=kats 2017-11-23 14:06:15 +08:00
ZoomConstraintsClient.h Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame 2017-10-27 10:33:53 -07:00