Commit Graph

207 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
f09ce66dde Bug 1386602: Avoid recreating the stylist in RebuildAllStyleData. r=heycam
MozReview-Commit-ID: 31G9BLgqEmm
2017-08-03 18:10:06 +02:00
Boris Chiou
ca91226cac Bug 1383998 - Increase animation generation if attributes are changed. r=heycam
We have to set mHaveNonAnimationRestyles if we have attributes changed
(note: we increase the animation generation only if mHaveNonAnimationRestyles
is set). Attributes changed may create a new transition, and we use the
animation generation as the order of the transition, so
Element::GetAnimations() can return transitions with correct order.

Besides, I think ContentStateChanged() will not trigger a new
transition, so we don't need to make mHaveNonAnimationRestyles there.

MozReview-Commit-ID: J5XgW8nqeLH
2017-08-02 11:43:41 +08:00
Boris Zbarsky
65cda04e48 Bug 1324619 part 6. Handle dynamic restyles of ::first-line in stylo. r=emilio
MozReview-Commit-ID: 3jQhIqPuL1g
2017-07-28 21:20:47 -04:00
Boris Zbarsky
061a63c8da Bug 1324619 part 5. Implement FrameForPseudoElement for ::first-line. r=emilio
MozReview-Commit-ID: JXcV58peI7T
2017-07-28 21:20:46 -04: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
Hiroyuki Ikezoe
3408342ad5 Bug 1383589 - Process post traversal whenever StyleDocument() or StyleDocumentForThrottledAnimationFlush() returns true. r=emilio
The test case in this patch freezes without this fix.

MozReview-Commit-ID: 6Rb9XmtAmpM
2017-07-25 11:49:04 +09:00
Emilio Cobos Álvarez
7624a03ad1 Bug 1383307: Remove ServoStyleContext::UpdateWithElementState. r=manishearth
And kill one GetParentAllowServo call while at it, and some other dumbness...

MozReview-Commit-ID: GmvzXwGorlX
2017-07-23 23:56:39 +02:00
Manish Goregaokar
82f2e05017 Bug 1382017 part 4 Gecko piece - Rename ServoComputedValues -> ServoComputedData; r=heycam
ServoComputedValues is confusing because ComputedValues is actually
ServoStyleContext on the C++ side.

MozReview-Commit-ID: IQNVdfREAMt
2017-07-20 21:44:02 -07:00
Manish Goregaokar
80fec50c0b Bug 1382017 part 4 Gecko piece - Remove usage of ServoComputedValues from most Gecko code; r=xidorn
MozReview-Commit-ID: 2NB4DgxMrL3
2017-07-20 17:27:05 -07:00
Emilio Cobos Álvarez
8a11661a50 Bug 1366721: Restyle additional style contexts in ServoRestyleManager. r=heycam
I was about to assert that other non-primary frames don't have additional style
contexts everywhere, but that wouldn't make much sense, given they don't
correspond to an element we could selector-match against.

MozReview-Commit-ID: EtAQbSg6nP6
2017-07-20 18:29:14 +02:00
Cameron McCormack
0ffc6fa773 Bug 1380133 - Part 3: Remove nsPresContext argument to ServoStyleContext::ResolveSameStructsAs. r=emilio
We have it in mPresContext already.

MozReview-Commit-ID: G1kKHGFOXTp
---
 layout/base/ServoRestyleManager.cpp     | 2 +-
 layout/generic/ViewportFrame.cpp        | 2 +-
 layout/style/ServoStyleContext.h        | 3 +--
 layout/style/ServoStyleContextInlines.h | 6 +++---
 4 files changed, 6 insertions(+), 7 deletions(-)
2017-07-21 11:42:43 +08:00
Sebastian Hengst
67a7bd0209 Backed out changeset 22dabf04e560 (bug 1380133) 2017-07-20 15:40:12 +02:00
Cameron McCormack
d04c4da574 Bug 1380133 - Part 3: Remove nsPresContext argument to ServoStyleContext::ResolveSameStructsAs. r=emilio
We have it in mPresContext already.

