Commit Graph

68 Commits

Author SHA1 Message Date
Nicholas Nethercote
7dbfdaf890 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
2017-10-03 09:05:19 +11:00
Boris Zbarsky
6e642eacf7 Bug 1397398. Don't assert about unprocessed wrapper anonymous box restyles in situations in which the styles of those wrapper anonymous boxes can't have changed anyway. r=emilio 2017-09-09 04:11:54 -04:00
Wei-Cheng Pan
77a3e6f43a Bug 1397168 - Add a function to find out if a node has any ancestor that is pending for restyling. r=emilio
MozReview-Commit-ID: DXcodMcQP59
2017-09-06 15:42:05 +08:00
Boris Zbarsky
c62dc63d66 Bug 1395650. Make anonymous column groups into non-inheriting anon boxes, to better match the behavior of other browsers. r=heycam 2017-09-01 00:53:33 -04:00
Xidorn Quan
94ca520e89 Bug 1390409 part 2 - Replace aParentWasRestyled with a bitflag. r=emilio
MozReview-Commit-ID: 49C1N6LNXi7
2017-08-28 14:53:35 +10:00
Xidorn Quan
7db47583d5 Bug 1390409 part 1 - Remove unused ServoTraversalFlags param from ServoRestyleManager::ProcessPostTraversal. r=emilio
This was added in bug 1384769 for passing into Servo_TakeChangeHint,
but bug 1388031 changed Servo_TakeChangeHint to no longer take it, and
there is nothing else in the function which uses the flags.

MozReview-Commit-ID: LvZkJZHENUB
2017-08-28 14:27:46 +10:00
Wei-Cheng Pan
0acd30eafe Bug 1388298 - Add an API to process all invalidations on the main thread. r=emilio
MozReview-Commit-ID: I7rBwvPQykR
2017-08-24 15:36:48 +08:00
Emilio Cobos Álvarez
0d18b49379 Bug 1392093: Remove dead code to get the old style context. r=heycam
Unused since https://github.com/servo/servo/pull/18153.

MozReview-Commit-ID: DtQdm3ONS5E
2017-08-20 18:01:25 +02:00
Sebastian Hengst
a950bd84b0 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
5e02184d29 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
2017-08-14 19:59:59 +09:00
Boris Zbarsky
14690c54ee Bug 1388625 part 5. Implement wrapper anonymous box restyling in ServoRestyleManager. r=heycam
MozReview-Commit-ID: FRW4RCR1GT4
2017-08-11 00:10:26 -04:00
Hiroyuki Ikezoe
e85ec19021 Bug 1379516 - Mark animation timerline marker for stylo. r=birtles
MozReview-Commit-ID: GkPSXEk4xua
2017-08-11 08:44:11 +09:00
Boris Zbarsky
ab822a31fe Bug 1324619 part 3. Implement ReparentStyleContext in ServoRestyleManager, for ::first-line use. r=emilio
This doesn't actually implement style context reparenting in the style set yet; that part is next.

There is one behavior difference being introduced here compared to Gecko: we
don't reparent the first block piece of an {ib} (block-inside-inline) split
whose first inline piece is being reparented.  This is actually a correctness
fix.  In this testcase:

  <style>
    #target { color: green; }
    #target::first-line { color: red; }
  </style>
  <div id="target">
    <span>
      <div>This should be green</div>
    </span>
  </div>

Gecko makes the text red, while every other browser makes it green.

We're preserving Gecko's behavior for out-of-flows in first-line so far, but
arguably it's wrong per spec and doesn't match other browsers either.  We can
look into changing it later.

MozReview-Commit-ID: 5eC6G449Mlh
2017-07-28 21:11:18 -04:00
Bobby Holley
cca4b9e30a Bug 1384769 - Clean up ForThrottledAnimationFlush stuff. r=hiro
MozReview-Commit-ID: I6xeHv65nH2
2017-07-27 17:49:40 -07:00
Bobby Holley
9b25ccada2 Bug 1384769 - Pass TraversalFlags from C++ into Rust. r=emilio
MozReview-Commit-ID: EVUzgnL5coN
2017-07-27 17:49:38 -07:00
Manish Goregaokar
63c907be23 Bug 1367904 - Part 11: stylo: Use ServoStyleContext in ServoStyleSet/ServoRestyleManager; r=bholley
MozReview-Commit-ID: JJOBixTSCZq
2017-07-17 21:00:54 -07:00
Hiroyuki Ikezoe
aa21f4e098 Bug 1371450 - Don't traverse normal dirty elements in ProcessPostTraversal when we process throttled animations restyle for event handling. r=emilio
When we process throttled animations restyle for event handling, we skip normal
traversal at all, so after Servo_TraverseSubtree, normally there remains
unstyled elements which have to be processed in normal traversal later. These
elements should be skipped in ProcessPostTraversal too since it's not yet styled!

