Граф коммитов

159 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez ddc24400e5 Bug 1341083: Cleanup infallible ProcessRestyledFrames. r=heycam
MozReview-Commit-ID: JfugKoU6caG
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-25 19:15:33 +01:00
Cameron McCormack 87681c4e08 Bug 1297899 - Part 9: Move RestyleFor{InsertOrChange,Append,EmptyChange} and ContentRemoved up to RestyleManager. r=bholley
MozReview-Commit-ID: 4iK7oG20awJ

--HG--
extra : rebase_source : 239f6bb272e68d1afe7314177e1b74bc0166dc2e
2017-02-13 11:21:33 +08:00
Cameron McCormack b063ce2515 Bug 1297899 - Part 8: Move Content{Inserted,Appended} up to RestyleManager. r=bholley
MozReview-Commit-ID: G2XyuyxhzOz

--HG--
extra : rebase_source : 28e1674562348bf92c2c55e1f5947a1c67666e22
2017-02-13 11:21:33 +08:00
Cameron McCormack 68519d4f84 Bug 1297899 - Part 7: Move PostRestyleEventForLazyConstruction up to RestyleManager. r=bholley
MozReview-Commit-ID: 8M5wgCJp6PT

--HG--
extra : rebase_source : 1a2b7d19bcb4d71107143fa3d437ccbf62f84060
2017-02-13 11:21:33 +08:00
Cameron McCormack f63cdecde2 Bug 1297899 - Part 6: Move RestyleManagerHandle functionality into RestyleManager. r=bholley
MozReview-Commit-ID: 7lsti0bGzNr

--HG--
extra : rebase_source : 13c64026190afe5de25f540adb6deea9f518149f
2017-02-13 11:21:33 +08:00
Cameron McCormack d075b281e3 Bug 1297899 - Part 5: Move refcounting from concrete restyle manager classes up to RestyleManager. r=bholley
MozReview-Commit-ID: 2KNfNCQzIIE

--HG--
extra : rebase_source : bc788e378c6239554b27efee23d3362fe2f44a78
2017-02-13 11:21:33 +08:00
Cameron McCormack 980ec770c6 Bug 1297899 - Part 4: Store concrete restyle manager type on RestyleManager. r=bholley
MozReview-Commit-ID: AmsNPqPVm8c

--HG--
extra : rebase_source : a30ae1028a9f4b7b63e8386e7182230d6c2e8b60
2017-02-13 11:21:32 +08:00
Cameron McCormack eddea92878 Bug 1297899 - Part 3: Rename RestyleManager to GeckoRestyleManager and RestyleManagerBase to RestyleManager. r=bholley
MozReview-Commit-ID: fFTZKwmGJm

--HG--
extra : rebase_source : 42b99c8a9c5616999abae2d195d16547f1fbc80f
2017-02-13 11:21:32 +08:00
Cameron McCormack 59395be5f8 Bug 1297899 - Part 2: Rename RestyleManagerBase.{h,cpp} to RestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: JVsfYommCoI

--HG--
rename : layout/base/RestyleManagerBase.cpp => layout/base/RestyleManager.cpp
extra : rebase_source : 45661c0bffb1bcdbe1496a54ca1d132663d63268
2017-02-13 11:21:31 +08:00
Cameron McCormack c041778642 Bug 1297899 - Part 1: Rename RestyleManager.{h,cpp} to GeckoRestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: 1v0ufuGFtiD

--HG--
rename : layout/base/RestyleManager.cpp => layout/base/GeckoRestyleManager.cpp
rename : layout/base/RestyleManager.h => layout/base/GeckoRestyleManager.h
extra : rebase_source : 9e9432b1185697dc21eb23de93a09610a5a074bd
2017-02-13 11:21:30 +08:00
Cameron McCormack 41cbd56383 Bug 1331294 - Part 6: Remove RestyleManager::HasPendingRestyles and Servo_Element_ShouldTraverse. r=bholley
MozReview-Commit-ID: 2ST5i7M4QZ4
2017-02-10 10:42:30 +08:00
Boris Chiou 8941b09399 Bug 1324691 - Part 2: Move AnimationsWithDestroyedFrame into RestyleManagerBase. r=hiro
Both ServoRestyleManager and RestyleManager need AnimationsWithDestroyedFrame,
so move it to the base class.

