Commit Graph

204 Commits

Author SHA1 Message Date
Xidorn Quan
2df49dbac2 Bug 1343964 part 1 - Move URLExtraData into its own header. r=heycam
This patch does the following in addition to a simple move:
* change the type of the pointers from RefPtr to nsCOMPtr
* move it from mozilla::css namespace to mozilla

MozReview-Commit-ID: 72MYq6kWm4s

--HG--
extra : rebase_source : 400fe0d7cc422f22592c302cfd4e457830b77e3e
2017-04-04 10:04:13 +10:00
Hiroyuki Ikezoe
2614ef2eac Bug 1311257 - Use underlying value for missing keyframes. r=birtles,heycam
mBaseStyleValuesForServo is a nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>
In this patch, we use void* instead of exposing nsRefPtrHashtable in FFI
because we just use the hash table as an argument of a C++ function, it means
we don't touch the hash table in Rust at all.

MozReview-Commit-ID: 1wM6NeF2S0t

--HG--
extra : rebase_source : 17908ff84d061e189f21641bf660dc9720b964bc
2017-04-06 10:34:51 +09:00
Hiroyuki Ikezoe
8e14922b0a Bug 1311257 - Add FFI functions to get progress value and current position in a segment. r=birtles
Two functions added in this patch get progress value from ComputedTiming
or get the position in a given AnimationPropertySegment.
Without these FFIs, we need to expose Maybe<> and Nullable<> and handle
them in Rust.

MozReview-Commit-ID: IXYWlqEQyVR

--HG--
extra : rebase_source : 8cc4d03f718cc13abfcb9c9af700bae7082bbf31
2017-04-06 10:34:51 +09:00
Manish Goregaokar
b67b0cb1ef Bug 1341714 - Part 4: stylo: Add support for xml:lang; r=heycam
MozReview-Commit-ID: E0GpyPKES3k

--HG--
extra : rebase_source : 0395305db946b4b54427fa9a19f2c3796123e6f5
2017-03-26 13:53:34 -07:00
Manish Goregaokar
a2be776eb5 Bug 1341714 - Part 2: stylo: Add support for <table> color quirk ; r=heycam
MozReview-Commit-ID: 56IKARwfbhw

--HG--
extra : rebase_source : af58d14da2e1c329ce2ace2b9cacf79b9adf0319
2017-03-26 13:53:34 -07:00
Xidorn Quan
4f6e257d03 Bug 1352025 part 1 - Use a UrlExtraData type alias to unify url handling logic. r=manishearth
MozReview-Commit-ID: 6gZHGQWbpAW

--HG--
extra : rebase_source : 0780021a0e5ef14b380ec247418c1c709056e792
2017-03-31 12:03:45 +11:00
Xidorn Quan
e0f34c4221 Bug 1352763 part 2 - Pass borrowed child stylesheet to Gecko for loading rather than the import rule. r=emilio
This is necessary because if we pass in the import rule, we would need
to invoke Servo_ImportRule_GetSheet to get the child sheet. However,
Servo_ImportRule_GetSheet tries to lock the global rwlock with read
access, while Servo_CssRules_InsertRule has already locked the same
rwlock with write access for the CSSOM case.

Since the import rule itself is never needed in the code path, it is
easier to just pass in the child stylesheet.

MozReview-Commit-ID: 4njNyGniPIm

--HG--
extra : rebase_source : ad88929713fdc5a581addc044094fa8130125121
2017-04-03 16:18:49 +10:00
Xidorn Quan
e3e4554871 Bug 1351957 - Create URLExtraData for holding base uri, referrer, and principal. r=heycam
MozReview-Commit-ID: 1wqTb3kvvWh

--HG--
extra : rebase_source : cae3dba21c916ab0f52056bd9db215249b650cd3
2017-03-30 18:54:48 +11:00
Manish Goregaokar
d52216a79d Bug 1341648 - stylo: Include content rules from HTMLTableCellElement::WalkContentStyleRules ; r=bz
This also removes the TABLE_ATTRS_DIRTY optimization. Constructing nsMappedAttributes isn't really expensive and we do it all the time anyway.