MozReview-Commit-ID: G1kKHGFOXTp
2017-07-19 14:39:40 +08:00
Hiroyuki Ikezoe
3d68f92114 Bug 1381431 - Allow that restyle hints other than animation hints remain for flushing throttle animations. r=emilio
MozReview-Commit-ID: GMkgvaK0mAu
2017-07-18 20:56:15 +09:00
Manish Goregaokar
df853f68c9 Bug 1367904 - Part 17: stylo: Clean up GetContext, call it UpdateWithElementState; r=bholley
MozReview-Commit-ID: I23w5hFatk8
2017-07-17 21:01:33 -07:00
Manish Goregaokar
f7ddf7a1b6 Bug 1367904 - Part 16: stylo: Stop using mStyleIfVisited in Servo; r=bholley
MozReview-Commit-ID: JxoMr6fz7lh
2017-07-17 21:01:23 -07:00
Manish Goregaokar
0dcf16fa0c Bug 1367904 - Part 14: stylo: Remove FFI calls for fetching style structs from ServoComputedValues; r=bholley
MozReview-Commit-ID: 2HrVZl9HZu1
2017-07-17 21:01:10 -07:00
Manish Goregaokar
9d1915a8b8 Bug 1367904 - Part 13: stylo: Flatten ServoComputedValues into ServoStyleContext; r=bholley
This patch also removes the duplication of style contexts during the
restyle, because otherwise pointer equality of ServoComputedValues stops
holding (and we assert on that in a few places)

MozReview-Commit-ID: 7Evc1p8ZfM2
2017-07-17 21:01:02 -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
Manish Goregaokar
86e90da5c3 Bug 1367904 - Part 10: stylo: Switch Gecko over to ServoStyleContext; r=bholley
MozReview-Commit-ID: EmopKVjEzlz
2017-07-17 21:00:46 -07:00
Emilio Cobos Álvarez
7b53dc20a6 Bug 1381323: Account for text frames in ExpectedOwnerForFrame. r=heycam
MozReview-Commit-ID: 62MXX5kf3jj
2017-07-16 15:42:22 +02:00
Hiroyuki Ikezoe
d895e1db59 Bug 1371450 - Recreate style context only if the element was restyled during the traversal. r=emilio
MozReview-Commit-ID: CBYTB5FeikP
2017-07-15 13:16:11 +09:00
Hiroyuki Ikezoe
28e61116a0 Bug 1371450 - Preserve restyle hints after ForThrottledAnimationFlush restyle. r=emilio
Those remaining restyle hints are needed for normal traversal later.

MozReview-Commit-ID: DswGYGQwgfw
2017-07-15 13:09:35 +09: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
Hiroyuki Ikezoe
b9836375ec Bug 1371450 - Rename TraversalRestyleBehavior::ForAnimationOnly to TraversalRestyleBehavior::ForThrottledAnimationFlush. r=birtles,emilio
ForAnimationOnly is somewhat misleading, it means actually we process
*only* animation-only restyle without normal restyle. The purpose of
ForAnimationOnly is for updating throttled animations to get correct position
of the animations when we need to handle events. Currently we do also update
unthrottled animations though.

MozReview-Commit-ID: HBCCluKrZs9
2017-07-15 13:08:47 +09:00
Wei-Cheng Pan
4c06965307 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
2017-05-23 14:13:47 +08: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
J. Ryan Stinnett
492af0b172 Bug 1371457 - Add restyle markers for Stylo. r=bholley,gregtatum
Add restyle markers to `PrepareAndTraverseSubtree` to cover both initial styling
and part of the work of restyling.  Also add restyle markers around the post
traversal work in `DoProcessPendingRestyles`.

A new marker is also added around the change hint processing after the post
traversal.

