Commit graph

59 commits

Author SHA1 Message Date
Hiroyuki Ikezoe
973d8287a9 Support vendor prefix keyframes rule.
If there are multiple prefixed/non-prefixed @keyframes with the same name;

* non-prefixed rule overrides earlier rules.
* prefixed rule overrides earlier prefixed rules.
2017-04-21 12:18:12 +09:00
J. Ryan Stinnett
6069e44f02 SVG length parsing mode
SVG allows non-zero lengths to be accepted and assumes they are in px.  This
adds this length parsing mode to Servo.

MozReview-Commit-ID: Kxd3x64r9Ye
2017-04-14 17:22:16 +08:00
J. Ryan Stinnett
1ae1d370f2 Check context to test keyframe rule_type
Now that the `context` contains the `rule_type`, we can remove the `in_keyframe`
arg and check the `rule_type` to achieve the same thing.

MozReview-Commit-ID: oXrFBPuKMz
2017-04-12 16:40:37 +08:00
J. Ryan Stinnett
4574cd8ea6 Pull rule_type into ParserContext
Absorb `rule_type` into the `ParserContext` so that it's easier to pass down to
deeper levels of the parser.

MozReview-Commit-ID: DjBNytLxGKX
2017-04-12 16:40:17 +08:00
J. Ryan Stinnett
981571f4f8 Ignore non-margin properties in @page rule
Extend Servo's @page parsing to match Gecko's CSS 2.2 behavior, where only
margin properties are allowed in an @page rule.  Other properties are ignored.

MozReview-Commit-ID: IPYUlnkLYSb
2017-04-09 17:49:41 +08:00
Xidorn Quan
37585309e9 Use a UrlExtraData type alias to unify url handling logic. 2017-04-03 21:57:16 +10:00
Simon Sapin
4f2b9a33fe Replace ParsedDeclaration::expand with non-generic method
... to reduce its code size impact.

https://bugzilla.mozilla.org/show_bug.cgi?id=1351737
2017-03-29 20:28:25 +02:00
Simon Sapin
1bacd0eb15 Move all PropertyDeclarationBlock from RwLock<_> to Locked<_> 2017-03-19 22:30:38 +01:00
Simon Sapin
57724e5a37 Replace RwLock<Keyframe> with Locked<Keyframe> 2017-03-19 22:30:37 +01:00
Bobby Holley
8cf331a498 Rearrange PropertyDeclaration to avoid embedding DeclaredValue.
From https://bugzilla.mozilla.org/show_bug.cgi?id=1347719

This effectively combines the discriminants of the two enums and reduces the
size of PropertyDeclaration by one word.

MozReview-Commit-ID: 9rCRiSVZTQT
2017-03-16 14:40:55 -07:00
Emilio Cobos Álvarez
b4de69e3eb
style: Avoid cloning all over the error reporter. 2017-03-14 00:49:18 +01:00
Simon Sapin
446aaa5845 Better variable name, remove obsolete comment 2017-03-08 12:03:47 +01:00
Simon Sapin
f70a49974a Make PropertyDeclarationBlock fields private 2017-03-07 23:37:32 +01:00
Simon Sapin
460fd6eba8 Deduplicate declarations when inserting each one, not at the end of parsing.
This will reduce the amount of re-allocations and copies.
It will be further optimized with a bit map.
2017-03-07 23:37:30 +01:00
Simon Sapin
4b4a873c3e Move parse method of PropertyDeclaration to ParsedDeclaration
This is what it now returns.
2017-03-07 23:37:29 +01:00
Simon Sapin
9d663ea7af Make PropertyDeclaration::parse return an enum rather than push to a Vec. 2017-03-07 23:37:29 +01:00
Simon Sapin
8160490272 Remove some unused impls. 2017-03-07 23:37:28 +01:00
Simon Sapin
7455ad5eb4 PropertyDeclarationParseResult -> Result<(), PropertyDeclarationParseError> 2017-03-07 23:37:27 +01:00
Simon Sapin
4ad844f7bd Rename PropertyBitField to LonghandIdSet 2017-02-26 19:24:50 +01:00
Simon Sapin
c81ebca7df Move PropertyBitField out of its module 2017-02-26 19:02:55 +01:00
Hiroyuki Ikezoe
501edfdbdb Get all animated properties in *all* keyframes.
@keyframes anim {
  from { transform: none; }
  to { opacity: 0; transform: none; }
}

In above case, we have to add opacity property and value in the 'from' keyframe.
2017-02-22 19:04:49 +09:00
Hiroyuki Ikezoe
35192b03c3 Assert if there is an important declaration while collecting animated properties in keyframes.
Parser has already dropped it.
2017-02-01 07:33:37 +09:00
Hiroyuki Ikezoe
a80725c91b Allow empty keyframe and keyframes with non-animatable properties.
We need to create CSS animations that have empty keyframe or keyframes
which have only invalid properties or non-animatable properties to fire
animation events for such animations.
2017-02-01 07:06:38 +09:00
Hiroyuki Ikezoe
90571eaa54 Bug 1328787 - Part 11: The last keyframe's KeyframePercentage is 1.0. r=heycam
MozReview-Commit-ID: Hgsc45m9401
2017-01-29 09:07:41 +09:00
Hiroyuki Ikezoe
e20a3ad9b5 Bug 1328787 - Part 8: Animation timing function can be overridden by animation-timing-function specified in keyframe. r=heycam 2017-01-29 09:07:41 +09:00
Manish Goregaokar
b5cb401aef Reduce allocator churn when parsing property declaration blocks (fixes #15060) 2017-01-18 16:31:46 -08:00
Emilio Cobos Álvarez
0b3c1a8924
style: Document the keyframes module. 2017-01-02 12:57:54 +01:00
Emilio Cobos Álvarez
fa01716c52
style: Avoid ending up with an invalid keyframe when inf or NaN are at play. 2016-12-15 13:58:51 +01:00
Simon Sapin
433c33c4df Match on PropertyId (not strings) to parse a declaration. 2016-12-09 17:06:51 -10:00
Nazım Can Altınova
e978f11c9f Fix Keyframe selector serialization 2016-12-06 01:38:06 +03:00
Simon Sapin
70b250fe2a Use stylesheet’s base URL and ns prefixes in CSSOM insert/appendRule. 2016-11-28 18:01:02 +01:00
Manish Goregaokar
18742e72fa Update test expectations 2016-11-23 09:32:48 -08:00
Manish Goregaokar
8108fc465a Add CSSNamespaceRule.{namespaceURI, prefix} 2016-11-23 09:32:46 -08:00
Manish Goregaokar
64442090ba Add CSSKeyframesRule.{findRule, deleteRule, appendRule} 2016-11-23 09:32:44 -08:00
Nazım Can Altınova
fdbadcdce2 Implement ToCss serialization for CSSRules 2016-11-18 12:17:53 +03:00
Simon Sapin
742681a623 Add RwLock in more Arc’d things in stylesheets. 2016-10-19 19:55:05 +02:00
Simon Sapin
89a29a7f12 Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
Simon Sapin
d986fd2d2f Use PropertyDeclarationBlock in a DOMRefCell everywhere. 2016-10-04 18:34:57 +02:00
Simon Sapin
29c72d15a9 Make style build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>.
The removal of this impl is not included in this commit.
CC https://github.com/servo/heapsize/issues/37#issuecomment-249861171
2016-10-04 13:45:57 +02:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Simon Sapin
8bfe978c78 Update cssparser 2016-09-07 14:13:56 +08:00
Simon Sapin
3ce64fd269 Rename DeclarationBlock to ApplicableDeclarationBlock
Make it more different from PropertyDeclarationBlock
2016-09-06 14:17:26 +08:00
Simon Sapin
ad3437b98a Remove now-redundant Arc inside PropertyDeclarationBlock. 2016-08-31 02:34:08 +02:00
Simon Sapin
acc38aa8c2 Use Arc<PropertyDeclarationBlock> everwhere it’s appropriate. 2016-08-31 02:34:07 +02:00
Simon Sapin
ef5977f059 Wrap in Arc<_> every object reflected in CSSOM.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1281962#c5
2016-08-31 02:34:03 +02:00
Simon Sapin
16bbc2f26e Merge normal and important declarations in style rules.
Have a single Vec instead of two. Fix #3426
2016-08-21 03:40:35 +02:00
Simon Sapin
ab846ab196 Make parsing of keyframe declaration blocks spec-compliant.
Exclude animation properties.
2016-08-21 03:40:24 +02:00
Simon Sapin
901aaeaf68 Remove unused Keyframe::parse method 2016-08-21 00:30:22 +02:00
Emilio Cobos Álvarez
8ba676533b
style: Fix timing-function overriding from the keyframe declaration list.
The previous behavior is plain wrong, since that array has always at least one
element, so we effectively couldn't specify anything else than "ease" in our
animations.
2016-07-07 16:05:28 -07:00
Simon Sapin
2d52b13f2f Make geckolib possible to build on stable Rust 2016-07-05 15:37:16 +02:00