MozReview-Commit-ID: BswoDYm0gS1

--HG--
extra : rebase_source : 7c5aad5189ad425b0dcefab12d465d579704030d
2017-01-26 17:05:53 +08:00
Mantaroh Yoshinaga ed9cb5c860 Bug 1287983 part 5 - Clarify the function name of creating transition. r=hiro
MozReview-Commit-ID: AW5qD8uBQxf

--HG--
extra : rebase_source : 5cc8b81bec1db0b40b420bc539f03f6307879cb0
2016-10-19 15:16:52 +09:00
Emilio Cobos Álvarez 619cb14d87 Bug 1299066: Make NS_STYLE_DISPLAY_* an enum class. Prefer indexing instead of linear search in the frame constructor r=heycam,bz
The main renaming was generated with the following python script:

```

import sys
import re

CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)")
DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b")

def to_camel_case(ident):
  return re.sub(CAMEL_CASE_REGEX,
                lambda m: m.group(2) + m.group(3).lower(), ident)

def constant_to_enum(constant):
  return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "")

def process_line(line):
  return re.sub(DISPLAY_REGEX,
                lambda m: constant_to_enum(m.group(1)), line)

lines = []
with open(sys.argv[1], "r") as f:
  for line in f:
    lines.append(process_line(line))

with open(sys.argv[1], "w") as f:
  for line in lines:
    f.write(line)
```

And the following shell commands:

```
find . -name '*.cpp' -exec python display.py {} \;
find . -name '*.h' -exec python display.py {} \;
```

MozReview-Commit-ID: 91xYCbLC2Vf
2016-09-01 20:41:17 -07:00
Bobby Holley 0ecda8e2e2 Bug 1292279 - Add a helper to get the real container and use it in nsPresShell::Content{Inserted,Removed}. r=heycam
The existing static_cast checks are totally wrong, by the way, since
nsIDocuments are never nsIContent. Looks like they were erroneously
added in bug 862763.
2016-08-25 21:36:41 -07:00
Bobby Holley bfbb6b5feb Bug 1292279 - Explicitly style new children in Content{Appended/Inserted} rather than using restyle hints. r=heycam
This gives us more control over what gets restyled when.
2016-08-25 21:36:32 -07:00
Emilio Cobos Álvarez ffa9466398 Bug 1292930: Hoist ChangeHintToString to RestyleManagerBase. r=heycam
MozReview-Commit-ID: BLW40PYhc0o
2016-08-10 22:00:49 -07:00
Emilio Cobos Álvarez 3f8ce6d753 Bug 1292930: stylo: Reuse RestyleManager::PostRestyleEventInternal. r=heycam
MozReview-Commit-ID: J6rw1feAYWh
2016-08-10 22:00:33 -07:00
Emilio Cobos Álvarez 5d8a772fcd Bug 1290335: Make ProcessRestyledFrames non static, and tidy up a bit. r=heycam
MozReview-Commit-ID: 4aALVtI5DXT
2016-08-03 15:11:15 -07:00
Emilio Cobos Álvarez 789c630dba Bug 1290335: Reuse the OverflowChangedTracker between both restyle managers. r=heycam
MozReview-Commit-ID: objnqfecZD
2016-08-03 15:11:15 -07:00
Emilio Cobos Álvarez 5f6238d913 Bug 1290335: Hoist GetNextContinuationWithSameStyle to RestyleManagerBase. r=heycam
MozReview-Commit-ID: 3Jz9Od5xav0
2016-08-03 15:11:15 -07:00
Emilio Cobos Álvarez 95abaaa872 Bug 1290335: Hoist frame-construction logic in RestyleManager to static members in RestyleManagerBase. r=heycam
MozReview-Commit-ID: BqywJXZ0CYU
2016-08-03 15:11:15 -07:00
Emilio Cobos Álvarez 0733bfeaf7 Bug 1288873: stylo: Improve the error message when we don't handle a restyle hint. r=heycam
MozReview-Commit-ID: 3FCCCCF5gQS
2016-07-27 09:35:20 -07:00
Jeremy Chen c8db19c1c0 Bug 1287728 - part2: convert RestyleResult to enum class. r=heycam
MozReview-Commit-ID: LofE7oAJj6K

