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

189 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez cb56e2c9f3 Bug 1459529: Remove UPDATE_STYLE. r=heycam
Now that BeginUpdate is useless for the UPDATE_STYLE case, we don't need the
update mechanism at all. Just ensure that ApplicableStylesChanged is called on
the pres shell via the relevant RuleChanged, etc. notifications.

There's a big hidden gotcha here. nsIDocument::BeginUpdate does put a script
blocker on the stack for these updates. However it's not needed, since no script
can run during these notifications (only the stylesheet events we post for
devtools, but those use AsyncEventDispatcher and PostDOMEvents, so they don't
try to run immediately).

nsIDocument::BeginUpdate also does XBL binding attached queue stuff, but we
can't change bindings during these notifications anyway, so it also doesn't
matter.

MozReview-Commit-ID: HJvK6zQfloh
2018-05-15 18:44:29 +02:00
Emilio Cobos Álvarez 592affc9c0 Bug 1454503: Remove unused RestyleManager refcounting. r=xidorn
MozReview-Commit-ID: DILRptmC8wJ
2018-04-17 11:24:52 +02:00
Jonathan Watt 782365b415 Bug 1452170 - Remove RestyleLogging.h, RestyleTrackerInlines.h and related RESTYLE_LOGGING cruft. r=heycam 2018-04-09 09:33:56 +01:00
Emilio Cobos Álvarez e1aec7cd95 Bug 1447827: Rename the reparenting stuff. r=xidorn
MozReview-Commit-ID: H7tl6O8Ju32
2018-04-07 15:51:19 +02:00
Emilio Cobos Álvarez a2cb2d85cd Bug 1447827: Remove unused hover generation. r=xidorn
Not worth to keep the dead code, even if we may end up having to do something
about it in bug 1376082.

MozReview-Commit-ID: 8GG7O9ujtk0
2018-04-07 15:50:59 +02:00
Emilio Cobos Álvarez b508e66696 Bug 1447827: Move members from ServoRestyleManager to RestyleManager. r=xidorn
This leaves ServoRestyleManager as just a typedef.

MozReview-Commit-ID: 5wfTkiDc2Nr
2018-04-07 15:40:00 +02:00
Emilio Cobos Álvarez 0ea369c6a3 Bug 1450717: Remove unneeded / inconsistent arguments from nsCSSFrameConstructor. r=mats
Much in the spirit of bug 1442207.

They're not only unneeded, and cheap to get, but also we call them
inconsistently with the light DOM and flattened tree parent (like ContentRemoved
for display: contents), so they're really confusing, and kind of a footgun.

MozReview-Commit-ID: 9u3Kp8Kpp5i
2018-04-07 15:37:39 +02:00
Xidorn Quan efc0cdde02 Bug 1447828 part 8 - Remove remaining uses of StyleBackendType as well as the type itself. r=emilio
MozReview-Commit-ID: 6sh4eKvDpRF

--HG--
extra : rebase_source : 7d83f2b2d4e2739333016ed82754bf3a4a700de4
extra : source : 147ca562a24652c3f30add793213db70aff65e9e
2018-03-29 02:34:34 +11:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Emilio Cobos Álvarez a133a50ada Bug 1427625: Optimize appends to avoid restyling unnecessarily. r=xidorn
This unfortunately doesn't fix my test-case (because we're replacing the text
content all the time and all that), but it's still worth it, since it fixes the
case we care about (the parser appending).

We could also optimize pure insertions (since in that case we can still figure
out what the old text was), but it's probably annoying and not worth the churn.

In any case, we cannot optimize anything that resembles any kind of removal,
because from there we don't know the old text in any way (and the text nodes
like to reuse string buffers and such).

We could do two other optimizations to replace / extend this one, in that order:

 * Pass the buffer and length to CharacterDataWillChange, and use that to get
   the exact old text and the new one in RestyleManager. That would make the
   optimization exact.

 * Pass some sort of Maybe<bool> mWasWhitespace down the CharacterDataChangeInfo
   which is computed like:

    HasFlag(NS_CACHED_TEXT_IS_ONLY_WHITESPACE)
      ? Some(NS_TEXT_IS_ONLY_WHITESPACE)
      : Nothing()

It's not clear to me it's going to be completely worth the churn, so I haven't
done those yet, if we see code in the wild which resembles my testcase, we can
think of doing it.

MozReview-Commit-ID: 2rTWaZti8rv

--HG--
extra : rebase_source : 7390b8740801eb7b91700bb2533c43c173ac5db9
2018-02-27 17:02:52 +01:00
Jeremy Chen d4489c8a64 Bug 1421197 - use 64-bit for restyle generation counters to avoid overflow issues. r=heycam
It is expected to use 64-bit for all the restyle generation counters, since the
getter methods all return uint64_t type at present. However, we're using uint32_t
for the actual counter variables, which means the potential overflow issue is not
avoided.

In this patch, we use 64-bit for the restyle generation counters, so the overflow
issue can be avoided as expected.

MozReview-Commit-ID: 2y2afIcuwvc

--HG--
extra : rebase_source : 3fe64d7d3fc00fa1031eef9f0c15b64405435dfd
2017-11-28 17:42:22 +08:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Brad Werth 1174656d6b Bug 1385789: Refactor RestyleManager::ContentStateChangedInternal to move nsRestyleHint calculation out to GeckoRestyleManager. r=bholley
MozReview-Commit-ID: 7GXkPcjfYe6

