Commit Graph

205 Commits

Author SHA1 Message Date
Manish Goregaokar
d909c5cea0 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
f33beecc59 Bug 1367904 - Part 10: stylo: Switch Gecko over to ServoStyleContext; r=bholley
MozReview-Commit-ID: EmopKVjEzlz
2017-07-17 21:00:46 -07:00
Manish Goregaokar
c2b070c584 Bug 1367904 - Part 5: stylo: Make GetBaseComputedValuesForElement return a style context; r=bholley
MozReview-Commit-ID: K5WpWc26xNZ
2017-07-17 21:00:32 -07:00
Jonathan Chan
9a920e6268 Bug 1375153 - Move nsStyleContext::mComputingStruct and AutoCheckDependency to GeckoStyleContext. r=manishearth
These are only used in Gecko mode.

MozReview-Commit-ID: DKQBwatbu62

--HG--
extra : rebase_source : 32fb108832e973bef04ef9c18d8ccc22059b58e4
2017-06-21 11:46:11 -07:00
Bobby Holley
834849b377 Bug 1376655 - Move EnsureSameStructsCached to GeckoStyleContext. r=emilio 2017-06-28 10:08:37 -07:00
Bobby Holley
5681b4713c Bug 1376655 - Use ServoStyleContext in more places. r=emilio 2017-06-28 10:08:36 -07:00
Manish Goregaokar
3125497283 Bug 1373018 - Part 11: stylo: Move cached style structs to GeckoStyleContext; r=bholley
MozReview-Commit-ID: 1LA8AJ3oNwF

--HG--
extra : rebase_source : e318c7c92973eb6daf9b9fb9b1dcd776e6788a95
2017-06-10 22:27:45 -07:00
Manish Goregaokar
3188b9bfd6 Bug 1373018 - Part 10: stylo: Remove StyleSource; r=bholley
MozReview-Commit-ID: 4IcROeDNoBA

--HG--
extra : rebase_source : e2f65c316be2c5640150eb5ff5628505ce446535
2017-06-10 22:27:45 -07:00
Manish Goregaokar
abdbfa30c6 Bug 1373018 - Part 9: stylo: Make more things on nsStyleContext inlined; r=bholley
MozReview-Commit-ID: FYiOtmSK2oC

--HG--
extra : rebase_source : a543fc05b6a5b5bd3c143d87730c66a1f8743f16
2017-06-10 22:27:45 -07:00
Manish Goregaokar
02ab46c24d Bug 1373018 - Part 8: stylo: Move nsStyleContext::SetStyle to GeckoStyleContext; r=bholley
MozReview-Commit-ID: ycXu95whnG

--HG--
extra : rebase_source : 852051aa074cc8ed8f11f0d68c26fe4f0a6962b6
2017-06-10 22:27:45 -07:00
Manish Goregaokar
828745da04 Bug 1373018 - Part 7: stylo: Move nsStyleContext::mSource into subclasses; r=bholley
MozReview-Commit-ID: AspYUJ7lGqD

--HG--
extra : rebase_source : 1f8d368312bd8149f32efc31130f4bf6659064ed
2017-06-10 22:27:45 -07:00
Manish Goregaokar
092c404741 Bug 1373018 - Part 6: stylo: Move most Gecko-specific methods into GeckoStyleContext; r=bholley
MozReview-Commit-ID: KzMAbuY8nll

--HG--
extra : rebase_source : 7d96f19a4bfcc2e97b7df513df881fa88f27cd85
2017-06-10 22:27:45 -07:00
Manish Goregaokar
70773cfc42 Bug 1373018 - Part 5: stylo: Move child/sibling pointers to GeckoStyleContext; r=bholley
MozReview-Commit-ID: Gay6RwpkNcu

--HG--
extra : rebase_source : 57a7f22b3d830e2fdc47faa15ceafbe5020a5964
2017-06-10 22:27:45 -07:00
Manish Goregaokar
2991af8d79 Bug 1373018 - Part 4: stylo: Rename eArenaObjectID_nsStyleContext to eArenaObjectID_GeckoStyleContext; r=bholley
MozReview-Commit-ID: 5oZwxG8r9Ty

--HG--
extra : rebase_source : 32fdfe60a20b2d90f531df1999b3aee0e4c8a5c2
2017-06-10 22:27:45 -07:00
Manish Goregaokar
719eec238a Bug 1373018 - Part 3: stylo: Move mPresContext to ServoStyleContext; r=bholley
MozReview-Commit-ID: 2BmRpIjxEO8