--HG--
extra : rebase_source : 8e82b40d3dd616e123908733a4ca14f5cbd4012a
2016-07-19 21:10:59 +08:00
Jeremy Chen 546697763f Bug 1287728 - part1: explicitly define default value for RestyleResult. r=heycam
After explicitly define default value for RestyleResult, we have a value
starting from 0 now. So, we can drop the explicity numbering.

MozReview-Commit-ID: 1UlpkUT6mAL

--HG--
extra : rebase_source : 441da4a5def8b9c8340cc3048d8dba5ddaae3b87
2016-07-19 21:10:59 +08:00
Emilio Cobos Álvarez 289ca90dc4 Bug 1285474: Add mozilla::RestyleManagerBase to share logic between RestyleManager and ServoRestyleManager. r=bholley
Partially implement some restyling APIs to take rid of some gecko-only code
paths.

MozReview-Commit-ID: L5i6Kr2Qars
2016-07-12 00:33:57 -07:00
Astley Chen 1fcb0ee95d Bug 1277131 : Part 1 - rename nsTableOuterFrame to nsTableWrapperFrame. r=heycam
MozReview-Commit-ID: KrSHLbmovTM

--HG--
rename : layout/tables/nsTableOuterFrame.cpp => layout/tables/nsTableWrapperFrame.cpp
rename : layout/tables/nsTableOuterFrame.h => layout/tables/nsTableWrapperFrame.h
extra : rebase_source : 730a73b8439f1f5c5ccdb32b241deda5224c321c
2016-06-16 13:14:08 +01:00
Jonathan Watt 3a3ceffce3 Bug 1263773 - Mark a bunch of classes in layout as MOZ_RAII. r=dholbert 2016-03-28 13:34:26 +01:00
Boris Chiou 6a9f22bcfe Bug 1182856 - Part 2: Let AnimationsWithDestroyFrame destroy transitions. r=heycam
We also want to cancel transitions with destroyed frames, so the simplest way
is to extend the ability of AnimationsWithDestroyFrame to cancel transitions as
well.

--HG--
extra : rebase_source : 87d09b6204240b51d425269cbdc07103df5d24ef
2016-04-10 21:28:00 +02:00
Brian Birtles 38e9dfee9e Bug 1245260 - Ignore redundant calls to RestyleManager::IncrementAnimationGeneration; r=dbaron
While processing restyles and starting transitions, we may trigger
a call to EffectCompositor::UpdateCascadeResults which may, in turn, call
EffectCompositor::RequestRestyle with RestyleType::Layer, which ultimately
results in a call to RestyleManager::IncrementAnimationGeneration().

Typically, nsTransitionManager::StyleContextChanged compares the animation
generation on its collection with that of the restyle manager and uses this
to ignore the restyle that it generates. However, given the sequence of events
above, that check may no longer help since the restyle manager's animation
generation will be out of step. As a result,
nsTransitionManager::StyleContextChanged will fail to ignore a subsequent
and redundant restyle. With certain combinations of content, this can mean that
restyles are posted in such a manner than an infinite cycle of restyles ensues.

This patch causes RestyleManager to ignore calls to IncrementAnimationGeneration
when it is already processing restyles such that the animation generation is
only ever updated once per restyle. This makes the check for a matching
animation generation in nsTransitionManager::StyleContextChanged work as
expected, preventing us from generating needless transitions which can produce
this endless loop.

MozReview-Commit-ID: 9HYDrknKPAI

--HG--
extra : rebase_source : f7d9f251d20805fcb4d0d9be04d4343336e69836
2016-03-16 15:05:10 +08:00
Cameron McCormack 2d34f1889d Bug 1244068 - Part 3: Factor out nsStyleSet getting in RestyleManager/ElementRestyler. r=dholbert 2016-02-24 18:01:10 +11:00
Cameron McCormack 62a2823887 Bug 1133615 - Don't assert about the contents of RestyleData::mDescendants when in a full style rebuild. r=dbaron 2016-02-20 13:20:24 +11:00
Boris Chiou e436478f26 Bug 1244049 - Part 2: Replace nsCSSPseudoElements::Type with CSSPseudoElementType. r=dbaron
Also, try to use forward declaraions for CSSPseudoElementType;

