Check if the attribute value does match the definedd attr() attr-type parameter
to see if the attribute value or the fallback is being used.
In the attr() tooltip, indicate when the attribute value doesn't match the specified
type.
Differential Revision: https://phabricator.services.mozilla.com/D301490
Don't put the (undefined) stack entry function name in nestedFunctions,
this would prevent the data-function-expression attribute to be set
properly on the parent stack entry when closing it.
Differential Revision: https://phabricator.services.mozilla.com/D299989
We add the image function in the COLOR_TAKING_FUNCTIONS Set and add a test case
to make sure we show the color swatch for the color parameter.
Differential Revision: https://phabricator.services.mozilla.com/D299949
This is moving the last special cases for Function tokens to onCloseParenthesis,
which means we can also remove `#parseVariable`, `#parseMatchingParens` and the
`stopAtComma` parameter for `#doParse`.
This has the nice side effects of adding color swatches for some declarations
where we didn't use to be able to compute those (results of `color-mix()`,
`contrast-color()`, relative color syntax `from` color, `var()` with fallback),
which are reflected in the changes in the tests.
With this final change, we also needed to change how we're handling font family
names so they can fit nicely in this new design. So instead of keeping track
of the different font family parts, and then appending them to `parts`, we
now keep a single index when we detect a font family name, and when we find
a delimiter or a closing parenthesis, we wrap the meaningful part of the
font family in a dedicated element.
As we needed something similar to what we have for stack entry for fonts, in order
to map a "part" to multiple tokens, we update the `CLOSED_STACK_ENTRY` "token",
renaming it to better convey what it does, and renaming the `stackEntry` into
a more generic `data` property.
Differential Revision: https://phabricator.services.mozilla.com/D296786
We still want to share code between proper url() and UnquotedUrl/BadUrl, so we
transform `#appendURL` into `#createURLElements` that we can use in the new
function that handle closing the url function.
It makes us throw away the part that were computed before, but that's quite limited
and I'd rather pay this cost than having to maintain 2 different places to handle
URLs.
Differential Revision: https://phabricator.services.mozilla.com/D296127
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Bug 2033191 made sure we only call ownerGlobal on nodes.
As per the discussion in dev-platform, the front-end ~always wants
.documentGlobal. This removes ownerGlobal from the bindings. Following
patch will rename internal GetOwnerGlobal in gecko to GetRelevantGlobal
as per the HTML spec terminology.
Differential Revision: https://phabricator.services.mozilla.com/D297183
Close the stack entry once we consumed the data that those function returned
so we can have the parts in the stack entry directly.
This is meant to be temporary as the goal of this stack of patches is to only
handle functions from `#onCloseParenthesis`, but in the meantime, this is helping
migrating other functions to it.
We also weren't properly adding stack entries for parenthesis blocks which might
lead to some issues (not sure which ones, but at least it seems more correct to
actually do it).
Differential Revision: https://phabricator.services.mozilla.com/D296090
This is also adding some test cases for shapes that weren't covered yet so we
can be confident about the refactoring we're doing for Bug 2034338 later in the stack.
Differential Revision: https://phabricator.services.mozilla.com/D295869
When an attr() function is used in the fallback part for an upper attr() function,
we need to properly style it when the fallback isn't used.
Since we're working with the modern syntax here, we take this as an opportunity
to properly style the whole first parameter, type data included, when the attribute
isn't set.
Test cases are added to properly cover this.
Differential Revision: https://phabricator.services.mozilla.com/D295347
Update the implementation of `waitForDOM` to use `waitFor` instead of mutations.
Remove `waitForDOMIfNeeded` in netmonitor, which becomes the standard behavior for `waitForDOM` now.
Add meaningful logs when starting to wait and when resolving or rejecting.
Differential Revision: https://phabricator.services.mozilla.com/D294427
Update the implementation of `waitForDOM` to use `waitFor` instead of mutations.
Remove `waitForDOMIfNeeded` in netmonitor, which becomes the standard behavior for `waitForDOM` now.
Add meaningful logs when starting to wait and when resolving or rejecting.
Differential Revision: https://phabricator.services.mozilla.com/D294427
Add a dedicated autocomplete function in InplaceEditor that goes through the function
tokens and provide the values that could be used at this point.
A test is added with extensive test cases to make sure we handle the different
matrix of possibilities the linear-gradient() function accepts.
Differential Revision: https://phabricator.services.mozilla.com/D286519
In Bug 1854104 I made a change to in `#parseMatchingParens` to return all the
tokens we parsed, including whitespaces.
This threw off the logic for parsing `var()`, so we're reverting this.
Because of this, we need a small adjustment in the function responsible to
parse `attr()` (adding a space after we handle a Comma).
Differential Revision: https://phabricator.services.mozilla.com/D288689
Set `layout.css.color-mix-multi-color.enabled` to true (it's only enabled on Nightly
at the moment), so the new assertions added for multicolor color-mix still work.
Differential Revision: https://phabricator.services.mozilla.com/D288910
Add a dedicated autocomplete module for the InplaceEditor.
This doesn't require any work on the Rules view side, as we're already
getting anchor names from the previous patch in the stack.
Differential Revision: https://phabricator.services.mozilla.com/D287965
Expose a new cropDimensionsIfNeeded helper from ScreenshotUtils and reuse this in devtools capture-screenshot directly.
This will ensure the implementation remains in sync with the screenshot one.
Differential Revision: https://phabricator.services.mozilla.com/D262533
This adds color spaces and keyword autocompletion for the `color()` function,
both for the absolute and the relative syntax.
Differential Revision: https://phabricator.services.mozilla.com/D284609
Add specific class from the OutputParser for the attribute name and fallback
spans so they're easier to target in tests.
Refactor and augment browser_rules_attr.js so it covers showing the preview
tooltip.
Differential Revision: https://phabricator.services.mozilla.com/D282021
This adds unmatched class to the attribute name or the fallback depending
on the existence of the attribute (provided via a `getAttributeValue` option.
In `#parseMatchingParens`, we know also return whitespace tokens so we can
reconstruct the authored value properly from it.
Test cases are added in `browser_outputparser.js` to cover this.
Differential Revision: https://phabricator.services.mozilla.com/D280212
Since we're now avoiding unnecessary work, we were missing events in the
openInspectorSidebarTab test helper.
To fix this, we make ToolSidebar#select return a Promise that resolves once
the select is done (or directly if the panel was already selected).
Callsites of ToolSidebar#select are updated accordingly.
We also add initialized promises to both the BoxModel and LayoutView so we
can wait on those instead of waiting for specific events.
We stop emitting the `grid-panel-updated` event as it's not listened for anymore.
Differential Revision: https://phabricator.services.mozilla.com/D278942
The `gBrowser.reloadTab` method was doing a very light reload,
which could preserve iframe overriden locations.
The new method ensures we load the original HTML content back,
this seems to also have an impact on keep-alive which is not longer guaranteed.
Only supports reloading the currently selected tab, to better replicate
real user scenarios. But also to comply to `BrowserCommands.reload`,
which only supports reloading the selected tab.
Also tune the har test, now that requests are really cancelled
and we may try to fetch reponse content for such request.
Differential Revision: https://phabricator.services.mozilla.com/D277433