These issues were previously ignored due to the nature of our global import
rules. They need to be fixed before that rule can be updated.
MozReview-Commit-ID: DCChktTc5TW
This is pretty simple... finding the best locations for the probes was the
struggle here.
In order to land these probes before the freeze the test for these events will
be created as part of bug 1456073.
MozReview-Commit-ID: 7hIfbD3wQ1I
***
Bug 1454202: Part 1a - Auto-replace uses of callback-based AddonManager APIs with Promise-based versions. r=aswan
This was done using the following script:
https://bitbucket.org/kmaglione/m-c-rewrites/src/4cd5ae959765d0965dd0cc635de3e953bf46edbb/processors/aom-api-generators.jsm
MozReview-Commit-ID: 8hobLz15a66
***
Bug 1454202: Part 1b - Manually fix eslint errors after auto-rewrite. r=aswan
This also deletes an obsolete test whose xpcshell variant was already deleted.
MozReview-Commit-ID: DM9W9Q2SVIE
***
Bug 1454202: Part 1c - Manually fix non-eslint issues after auto-rewrite. r=aswan
MozReview-Commit-ID: DtMscWZuExc
There are some extra hoops here because devtools has a lint to prevent Cu.importGlobalProperties, which is the normal way one would import a WebIDL constructor.
MozReview-Commit-ID: 2mdNI6N1z5B
After switching to Stylo, animation is handled by Servo, and thus it no
longer relies on the animation type recorded in nsCSSPropList.h, and
devtools become the only consumer of that information.
This patch puts a map of longhands to animation types into devtools
instead. The map is extracted from nsCSSPropList.h by the script below
based on the logic of nsDOMWindowUtils::GetAnimationTypeForLonghand.
There are two reasons that I don't port this into Servo:
First, Servo doesn't have a concept of property-level animation type.
Animation change in Servo is directly encoded into value types. It means
porting this to Servo would require creating a new concept purely for
devtools. It's not great because that data doesn't reflect how animation
is handled in the engine, and people may keep forgetting to give proper
animation type to new animatable types they add.
Second, the handling of animation type in devtools also looks rather
arbitrary to me. For example, eStyleAnimType_Corner_* types are actually
two coordinate values, bug GetAnimationTypeForLonghand returns "coord"
for them, and devtools just parses the first value and uses it. This
means the animation type here is really more closely related to how
devtools handles the value, rather than how the style engine does so.
Given above, I decided to put the list into devtools rather than encode
the information into Servo code. To encourage people to think about
animation handling in devtools for new properties, there is also a new
test added to ensure every property has a devtools animation type.
The content of ANIMATION_TYPE_FOR_LONGHANDS is generated via running
the following script in layout/style:
```python
#!/usr/bin/env python3
import subprocess
from collections import defaultdict
ANIMTYPE_MAPPING = {
"Custom": "custom",
"Coord": "coord",
"Sides_Top": "coord",
"Sides_Right": "coord",
"Sides_Bottom": "coord",
"Sides_Left": "coord",
"Corner_TopLeft": "coord",
"Corner_TopRight": "coord",
"Corner_BottomRight": "coord",
"Corner_BottomLeft": "coord",
"nscoord": "length",
"float": "float",
"Color": "color",
"ComplexColor": "color",
"PaintServer": "paintServer",
"Shadow": "shadow",
"Discrete": "discrete",
"None": "none",
}
input = b"""
#define CSS_PROP(name, id, method, flags, pref, \\
variant, kwtable, animtype) name, flags, animtype
#include "nsCSSPropList.h"
"""
props = subprocess.check_output(["clang", "-E", "-P", "-"], input=input)
props = props.decode("ascii")
result = defaultdict(list)
for line in props.splitlines():
line = line.strip()
if not line:
continue
name, flags, animtype = line.split(", ")
assert animtype.startswith("eStyleAnimType_")
if "CSS_PROPERTY_PARSE_INACCESSIBLE" in flags:
continue
animtype = ANIMTYPE_MAPPING[animtype[15:]]
result[animtype].append(name)
print("[")
for animtype, names in result.items():
print(' ["{}", new Set(['.format(animtype))
for name in names:
print(' "{}",'.format(name))
print(" ])],")
print("]")
```
MozReview-Commit-ID: BGiGq0jUgG5
- Compute constraints so that a dragged marker stays visible with the viewport.
- Constrain dragging of marker to the viewport of the node's host window.
- If the marker is visible outside of the node host's viewport (ex:
shapes within a smaller iframe nested in a larger document), do not
constrain that marker and allow dragging it outside the viewport.
If dragging starts while the marker is within its intended viewport,
do constrain it to that viewport.
MozReview-Commit-ID: 9JyEfseSLXW
The previous implementation treated any zero coordinate as pixels,
regardless of its unit type. For example, 0% would be converted to 0px.
This changed the shape value resulting in unintentional unit mismatch
after editing a coordinate which started off as 0% or 0em or 0vh, etc.
This patch fixes that and preserves the unit type for zero coordinates.
It changes the implementation of isUnitless() to return false for values
like 0%, 0px, 0em, 0.00000%, etc.
It introduces getUnitToPixelRatio() to get the ratio by which to
multiply a pixel value to convert it to the given unit during shape
editing operations (point move, scale, translate, rotate, etc.)
The ratio is constant by unit type. Previously, this ratio was
calculated in-place for each unit value. Values which started as zero,
always resulted in a ratio equal to zero. This multiplied with a pixel
value resulted zero. So the previous code defaulted to ratio of 1 when
the ratio was zero, but this meant that a 1:1 ratio between pixels and
another unit type (%, em, vh) would result in disproportionate
shape changes (1px of mouse travel would result in 1em). This is why
isUnitless() originally discarded the original unit from a zero
coordinate and replaced it with pixels; to account for this fallback
ratio of 1.
MozReview-Commit-ID: 49tyLfYjkLO
The previous implementation treated any zero coordinate as pixels,
regardless of its unit type. For example, 0% would be converted to 0px.
This changed the shape value resulting in unintentional unit mismatch
after editing a coordinate which started off as 0% or 0em or 0vh, etc.
This patch fixes that and preserves the unit type for zero coordinates.
It changes the implementation of isUnitless() to return false for values
like 0%, 0px, 0em, 0.00000%, etc.
It introduces getUnitToPixelRatio() to get the ratio by which to
multiply a pixel value to convert it to the given unit during shape
editing operations (point move, scale, translate, rotate, etc.)
The ratio is constant by unit type. Previously, this ratio was
calculated in-place for each unit value. Values which started as zero,
always resulted in a ratio equal to zero. This multiplied with a pixel
value resulted zero. So the previous code defaulted to ratio of 1 when
the ratio was zero, but this meant that a 1:1 ratio between pixels and
another unit type (%, em, vh) would result in disproportionate
shape changes (1px of mouse travel would result in 1em). This is why
isUnitless() originally discarded the original unit from a zero
coordinate and replaced it with pixels; to account for this fallback
ratio of 1.
MozReview-Commit-ID: 49tyLfYjkLO
While at it, remove useless charset rule lookups, since charset rules aren't
part of the OM, and have no effect at all anymore.
MozReview-Commit-ID: EefGrOZvmm7
`Infinity` object can't be serialized via structuredclone and so actors
should not communicate such object. Fix this code which meant to prevent that.
MozReview-Commit-ID: 3TpldcSE88F
This feature introduced in bug 1036949 is not longer used as it was designed for XUL add-ons.
The setFormProperty method was prevently Node's form from getting correctly
serialized between processes.
MozReview-Commit-ID: AiNnHSkwsEM