MozReview-Commit-ID: 2krt1nFUzgl

--HG--
extra : rebase_source : 18d400aed6f427e5efc503b87b6ee2d9af74f3f5
2017-03-26 13:53:34 -07:00
Nazım Can Altınova
e31083ac08 Bug 1351262 - Serialize unquoted font-family without quote r=manishearth
MozReview-Commit-ID: LY554sZxZyb

--HG--
extra : rebase_source : acfaafcee91db6775e033beff6fd94487aefa0a6
2017-03-30 21:15:57 +03:00
Xidorn Quan
12e077cda8 Bug 1345696 part 4 - Add function for sugar of nsCSSValue. r=manishearth
MozReview-Commit-ID: 9go3QDIXLgH

--HG--
extra : rebase_source : e656489567d9ab04d9abb07f5bbaea5d46480fb4
2017-03-28 11:52:14 +11:00
Xidorn Quan
ee9e8c445d Bug 1345696 part 3 - Add FFI for nsCSSFontFaceRule. r=manishearth
MozReview-Commit-ID: GV1CWwFihw7

--HG--
extra : rebase_source : d1c56248f23a2b7513bff37b891ba67ce73da20e
2017-03-24 14:42:18 +11:00
Emilio Cobos Álvarez
d2c6c7feb7 Bug 1351275: Make the pres shell observe style flushes if needed when calling from Servo. r=bholley
MozReview-Commit-ID: 6G0ZtAXBLqX
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 096c1342be4c7c6c3b546937cd9e1eda342c12ae
2017-03-29 16:13:46 +02:00
Bobby Holley
be7a7ceab0 Bug 1350244 - Back out bug 1348606 part 5 (Use a threadsafe array for counters). r=me
This reverts commit 07301f1c3f71b36dbe2345e8faa9bc6d643cfc97.

MozReview-Commit-ID: 8tLjUhki2C1
2017-03-29 11:05:17 -07:00
Emilio Cobos Álvarez
138c319bc2 Bug 1350140: Avoid dumb copy-constructor. r=heycam
MozReview-Commit-ID: CoCbXXYTfH4

--HG--
extra : rebase_source : 080bda25b112094d1bf4c3915054c23aadcd35e5
2017-03-26 19:06:12 +02:00
Emilio Cobos Álvarez
3ed9e13ba8 Bug 1350140: stylo: Implement all the remaining state pseudo-classes. r=heycam
Also implements :link, :visited, and :any-link more efficiently, and stops
matching :-moz-read-only in everything that is not read-write, which is kind of
dumb, and probably creates some artifacts.

MozReview-Commit-ID: 6BQqi7nAWdT

--HG--
extra : rebase_source : 39dc6b481b3a92942dc3732990d8b9040d8e6d84
2017-03-24 00:45:07 +01:00
Hiroyuki Ikezoe
1262a6cd95 Bug 1350754 - Call UpdateEffectProperties for stylo. r=heycam
MozReview-Commit-ID: 9urkJ0lsxMM

--HG--
extra : rebase_source : d108f7e758dfcdd78dcfce54966980855b661cbb
2017-03-27 19:43:20 +09:00
Hiroyuki Ikezoe
d6922e73d9 Bug 1350754 - Introduce UpdateAnimationTasks to perform a bunch of animation's tasks in a SequentialTask. r=heycam
The UpdateAnimationsTasks is a bitflags and each bit is generated from
Gecko's UpdateAnimationsTasks (enum class) values for matching values
between C++ and Rust. For this reason, the bitflags is annotated as
(feature = "gecko"), as a result update_animations() which uses this bitflags
also became gecko-only function.

MozReview-Commit-ID: AfQd0FJGkYd

--HG--
extra : rebase_source : 2a5fee40c57a7941defa447357915756af42bc11
2017-03-27 19:43:16 +09:00
Hiroyuki Ikezoe
ee457cf7c3 Bug 1350754 - Convert pseudo nsIAtom to CSSPseudoElementType in Gecko_UpdateAnimations(). r=heycam
MozReview-Commit-ID: 38ZyRyxB73z