MozReview-Commit-ID: 43PSyCJLikR
2017-06-28 12:03:18 -07:00
Emilio Cobos Álvarez
2bbfd6efff Bug 1378190: Try to make ServoRestyleManager easier to follow. r=heycam
MozReview-Commit-ID: B9bw23n2jUe
2017-07-04 19:16:04 +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
Boris Zbarsky
6cfed605fc Bug 1376640. Fix dynamic updates when an inline that sits between a first-letter and its block changes style. r=heycam
MozReview-Commit-ID: 8osMUpYVRvR
2017-06-28 22:19:35 -07:00
Carsten "Tomcat" Book
1370c74581 Backed out changeset 2992d5af6251 (bug 1376640) for assertion failures like Assertion failure: mOwner == ExpectedOwnerForChild(aFrame) (Missed some frame in the hierarchy?) 2017-06-29 08:22:08 +02:00
Boris Zbarsky
2bc0e8180b Bug 1376640. Fix dynamic updates when an inline that sits between a first-letter and its block changes style. r=heycam
MozReview-Commit-ID: 8osMUpYVRvR
2017-06-28 22:19:35 -07:00
Emilio Cobos Álvarez
03a3dd1fea Bug 1375969: Fix MightHave{State,Attribute}Dependency for XBL. r=heycam
MozReview-Commit-ID: 8I29pMHq4uf
2017-06-28 18:45:34 -07:00
Bobby Holley
53a0874e63 Bug 1376655 - Don't call EnsureSameStructsCached in ServoRestyleManager. r=emilio 2017-06-28 10:08:37 -07:00
Bobby Holley
0bb4f2f9ec Bug 1376655 - Use ServoStyleContext in more places. r=emilio 2017-06-28 10:08:36 -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
d4f8f4534c Bug 1375674: Don't use the owner's changes handled for the backdrop frame. r=heycam
MozReview-Commit-ID: GpIQwqge8L
2017-06-23 19:26:20 +02:00
Boris Zbarsky
41540c4fa2 Bug 1324618 part 9. Implement FrameForPseudoElement for ::first-letter. r=emilio
This also makes us stop reframing on lack of frame for pseudo-elements for which
such a lack is expected in various situations and means the pseudo-element's
styles do not matter.

MozReview-Commit-ID: K1qzeow2Z6H
2017-06-26 23:35:09 -07:00
Boris Zbarsky
37997250b7 Bug 1324618 part 7. Set our new style context on all our continuations in ServoRestyleManager. r=emilio
MozReview-Commit-ID: 4gVXPDCPZnq
2017-06-26 23:35:08 -07:00
Boris Zbarsky
ba3577a6cb Bug 1324618 part 6. Change when we update frame pseudo styles to happen after we've dealt with styles for the frame's kids. r=emilio
::first-letter and ::first-line both want to change the styles of kids, and we
don't want the normal post-traversal for kids to clobber those changes.

MozReview-Commit-ID: 1tIsXz1n0uZ
2017-06-26 23:35:08 -07:00
Carsten "Tomcat" Book
9fcc7089b0 Backed out changeset d2ac7a671d41 (bug 1324618) 2017-06-27 10:39:43 +02:00
Carsten "Tomcat" Book
1268db481a Backed out changeset 01deb185c67a (bug 1324618) 2017-06-27 10:39:41 +02:00
Carsten "Tomcat" Book
5b501e61cc Backed out changeset 18cd81f24778 (bug 1324618) 2017-06-27 10:39:38 +02:00
Boris Zbarsky
d2856a83ea Bug 1324618 part 9. Implement FrameForPseudoElement for ::first-letter. r=emilio
This also makes us stop reframing on lack of frame for pseudo-elements for which
such a lack is expected in various situations and means the pseudo-element's
styles do not matter.

MozReview-Commit-ID: K1qzeow2Z6H
2017-06-26 23:35:09 -07:00
Boris Zbarsky
ad077db78a Bug 1324618 part 7. Set our new style context on all our continuations in ServoRestyleManager. r=emilio
MozReview-Commit-ID: 4gVXPDCPZnq
2017-06-26 23:35:08 -07:00
Boris Zbarsky
3fba3a09b9 Bug 1324618 part 6. Change when we update frame pseudo styles to happen after we've dealt with styles for the frame's kids. r=emilio
::first-letter and ::first-line both want to change the styles of kids, and we
don't want the normal post-traversal for kids to clobber those changes.

MozReview-Commit-ID: 1tIsXz1n0uZ
2017-06-26 23:35:08 -07:00
Boris Zbarsky
7d9cc57ca2 Bug 1375315. Make sure to update block pseudo-element styles on various anonymous blocks. r=emilio
MozReview-Commit-ID: HBabvfWYgdP
2017-06-22 11:24:11 -04:00