Prevent `anchor()`'s inner keywords from suggested, and make the suggestion of
`anchor()` only if the relevant pref is flipped.
Differential Revision: https://phabricator.services.mozilla.com/D222018
This adds the pasring support for:
1. `::view-transition`
2. `::view-transition-group(name)`
3. `::view-transition-image-pair(name)`
4. `::view-transition-old(name)`
5. `::view-transition-new(name)`
The `name` here is a `<custom-ident>` or `*`.
Differential Revision: https://phabricator.services.mozilla.com/D219713
In some cases, DevTools might want to get the property definition of a given registered property,
so we're adding a new InspectorUtils method for this.
It returns null when there is no registered property matching the passed name.
A test is added to ensure this behaves as expected.
Differential Revision: https://phabricator.services.mozilla.com/D215317
Update the API, `nspectorUtils.getCSSStyleRules`. Add one extra
argument so the user can choose whether we should return the starting
style, for a given element, at this moment.
Differential Revision: https://phabricator.services.mozilla.com/D209318
Also, in EventStateManager, convert `ComputeScrollTarget()` and
`ComputeScrollTargetAndMayAdjustWheelEvent()` to return `ScrollContainerFrame*`
so that we can drop more unnecessarily `do_QueryFrame`.
Due to removing `nsIScrollableFrame` forward declaration in DOM headers, we have
to add `nsIScrollableFrame` forward declaration temporarily in
nsMenuPopupFrame.h to make this patch compile, but we'll remove it once we
remove `nsIScrollableFrame` under layout/.
Differential Revision: https://phabricator.services.mozilla.com/D211496
Also, in EventStateManager, convert `ComputeScrollTarget()` and
`ComputeScrollTargetAndMayAdjustWheelEvent()` to return `ScrollContainerFrame*`
so that we can drop more unnecessarily `do_QueryFrame`.
Due to removing `nsIScrollableFrame` forward declaration in DOM headers, we have
to add `nsIScrollableFrame` forward declaration temporarily in
nsMenuPopupFrame.h to make this patch compile, but we'll remove it once we
remove `nsIScrollableFrame` under layout/.
Differential Revision: https://phabricator.services.mozilla.com/D211496
For the selector highlighter, we were retrieving the desugared selector of each
displayed rule, and using the selector text in querySelectorAll to retrieve the
elements matching the rule.
This can be very expensive, especially for deeply nested rule, for a feature that
might not even be used.
This patch is adding a method which takes a root node, and will return the
elements inside the root node that match the rule's selectors.
We're only exposing the method that existed in glue.rs to get the SelectorList
of a given Rule, and call `Servo_SelectorList_QueryAll` with it to get our NodeList.
A test file is added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D208363
In some cases, it can be more useful to only get the token value than the whole
token text (e.g. for 'Function`, where the value is the function name, while
the text includes the opening parenthesis)
Refactor `test_lexer` to better test the tokens we get, including their value property.
Differential Revision: https://phabricator.services.mozilla.com/D207400
This new InspectorCSSParser makes use of the cssparser crate so DevTools end
up using the same code as the CSS engine.
At the moment, we can't get the token start and end offsets, so we create
a JS wrapper class to compute them in JS. This might be removed if we get
a way to retrieve utf16 position from the cssparser.
The existing lexer xpcshell test is modified so it can run against both js-based
and rust-based lexers.
Differential Revision: https://phabricator.services.mozilla.com/D202909
We were getting a line byte index for the
actual char matching the line we want, but
we actually need the index _after_ that
new line char.
A test case is added to cover this fix.
Differential Revision: https://phabricator.services.mozilla.com/D207156
`InspectorUtils.getRuleBodyTextOffset` was returning bytes position, and we
were using them directly in Javascript `substring`, which causes problem
with non-ascii chars.
Instead of returning offsets to compute the rule string, we directly return
the string from InspectorUtils which is easier to work with.
Differential Revision: https://phabricator.services.mozilla.com/D204523
The next patch modifies `getRuleText` so it only returns the text, and no
longer the offset at which the rule starts.
The only consumer of the returned offset was in `StyleRuleActor#setRuleText`,
so we migrate this directly to a InspectorUtils method to avoid mixing JS string
indexes with Rust bytes position.
Differential Revision: https://phabricator.services.mozilla.com/D204522
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.
Differential Revision: https://phabricator.services.mozilla.com/D195687
Implement the style part for shape(). Besides, update some issues in the
test file, e.g. avoid using viewport height so we get the fixed result
on different devices.
I will refactor `PathCommand` to let it be a specialization of
`GenericShapeCommand` in the following path.
Differential Revision: https://phabricator.services.mozilla.com/D202882
We were returning the whole list of rules for a given stylesheet, and then
picking the at-rules we wanted in JS.
This patch make it so that the InspectorUtils method will only return the
at-rules we want directly, so we're building a smaller array of rule in the end.
Since `getStyleSheetRuleCountAndAtRules` also need to return the total number
of rules, this adds a simple `InspectorUtils.getStyleSheetRulesCount` method that
does that.
Differential Revision: https://phabricator.services.mozilla.com/D203878
We were returning the whole list of rules for a given stylesheet, and then
picking the at-rules we wanted in JS.
This patch make it so that the InspectorUtils method will only return the
at-rules we want directly, so we're building a smaller array of rule in the end.
Since `getStyleSheetRuleCountAndAtRules` also need to return the total number
of rules, this adds a simple `InspectorUtils.getStyleSheetRulesCount` method that
does that.
Differential Revision: https://phabricator.services.mozilla.com/D203878
This will allow calling InspectorUtils.ColorTo("red", "lab") and
receive {color: "lab(54.3 80.8 69.9)", components: [54.3, 80.8, 69.9, 1.0], adjusted: false}.
The adjusted value is always "false", because gamut checking and mapping
is not supported at the moment. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1823363
Depends on D192673
Differential Revision: https://phabricator.services.mozilla.com/D169942