--HG--
extra : rebase_source : d493227f872f2698d2f7d48df4132377b2d43c36
2017-08-29 15:50:50 -07:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Sebastian Hengst 2f2796d731 Backed out changeset 27e08c76b767 (bug 1388692) for failing mochitest layout/style/test/test_animations_styles_on_event.html on Android. r=backout 2017-08-14 15:16:28 +02:00
Hiroyuki Ikezoe 4a2f4eaddc Bug 1388692 - When doing hit testing, only flush animations if there are throttled compositor animations. r=birtles
This patch changes UpdateAnimationOnlyStyles to only flush animation styles if
there are throttled animation styles that could affect hit-testing and renames
the function to UpdateAnimationStylesForHitTesting at the same time.

For GeckoRestyleManager, the original UpdateAnimationOnlyStyles which flushes
animation styles if there are any pending animation styles, is renamed to
UpdateAnimationStyles for consistency.

MozReview-Commit-ID: 89UleXjI2OE

--HG--
extra : rebase_source : cac59f9d48b096aee718f89ffe203d38d39027fd
2017-08-14 19:59:59 +09:00
Emilio Cobos Álvarez 2b7de51623 Bug 1381844: Be more explicit about the kind of style context we handle all the time. r=bholley
MozReview-Commit-ID: E0mdkhU3XBz
2017-07-22 18:02:57 +02:00
Wei-Cheng Pan ef1ad5c8c6 Bug 1366964 - Update style context generation after style resolved. r=heycam
Adds another restyle generation which represents the dirty state of raw
style changes, so that getComputedStyle() wont be confused by optimizations
made by style engines.

MozReview-Commit-ID: 7RYeNCzFygO

--HG--
extra : rebase_source : e2a6bd73f4b2b71115abe68b5cce95be57cbd9b2
2017-05-23 14:13:47 +08:00
Emilio Cobos Álvarez ffbc62fe44 Bug 1379421: followup: Remove more dead code, and mark RestyleManager::mType as protected. r=me
The protected thing is needed to silence a clang warning about unused fields on
non-stylo builds.

MozReview-Commit-ID: CsFuIGmKfJx
2017-07-09 03:42:14 +02:00
Emilio Cobos Álvarez 0eea23decf Bug 1357583: Tidy the PostRestyleEventForCSSRuleChanges API. r=heycam
MozReview-Commit-ID: BtOWWC5knsi
2017-05-29 23:01:50 +02:00
Jonathan Kew a8f81efd8e Bug 1365982 - Attach frame properties to each frame instead of looking them up in a hashtable on the prescontext. r=mats
--HG--
rename : layout/base/FramePropertyTable.cpp => layout/base/FrameProperties.cpp
rename : layout/base/FramePropertyTable.h => layout/base/FrameProperties.h
2017-05-27 12:36:00 +01:00
Hiroyuki Ikezoe 665da78452 Bug 1364799 - Add PostRestyleEventForCSSRuleChanges to distinguish PostRestyleEvent. r=birtles,heycam
The difference is that PostRestyleEventForCSSRuleChanges sets
mRestyleForCSSRuleChanges true. In a subsequent patch,
we propagate a new TraversalRestyleBehavior flag to servo side
if mRestyleForCSSRuleChanges is true.

MozReview-Commit-ID: IKsBbm09uT9

--HG--
extra : rebase_source : 5014c0a978f98e81543ec7766d2daa415317069c
2017-05-21 08:16:26 +09:00
Boris Chiou 38215cedea Bug 1334036 - Part 11: Trigger animation-only restyle when we handle an event with coordinates. r=birtles,heycam
We need to request an animation-only restyle to force flush all throttled
animations on main thread when we handle an event with coordinates
(e.g. mouse event).

MozReview-Commit-ID: KkjeQVsLgTl

--HG--
extra : rebase_source : 314408062e719e9f52df9a6726e2f3dad817bbef
2017-05-19 16:16:41 +08:00
Boris Chiou 9a42bdba22 Bug 1334036 - Part 8: Add AddLayerChangesForAnimation in ServoRestyleManager. r=birtles
Some changes to animations don't affect the computed style and yet still
require the layer to be updated. Therefore, we also need to call
AddLayerChangesForAnimation in ServoRestyleManager. In this patch, we
factor out this function from GeckoRestyleManager, so we can reuse it.

MozReview-Commit-ID: LL7D1oGS65l

--HG--
extra : rebase_source : cd028a3d8f5dc251ec6615918a0f9569f0af44f5
2017-05-02 14:03:16 +08:00
Boris Chiou 2317c8957e Bug 1343753 - Part 6: Move mAnimationGeneration into RestyleManager. r=birtles
So stylo can also use mAnimationGeneration.

MozReview-Commit-ID: KTc8vs2RKMm

--HG--
extra : rebase_source : 52aeb3bf91fa849cbddbedff28418736f96086bb
2017-03-09 17:15:08 +08:00
Emilio Cobos Álvarez 9aaeccc118 Bug 1351791: Move PostRestyleEventForLazyConstruction and PostRestyleEventInternal to GeckoRestyleManager. r=bholley
MozReview-Commit-ID: 5lrNlkbrnZb
2017-03-31 11:56:29 +02:00
Emilio Cobos Álvarez fc80cf434d Bug 1351275: Move style flush observer logic to nsIPresShell, and align layout observing code. r=bholley
MozReview-Commit-ID: 2oUTNfTS4Ku
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 97d055e6682cbe81eaf32c365004f194a0ae1935
2017-03-29 15:41:11 +02:00
Emilio Cobos Álvarez 6c40f8a40b Bug 1296516: Tidy RestyleManager::ContentStateChanged. r=heycam
MozReview-Commit-ID: 7iWc6JvljhT
2017-03-20 22:28:13 +01:00
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