Commit Graph

14019 Commits

Author SHA1 Message Date
Cosmin Sabou
f4b3baf021 Merge mozilla-inbound to mozilla-central. a=merge 2018-06-28 13:04:23 +03:00
Tiberius Oros
945c24abe5 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-06-28 01:12:18 +03:00
Tiberius Oros
705b995848 Merge inbound to mozilla-central. a=merge 2018-06-28 01:07:30 +03:00
Emilio Cobos Álvarez
8aaca6bf90 Bug 1464782: Allow logical aliases in the property database. r=me
MozReview-Commit-ID: 68WqG0OViPQ
2018-06-27 17:35:46 +02:00
Dorel Luca
4e1a98da16 Merge mozilla-central to autland. CLOSED TREE
--HG--
extra : amend_source : f27ba81f58e12b4cf5286650b6910404748e7f95
2018-06-27 14:07:04 +03:00
Dorel Luca
d296624690 Backed out 5 changesets (bug 1340498) for build bustage due to conflicts with bug 1470325. a=backout
Backed out changeset 28bedb658af4 (bug 1340498)
Backed out changeset f950a2310e26 (bug 1340498)
Backed out changeset 5fcd31c65fe0 (bug 1340498)
Backed out changeset 515bb5e24dd7 (bug 1340498)
Backed out changeset 79a8619bd3e2 (bug 1340498)
2018-06-27 14:05:20 +03:00
Dorel Luca
bc2fbd0648 Merge mozilla-central to autoland
--HG--
extra : rebase_source : 0f5c3c308ce6ddd6fb9fcb49b83d4450a24d67dc
2018-06-27 13:33:04 +03:00
Dorel Luca
f51c4fa5d9 Merge mozilla-inbound to mozilla-central. a=merge 2018-06-27 13:26:49 +03:00
Cameron McCormack
674e812659 Bug 1471499 - Part 3: Replace remaining "see nsStyleConsts.h" comments with more useful references. r=xidorn
MozReview-Commit-ID: kO8uT9JZgK

--HG--
extra : rebase_source : 119ce72ccb1f2b79ec0e827325ed4ea6897a9e87
2018-06-27 16:45:56 +10:00
Cameron McCormack
73de67e798 Bug 1471499 - Part 2: Remove "see nsStyleConsts.h" comments for style struct members that are enum classes. r=xidorn
MozReview-Commit-ID: ISkGZ7FU8xR

--HG--
extra : rebase_source : 74e8b99a38e9d9fd94d1a93c2385fb91d66c12f4
2018-06-27 15:51:33 +10:00
Cameron McCormack
d5ad9f4ec6 Bug 1471499 - Part 1: Remove [reset] and [inherited] comments on style struct members. r=xidorn
MozReview-Commit-ID: 9dL51J2KqPS

--HG--
extra : rebase_source : 28cb17a14052db90b55a75d09ac190b85051624e
2018-06-27 15:44:58 +10:00
Xidorn Quan
4b65f18d5a Bug 1471114 part 7 - Scripts used to generated the previous patches. r=emilio
MozReview-Commit-ID: E9dB5l9AmeS

--HG--
extra : source : 960b212b998e728f90bbf564f5899a92f65c9e0e
2018-06-27 15:34:29 +10:00
Xidorn Quan
882b6f2f03 Bug 1471114 part 6 - Remove unused CSS keywords. r=emilio
This is done with the following script:
```python
#!/usr/bin/env python3

import re
import subprocess

LIST_FILE = "layout/style/nsCSSKeywordList.h"

RE_KEYWORD = re.compile(r"\beCSSKeyword_(\w+)")
rg_result = subprocess.check_output(["rg", r"eCSSKeyword_\w+"], encoding="UTF-8")
to_keep = set()
for item in rg_result.splitlines():
    file, line = item.split(':', 1)
    for m in RE_KEYWORD.finditer(line):
        to_keep.add(m.group(1))

remaining_lines = []
RE_ITEM = re.compile(r"CSS_KEY\(.+, (\w+)\)")
with open(LIST_FILE, "r") as f:
    for line in f:
        m = RE_ITEM.search(line)
        if m is not None and m.group(1) not in to_keep:
            print("Removing " + m.group(1))
            continue
        remaining_lines.append(line)
with open(LIST_FILE, "w", newline="") as f:
    f.writelines(remaining_lines)
```

MozReview-Commit-ID: upyTPc8984