--HG--
extra : rebase_source : 51b9d1cd0963d0d243a6e575eff3a7407ee27485
2017-06-10 22:27:45 -07:00
Manish Goregaokar
7fceedfbae Bug 1373018 - Part 2: stylo: Add stylo conversion methods for nsStyleContext; stop using arena; r=bholley
MozReview-Commit-ID: CeIDP7idlmC

--HG--
extra : rebase_source : 8e7ec95fd068e562d947fbc39e84cd8e60daa910
2017-06-10 22:27:45 -07:00
Manish Goregaokar
01dc13b311 Bug 1373018 - Part 1: stylo: Introduce ServoStyleContext and GeckoStyleContext subclasses; r=bholley
MozReview-Commit-ID: GY1GfkWMK0n

--HG--
extra : rebase_source : a631b068cf0d54f5105e3dfe411365157490cac5
2017-06-10 22:27:45 -07:00
J. Ryan Stinnett
3041171150 Bug 1328509 - Wire up visited values in ServoStyleSet::GetContext. r=emilio
Create an extra style context using the visited values (if they exist).  This
mirrors the logic Gecko performs in nsStyleSet::GetContext for visited support.

MozReview-Commit-ID: EiJQXDgz8tX
2017-05-25 10:13:23 -05:00
Phil Ringnalda
30a91cb819 Backed out 6 changesets (bug 1328509) for Windows 7 failures in test_visited_reftests.html
Backed out changeset 8388d8c76fed (bug 1328509)
Backed out changeset 182a88607e08 (bug 1328509)
Backed out changeset 008efac7764b (bug 1328509)
Backed out changeset c2ce10b8bc37 (bug 1328509)
Backed out changeset 65bbc73c87aa (bug 1328509)
Backed out changeset e20d3d5170c2 (bug 1328509)

MozReview-Commit-ID: BSmqdFP1Zom
2017-05-24 22:12:53 -07:00
J. Ryan Stinnett
56b5ec82a0 Bug 1328509 - Wire up visited values in ServoStyleSet::GetContext. r=emilio
Create an extra style context using the visited values (if they exist).  This
mirrors the logic Gecko performs in nsStyleSet::GetContext for visited support.

MozReview-Commit-ID: EiJQXDgz8tX
2017-05-24 21:20:06 -05:00
Jonathan Kew
fcf175b16a Bug 1365928 - patch 2 - Annotate style-struct getters with MOZ_NONNULL_RETURN for better optimization. r=mats 2017-05-22 19:00:19 +01:00
Cameron McCormack
a34d0bbc9d Bug 1344914 - stylo: Stop pretending to handle style fixups on the C++ side. r=bz
MozReview-Commit-ID: FBM2NOlXIe5

--HG--
extra : rebase_source : b197089498e261a3abc7a50f4f06df92d7478d97
2017-04-25 12:52:51 +08:00
Emilio Cobos Álvarez
90236f99ab Bug 1360508: Allow fixups on text styles to be reflected. rpending=heycam a=orange
MozReview-Commit-ID: Eh6shYiv4RC
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-28 20:19:03 +02:00
Ting-Yu Lin
b71ec494d5 Bug 1322570 Part 1 - Add MOZ_ASSERT in nsStyleContext::GetParent() to disallow usage by stylo. r=bz
Also, add GetParentAllowServo() to whitelist the usage in servo-backed style
system in subsequent parts so that we could revisit them later.

MozReview-Commit-ID: JthU18Ftx02

--HG--
extra : rebase_source : b8840adcc4959f96cd429db65584f3e83c09c597
2017-03-20 14:11:06 +08:00
Carsten "Tomcat" Book
97f79397b6 Merge mozilla-central to mozilla-inbound 2017-03-21 12:07:49 +01:00
Cameron McCormack
cf56de72b5 Bug 1302054 - Part 2: Remove no longer useful nsStyleContext::CalcDifference optimization that handles the same-rule-node case. r=dbaron
nsStyleContext::CalcDifference had an optimization where, when we knew
that the old and new style context have the same rule node, we knew that
the only change hints that would need to be handled are those in the
"not handled for descendants" category, generated due to explicit
'inherit' values on reset properties.  This was because any changes due
to differences in inherited properties should only have generated
"handled for descendants" change hints (and thus would already have been
handled on an ancestor).