MozReview-Commit-ID: LgyWQpiFZ8e
2017-07-15 13:09:14 +09:00
Emilio Cobos Álvarez
8588428e5c Bug 1379421: Remove dead code in ServoRestyleManager. r=heycam
MozReview-Commit-ID: zNNcy6p5qD
2017-07-09 00:02:16 +02:00
Brian Birtles
e0c8e2c737 Bug 1365472 - Use animated class names when doing selector matching in Servo; r=heycam
Using SVG SMIL it is possible to animate the class attribute of an element using
markup such as the following:

  <style>
    .red {
      fill: red;
    }
  </style>
  <svg>
    <circle cx="50" cy="50" r="30" fill="blue">
      <set attributeName="class" to="red" begin="1s"/>
    </circle>
  </svg>

In Gecko, Element::GetClasses handles this case by looking for an animated class
string when the element in question is an SVG element.

This patch causes our Servo bindings to use GetClasses when querying attribute
values for selector matching.

Note that animating the class attribute is *not* expected to affect attribute
selectors such as `circle[class="red"]`. It does in Chrome, but that is due to
a Blink bug where animating attributes using SMIL affects the result of
getAttribute:

  https://bugs.chromium.org/p/chromium/issues/detail?id=735820

This patch adjusts the behavior for both the GeckoElement case and the
ServoElementSnapshot case.

MozReview-Commit-ID: DAFWHSH1aYB
2017-06-27 10:55:03 -07:00
Emilio Cobos Álvarez
23662f6e46 Bug 1375674: Track the owner that represents the changes handled, and fix a bunch of issues while at it. r=heycam
In particular, this fixes:

 * Restyling of <area> elements that reuse the primary frame mapping for the
   image map.

 * Restyling of children of display: contents elements when the display:
   contents element generates a hint.

 * Restyling of out-of-flows (if my analysis in the bug is right).

 * Restyling of the ::backdrop pseudo-element.

 * Restyling of the Viewport frame.

I only managed to do a reftest for the second one, but the rest of them are
covered by the assertions added.

MozReview-Commit-ID: E7QtiQ1vPqu
2017-06-23 19:31:35 +02:00
Emilio Cobos Álvarez
fc8b78f775 Bug 1374752: Pack together the StyleSet, ChangeList and handled change hints, and use the latter with anonymous boxes while we're at it. r=heycam
MozReview-Commit-ID: DiWcUwD9po5
2017-06-20 23:21:27 +02:00
Emilio Cobos Álvarez
ad49506734 Bug 1368236: Implement the "hints handled for descendants" optimization. r=heycam
MozReview-Commit-ID: D6CCmWbEXTs
2017-06-16 09:37:45 +02:00
Emilio Cobos Álvarez
1e5cead0c1 Bug 1371955: Diff against the correct style, not the table wrapper style. r=heycam
MozReview-Commit-ID: 9fwt2D7vOpW
2017-06-11 13:44:24 +02:00
Hiroyuki Ikezoe
73a43218dd Bug 1368889 - Post animation restyle hint againt pseudo element instead of its parent. r=birtles
To traverse pseudo elements in animation-only restyle, the pseudo element
itself needs the animation-only dirty bit.

MozReview-Commit-ID: 11RfVqnPXfJ
2017-06-08 10:22:25 +09:00
Emilio Cobos Álvarez
084a6bad22 Bug 1357461: Ensure not to increment the restyle generation if we haven't restyled after all. r=heycam
This can happen with content attribute or state changes that end up not
generating any hint.

In particular, in the media_queries_dynamic.html case, the iframe resize was
toggling a few scrollbar attributes, which made us never pass the "didn't
restyle" test, even though the test really passed.

I'll probably need to add a workaround to assume we use viewport units, so
probably won't pass for long.

MozReview-Commit-ID: 2oEfic5yaOy
2017-06-03 18:59:10 +02:00
Emilio Cobos Álvarez
0ebab4c299 Bug 1357583: Tidy the PostRestyleEventForCSSRuleChanges API. r=heycam
MozReview-Commit-ID: BtOWWC5knsi
2017-05-29 23:01:50 +02:00
Hiroyuki Ikezoe
ac168a7d07 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
2017-05-21 08:16:26 +09:00
Boris Chiou
18ca899edb 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
2017-05-19 16:16:41 +08:00
Emilio Cobos Álvarez
c4f847ffaa Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM
2017-05-07 16:36:47 +02:00
Emilio Cobos Álvarez
cabca766ba Bug 1362991: Compute at most one text style context per element. r=heycam
MozReview-Commit-ID: IDTRk47CsRS
2017-05-08 14:49:57 +02:00
Emilio Cobos Álvarez
c1d10eadbb Bug 1351339: Compute text style changes when the parent is a display: contents element. r=heycam
MozReview-Commit-ID: GWPNevfP4xc
2017-05-08 03:16:43 +02:00
Boris Chiou
fcc513f6a3 Bug 1355758 - Update RestyleManager::mAnimationGeneration for non-animation update. r=heycam
We use RestyleManager::mAnimationGeneration as the animation index of a
new created transition, and Element.getAnimations() uses this index to
sort the order of transitions. We increase mAnimationGeneration one per
restyle cycle if there is any non-animation update.

