Commit Graph

45 Commits

Author SHA1 Message Date
Cameron McCormack
40fb431145 Bug 979133 - Add facility to log the restyle process. r=dbaron
Set the MOZ_DEBUG_RESTYLE environment variable and every restyle will have
detailed logging printed to stderr. By default, restyles for animations are
not logged; you can include them by also setting MOZ_DEBUG_RESTYLE_ANIMATIONS.

If you wish to limit restyle logging to a particular change, you can call
nsPresContext::StartRestyleLogging() and nsPresContext::StopRestyleLogging()
at appropriate points. (You might want to add a couple of helper methods
temporarily on nsIDocument and then expose them to your page with Web IDL
to make them easier to call.) You do not need to have set MOZ_DEBUG_RESTYLE
for this to work.
2014-09-25 15:45:36 +10:00
Phil Ringnalda
14f9d99fc1 Back out c0c410aed86f (bug 979133) for -wError bustage
CLOSED TREE
2014-09-24 21:06:22 -07:00
Cameron McCormack
3483fb3f51 Bug 979133 - Add facility to log the restyle process. r=dbaron
Set the MOZ_DEBUG_RESTYLE environment variable and every restyle will have
detailed logging printed to stderr.  By default, restyles for animations are
not logged; you can include them by also setting MOZ_DEBUG_RESTYLE_ANIMATIONS.

If you wish to limit restyle logging to a particular change, you can call
nsPresContext::StartRestyleLogging() and nsPresContext::StopRestyleLogging()
at appropriate points.  (You might want to add a couple of helper methods
temporarily on nsIDocument and then expose them to your page with Web IDL
to make them easier to call.)  You do not need to have set MOZ_DEBUG_RESTYLE
for this to work.
2014-09-25 13:13:14 +10:00
L. David Baron
3357a00e3a Bug 977991 patch 5 - Add eRestyle_ChangeAnimationPhase to switch between the with-animation and without-animation styles. r=birtles
This is an additional bit on nsRestyleHint that says that the restyling
operation should also perform all the work needed to switch between
style-without-animation and style-with-animation (based on
nsPresContext::IsProcessingAnimationStyleChange).  These concepts will
go away in bug 960465.

Note that we don't want this behavior for the animation-only style
update code (bug 996796, etc.), and I wanted to make this explicit so
that it was clear when it was happening, and so that it was clear what
code should be removed when we git rid of it.

This is the workaround needed to land bug 977991 prior to bug 960465.
(I think there's also a minor dependency in the other direction, so we
need a workaround one way or the other.)

Note that this depends on bug 1057231.
2014-09-13 06:17:37 -07:00
L. David Baron
5e262a47d8 Bug 977991 patch 3 - Add ability for RuleNodeWithReplacement to replace the style attribute rule and its important rule. r=birtles
This allows posting a restyle that says that only the rule(s) from the
StyleAttrSheet cascade level will be replaced, which avoids running
selector matching.

Part 4 will ensure that we only invoke this code for element styles (and
not pseudo-element or anonymous box styles).  Despite that, I prefer
having the runtime check here as well given that it's a very simple way
to ensure we don't do something silly that might have security
implications.
2014-09-13 06:17:36 -07:00
L. David Baron
81bd9c7023 Bug 977991 patch 0 - Add bitwise operators to nsRestyleHint. r=birtles
This avoids having to cast back to nsRestyleHint after using bitwise
operators, and allows |= (etc.).

(In the future we should consider converting nsRestyleHint, and probably
also nsChangeHint, to use MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS.)
2014-09-13 06:17:36 -07:00
L. David Baron
e5f6879ca0 Bug 1058346 patch 2 - Add eRestyle_SVGAttrAnimations and support it in nsStyleSet::RuleNodeWithReplacement. r=birtles
This allows posting a restyle that says that only the rule(s) from the
SVGAttrAnimationSheet cascade level will be replaced, which avoids running
selector matching.

This is needed to land bug 977991 prior to landing bug 960465, since
that requires replacing all levels that contain animations.