Before bug 931668, this let us avoid calling CalcDifference on structs
that only would have generated hints that we knew we already would have
handled.  However, after bug 931668, we compare all structs anyway so
that we can set the aEqualStructs outparam, so we don't gain anything
from this optimization.  We can still return these change hints we know
will not need to be handled, and rely on ElementRestyler::CaptureChange
to filter them out.

MozReview-Commit-ID: Ld1s2Js0i6r
2017-03-21 16:33:05 +08:00
Cameron McCormack
5131fe23a2 Bug 1302054 - Part 1: Avoid computing style differences when we just want to ensure structs are cached on the new context. r=dbaron
MozReview-Commit-ID: DLhHcCD4GQS
2017-03-21 16:33:05 +08:00
Bobby Holley
7b43e374c0 Bug 1348602 - Assert main thread when setting style bits. r=emilio
We also assert against the Servo traversal because we don't currently test the
parallel traversal on CI (though we will soon).

MozReview-Commit-ID: 9GRNizE44Oi
2017-03-20 15:31:14 -07:00
Boris Zbarsky
b537f110e2 Bug 1345362 part 3. Introduce CSSPseudoElementType::NonInheritingAnonBox to represent non-inheriting anon boxes. r=heycam
The idea is to be able to call the right function during style resolution time
without doing a linear walk via nsCSSAnonBoxes::IsNonInheritingAnonBox.

MozReview-Commit-ID: JKt33GggTjz

--HG--
extra : rebase_source : fcf477dcef8529c803bf97b1d3a16f8f4fcea39f
2017-03-08 23:41:04 -05:00
Emilio Cobos Álvarez
7b7a364f71 Bug 1322317: Fix CalcStyleDifference assumptions and PeekStyleContext semantics. r=heycam
For the reasoning for this change, please see the related bugs and:

http://logs.glob.uno/?c=mozilla%23layout&s=22+Feb+2017&e=22+Feb+2017#c27236

Mainly, before this change, there was nothing forcing style structs computed in
a style context to remain computed for the new style context after a call to
CalcStyleDifference. This can make us skip change hints when a style change
doesn't force to recompute one of these structs.

MozReview-Commit-ID: FoWbLjt97Uu
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 27772fc67b3c241ca4cef580112c949ad506b167
2017-02-21 16:56:43 +01:00
Iris Hsiao
eb16544eaf Backed out changeset 3cf38f4d7395 (bug 1322317) for stylo test failure 2017-02-22 17:31:04 +08:00
Emilio Cobos Álvarez
0ca5ea4955 Bug 1322317: Don't call FinishStyle off-main-thread for reset structs. r=heycam
MozReview-Commit-ID: FoWbLjt97Uu

--HG--
extra : rebase_source : 00f5565a9c3bd09b7d2ed7c6aadd2d58ec0e1ec4
2017-02-21 16:56:43 +01:00
Bobby Holley
d05a45802c Bug 1340339 - Generalize the mechanism for accessing servo style structs without side effects and use it in CalcStyleDifferenceInternal. r=heycam
MozReview-Commit-ID: 54cL2ePc0OF
2017-02-16 21:57:48 -08:00
Emilio Cobos Álvarez
51e9294d5f Bug 1335987: stylo: Don't use the change hint to decide whether to recreate style contexts. r=bholley
MozReview-Commit-ID: 11Yyq8UE3LP
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-03 22:03:34 +01:00
Emilio Cobos Álvarez
7a40386fed Bug 1330874: Preserve neutral style changes for stylo. r=heycam
Since we use the presence of a change hint to determine whether we should
recreate a style context, we can't just strip them out on CalcStyleDifference.

MozReview-Commit-ID: GLhbTc2W3d7
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-15 16:10:01 +01:00
Xidorn Quan
97d13f46a3 Bug 1303241 part 2 - Make GetVisitedDependentColor use style structs directly. r=dbaron
I think there are three advantages of this change:
1. removes some dependencies from layout / painting code to pre-computed
   value stuff in the style system;
2. makes it easier to audit usage of specific fields in style structs
   (which is probably a side effect of the first one);
3. potentially improves performance since it doesn't go through the
   unnecessary general logic in ExtractComputedValue.

Also, combined with the part before, we get a unified list for visited-
dependent properties so that we can ensure the assertion here and the
style difference calc code are consistent.

MozReview-Commit-ID: 5B9aN7CfRgI