--HG--
extra : rebase_source : 01c971c2db8779f92d5845fa09047cb7eae43c7d
2017-03-27 19:43:13 +09:00
Hiroyuki Ikezoe
de29155c66 Bug 1350754 - Use ServoComputedValuesWithParent for nsAnimationManager::UpdateAnimations(). r=birtles
MozReview-Commit-ID: GkLoACgqVON

--HG--
extra : rebase_source : 1f47c5d5a73d4b343c677980af299e068ebebd84
2017-03-27 19:43:09 +09:00
Hiroyuki Ikezoe
ea9ccbbab2 Bug 1350754 - Add an FFI to check that a given (pseudo-) element has any type of animations or not. r=birtles,heycam
If an element has any type of animations in match_elements(), we need to call
UpdateEffectProperties() to update KeyframeEffectReadOnly::mProperties.

MozReview-Commit-ID: 1CDhwoM2llE

--HG--
extra : rebase_source : f2c476d579019079702b01fec375f75b4594dee9
2017-03-27 19:42:59 +09:00
Hiroyuki Ikezoe
3161326ebd Bug 1350754 - Assert in Gecko_ElementHasCSSAnimations if pseudo element is neither ::before nor ::after. r=heycam
Gecko_ElementHasCSSAnimations is not called against pseudo elements
other than ::before or ::after.

MozReview-Commit-ID: EtHoLhX5P9h

--HG--
extra : rebase_source : 534fe74280bc6cd7362ee7580a83d0a9af8e164f
2017-03-27 19:42:53 +09:00
Nazım Can Altınova
f0404cbd9f Bug 1341763 - stylo: Add support for -moz-image-rect value r=manishearth
MozReview-Commit-ID: CjjX6SI3sWX

--HG--
extra : rebase_source : be56e929d5ed9b0253ae5777ca60e6c73a403222
2017-03-25 21:48:47 +03:00
Manish Goregaokar
9116206487 Bug 1341775 - Part 1: stylo: Calculate font-size keywords based on base size; r=heycam
MozReview-Commit-ID: Ff6kt8RLChI

--HG--
extra : rebase_source : 1d52cc24a4756ec4ef649bbe814eec5919dc206d
2017-03-17 19:48:20 -07:00
Bobby Holley
fee01f78fb Bug 1348606 - Use a threadsafe array for counters. r=xidorn
MozReview-Commit-ID: KgTgcD5mGqr
2017-03-23 10:56:49 -07:00
Bobby Holley
701a45ad75 Bug 1347435 - Don't resolve URLs at parse time for Stylo. r=emilio
It's a bit unfortunate the use separate implementations of SpecifiedUrl for Servo
and Gecko, but they're different enough at this point that I don't think it really
makes sense to try to share everything. Splitting them out has some nice
simplifications as well.

I recognize that there's still some potential correctness issues for Servo using
the resolved URI in various places where the original URI may be the right thing,
but I've got too much on my plate to look into that for now.

MozReview-Commit-ID: BeDu93TQ4Ow
2017-03-22 20:17:51 -07:00
Matt Brubeck
11b50c02a4 Bug 1337068 - stylo: :empty, :-moz-first-node, :-moz-last-node, and :-moz-only-whitespace. r=emilio
MozReview-Commit-ID: 5wEk8OQAFSP

--HG--
extra : rebase_source : fb395492e2e6551d3a9203d2dc87fbbb6c699682
extra : intermediate-source : ddffbd2d62ea066d1151c7127365c597c54aad01
extra : source : 1d34ee0e479f0b1f9f2662e08f73a54a736152f2
2017-03-22 09:18:34 -07:00
Nazım Can Altınova
cc7bc8e08d Bug 1342139 - Implement gecko bindings for will-change r=xidorn
MozReview-Commit-ID: KNhVz9vjXUl