(I'll rename this to match the name determined in bug 1057231.)
2014-09-13 06:17:35 -07:00
Cameron McCormack
c07bb594ab Bug 931668 - Part 11: Add eRestyle_Force (and eRestyle_ForceDescendants) restyle hints to control whether the frame (and all of its descendants) must be assigned its new style context even if it had the same style data as the old style context. r=dbaron
--HG--
extra : rebase_source : f92a5b5033bb4cf424ee172611a58fe583aed87f
2014-09-05 13:48:45 +10:00
Cameron McCormack
9800c74ff6 Bug 931668 - Part 1: Add a change hint that represents a style data change that requires no processing. r=dbaron
--HG--
extra : rebase_source : 9035e376bfc53a18d6499407ad5958706aefcb7a
2014-09-05 13:48:43 +10:00
L. David Baron
1321a6e91b Bug 996796 patch 7 - Add new restyle types that replace only the data from CSS transitions or animations. r=heycam
This is the start of a refactoring of the existing code in
CommonAnimationManager, nsTransitionManager, and nsAnimationManager,
which will be removed in later patches (after patches in between cause
this code to be used instead of the current code).

But it also handles interesting cases more correctly, such as cases
where style context parents are unusual.

FIXME: It would be nice to add tests for these cases, but they're mostly
pretty obscure (e.g., a transition of 'transform' that's affected by
inheriting 'transform' from ::first-line), so I'm not treating it as a
priority right now.
2014-08-02 19:37:43 -07:00
Chris Lord
d54493310a Bug 1038781 - Don't reflow/repaint frame when clip changes. r=roc
If an element's existing clip changes, just update overflow areas and let
DLBI handle invalidation.
2014-07-16 13:28:50 +02:00
Susanna Bowen
4451470f2b Bug 727125 - Update overflow areas for text frames on text-decoration change to ensure text-decoration on hover is visible. r=dbaron 2014-06-17 10:32:00 -04:00
Wes Kocher
b29250a3a3 Backed out 2 changesets (bug 727125) for reftest bustage on an otherwise CLOSED TREE
Backed out changeset 443361e2724a (bug 727125)
Backed out changeset 16c8d78df86e (bug 727125)
2014-06-16 13:34:50 -07:00
Susanna Bowen
de5185bcd2 Bug 727125 - Update overflow areas for text frames on text-decoration change to ensure text-decoration on hover is visible. r=dbaron 2014-06-16 11:58:29 -07:00
Kearwood (Kip) Gilbert
93e818d617 Bug 984226 - Add parameter to OverflowChangedTracker::AddFrame to distingush between frames that need nsIFrame::UpdateOverflow called and frames that only have a transform that has changed. r=dbaron
- OverflowChangedTracker::AddFrame now accepts an enumerated type parameter to
  indicate if the overflow areas of children have changed (CHILDREN_CHANGED),
  the overflow areas of the children have changed and the parent have changed
  (CHILDREN_AND_PARENT_CHANGED), or if only the transform has changed
  (TRANSFORM_CHANGED).
- OverflowChangedTracker::Flush no longer falls back to calling
  nsIFrame::UpdateOverflow when a frame lacks a PreTransformOverflowAreas
  property.
- Added an additional change hint, nsChangeHint_ChildrenOnlyTransform, which
  results in TRANSFORM_CHANGED being passed in to
  OverflowChangedTracker::AddFrame.
- In nsIFrame::FinishAndStoreOverflow, the passed in overflow is now stored as
  the InitialTransformProperty for elements that are IsTransformed().
- Partially corrected Bug 926155, by only calling
  OverflowChangedTracker::AddFrame on parents of the sticky element during
  StickyScrollContainer::UpdatePositions, using CHILDREN_CHANGED.
2014-03-13 17:21:25 -07:00
Ryan VanderMeulen
27b28b1c13 Backed out changeset 7be71c699b85 (bug 984226) for crashtest asserts. 2014-04-08 15:31:45 -04:00
Kearwood (Kip) Gilbert
ebcffdc9e3 Bug 984226 - Add parameter to OverflowChangedTracker::AddFrame to distingush between frames that need nsIFrame::UpdateOverflow called and frames that only have a transform that has changed. r=dbaron
- OverflowChangedTracker::AddFrame now accepts an enumerated type parameter to
  indicate if the overflow areas of children have changed (CHILDREN_CHANGED) or
  if the transform has changed (TRANSFORM_CHANGED).
- OverflowChangedTracker::Flush no longer falls back to calling
  nsIFrame::UpdateOverflow when a frame lacks a PreTransformOverflowAreas
  property.
- Added an additional change hint, nsChangeHint_ChildrenOnlyTransform, which
  results in TRANSFORM_CHANGED being passed in to
  OverflowChangedTracker::AddFrame.
- In nsIFrame::FinishAndStoreOverflow, the passed in overflow is now stored as
  the InitialTransformProperty for elements that are IsTransformed().
- Partially corrected Bug 926155, by only calling
  OverflowChangedTracker::AddFrame on parents of the sticky element during
  StickyScrollContainer::UpdatePositions, using CHILDREN_CHANGED.
2014-03-13 17:21:25 -07:00
Robert Longson
95d45d92ee Bug 779971 - Make nsSVGTextPathProperty::DoUpdate trigger nsSVGTextFrame::NotifyGlyphMetricsChange() off an asynchronous change hint (to avoid calling nsLayoutUtils::FrameNeedsReflow synchronously under nsISVGChildFrame::ReflowSVG or during frame teardown, and avoid infinite loops caused by using an event queue event). r=jwatt.
--HG--
extra : rebase_source : 4dc4e59cf423f6ffb02826fb2f357edda85c048c
2012-11-07 09:53:44 +00:00
Jonathan Watt
1a92bc6ab1 Bug 809328 - Stop using nsChangeHint_UpdateEffects in nsSVGRenderingObserver::DoUpdate overrides. r=roc.
--HG--
extra : rebase_source : 79d032ea6ad6275882ab675004d2e02b932d56d5
2012-11-07 13:54:55 +00:00
Ed Morley
18a52c3135 Backout 99a2125bd365 (bug 779971) for reftest failures 2012-11-07 12:31:00 +00:00
Robert Longson
af422317a5 Bug 779971 - Make nsSVGTextPathProperty::DoUpdate trigger nsSVGTextFrame::NotifyGlyphMetricsChange() off an asynchronous change hint (to avoid calling nsLayoutUtils::FrameNeedsReflow synchronously under nsISVGChildFrame::ReflowSVG or during frame teardown, and avoid infinite loops caused by using an event queue event). r=jwatt. 2012-11-07 09:53:44 +00:00
Nathan Froyd
e888ba80f4 Bug 796129 - remove prtypes #includes in layout/ 2012-10-01 17:12:57 -04:00
L. David Baron
f646baaa52 Rename nsChangeHint_ReflowFrame to nsChangeHint_AllReflowHints to make it clearer that it's the one that contains multiple bits. (Bug 789592, patch 2) r=bzbarsky 2012-09-07 15:57:06 -07:00
L. David Baron
71132a9a8d Remove ForceCompare methods from style structs. (Bug 779968, patch 7) r=bzbarsky 2012-09-07 10:13:36 -07:00
L. David Baron
a272065d84 Make nsStyleContext::CalcStyleDifference force comparison based on the parent's hint instead of the style struct ForceCompare methods. (Bug 779968, patch 6, the main patch) r=bzbarsky
This propagates the non-inherited (in the nsChangeHint sense, not the
CSS inheritance sense) parts of the parent's change hint through
ReResolveStyleContext so that we can use them in
nsStyleContext::CalcDifference.  In the cases where we don't know the
parent's hint, we assume the worst, that all the non-inherited hints
were present in the parent's style change.

This should be a significant performance improvement handling simple
style changes (such as a style attribute change setting a non-inherited
property) on elements with large numbers of descendants that have data
in ForceCompare structs that can't be stored in the rule tree (for
example, margins or widths in em or rem units).
2012-09-07 10:13:36 -07:00
L. David Baron
e5c1596389 Refix bug 731521 in the new setup for forcing comparison in nsStyleContext::CalcDifference, since we can no longer rely on nsStyleBorder::ForceCompare. (Bug 779968, patch 5) r=bzbarsky 2012-09-07 10:13:36 -07:00
L. David Baron
d73fade352 Abstract nsChangeHint_NonInherited_Hints into a function so that it accurately reports the reflow cases to all callers. (Bug 779968, patch 4) r=bzbarsky
This is in preparation for adding an additional caller.

