Really sorry for the size of the patch :(
Only intentional behavior change is in the uses of HasLengthAndPercentage(),
where it's easier to do the right thing. The checks that used to check for
(IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915.
Differential Revision: https://phabricator.services.mozilla.com/D19553
The only reason it was on style_traits is so that they could use it from some
other crates, but Servo eventually ends up getting the value from an integer, so
may as well pass it around and do that in the end of the process anyway.
Differential Revision: https://phabricator.services.mozilla.com/D16557
Support unprefixed min-content and max-content and treat the prefixed
version as aliases for
1. width, min-width, max-width if inline-axis is horizontal, and
2. height, min-height, max-height if inline-axis is vertical, and
3. inline-size, min-inline-size, max-inline-size, and
4. flex-basis.
Besides, update the test cases to use unprefixed max-content and
min-content.
Depends on D7535
Differential Revision: https://phabricator.services.mozilla.com/D7536
--HG--
extra : moz-landing-system : lando
(Also remove stale decl for DoGetOverflowY, which cleanup_computed_getters.py
found for me.)
Differential Revision: https://phabricator.services.mozilla.com/D14618
--HG--
extra : moz-landing-system : lando
All of the removed includes are redundant (i.e. they're #included elsewhere in
the same file).
In most cases, I'm removing the second (redundant) copy of the
#include, except when that copy makes more sense (i.e. if it's in better sorted
order, or if it's paired alongside a closely-associated header while the
earlier copy is not).
Here's the script that I used to generate candidates here -- I ran this in
every subdirectory of layout, on my linux machine (warning, this writes two
files to your /tmp directory):
for FILE in *.h *.cpp; do
nonunique=$(grep \#include $FILE | grep -v List\.h | cut -f2 -d'"' | cut -f2- -d'/'| cut -f2- -d'/' | sort | wc -l)
unique=$( grep \#include $FILE | grep -v List\.h | cut -f2 -d'"' | cut -f2- -d'/'| cut -f2- -d'/' | sort | uniq | wc -l)
if [[ "$unique" != "$nonunique" ]]; then
echo "$FILE: $nonunique / $unique"
grep \#include $FILE | cut -f2 -d'"' | grep -v List\.h | cut -f2- -d'/'| cut -f2- -d'/' | sort > /tmp/nonunique.txt
grep \#include $FILE | cut -f2 -d'"' | grep -v List\.h | cut -f2- -d'/'| cut -f2- -d'/' | sort | uniq > /tmp/unique.txt
diff /tmp/nonunique.txt /tmp/unique.txt
echo
fi
done
Depends on D13773
Differential Revision: https://phabricator.services.mozilla.com/D13774
--HG--
extra : moz-landing-system : lando
I'm pretty sure the FIXME I left in the outline-style code is a bug,
but I want to clean this up further and I didn't want to fix it without adding
a test.
Differential Revision: https://phabricator.services.mozilla.com/D12859
--HG--
extra : moz-landing-system : lando
Converted NS_STYLE_BORDER_STYLE_* consts to enum class. Updated corresponding values to enum class. reduced BCCornerInfo struct values to fit StyleBorderStyle values inside struct. Added defaults to switches that do not fully cover all instances of StyleBorderStyle.
With this change, all of Chrome, Edge, Firefox, and Safari serialize
border-image-repeat by omitting a repeated keyword, so we update a WPT
that was expecting duplicated keywords.
Differential Revision: https://phabricator.services.mozilla.com/D10445
--HG--
extra : moz-landing-system : lando
It's worth to serialize the timing function from web animation api with
servo, too. However, we need an FFI to do that, so this patch also add a
new FFI.
Depends on D10443
Differential Revision: https://phabricator.services.mozilla.com/D10444
--HG--
extra : moz-landing-system : lando
Also remove specified-value-only keywords, since those are handled
only in Rust code and C++ doesn't need to know about them.
Differential Revision: https://phabricator.services.mozilla.com/D9634
--HG--
extra : moz-landing-system : lando
First, we generate StyleComputedTimingFunction by cbindgen from Rust, and use
it in nsTimingFunction, so we could copy it directly without handling
the different memory layout. However, we have to rewrite the
nsTimingFunction and mozilla::ComputedTimingFunction for this.
Second, the rust-bindgen seems cannot generate the correct generic members
from complex C++ templates, especially for the nested template struct,
(https://github.com/rust-lang-nursery/rust-bindgen/issues/1429)
So we have to hide StyleTimingFunction to avoid the compilation errors.
Depends on D9312
Differential Revision: https://phabricator.services.mozilla.com/D9313
--HG--
extra : moz-landing-system : lando
I had to fix the conversion for BackgroundSize too, hopefully we can
simplify all this using cbindgen in the future instead of CalcValue.
Differential Revision: https://phabricator.services.mozilla.com/D7580
--HG--
extra : moz-landing-system : lando
This moves most of the code to be Rust, except potentially some evaluator
functions, and allows to unblock the use case from any-hover / any-pointer and
remove nsMediaFeatures.
Differential Revision: https://phabricator.services.mozilla.com/D2976
Always assume allowed-for-all-content. There are a couple callers which weren't
doing that:
* A unit test -> removed.
* ComputeAnimationDistance: Used for testing (in transitions_per_property), and
for the animation inspector. The animation inspector shouldn't show
non-enabled properties. The transitions_per_property test already relies on
getComputedStyle stuff which only uses eForAllContent.
* GetCSSImageURLs: I added this API for the context menu page and such. It
doesn't rely on non-enabled-everywhere properties, it was only using
eInChrome because it was a ChromeOnly API, but it doesn't really need this.
Differential Revision: https://phabricator.services.mozilla.com/D2514
MozReview-Commit-ID: 4VOi5Su3Bos
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.
Really sorry for the size of the patch.
There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.
Differential Revision: https://phabricator.services.mozilla.com/D2361
MozReview-Commit-ID: DiSmMWK7Krp
This is done with the following script:
```python
#!/usr/bin/env python3
import re
import subprocess
from pathlib import Path
HEADER = Path("layout/style/nsCSSProps.h")
SOURCE = Path("layout/style/nsCSSProps.cpp")
RE_TABLE = re.compile(r"\b(k\w+KTable)")
rg_result = subprocess.check_output(["rg", r"\bk\w+KTable"], encoding="UTF-8")
to_keep = set()
all = set()
for item in rg_result.splitlines():
file, line = item.split(':', 1)
name = RE_TABLE.search(line).group(1)
path = Path(file)
if path != HEADER and path != SOURCE:
to_keep.add(name)
else:
all.add(name)
to_remove = all - to_keep
remaining_lines = []
with HEADER.open() as f:
for line in f:
m = RE_TABLE.search(line)
if m is not None and m.group(1) in to_remove:
print("Removing " + m.group(1))
continue
remaining_lines.append(line)
with HEADER.open("w", newline="") as f:
f.writelines(remaining_lines)
remaining_lines = []
removing = False
RE_DEF = re.compile(r"KTableEntry nsCSSProps::(k\w+KTable)\[\]")
with SOURCE.open() as f:
for line in f:
if removing:
if line == "};\n":
removing = False
continue
m = RE_DEF.search(line)
if m is not None and m.group(1) in to_remove:
if remaining_lines[-1] == "\n":
remaining_lines.pop()
removing = True
continue
remaining_lines.append(line)
with SOURCE.open("w", newline="") as f:
f.writelines(remaining_lines)
```
MozReview-Commit-ID: FeDZRcBceqV
--HG--
extra : source : fe9369e5cef11a6c6eaac641c185844eb45554b1
I manually diffed the generated lists and the original ones from in
nsCSSProps.cpp. All generated lists seem to contain the same set of
subproperties as their old correspondents.
There are still some differences:
Order of subproperties of many shorthands is changed. There are many
comments in the old lists stating that the order is important, but they
are mostly for serialization. I auditted all users of the subproperty
lists, and it doesn't seem to me any of them relies on the order.
gOutlineRadiusSubpropTable is renamed to gMozOutlineRadiusSubpropTable
which I don't think is a problem at all, but maybe worth mentioning.
MozReview-Commit-ID: 190SBZfxVOW
--HG--
extra : rebase_source : cd5e8b1667a4550542c361d31361e45456c6b6a3
The parsevariant field is not removed from nsCSSPropList.h since that
file is going away soon anyway.
MozReview-Commit-ID: 3nRBQtmZRKG
--HG--
extra : source : dcb6ff9ec9f61d2ea99253cd34a9d904f89cfe17
Some assertions are also removed because they are no longer necessary.
The script generating the flags guarantees those assertions hold.
MozReview-Commit-ID: BgXMBoRBJaJ
Some assertions are also removed because they are no longer necessary.
The script generating the flags guarantees those assertions hold.
MozReview-Commit-ID: BgXMBoRBJaJ
--HG--
extra : source : 9c528e502e6c5e83012402e5b3c193472f00d6d0
extra : amend_source : 3bb111571c319e89f93d4759d3fa2c99bf4977bb
These are the only remaining flags that we don't generate from Servo
side. We can now assert flags are equal and switch kFlagsTable to use
ServoCSSPropList.h instead.
MozReview-Commit-ID: 6RhXeCf6DgK
--HG--
extra : rebase_source : 604eb046b4cc56db2e6ee2d35441000a74575368
extra : source : cdd19a8641a86d2460107e6c0f50a9d27c7bdb6c