--HG--
extra : rebase_source : 20f5d2ec6c151e2d3024bcd11b5ca920158f5a93
2017-03-19 15:36:16 +03:00
Manish Goregaokar
16276b38cd Bug 1341086 - Part 3: stylo: Add thread-safe version of nsStyleUtil::IsSignificantChild(); r=emilio
MozReview-Commit-ID: 3l8cNwDHKFl

--HG--
extra : rebase_source : af2ed1c345991c894d482193a1fb654bd6a7ba69
2017-03-16 14:10:22 -07:00
Manish Goregaokar
681045b70e Bug 1341086 - Part 2: stylo: Support all non-ts pseudos with an argument; r=emilio,heycam
MozReview-Commit-ID: IHjX2Q3k8eD

--HG--
extra : rebase_source : 57df0f0e54fd1aa1ce4b304238c7070ef9af6dd4
2017-03-16 14:10:22 -07: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
Ting-Yu Lin
e27cc69d63 Bug 1338446 Part 5 - Label runnable in Gecko_DropElementSnapshot by using SystemGroup. r=heycam
This runnable is to delete object only, so using system group should be
fine.

MozReview-Commit-ID: 8uMxMO3yERG

--HG--
extra : rebase_source : 75ae4953d4c91fa0ab9a0c598a1989fa122f8f5a
2017-03-14 21:34:57 +08:00
Hiroyuki Ikezoe
cb4ce7109c Bug 1340958 - Drop AnimationRule and ServoAnimationRule. r=boris
MozReview-Commit-ID: ClnvyShHpsN

--HG--
extra : rebase_source : c554550264bfedafbf91ed2ed754603fb5c3e4c6
2017-03-17 13:24:42 +09:00
Hiroyuki Ikezoe
3b9f585232 Bug 1340958 - Put computed values into AnimationValueMap instead of hashtable in gecko. r=heycam
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust.  This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.

MozReview-Commit-ID: EJ2Kl65fVeF

--HG--
extra : rebase_source : e30a9d440dc9855e21b94501b07a3501d31bc345
2017-03-17 13:23:21 +09:00
Hiroyuki Ikezoe
a3c9c5051e Bug 1340958 - Do not call EffectCompositor::GetServoAnimationRule for print preview. r=heycam
The only one caller of GetServoAnimationRule is Gecko_GetAnimationRule.
There is no risk that pres context is destroyed in Gecko_GetAnimationRule.

MozReview-Commit-ID: 52pxbCiCNoJ

--HG--
extra : rebase_source : 8000e267d1d5706c709f807e11396dda3579c4dc
2017-03-17 12:48:34 +09:00
Hiroyuki Ikezoe
00ae32a7b2 Bug 1340958 - Do not call get_animation_rules for pseudo elements other than ::before and ::after. r=heycam
MozReview-Commit-ID: FlrT4hIst6U

--HG--
extra : rebase_source : 7cefba0f9353efd8128117f8596a01315937ef6c
2017-03-17 12:48:15 +09:00
Hiroyuki Ikezoe
a9a15a1807 Bug 1347806 - Fix pseudo nsIAtom for ::before and ::after. r=birtles
cssPseudoElementBeforeProperty and cssPseudoElementAfterProperty are for
CSSPseudoElement.

MozReview-Commit-ID: 3WETv4QeC5

--HG--
extra : rebase_source : b7e902786ca9ebe7c92a573604e15d868c6067a7
2017-03-16 14:01:44 +09:00
Manish Goregaokar
12b518aef0 Bug 1340696 - stylo: Support system colors; r=heycam
MozReview-Commit-ID: HUfTdcMRoEx

--HG--
extra : rebase_source : 85af717eb521a2c790d3ec7a20c46dd318e4761f
2017-03-15 14:49:35 -07:00
Manish Goregaokar
75a5e5853d Bug 1296477 - Part 3: stylo: Support counter-increment and counter-reset; r=heycam
MozReview-Commit-ID: DnSd8xAkidM

--HG--
extra : rebase_source : 34038cee5a99c3dac64abd9c2bed38ab49aa1461
2017-03-12 21:11:52 -07:00
Manish Goregaokar
8b8d456955 Bug 1296477 - Part 2: stylo: Implement remaining content values; r=heycam
MozReview-Commit-ID: 9fLM5bdR8hr

