The only difference in the final result is "all" shorthand, for which
the original result is wrong because "all" shorthand doesn't accept any
value other than the CSS-wide keywords.
MozReview-Commit-ID: BmT7kGwC0ZQ
--HG--
extra : rebase_source : 094d764007359cb928f4c31a3818448f254a4043
extra : source : 10d25cf7b4ff2b5615a638031f98dc6163708545
Most of types just derive it using proc_macro directly. Some of value
types need manual impl.
In my current plan, this new trait will be used in bug 1434130 to expose
values as well.
MozReview-Commit-ID: LI7fy45VkRw
--HG--
extra : rebase_source : a765e43b0c615e5f47bddb90ba6fa24bfc06959e
extra : source : 60812c1b190d90602bc6d49477fe1f558a53cd51
I didn't bother not shifting there. We need to load the whole thing and shift
for at least one of cascade level / shadow cascade order.
Callers of level() other than for_rule_tree are non-existent in release builds,
so we'd be doing the shift anyway. I can implement the same thing for
shadow_cascade_order too, but I don't think that optimization is measurable in
any way, either, the compiler should make the decision.
And just in case, the simpler version actually generated less instructions in:
https://play.rust-lang.org/?gist=ceadb0d3cbce4eeca76e4d9ab9a1c744&version=nightly
with the simple thing.
MozReview-Commit-ID: 8xPBJmlcyKh
If I had to write that again I would've killed myself :).
This is still not perfect, and the system font code is still quite a mess, but
well, little steps.
MozReview-Commit-ID: BmrZlCSejo7
This patch is meant to be squashed with the following two. This is an initial
strawman implementation that I wrote to unblock jwatt, cleanups and fixes
follow.
Note that this is style pretty much untested until jwatt's patches are ready,
since Gecko doesn't understand the angle at all, but I expect the fixes to be
minor.
MozReview-Commit-ID: 1Nq5DyCjaZe
No cleaner ideas right now that carrying that counter around... Maybe a custom
type may be cleaner?
This makes ApplicableDeclarationBlock a bit bigger. I could probably try to make
the counter a 4 / 5-bit number or something and pack the counter there in the
SourceOrderAndCascadeLevel somehow...
But doesn't seem really worth the churn, and can be done as a followup in any
case. Let me know if you want to block on that.
MozReview-Commit-ID: 1LdW9S4xA6f
With this change, we first generate a data file ServoCSSPropList.py from
Servo data, and then use this data to generate ServoCSSPropList.h.
This change itself serves as a checkpoint with a runtime check that all
information generated from Servo side matches what we have in the Gecko
side. Following patches will start replacing uses of nsCSSPropList.h
with either the data file or the header file.
The reason that it generates data file rather than header directly is
that, many users of PythonCSSProps.h invokes C++ preprocessor manually
to extract data from nsCSSPropList.h without passing in search paths,
so it is non-trivial to replace the use of nsCSSPropList.h there with
a generated header. Generating a Python data file would hopefully
simplify those users rather than adding more complexity to them.
I also thought about generating JSON rather than plain Python file, but
JSON doesn't allow trailing comma in array, which makes it less pretty
to generate via mako template.
MozReview-Commit-ID: CwK2oL88r6F
--HG--
extra : rebase_source : aaf98cfd768740fdd6ac4961fc825d84adaf94a5
Note that we also drop the dead optional aReusableSheets argument from
the async parsing path, since it was always null.
MozReview-Commit-ID: KddpGFdaqEe
With this change, we first generate a data file ServoCSSPropList.py from
Servo data, and then use this data to generate ServoCSSPropList.h.
This change itself serves as a checkpoint with a runtime check that all
information generated from Servo side matches what we have in the Gecko
side. Following patches will start replacing uses of nsCSSPropList.h
with either the data file or the header file.
The reason that it generates data file rather than header directly is
that, many users of PythonCSSProps.h invokes C++ preprocessor manually
to extract data from nsCSSPropList.h without passing in search paths,
so it is non-trivial to replace the use of nsCSSPropList.h there with
a generated header. Generating a Python data file would hopefully
simplify those users rather than adding more complexity to them.
I also thought about generating JSON rather than plain Python file, but
JSON doesn't allow trailing comma in array, which makes it less pretty
to generate via mako template.
MozReview-Commit-ID: CwK2oL88r6F
--HG--
extra : rebase_source : 926cca8548d42ecb0dd364ea5c52a46a4973e819
This also adopts the resolution of [1] while at it, and switches XUL to not
support display: contents until a use case appears.
This makes our behavior consistent both with the spec and also in terms of
handling dynamic changes to stuff that would otherwise get suppressed.
Also makes us consistent with both Blink and WebKit in terms of computed style.
We were the only ones respecting "behaves as display: none" without actually
computing to display: none. Will file a spec issue to get that changed.
It also makes us match Blink and WebKit in terms of respecting display: contents
before other suppressions, see the reftest which I didn't write as a WPT
(because there's no spec supporting neither that or the opposite of what we do),
where a <g> element respects display: contents even though if it had any other
kind of display value we'd suppress the frame for it and all the descendants
since it's an SVG element in a non-SVG subtree.
Also, this removes the page-break bit from the display: contents loop, which I
think is harmless.
As long as the tests under style are based in namespace id / node name /
traversal parent, this should not make style sharing go wrong in any way, since
that's the first style sharing check we do at [2].
The general idea under this change is making all nodes with computed style of
display: contents actually honor it. Otherwise there's no way of making the
setup sound except re-introducing something similar to all the state tracking
removed in bug 1303605.
[1]: https://github.com/w3c/csswg-drafts/issues/2167
[2]: https://searchfox.org/mozilla-central/rev/fca4426325624fecbd493c31389721513fc49fef/servo/components/style/sharing/mod.rs#700
MozReview-Commit-ID: JoCKnGYEleD