--HG--
extra : rebase_source : ac80eaea2474b9ec4b47b1cc9a5bdd2e61f6ec4d
2016-12-31 00:57:37 +11:00
Bobby Holley
f8c9d884fc Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal. r=emilio
MozReview-Commit-ID: 7wH5XcILVmX
2016-11-25 10:06:39 -08:00
Cameron McCormack
642cdb8e14 Bug 1288302 - Part 4: Perform final main thread work on style structs sourced from ServoComputedValues. r=xidorn
MozReview-Commit-ID: D6nQQ3yI4sx
2016-11-02 16:58:32 +08:00
Cameron McCormack
13f86cd932 Merge backout. 2016-11-01 08:43:23 +08:00
Cameron McCormack
02f1de5bbd Back out a0488e9c0024..5ebcedea1fa5 (bug 1288302 and bug 1310463) for Talos RSS regressions.
MozReview-Commit-ID: JB5uwDeO0We
2016-11-01 08:42:49 +08:00
Cameron McCormack
2cd316fd59 Bug 1288302 - Part 4: Perform final main thread work on style structs sourced from ServoComputedValues. r=xidorn
MozReview-Commit-ID: D6nQQ3yI4sx
2016-10-20 08:36:23 +08:00
Xidorn Quan
fe470c1653 Bug 1309868 part 3 - Make NonOwningStyleContextSource store const ServoComputedValues. r=heycam
MozReview-Commit-ID: G84fYXLbQyt

--HG--
extra : source : 85ba0fdfc05ec11dd08eba5a1b1f6a9d7e8acd8f
2016-10-18 15:29:03 +11:00
Xidorn Quan
a7771e9c76 Bug 1311598 part 2 - Declare Servo_GetStyle* functions in nsStyleContext.h. r=heycam
MozReview-Commit-ID: 5i3rX4ateH3

--HG--
extra : rebase_source : f541b11b9eeb5b76be99277300faf3cbfc777eca
extra : source : c600b8ff90d4d9f6e5a4aefcc4230842da22615e
2016-10-24 20:16:46 +11:00
Xidorn Quan
2f279e5ef8 Bug 1306214 part 3 - Remove -moz-use-text-color from Gecko. r=heycam
MozReview-Commit-ID: EEYCB5jUH9L

--HG--
extra : rebase_source : ce6fcfdd573e1986a07fdae84106274bd2ae2495
2016-09-29 17:47:22 +10:00
Jeremy Chen
05b7065953 Bug 1305004 - fix ReResolveStyleContext related comments. r=heycam
Fix comment only, NPOTB, DONTBUILD.

MozReview-Commit-ID: APxOg5yVw7A

--HG--
extra : rebase_source : a48180811fedda97eaf374a7777374f8c3616ce3
2016-09-23 18:08:01 +08:00
Xidorn Quan
6b6e2ad7b2 Bug 1299741 part 11 - Change text-{emphasis,fill,stroke}-color to using StyleComplexColor. r=dbaron
MozReview-Commit-ID: 1MlgGAkdPn8

--HG--
extra : rebase_source : 293aa61adaa091bb3d4350a4b86ec9cfbb40eb02
2016-09-16 14:40:45 +10:00
Nicholas Nethercote
34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Emilio Cobos Álvarez
1c69b29535 Bug 1296556: Don't store change hints for non-elements. r=heycam
MozReview-Commit-ID: 1pIajBpt4CT

--HG--
extra : rebase_source : c91a1ddac66f4e64909220d4425c49e5605ac7a4
2016-08-20 00:20:36 -07:00
Emilio Cobos Álvarez
83a2bc2ac0 Bug 1296556: Reach the parent to compute inherited style structs. r=heycam
It's a shame that assertion can be made a crashing one, but unfortunately it was
hitting me regularly.

MozReview-Commit-ID: 4iZf1rm1fO2

--HG--
extra : rebase_source : 0b9ef55e3036eeefe4b989c284b1aff3e99a906d
2016-08-19 14:32:51 -07:00
Bobby Holley
6ba364070d Bug 1297572 - Prevent HasPseudoElementData from erroneously tracking anonymous boxes. r=heycam
The layout inspector ends up traversing into the root scroll frame in the next patch. If we don't
fix this, we erroneously enter this code here:

http://searchfox.org/mozilla-central/rev/44f6964ba95b8ddd8ebf70c55b34cd2323afeef4/layout/style/nsComputedDOMStyle.cpp#682

in this test:

devtools/client/inspector/markup/test/browser_markup_anonymous_04.js
2016-08-25 21:34:21 -07:00