--HG--
extra : source : 65a744682fe99d8f0de4fa4b7a478e10aba0349e
2018-06-27 15:34:29 +10: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
a01792b85b Bug 1471114 part 4 - Remove unused getter functions from nsComputedDOMStyle. r=emilio
This is done with the following script:
```python
#!/usr/bin/env python3

import re
import sys

from pathlib import Path

if len(sys.argv) != 2:
    print("Usage: {} objdir".format(sys.argv[0]))
    exit(1)

generated = Path(sys.argv[1]) / "layout" / "style"
generated = generated / "nsComputedDOMStyleGenerated.cpp"
RE_GENERATED = re.compile(r"DoGet\w+")
keeping = set()
with generated.open() as f:
    for line in f:
        m = RE_GENERATED.search(line)
        if m is not None:
            keeping.add(m.group(0))

HEADER = "layout/style/nsComputedDOMStyle.h"
SOURCE = "layout/style/nsComputedDOMStyle.cpp"

# We need to keep functions invoked by others
RE_DEF = re.compile(r"nsComputedDOMStyle::(DoGet\w+)\(\)")
RE_SRC = re.compile(r"\b(DoGet\w+)\(\)")
with open(SOURCE, "r") as f:
    for line in f:
        m = RE_DEF.search(line)
        if m is not None:
            continue
        m = RE_SRC.search(line)
        if m is not None:
            keeping.add(m.group(1))

removing = set()
remaining_lines = []
with open(HEADER, "r") as f:
    for line in f:
        m = RE_SRC.search(line)
        if m is not None:
            name = m.group(1)
            if name not in keeping:
                print("Removing " + name)
                removing.add(name)
                continue
        remaining_lines.append(line)

with open(HEADER, "w", newline="") as f:
    f.writelines(remaining_lines)

remaining_lines = []
is_removing = False
with open(SOURCE, "r") as f:
    for line in f:
        if is_removing:
            if line == "}\n":
                is_removing = False
            continue
        m = RE_DEF.search(line)
        if m is not None:
            name = m.group(1)
            if name in removing:
                remaining_lines.pop()
                if remaining_lines[-1] == "\n":
                    remaining_lines.pop()
                is_removing = True
                continue
        remaining_lines.append(line)

with open(SOURCE, "w", newline="") as f:
    f.writelines(remaining_lines)
```

MozReview-Commit-ID: ACewvZ9ztWp

--HG--
extra : source : 7f167f9affd954da907d1da307ebc82be4b85911
2018-06-27 15:34:29 +10:00
Xidorn Quan
cd114ec151 Bug 1471114 part 3 - Drop the reference to getter functions we don't call. r=emilio
MozReview-Commit-ID: IbBayOwsjNX

--HG--
extra : source : 82ce1f7b7fd21c406cf61726c78de5f120028e35
2018-06-27 15:34:29 +10:00
Xidorn Quan
dca9867a8f Bug 1471114 part 2 - Generate ComputedStyleMap entry list from property data. r=emilio
This changes the order of properties returned from gCS. The old order
doesn't make much sense, and other browsers don't agree on an identical
order either, so it should be trivial to change it. Also the spec isn't
super clear / useful in this case.

Several -moz-prefixed properties are excluded from the list due to their
being internal. I suspect they are never accessible anyway, so probably
nothing gets changed by this.

MozReview-Commit-ID: 9LfangjpJ3P

--HG--
extra : source : 879a7265c35f51c5954d8a44ccd374a606ecba0e
2018-06-27 15:34:29 +10:00
Xidorn Quan
d1caa962ed Bug 1471114 part 1 - Move CSSPropFlags prefix generation into GenerateServoCSSPropList.py. r=emilio
MozReview-Commit-ID: E5dl9V2B2dq

--HG--
extra : source : 6e2448ce3f4d9965749298a575795dfab926b9cb
2018-06-27 15:34:29 +10:00
Xidorn Quan
cca2036556 Bug 1471116 - Use nsCSSProps::kPropertyPrefTable for pref callback register of nsComputedDOMStyle. r=emilio
MozReview-Commit-ID: 7VvFGYi12te

--HG--
extra : rebase_source : de146bf00f8902ba01278cc70ddf231272fc5cee
2018-06-26 14:06:46 +10:00
Morgan Rae Reschenberg
41f649ace3 Bug 1471267 - Update some baseline-querying utility functions to bail on frames that have 'contain:size'. r=dholbert
MozReview-Commit-ID: Bk2P73tlRqG