nsChangeHint_NonInherited_Hints will be reintroduced in patch 6, but as
the maximum set of such hints rather than the minimal set, and with the
less confusing name nsChangeHint_Hints_NotHandledForDescendants.
2012-09-07 10:13:36 -07:00
Robert O'Callahan
91c0802b2f Bug 691651. When an element changes between having a transform and not having one, don't reframe if we don't need to. r=dbaron
--HG--
extra : rebase_source : ed990c17d2501ea5f4d09dea56baeada41cd3f35
2012-08-10 23:16:49 +12:00
Jonathan Watt
2e72406ef8 Bug 775304 - Don't visit the descendant frames for the nsChangeHint_UpdateEffects hint. r=roc, r=dbaron.
--HG--
extra : rebase_source : 11996bd6194d62f98eba81d5e3a13d29eaacd62b
2012-07-19 15:44:04 -04:00
Ehsan Akhgari
5682d40581 Bug 157681 - Part 2: Optimize positioned frame offset changes by moving the frame as opposed to reflowing it in case we know that the size of the frame will not change; r=dbaron
This patch adds a change hint to signal that one of the offsets on a
frame has been changed.  When processing the hint, we do one of the
following things based on the position property of the frame.

* For static frames, we ignore the offset changes completely, as they
  will not change the layout.