MozReview-Commit-ID: KmirBzI7CXi
2017-04-21 16:44:17 +08:00
Bobby Holley
aacbfde69f Bug 1350115 - Squelch post-traversal generated by additional animation traversals when we're styling a fresh subtree. r=heycam,r=birtles
This patch exists to avoid a crash in layout/style/test/test_animations.html. We end up
generating some ::before content, which causes us to style the new subtree at [1]. In
StyleNewSubtree, we fail the !postTraversalRequired assertion because
PrepareAndTraverseSubtree decided to traverse the tree twice (once to style it, and again
to restyle it for animations), and return that a post-traversal is needed.

The reason this issue happens with my NAC patches and not without is that we were previously
filtering out generated ::before content from the servo traversal, so the servo traversal
wouldn't have reached it and (presumably) the animation restyle wouldn't have happened and
we wouldn't have returned true for needing a post-traversal.

[1] http://searchfox.org/mozilla-central/rev/c48398abd9f0f074c69f2223260939e30e8f99a8/layout/base/nsCSSFrameConstructor.cpp#1918

MozReview-Commit-ID: 8tgzLjV8B3A
2017-03-24 09:40:30 -07:00
Emilio Cobos Álvarez
78d21942de Bug 1296516: Tidy RestyleManager::ContentStateChanged. r=heycam
MozReview-Commit-ID: 7iWc6JvljhT
2017-03-20 22:28:13 +01:00
Hiroyuki Ikezoe
d9c3518720 Bug 1341985 - Trigger the second traversal for updating CSS animations. r=birtles,heycam
The restyle request during restyling is a result of creating/updating/removing
CSS animations that will come from a SequentialTask which will be implemented
in a subsequent patch.

MozReview-Commit-ID: JoAqvcN3y51
2017-03-10 11:53:19 +09:00
Bobby Holley
6ff512b18f Bug 1338921 - Handle lazy frame construction in the regular post-servo pass. r=emilio
MozReview-Commit-ID: FSXKAiyZDzt
2017-03-03 14:55:22 -08:00
Bobby Holley
6d5ba43988 Bug 1343128 - Don't leave stale change hints and other restyle data hanging around in reconstructed subtrees. r=emilio
MozReview-Commit-ID: 4BIvC6lPUmF
2017-02-28 18:02:11 -08:00
Cameron McCormack
4947a2ed5a Bug 1297899 - Part 5: Move refcounting from concrete restyle manager classes up to RestyleManager. r=bholley
MozReview-Commit-ID: 2KNfNCQzIIE
2017-02-13 11:21:33 +08:00
Cameron McCormack
34c943ee6e Bug 1297899 - Part 3: Rename RestyleManager to GeckoRestyleManager and RestyleManagerBase to RestyleManager. r=bholley
MozReview-Commit-ID: fFTZKwmGJm
2017-02-13 11:21:32 +08:00
Cameron McCormack
3769d1a59e Bug 1297899 - Part 2: Rename RestyleManagerBase.{h,cpp} to RestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: JVsfYommCoI
2017-02-13 11:21:31 +08:00
Cameron McCormack
8e21d528cb 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
Cameron McCormack
a0875e2a06 Bug 1321284 - Part 5: Process document level NAC when restyling. r=bholley
MozReview-Commit-ID: GigSrTHXXte
2016-12-01 16:19:50 +08:00
Bobby Holley
3775205e64 Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal. r=emilio
MozReview-Commit-ID: 7wH5XcILVmX
2016-11-25 10:06:39 -08:00
Cameron McCormack
15e6c53c13 Bug 1318238 - Clear all ServoNodeData during style set shutdown. r=bholley
MozReview-Commit-ID: 9MvBTAWeawC
2016-11-18 16:54:10 +08:00
Xidorn Quan
3f14ab1f0c Bug 1294299 part 13 - Post restyle event with style attribute hint for style change. r=heycam
MozReview-Commit-ID: 8quLmF0xaxv
2016-11-03 14:41:02 +11:00
Xidorn Quan
f2930fb5a2 Bug 1309868 part 2 - Use const nsIContent pointer in some layout utils. r=heycam
MozReview-Commit-ID: 5GMave4FS48
2016-10-18 15:29:03 +11:00
Bobby Holley
7cba59f144 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
d78f7933b3 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
Bobby Holley
637b18d6e6 Bug 1292279 - Consult the dirty bits to determine whether we have pending restyles. r=heycam
The current mechanism assumes that everything can be expressed in terms of restyle
hints, which has several limitations (in particular, we can't specify that a
subtree is dirty without also claiming that the root is dirty, since eRestyleSubtree
implies eRestyleSelf).

We may eventually decide that restyles hints give us everything we need, but while
we're experimenting I'd like the flexibility to do things both ways.
2016-08-25 21:34:29 -07:00
Emilio Cobos Álvarez
b233d1f26a Bug 1292618: Support basic pseudo-element restyling. r=heycam
:before and :after only, for now.

MozReview-Commit-ID: 9hLFvVhqIrN
2016-08-19 20:24:27 -07:00