--HG--
extra : rebase_source : c00eb9753e8f618a33aa711538ac45c0132b353c
2016-02-17 21:37:00 +01:00
Boris Chiou 185a769719 Bug 1244049 - Part 1: Define scoped enum for CSSPseudoElement type. r=dbaron
--HG--
extra : rebase_source : e53dd269e47fa97eb259ebd9295d012eacbdb612
2016-02-16 23:07:00 +01:00
Birunthan Mohanathas d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas 373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Brian Birtles 7236a7fdbd Bug 1232577 part 18 - Drop RestyleManager::mLastUpdateForThrottledAnimations; r=heycam
RestyleManager currently has a piece of state for tracking if throttled
animations are up-to-date or not. Actually, it's not so much about throttled
animations but really about outstanding changes to animation styles (which
is typically expected to be due to throttling animations but there are
other cases that invalidate the animation style rule that we should be
considering here).

We now have that same information stored in the EffectCompositor so we can
remove the redundant state from RestyleManager. Furthermore, the state stored
in EffectCompositor is more accurate since it captures the case when animation
style needs to be updated twice within a tick, or when nothing needs to be
updated within a tick.

This patch, therefore, introduces EffectCompositor::HasPendingStyleUpdates in
place of setting RestyleManager::mLastUpdateForThrottledAnimations.

nsTransitionManager also uses mLastUpdateForThrottledAnimations to warn if we
have not processed throttled animations. We can't use HasPendingStyleUpdates
here however, since it will return true in the case where we have triggered new
transitions in the process of restyling. However, any new transitions will
trigger "standard" (i.e. not throttled) restyles so we introduce another
method, HasThrottledStyleUpdates, that returns true only if we have outstanding
throttled updates and use this for the warning inside nsTransitionManager.
2016-01-13 07:54:55 +09:00
Brian Birtles bf0b758990 Bug 1229280 - Move animation generation from AnimationCollection to EffectSet; r=dbaron
--HG--
extra : rebase_source : 26a942c8c6058e629e7d7ed549eb1fcdf7f6d399
2016-01-06 11:04:05 +09:00
Cameron McCormack 10e7cb5fae Bug 1219991 - Make RestyleManager::{Begin,End}ProcessingRestyles private. r=dholbert 2015-10-30 10:57:47 +11:00
Cameron McCormack 68f702f40a Bug 1219555 - Make RestyleManager::FrameConstructor() private. r=dholbert 2015-10-29 17:06:04 +11:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Cameron McCormack 54e04d5eff Bug 1203766 - Part 4: Add a "restyle generation" counter, which increments whenever we process pending restyles. r=bzbarsky 2015-09-17 12:08:20 +10:00
Hiroyuki Ikezoe 3525eca033 Bug 1197620 - Part 1 - Stop all animations in destroyed frames. r=bbirtles 2015-09-14 23:42:00 +02:00
Cameron McCormack 9c2b79104e Bug 1192302 - Part 2: Traverse the frame tree when processing eRestyle_SomeDescendants. r=bzbarsky 2015-09-04 10:00:14 +10:00
Cameron McCormack 5a7fd0fade Bug 1192302 - Part 1: Make MustCheckUndisplayedContent take its frame as an argument. r=bzbarsky 2015-09-04 10:00:14 +10:00
Cameron McCormack d32a93dce9 Bug 1180120 - Part 7: Add eRestyleResult_StopWithStyleChange. r=dbaron 2015-08-29 06:13:48 +10:00
Cameron McCormack f7742cef5d Bug 1180120 - Part 6.2: Refactor MaybeReframeFor{Before,After}Pseudo. r=dbaron 2015-08-29 06:13:48 +10:00
Cameron McCormack a830175340 Bug 1180120 - Part 6.1: Factor out some of RestyleUndisplayedDescendants. r=dbaron 2015-08-29 06:13:47 +10:00
Cameron McCormack ec9fcbb753 Bug 1180120 - Part 5: Factor out section of ElementRestyler::Restyle that calls AddPendingRestylesForDescendantsMatchingSelectors. r=dbaron 2015-08-29 06:13:47 +10:00