Граф коммитов

829 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez e9ae3b0907 Bug 1527410 - Use Rust sizes for flex-basis, width, height, and their min/max properties. r=jwatt
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
2019-02-15 03:59:31 +01:00
Emilio Cobos Álvarez b44ff327e9 Bug 1520154 - Move cursor to cbindgen. r=boris
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
2019-01-16 14:13:07 +01:00
Boris Chiou c35f47093e Bug 1322780 - Part 2: Support unprefixed min-content and max-content. r=mats,emilio
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
2018-12-18 18:47:37 +00:00
Daniel Holbert 7258ebe69e Bug 1514309 part 2: Remove C++ serialization code for CSS {align,justify}-{content,items,self} properties. r=emilio
(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
2018-12-14 21:27:18 +00:00
Emilio Cobos Álvarez 4591031b65 Bug 1513012 - Move overflow to use cbindgen. r=heycam
It's one of the most annoying / hacky mako bits we have.

Differential Revision: https://phabricator.services.mozilla.com/D14084
2018-12-11 03:07:08 +01:00
Emilio Cobos Álvarez 0b0dd2d95f Bug 1512328 - Use cbindgen for a couple more CSS properties. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D13886
2018-12-07 15:06:07 -05:00
Daniel Holbert 7c3b31a25d Bug 1512112: Remove redundant includes from source files in layout. r=TYLin
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
2018-12-05 18:55:59 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez b54948124d Bug 1509717 - Use cbindgen for border-style and outline-style. r=heycam
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
2018-11-30 05:27:28 +00:00
Kristen Wright f22175b197 Bug 1460439 - Conversion from NS_STYLE_BORDER_STYLE_* macro to StyleBorderStyle::* enum class r=emilio
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.
2018-11-07 11:56:17 -08:00
Cameron McCormack be0999a658 Bug 1501261 - Part 1: Use Servo to serialize border-image-repeat r=firefox-style-system-reviewers,emilio
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
2018-11-05 02:21:39 +00:00
Boris Chiou e3efce4cc6 Bug 1501117 - Part 2: Serialize timing function from web animation api with servo. r=emilio,birtles
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
2018-11-01 21:33:56 +00:00
Emilio Cobos Álvarez 9f8636dee7 Bug 1500885 - Remove tests and other similar bits. r=mats
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
2018-10-24 20:32:16 +00:00
Boris Chiou 04b273259e Bug 1496619 - part 6: Generate StyleTimingFunction and drop ns_timing_function.rs r=emilio,birtles
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
2018-10-26 18:03:35 +00:00
Emilio Cobos Álvarez e929975273 Bug 1496008 - Serialize a bunch of image properties with Servo. r=heycam
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
2018-10-05 20:08:55 +00:00
Emilio Cobos Álvarez 0cf34bf459 Bug 1484316: Serialize clip-path and shape-outside using Servo. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D3653
2018-08-22 11:20:41 +02:00
Emilio Cobos Álvarez 03eea217a8 Bug 1481961: Rewrite media queries so that they work on an evaluator function. r=xidorn
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
2018-08-15 16:09:19 +02:00
Emilio Cobos Álvarez 6c81e2e79c Bug 1479450: Convert GetStringValue to use Servo. r=xidorn
And remove gPropertyTable / kCSSRawProperties while at it.

Differential Revision: https://phabricator.services.mozilla.com/D2516

MozReview-Commit-ID: 8U87BcBkrJF
2018-07-31 12:05:00 +02:00
Emilio Cobos Álvarez 2996813963 Bug 1479450: Implement nsCSSProps::LookupProperty using Rust. r=xidorn
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
2018-07-31 12:00:15 +02:00
Emilio Cobos Álvarez 517256e365 Bug 1478391: Autogenerate StyleAppearance. r=jwatt
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
2018-07-26 17:06:17 +02:00
Kris Maglione 3e400a8f72 Bug 1472523: Part 2 - Avoid unnecessary string copies in preference caches. r=njn
MozReview-Commit-ID: 74svGlwMVF1

--HG--
extra : rebase_source : ee25a335773b9afba9125c9092ed95eecc702cd9
2018-06-30 23:07:30 -07:00
Emilio Cobos Álvarez 92952c788e Bug 1472551 - Serialize font properties using Servo. r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D1905

--HG--
extra : moz-landing-system : lando
2018-07-01 23:00:18 +00:00
Xidorn Quan a18ad3b214 Bug 1471114 part 5 - Remove unused keyword tables. r=emilio
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
2018-06-27 15:34:29 +10:00
Xidorn Quan 846d7b5617 Bug 1463917 part 1 - Add scrollcorner to -moz-appearance so that widget can render it. r=heycam
MozReview-Commit-ID: 1Za22ifONfG

--HG--
extra : rebase_source : f68ab7acae943c633299dd422a0587b22c2ba5e9
2018-05-11 10:12:17 +10:00
Nazım Can Altınova 60852e7cad Bug 1451289 - Part 10: Merge ServoImportRule and CSSImportRule r=emilio
MozReview-Commit-ID: JvHNGoX4AUF

--HG--
extra : rebase_source : 3d30ee1278f035bd480c05ec0d8f35d4a31cf3c7
2018-06-06 15:31:33 +02:00
Matthew Noorenberghe f4b1dd23aa Bug 1466715 - Remove unimplemented -moz-appearance:window from XUL document elements on Windows and align on 'dialog' elsewhere. r=dao,emilio
Before this commit, we use `-moz-appearance: dialog;`[1] (mapping to NS_THEME_DIALOG) in global.css
on macOS for XUL root elements while on Windows[2] and Linux[3] we use `-moz-appearance: window;`
(mapping to NS_THEME_WINDOW).

From what I can tell NS_THEME_WINDOW behaves the same as NS_THEME_DIALOG on Linux[4], NS_THEME_WINDOW
doesn't do anything useful on macOS[5], and neither are implemented on Windows (bug 119737).

[1] https://dxr.mozilla.org/mozilla-central/rev/0ee6b755ab2ee6d2ab79b17cc97bd4e83424cbfc/toolkit/themes/osx/global/global.css#35
[2] https://dxr.mozilla.org/mozilla-central/rev/0ee6b755ab2ee6d2ab79b17cc97bd4e83424cbfc/toolkit/themes/windows/global/global.css#41
[3] https://dxr.mozilla.org/mozilla-central/rev/0ee6b755ab2ee6d2ab79b17cc97bd4e83424cbfc/toolkit/themes/linux/global/global.css#45
[4] All references to NS_THEME_WINDOW and NS_THEME_DIALOG seem to handle the other in the same way.
[5] https://dxr.mozilla.org/mozilla-central/search?q=regexp%3ANS_THEME_WINDOW%5Cb+path%3Acocoa&redirect=false

MozReview-Commit-ID: 6TGzDnMEY2y

--HG--
extra : rebase_source : 12338eb408a759525f1f37b308f333d043cec1c9
2018-06-10 14:54:06 -07:00
Xidorn Quan f9e0542b4d Bug 1465628 part 1 - Use a static table for property preferences. r=emilio
MozReview-Commit-ID: 7tCdZyAlZc0

--HG--
extra : rebase_source : 80ae9bb4199efa3c7948004d329e617b1f14f154
2018-05-31 13:49:25 +10:00
Dorel Luca 6780acc0ad Backed out 4 changesets (bug 1465628) for Eslint failure. CLOSED TREE
Backed out changeset 04f276eb2f0e (bug 1465628)
Backed out changeset e9cdff122793 (bug 1465628)
Backed out changeset 6832baa28e3f (bug 1465628)
Backed out changeset e5ac0c7a9fb4 (bug 1465628)
2018-06-05 04:00:30 +03:00
Xidorn Quan 75e55a5d66 Bug 1465628 part 1 - Use a static table for property preferences. r=emilio
MozReview-Commit-ID: 7tCdZyAlZc0

--HG--
extra : rebase_source : 826eb91e0abecd02e89860b5ca6533b8b1463260
2018-05-31 13:49:25 +10:00
Morgan Rae Reschenberg 0403087901 Bug 1463589 - Add contain:size and contain:content parsing functionality. r=emilio
MozReview-Commit-ID: 4fOqln3oOpC

--HG--
extra : rebase_source : 3b2ac1116ea9399a8fbbaab158e7dda5fec3930d
2018-05-30 07:49:31 -07:00
Gerald Squelart 49bbea11e3 Bug 1457373 - Remove text-combine-upright digits option - r=xidorn
MozReview-Commit-ID: Ehzsd2rmBER

--HG--
extra : rebase_source : 15e109be686e2b849a4676ad89a1b06bc4fe9687
2018-05-17 15:29:17 +10:00
Margareta Eliza Balazs 4f9a2ba08e Merge inbound to mozilla-central. a=merge 2018-05-11 12:36:02 +03:00
Brian Birtles f8c518344a Bug 1456394 - Rename AnimationEffectReadOnly to AnimationEffect; r=bz,hiro
MozReview-Commit-ID: 8jzJiCWt5vs

--HG--
rename : dom/animation/AnimationEffectReadOnly.cpp => dom/animation/AnimationEffect.cpp
rename : dom/animation/AnimationEffectReadOnly.h => dom/animation/AnimationEffect.h
rename : dom/webidl/AnimationEffectReadOnly.webidl => dom/webidl/AnimationEffect.webidl
extra : rebase_source : 2bd6490fe9be47cfb760bda81a63c33ba0b0397d
2018-05-07 11:15:16 +09:00
Kristen Wright 031610cc8e Bug 1459367 - Convert NS_STYLE_IMAGELAYER_ATTACHMENT_* to enum class. r=manishearth
Converted NS_STYLE_IMAGELAYER_ATTATCHMENT_* vals to enum class, StyleImageLayerAttachment.
2018-05-08 15:05:33 -07:00
Xidorn Quan 48dc9dc70a Bug 1454591 part 5 - Generate subproperty lists from Servo data. r=heycam
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
2018-05-04 15:17:05 +10:00
Xidorn Quan 8de2cba5fc Bug 1457802 part 3 - Remove unused keyword tables. r=heycam
MozReview-Commit-ID: A94JflJh368

--HG--
extra : rebase_source : 8c090b26415462a3e55ad59b7aa4b011b99ad342
2018-04-30 09:56:26 +10:00
Xidorn Quan b81d5f0707 Bug 1457802 part 1 - Remove nsCSSProps::GetColorName which is unused. r=heycam
MozReview-Commit-ID: GybpTh6GYYx

--HG--
extra : rebase_source : 76c54179522d37ebfc42cbfbc7590605c0f5ae70
2018-04-30 09:20:53 +10:00
Xidorn Quan b50ebda124 Bug 1448759 part 5 - Remove nsCSSPropList.h and nsCSSPropAliasList.h. r=heycam
MozReview-Commit-ID: EKx2g7CmvqB

--HG--
extra : rebase_source : 11ba4920129e22bd6469b2e89cd6e738d2d921b5
2018-04-29 22:09:17 +10:00
Xidorn Quan 2e130c425c Bug 1448759 part 4 - Switch gAllSubpropTable to use generated ServoCSSPropList.h. r=heycam
MozReview-Commit-ID: IfzfFpw5ABz

--HG--
extra : rebase_source : ce27e8440108763c0758f9dc071b7990fc4034b6
2018-04-29 22:03:48 +10:00
Xidorn Quan 8f6370d1d3 Bug 1448759 part 3 - Remove kKeywordTableTable and LookupPropertyValue. r=heycam
MozReview-Commit-ID: F2EbL0hSgPX

--HG--
extra : rebase_source : 8394244ec3cf903439972d325f6976e3a02d70e1
2018-04-29 21:41:29 +10:00
Xidorn Quan 5efc0123ab Bug 1434130 part 15 - Remove kCSSRawPredefinedCounterStyles. r=emilio
MozReview-Commit-ID: 5aiU0VChbpY

--HG--
extra : source : 3943b16b0d0b6ba4f2bb04423daf609fd204c10e
2018-04-29 09:03:31 +10:00
Xidorn Quan f7399c7c0f Bug 1434130 part 14 - Remove nsCSSProps::kParseVariantTable. r=emilio
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
2018-04-29 09:03:31 +10:00
Xidorn Quan 43eb5c8140 Bug 1456364 part 4 - Convert CSS_PROPERTY_* flags to a typed enum flags. r=emilio
MozReview-Commit-ID: 4mLPe5cH80N
2018-04-26 16:24:33 +02:00
Xidorn Quan 1eb2fafd90 Bug 1456364 part 3 - Remove flags from nsCSSPropList.h. r=emilio
Some assertions are also removed because they are no longer necessary.
The script generating the flags guarantees those assertions hold.

MozReview-Commit-ID: BgXMBoRBJaJ
2018-04-26 16:24:32 +02:00
Andreea Pavel 87bf18c74d Backed out 4 changesets (bug 1456364) for build bustages at /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/dom/AnimationEffectReadOnlyBinding.h:35 on a CLOSED TREE
Backed out changeset 020151240bb8 (bug 1456364)
Backed out changeset bc0aa5224d91 (bug 1456364)
Backed out changeset d919bbe7440c (bug 1456364)
Backed out changeset ab1472823e8a (bug 1456364)
2018-04-26 08:27:45 +03:00
Xidorn Quan 8af84311ff Bug 1456364 part 4 - Convert CSS_PROPERTY_* flags to a typed enum flags. r=emilio
MozReview-Commit-ID: 4mLPe5cH80N

--HG--
extra : rebase_source : 25f7c909b199c7a83d5809b56afad50ab4f5167e
extra : source : acd1c316929682c4c19beda22d6ce1f1146fce8b
2018-04-26 15:00:50 +10:00
Xidorn Quan 82ec5d1a6b Bug 1456364 part 3 - Remove flags from nsCSSPropList.h. r=emilio
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
2018-04-26 15:00:50 +10:00
Xidorn Quan 8171839f2c Bug 1455576 part 4 - Remove CSS_PROPERTY_PARSE_FUNCTION and CSS_PROPERTY_VALUE_PARSER_FUNCTION flags. r=emilio
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
2018-04-26 09:01:02 +10:00
Mats Palmgren 8e30369644 Bug 1398482 part 2 - [css-grid][css-flexbox][css-multicol] Add 'row-gap' and 'gap' properties; make 'grid-[column|row]-gap' and 'grid-gap' alias the respective unprefixed properties (Gecko part). r=dholbert 2018-04-24 01:52:51 +02:00
Jonathan Watt 156c4af1ec Bug 1436048: Use user defined types for font-stretch / font-style. r=jfkthame,jwatt
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>

MozReview-Commit-ID: 7ONYtICeAqb
2018-04-23 18:22:05 +02:00