* For relative positioned frames, this patch refactors the
  nsHTMLReflowState::ComputeRelativeOffsets function so that it can be
  used from other callers, and it uses that to compute the new relative
  offsets, and uses the offsets computed previously to compute the new
  position of the frame.
* For absolute positioned frames, we set up a fake parent reflow state
  object, and then we create a new reflow state object for the frame in
  question.  This setup is similar to what nsFrame::BoxReflow does.
  Once we have the new reflow state object, we use it to compute the
  absolute offsets, and then we use the computed offsets to set the new
  position of the frame.  The offset computation is similar to what
  nsAbsoluteContainingBlock::ReflowAbsoluteFrame does.  In some cases
  where it is possible for the dimensions of the frame to change based
  on the offset changes, we fall back to a full reflow.
2012-06-06 00:53:48 -04:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Jonathan Watt
75835eecfc Bug 734082 - Compute and store bounds and visual overflow bounds for both SVG leaf and container frames. r=roc. 2012-05-17 05:05:09 +01:00
Robert O'Callahan
4146c611c0 Bug 724502. Ensure that UpdateTransformLayer and UpdateOpacityLayer change hints generate a new change list entry for every frame whose style asks for them. r=matspal 2012-02-08 11:52:59 +13:00
Benjamin Stover
0a52de4032 Bug 524925 - Recompute overflow without reflowing for transforms. part=1/6 r=dbaron
Add an extra change hint, UpdateOverflow, that can be used to specify that
a frame's overflow areas may have changed and that they need to be recalculated.
When a transform on a frame changes, instead of marking it for reflow, set this
hint instead.

There is an added virtual function on nsIFrame, UpdateOverflow, which is called
recursively on a frame when the corresponding hint is set, to allow it to
update its overflow areas.
2011-06-15 14:03:49 -07:00
Michael Wu
d8e503c38b Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Matt Woodrow
a580694478 Bug 505115. Use layers to render active 2D transforms. r=roc,dbaron 2010-08-02 15:07:04 +12:00
Robert O'Callahan
1917c1d836 Bug 564991. Part 13: Optimize invalidation to avoid repainting ThebesLayer contents sometimes. r=mats,sr=dbaron 2010-07-16 09:07:53 +12:00
Boris Zbarsky
e81230c9bb Bug 494117 part 2. Don't force selector matching on the whole subtree rooted at an element when the element's style changes. r=dbaron 2010-06-18 12:23:05 -04:00
Boris Zbarsky
37c6532fe1 Bug 494117 part 1. Rename eRestyle_Self to eRestyle_Subtree. r=dbaron 2010-06-18 12:23:05 -04:00
Zack Weinberg
ee4e0f1e56 Bug 494117 preliminary refactor: Search-and-replace 'ReStyle' with 'Restyle' throughout layout. r=roc 2010-03-31 17:43:32 -07:00
Boris Zbarsky
e2f39a9eac Bug 502288. Provide finer-grained style change hints for triggering reflow. r=dbaron 2009-08-03 21:22:13 -04:00
Boris Zbarsky
bc219716a8 Backed out changeset 25462849adcc (bug 502288) to get some talos cycles for the tracemonkey merge without this patch in.
--HG--
extra : rebase_source : bff86f8ab792af6109b1862d601e2ba560dc4ba1
2009-08-03 15:10:09 -04:00
Boris Zbarsky
ff75d6817f Bug 502288. Provide finer-grained style change hints for triggering reflow. r=dbaron 2009-08-03 13:38:42 -04:00
Robert O'Callahan
aa8fb5c224 Bug 447567. Instead of brutally wiping out effects properties whenever the style context changes for an SVG frame (which wouldn't work for non-SVG frames), create a new style change hint to handle it. r=longsonr,sr=dbaron 2008-08-06 12:55:07 +12:00
hg@mozilla.com
465265d0d4 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT, 2007-03-22 10:30:00 -07:00