--HG--
extra : rebase_source : f20c751b9dd902f295a2a2181a13453451327e2c
2018-06-26 15:34:15 -07:00
Emilio Cobos Álvarez
688e2c1d75 Bug 1464782: Put offset-* aliases behind a pref. r=xidorn
MozReview-Commit-ID: Hl6Muim3wVH
2018-06-27 16:12:04 +02:00
Emilio Cobos Álvarez
d73b4b0679 Bug 1464782: Rename offset-* logical properties to inset-*. r=xidorn
MozReview-Commit-ID: BW44sru99RF
2018-06-27 16:12:01 +02:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Tiberius Oros
eacc3eda3e Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-28 01:15:41 +03:00
Stephen A Pohl
1f2e716a79 Bug 1466335: Automatically switch to the appropriate Firefox theme based on the macOS dark mode system preference. r=dao,mstange 2018-06-27 13:59:21 -04:00
Emilio Cobos Álvarez
c7d35aa526 Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug
MozReview-Commit-ID: DsNuF7GAflJ
2018-06-26 18:22:06 +02:00
Doug Thayer
864c89631c Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : 4f8dd2996d820fdb5a07afe544be5e2d6ca6a5c7
2018-04-13 11:04:47 -07:00
Doug Thayer
488eb2eb9c Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : 61afc5481dc8ec34caba1886bd74200cf3659fb4
2018-04-13 11:04:47 -07:00
Emilio Cobos Álvarez
9e9546ecb2 Bug 1471045: Don't flush layout if the ready promise is not resolved yet. r=heycam
This prevents FOUC, and also matches the chromium logic:

  https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/css/font_face_set_document.cc?l=105&rcl=e70e652d516c7d14d50e547aae2da1690c4ae54c

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

MozReview-Commit-ID: A6m5fAMXhae
2018-06-26 15:32:03 +02:00
Olli Pettay
abf54817b9 Bug 1428246 - The attributeChangedCallback is fired twice for the *first* style attribute change, r=peterv
The idea with this patch is that style code will first call
InlineStyleDeclarationWillChange before style declaration has changed, and SetInlineStyleDeclaration once it has changed.

In order to be able to report old attribute value, InlineStyleDeclarationWillChange reads the value and also calls AttributeWillChange (so that DOMMutationObserser can grab the old value). Later SetInlineStyleDeclaration passes the old value to
SetAttrAndNotify so that mutation events and attributeChanged callbacks are handled correctly.

Because of performance, declaration can't be cloned for reading the old value. And that is why the recently-added callback is used to detect when declaration is about to change (bug 1466963 and followup bug 1468665).

To keep the expected existing behavior, even if declaration isn't changed, but just a new declaration was created (since there wasn't any), we need to still run all these
willchange/set calls. That is when the code has 'if (created)' checks.

Since there are several declaration implementation and only nsDOMCSSAttributeDeclaration needs the about-to-change callback, GetPropertyChangeClosure is the one to initialize the callback closure, and the struct which is then passes as data to the closure.

Apparently we lost mutation event testing on style attribute when the pref was added, so test_style_attr_listener.html is modified to test both pref values.

--HG--
extra : rebase_source : 9e605d43f22e650ac3912fbfb41abb8d5a2a0c8f
2018-06-26 12:54:00 +03:00
Margareta Eliza Balazs
c866c30fcf Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-26 12:24:32 +03:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Hiroyuki Ikezoe
0b9b61abdd Bug 1418806 - Try to allocate possible size for AnimationValueMap before composing. r=birtles
The EffectSet count does not exactly represent the count what we really need
for AnimationValueMap, but in most cases it matches.  For example;

1) The element has two different keyframes animations

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { transform: rotate(360deg); }
 }

 In this case the number matches.

2) The element has two animations but both keyframes have the same CSS property

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { opacity: 0.1; }
 }

 In this case the number doesn't match, moreover it results more memory than we
 ever needed, but this case is presumably less common.

3) The element has an animation having keyframes for two different CSS
   properties.

 @keyframes anim {
   from { opacity: 0; transform: rotate(360deg); }
 }

 In this kind of cases, the number doesn't match.  But even so, this patch
 reduces the opportunities that the AnimationValueMap tries to allocate a new
 memory (i.e. less opportunities on expanding the map).

Note that when the hash map is expanded, we do allocate a new RawTable with the
new size then replace the old one with the new one [1], so I believe this
change will reduce the crash rate to some extent.

[1] https://hg.mozilla.org/mozilla-central/file/15c95df467be/servo/components/hashglobe/src/hash_map.rs#l734

MozReview-Commit-ID: 6tcF9aqXh7a

--HG--
extra : rebase_source : 366989d3a2756f5a5711503a57f42f3b746d93a5
2018-06-26 11:08:24 +09:00
Noemi Erli
aaac9a77dd Merge inbound to mozilla-central. a=merge 2018-06-25 22:02:08 +03:00
Emilio Cobos Álvarez
80e6dac54a Bug 1449806: followup: Fix a typo that I made while addressing review comments. r=me CLOSED TREE
MozReview-Commit-ID: 8EFhj9Gi5et
2018-06-25 11:36:25 +02:00
Emilio Cobos Álvarez
6b12f2076c Bug 1449806: Remove MOZ_STYLO_* macros. r=xidorn
Yay :)

