Closed Bug 1895179 Opened 2 years ago Closed 6 months ago

Mark !important values for supported properties in @position-try as invalid

Categories

(DevTools :: Inspector: Rules, task, P3)

task

Tracking

(firefox147 fixed, firefox148 fixed)

RESOLVED FIXED
148 Branch
Tracking Status
firefox147 --- fixed
firefox148 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

From https://drafts.csswg.org/css-anchor-position-1/#fallback-rule:

It is invalid to use !important on the properties in the <declaration-list>. Doing so causes the property it is used on to become invalid, but does not invalid the @property-try rule as a whole.

Priority: -- → P3
Summary: Mark !important properties in @position-try invalid → Mark invalid values for supported properties in @position-try as invalid
Summary: Mark invalid values for supported properties in @position-try as invalid → Mark !important values for supported properties in @position-try as invalid

In some cases, a declaration will be valid for a rule type, and not for another
rule type. At the moment, InspectorUtils.supports will only watch the validity
of the passed string for CssRuleType::Style.
This patch adds a rule option to SupportsOptions, from which we then
extract its type and pass it to Servo_CSSSupports so we can check the validity
of a string against a specific rule type.

Test cases are added in layout/inspector/tests/test_supports.html.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

This will make it possible to check the validity of a declaration for a specific rule,
for example, we'll be able to detect !important invalid declaration value in @position-try rules.

The assertion was hard to parse and not working as expected.

Attachment #9531078 - Attachment description: WIP: Bug 1895179 - [devtools] Use the new `rule` option when calling `InspectorUtils.supports`. r=#devtools. → Bug 1895179 - [devtools] Mark declaration with !important values as invalid in @position-try rules. r=#devtools.

Comment on attachment 9531077 [details]
Bug 1895179 - Add rule SupportsOptions for InspectorUtils.supports to check support for a given rule type. r=#layout-reviewers.

Revision D275192 was moved to bug 2004379. Setting attachment 9531077 [details] to obsolete.

Attachment #9531077 - Attachment is obsolete: true
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5a7bbc46f6da https://hg.mozilla.org/integration/autoland/rev/c2fb7edc024a [devtools] Fix checking valid declaration in checkRuleViewContent. r=devtools-reviewers,bomsy https://github.com/mozilla-firefox/firefox/commit/3e26fc1cb82c https://hg.mozilla.org/integration/autoland/rev/85db22e38540 [devtools] Mark declaration with !important values as invalid in @position-try rules. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch

The assertion was hard to parse and not working as expected.

Original Revision: https://phabricator.services.mozilla.com/D275228

Attachment #9532274 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: This stack of patches adds minimal DevTools support for @position-try rules, which are part of Anchor positioning, which was enabled by default in 147.
    Without this, users might think that the implementation is incomplete and that @position-try is not supported.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: -
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is DevTools only, covered by tests.
    Even though this is not a small change, we're not doing anything extraordinarily new, mostly just adding on existing mechanism in DevTools
  • String changes made/needed: inactive-css-at-position-try-not-supported was added
  • Is Android affected?: yes
Attachment #9532275 - Flags: approval-mozilla-beta?
Flags: in-testsuite+
Attachment #9532274 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9532275 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: