Although the methods of Matrix3D in animated_properties.mako.rs could be
simplified by mako, it's a little bit hard to read because they are far
from the usage and definition. Therefore, we move them to the definition of
computed::Matrix3D and expand the mako.
Depends on D11935
Differential Revision: https://phabricator.services.mozilla.com/D11961
--HG--
extra : moz-landing-system : lando
We manually implement ComputeSquaredDistance for Translate, Rotate, and
Scale because we have to handle mismatch cases, and actually we don't
need to implement it for specified types.
Depends on D11934
Differential Revision: https://phabricator.services.mozilla.com/D11935
--HG--
extra : moz-landing-system : lando
Basically, most of the animation code of transform don't need mako, so
we could move them into values/animated/transform.rs.
However, we still use mako to generate some code to make the methods of
Matrix3D simpler, so I still leave them in animated_properties.mako.rs.
Depends on D11933
Differential Revision: https://phabricator.services.mozilla.com/D11934
--HG--
rename : servo/components/style/properties/helpers/animated_properties.mako.rs => servo/components/style/values/animated/transform.rs
extra : moz-landing-system : lando
I'm trying to put all the mako code together, so we could move transform
code into a different file.
Differential Revision: https://phabricator.services.mozilla.com/D11933
--HG--
extra : moz-landing-system : lando
This implements the mechanism reusing the animation machinery for now, so it
asserts in a few cases that this wouldn't handle correctly.
For shorthands that have colors and other bits we'd need a more sophisticated
mechanism with a bit more code (that resolves colors and such), but it'd look
something like this regardless, and we should have this in any case.
Differential Revision: https://phabricator.services.mozilla.com/D11944
--HG--
extra : moz-landing-system : lando
This helps to preserve the old longhand form when possible (mask used to be a
longhand), which will be relevant when we serialize this for the computed
value.
Differential Revision: https://phabricator.services.mozilla.com/D11943
--HG--
extra : moz-landing-system : lando
This way we always serialize in the shortest form, and take less space.
This is useful because when serializing uncomputed values we'd like to compare
to the initial value to avoid serializing parts of a shorthand, but with the
existing implementation we would generate always a second keyword, which means
that we'll never match it.
This also matches Chrome and WebKit, incidentally, so I'm pretty confident the
behavior change when serializing specified style is web-compatible.
Differential Revision: https://phabricator.services.mozilla.com/D11941
--HG--
extra : moz-landing-system : lando
This patch removes the following functions:
* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)
and all references of the pref.
Depends on D11183
Differential Revision: https://phabricator.services.mozilla.com/D11249
--HG--
extra : moz-landing-system : lando
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:
* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)
This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():
* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)
I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.
Differential Revision: https://phabricator.services.mozilla.com/D11183
--HG--
extra : moz-landing-system : lando
This patch removes the following functions:
* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)
and all references of the pref.
Depends on D11183
Differential Revision: https://phabricator.services.mozilla.com/D11249
--HG--
extra : moz-landing-system : lando
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:
* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)
This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():
* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)
I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.
Differential Revision: https://phabricator.services.mozilla.com/D11183
--HG--
extra : moz-landing-system : lando
The current use of a static reference is incompatible with sharing style sheet data
across processes.
Differential Revision: https://phabricator.services.mozilla.com/D11845
--HG--
extra : moz-landing-system : lando
Once we've parsed the variable references, there is no need to keep an entire HashSet
object around, as all we do is iterate over the values.
Differential Revision: https://phabricator.services.mozilla.com/D11735
--HG--
extra : moz-landing-system : lando
And thus massively speed up ascii-case-insensitive atom comparisons when both
atoms are lowercase (which is the common case by far).
This removes almost all the slow selector-matching in this page, and it seems
an easier fix than storing the lowercased version of all class-names in quirks
mode in elements and selectors...
Differential Revision: https://phabricator.services.mozilla.com/D10945
--HG--
extra : moz-landing-system : lando
Rotate accepts rotate axis and angle in any order
(i.e. <number>{3} <angle> or <angle> <number>{3}), so we rewrite the
parser.
Depends on D11401
Differential Revision: https://phabricator.services.mozilla.com/D11417
--HG--
extra : moz-landing-system : lando
The original implementation always returns Rotate::Rotate3D, but it is
not correct, so we have to rewrite it:
1. If both from value and to value are none, we don't have to convert it
into identity value, so just return None.
2. If one of the value is none, we replace it with an identity value based on
the other one's rotate axis.
3. If we only have 2D rotation, we just animate the <angle>.
4. Otherwise, we do interpolation by 3D rotation.
Differential Revision: https://phabricator.services.mozilla.com/D11247
--HG--
extra : moz-landing-system : lando
Basically, we rewrite the type of generics::transform::Translate and its
ToCss to match the spec. Besides, we always serialize Translate by servo,
so we could drop a lot of duplicated code.
Differential Revision: https://phabricator.services.mozilla.com/D11206
--HG--
extra : moz-landing-system : lando
It's only used in contenteditable.css, and same usage in comm-central. That
sheet is loaded as a ua sheet so let's restrict it to that. No relevant
external usage either. This value was introduced in bug 1181130.
Differential Revision: https://phabricator.services.mozilla.com/D11584