MozReview-Commit-ID: 1XKS5fSQkHs
2018-06-25 11:14:46 +02:00
Emilio Cobos Álvarez
47ebd819b3 Bug 1449806: Merge {Servo,Generic}SpecifiedValues into MappedDeclarations. r=xidorn
The idea would be that this header is only included in cpp files, thus it's ok
to include ServoBindings, etc.

MozReview-Commit-ID: EgQEsR0cZd4
2018-06-25 11:14:39 +02:00
Emilio Cobos Álvarez
53db39a155 No bug - Fix a typo (synchrously). r=me
MozReview-Commit-ID: K4So4S7XmIZ
2018-06-24 04:02:05 +02:00
Hiroyuki Ikezoe
fbf7fab2f3 Bug 1430884 - Throttle transform animations without %0 or 100% keyframe. r=birtles
MozReview-Commit-ID: 3vLAlSkLz97

--HG--
extra : rebase_source : 7a82246699f3858757dce887e0d2154d165c0da1
2018-06-25 18:29:28 +09:00
Margareta Eliza Balazs
e1ea59be60 Backed out 9 changesets (bug 1430884) for frequently failing dom/animation/test/mozilla/test_restyles.html on android-em-4-3-armv7-api16 debug
Backed out changeset 262dbc8daac1 (bug 1430884)
Backed out changeset c3f9f3f66a98 (bug 1430884)
Backed out changeset 39e1c4e3c8c9 (bug 1430884)
Backed out changeset 4505e3f87b2e (bug 1430884)
Backed out changeset e7e8977e0e92 (bug 1430884)
Backed out changeset 6dbae2b8957d (bug 1430884)
Backed out changeset 1e047fbcae2a (bug 1430884)
Backed out changeset 52be07f10eaa (bug 1430884)
Backed out changeset cec68a5b01da (bug 1430884)

--HG--
extra : rebase_source : 9877dce2438d42eca99898b22c95ecc04dbd748f
2018-06-25 12:23:59 +03:00
Hiroyuki Ikezoe
f6072c5630 Bug 1470792 - Backout the changeset that introduced UpdateContainingBlock change hint for mask changes. r=heycam
MozReview-Commit-ID: JF88VkutUgG

--HG--
extra : rebase_source : fbfebc74ae874c977a91c9e48c962c951d4f43e3
2018-06-25 15:42:38 +09:00
Emilio Cobos Álvarez
a79eb06b7c Bug 1470420: followup: Try to fix the build in some compilers. r=me CLOSED TREE
MozReview-Commit-ID: Hc7LRfl16ED
2018-06-22 17:45:26 +02:00
Emilio Cobos Álvarez
e54eee09d0 Bug 1470420: Fix some minor style inconsistencies I stumbled upon. r=xidorn
MozReview-Commit-ID: KKnIXoQthdG
2018-06-22 17:23:02 +02:00
Emilio Cobos Álvarez
9caf38a872 Bug 1470420: Change an nsAutoPtr to UniquePtr in the Loader. r=xidorn
MozReview-Commit-ID: 4KnjxHOybmG
2018-06-22 17:23:01 +02:00
Emilio Cobos Álvarez
da6e9b176a Bug 1470420: Cleanup ParseSheet. r=xidorn
MozReview-Commit-ID: 3RtTHSo9Z1G
2018-06-22 17:23:00 +02:00
Emilio Cobos Álvarez
79401ad550 Bug 1470420: Make Stop() infallible. r=xidorn
MozReview-Commit-ID: KScKUyUSkjj
2018-06-22 17:22:59 +02:00
Emilio Cobos Álvarez
c3f12726ac Bug 1470420: Make InsertChildSheet infallible. r=xidorn
MozReview-Commit-ID: 4bkwzSZ2ByZ
2018-06-22 17:22:58 +02:00
Emilio Cobos Álvarez
ee59da45b2 Bug 1470358: Deduplicate sheet insertion code between document and shadow root. r=heycam
Summary: Sort of straight-forward cleanup.

Test Plan: Covered by existing tests.

Reviewers: heycam

Reviewed By: heycam

Bug #: 1470358

Differential Revision: https://phabricator.services.mozilla.com/D1763
2018-06-22 12:57:37 +02:00
Emilio Cobos Álvarez
c228998b4f Bug 1410578: Make <link rel="stylesheet"> work in shadow trees. r=heycam
Summary: Somewhat straight-forward, mostly removing special-casing.

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

MozReview-Commit-ID: 6f8duD4pGrl
2018-06-22 04:15:56 +02:00
Emilio Cobos Álvarez
c3ac8b8b46 Bug 1470150: noscript rules should not apply to non-HTML elements. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D1749

MozReview-Commit-ID: JhNFlHbtDw6
2018-06-22 03:48:34 +02:00