--HG--
extra : rebase_source : f1397129408e7e9763733c026855a99321b09656
2017-03-11 22:40:54 -08:00
Manish Goregaokar
471d940ebc Bug 1296477 - Part 1: stylo: Use ServoBundledURI everywhere else, fix from_ffi to handle the error case; r=heycam
MozReview-Commit-ID: DHNKLm3y5Gv

--HG--
extra : rebase_source : c5780ddc22169d9c908559c2eb94ca827d481e0b
2017-03-12 21:08:29 -07:00
Hiroyuki Ikezoe
2eb4e20a24 Bug 1341985 - Call UpdateAnimations even if the element has no computed values. r=birtles,heycam
MozReview-Commit-ID: 2dgAF7WOWxr

--HG--
extra : rebase_source : 8c2378d8d45484f206b4c890e89271fc95691ac3
2017-03-10 11:53:19 +09:00
Hiroyuki Ikezoe
5bfe316f81 Bug 1341985 - Skip update_animations if we have no running animations and the element becomes display:none. r=heycam
MozReview-Commit-ID: Ig81NKtXB85

--HG--
extra : rebase_source : 6d6d3f4794b83f5bc2b45bf2b6684f8c80064b32
2017-03-10 11:53:19 +09:00
Hiroyuki Ikezoe
96240dbfc8 Bug 1341985 - Update CSS animations in a SequentialTask. r=heycam
We create the SequentialTask only if:

* We have no old computed values and we have animation name style in the new
  computed values.
* Any animation properties is changed.
* display property is changed from 'none' and we have animation name style.
* display property is changed to 'none'.

In a subsequent patch we skip the SequentialTask if we have no running
animations and the display propery is changed to 'none'.

MozReview-Commit-ID: JRSZznufOS2

--HG--
extra : rebase_source : 566026c21c6357f77df55e3bd588835f5fd6c3d4
2017-03-10 11:53:19 +09:00
Hiroyuki Ikezoe
65b2567898 Bug 1341985 - Implement Gecko_StyleAnimationsEquals for checking nsStyleAutoArray<StyleAnimation> equality in servo side. r=heycam
Later we update CSS animations if this function returns false.

MozReview-Commit-ID: 27FsYQ40gSv

--HG--
extra : rebase_source : a043282de6c8a50ed53a92de98ecf93eb042f188
2017-03-10 11:53:17 +09:00
Manish Goregaokar
bae202bd4f Bug 1329093 - Part 3: Overload FromContent() to work with const; r=bz
MozReview-Commit-ID: BUFmPtcf6LM
2017-03-09 17:46:23 -08:00
Manish Goregaokar
07fc7c5b25 Bug 1329093 - Part 1: stylo: Handle SVG presentation attributes; r=bz
MozReview-Commit-ID: 9cymo3c9HIn
2017-03-09 17:46:21 -08:00
Hiroyuki Ikezoe
fe8cb62b44 Bug 1343751 - ensure_len() for nsStyleAutoArray<StyleTransition>. r=emilio
MozReview-Commit-ID: 2xCExdpldWQ

--HG--
extra : rebase_source : e327b4d2267899f30f361ccbfdc6fb63b04f66f4
2017-03-03 08:35:33 +09:00
Emilio Cobos Álvarez
b903e8dcf2 Bug 1341083: Don't fall back to reframing with display: contents. r=heycam
MozReview-Commit-ID: KD3QBiU7M5f
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-02-25 19:15:43 +01:00
Nazım Can Altınova
ded05dd047 Bug 1340728 - stylo: add constructors for @font-face descriptors r=manishearth,SimonSapin
MozReview-Commit-ID: BL3uxlE1TmU

--HG--
extra : rebase_source : b2289af62d02e0cc1d3f84bb21077cd35d36c56b
extra : source : 8622f2e9ec9597e56e406aaff1856275b6d62db5
2017-02-18 02:15:55 +03:00