Bug 1868316 - Remove user-find, make inert not findable. r=dholbert

As per the HTML spec.

Differential Revision: https://phabricator.services.mozilla.com/D201906
This commit is contained in:
Emilio Cobos Álvarez 2024-02-16 20:18:06 +00:00
parent 3224438b92
commit 47165ebb0f
17 changed files with 15 additions and 155 deletions

View file

@ -180,7 +180,6 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [
"transform-box", "transform-box",
"transform-style", "transform-style",
"unicode-bidi", "unicode-bidi",
"user-find",
"-moz-user-focus", "-moz-user-focus",
"-moz-user-input", "-moz-user-input",
"-moz-user-modify", "-moz-user-modify",

View file

@ -196,8 +196,8 @@ let runTests = t.step_func_done(function() {
// TODO(emilio): This might be worth discussing in the spec. For now // TODO(emilio): This might be worth discussing in the spec. For now
// hard-coding our implementation. // hard-coding our implementation.
testFindable(false, "find me", ` testFindable(false, "find me", `
Do you find <span style="user-find: none">not findable</span> me? Do you find <span inert>not findable</span> me?
`, "boundary-crossing user-find: none"); `, "boundary-crossing inert");
}); });
window.onload = function() { window.onload = function() {

View file

@ -107,7 +107,7 @@ use.counter:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 2311 use counter metrics (excludes denominators). # Total of 2307 use counter metrics (excludes denominators).
# Total of 358 'page' use counters. # Total of 358 'page' use counters.
use.counter.page: use.counter.page:
svgsvgelement_getelementbyid: svgsvgelement_getelementbyid:
@ -13973,7 +13973,7 @@ use.counter.worker.service:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 51 'deprecated operations (page)' use counters. # Total of 50 'deprecated operations (page)' use counters.
use.counter.deprecated_ops.page: use.counter.deprecated_ops.page:
mutation_event: mutation_event:
type: counter type: counter
@ -14825,7 +14825,7 @@ use.counter.deprecated_ops.page:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 51 'deprecated operations (document)' use counters. # Total of 50 'deprecated operations (document)' use counters.
use.counter.deprecated_ops.doc: use.counter.deprecated_ops.doc:
mutation_event: mutation_event:
type: counter type: counter
@ -15677,7 +15677,7 @@ use.counter.deprecated_ops.doc:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 697 'CSS (page)' use counters. # Total of 696 'CSS (page)' use counters.
use.counter.css.page: use.counter.css.page:
css_align_content: css_align_content:
type: counter type: counter
@ -17736,23 +17736,6 @@ use.counter.css.page:
send_in_pings: send_in_pings:
- use-counters - use-counters
css_user_find:
type: counter
description: >
Whether a page used the CSS property user-find.
Compare against `use.counter.top_level_content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
css_user_select: css_user_select:
type: counter type: counter
description: > description: >
@ -27528,7 +27511,7 @@ use.counter.css.page:
send_in_pings: send_in_pings:
- use-counters - use-counters
# Total of 697 'CSS (document)' use counters. # Total of 696 'CSS (document)' use counters.
use.counter.css.doc: use.counter.css.doc:
css_align_content: css_align_content:
type: counter type: counter
@ -29587,23 +29570,6 @@ use.counter.css.doc:
send_in_pings: send_in_pings:
- use-counters - use-counters
css_user_find:
type: counter
description: >
Whether a document used the CSS property user-find.
Compare against `use.counter.content_documents_destroyed`
to calculate the rate.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1852098
notification_emails:
- dom-core@mozilla.com
- emilio@mozilla.com
expires: never
send_in_pings:
- use-counters
css_user_select: css_user_select:
type: counter type: counter
description: > description: >

View file

@ -153,12 +153,6 @@ enum class StyleUserInput : uint8_t {
Auto, Auto,
}; };
// user-find
enum class StyleUserFind : uint8_t {
Auto,
None,
};
// user-modify // user-modify
enum class StyleUserModify : uint8_t { enum class StyleUserModify : uint8_t {
ReadOnly, ReadOnly,

View file

@ -2969,7 +2969,6 @@ nsStyleUI::nsStyleUI()
: mInert(StyleInert::None), : mInert(StyleInert::None),
mMozTheme(StyleMozTheme::Auto), mMozTheme(StyleMozTheme::Auto),
mUserInput(StyleUserInput::Auto), mUserInput(StyleUserInput::Auto),
mUserFind(StyleUserFind::Auto),
mUserModify(StyleUserModify::ReadOnly), mUserModify(StyleUserModify::ReadOnly),
mUserFocus(StyleUserFocus::Normal), mUserFocus(StyleUserFocus::Normal),
mPointerEvents(StylePointerEvents::Auto), mPointerEvents(StylePointerEvents::Auto),
@ -2985,7 +2984,6 @@ nsStyleUI::nsStyleUI(const nsStyleUI& aSource)
: mInert(aSource.mInert), : mInert(aSource.mInert),
mMozTheme(aSource.mMozTheme), mMozTheme(aSource.mMozTheme),
mUserInput(aSource.mUserInput), mUserInput(aSource.mUserInput),
mUserFind(aSource.mUserFind),
mUserModify(aSource.mUserModify), mUserModify(aSource.mUserModify),
mUserFocus(aSource.mUserFocus), mUserFocus(aSource.mUserFocus),
mPointerEvents(aSource.mPointerEvents), mPointerEvents(aSource.mPointerEvents),
@ -3043,8 +3041,7 @@ nsChangeHint nsStyleUI::CalcDifference(const nsStyleUI& aNewData) const {
hint |= NS_STYLE_HINT_VISUAL | kPointerEventsHint; hint |= NS_STYLE_HINT_VISUAL | kPointerEventsHint;
} }
if (mUserFocus != aNewData.mUserFocus || mUserInput != aNewData.mUserInput || if (mUserFocus != aNewData.mUserFocus || mUserInput != aNewData.mUserInput) {
mUserFind != aNewData.mUserFind) {
hint |= nsChangeHint_NeutralChange; hint |= nsChangeHint_NeutralChange;
} }

View file

@ -1742,7 +1742,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI {
private: private:
mozilla::StyleUserInput mUserInput; mozilla::StyleUserInput mUserInput;
mozilla::StyleUserFind mUserFind;
mozilla::StyleUserModify mUserModify; mozilla::StyleUserModify mUserModify;
mozilla::StyleUserFocus mUserFocus; mozilla::StyleUserFocus mUserFocus;
mozilla::StylePointerEvents mPointerEvents; mozilla::StylePointerEvents mPointerEvents;
@ -1755,8 +1754,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI {
return IsInert() ? mozilla::StyleUserInput::None : mUserInput; return IsInert() ? mozilla::StyleUserInput::None : mUserInput;
} }
mozilla::StyleUserFind UserFind() const { return mUserFind; }
mozilla::StyleUserModify UserModify() const { mozilla::StyleUserModify UserModify() const {
return IsInert() ? mozilla::StyleUserModify::ReadOnly : mUserModify; return IsInert() ? mozilla::StyleUserModify::ReadOnly : mUserModify;
} }

View file

@ -18,7 +18,6 @@ prefs = [
"layout.css.basic-shape-rect.enabled=true", "layout.css.basic-shape-rect.enabled=true",
"layout.css.basic-shape-xywh.enabled=true", "layout.css.basic-shape-xywh.enabled=true",
"layout.css.transform-box-content-stroke.enabled=true", "layout.css.transform-box-content-stroke.enabled=true",
"layout.css.user-find.enabled=true",
] ]
support-files = [ support-files = [
"animation_utils.js", "animation_utils.js",

View file

@ -3928,14 +3928,6 @@ var gCSSProperties = {
alias_for: "user-select", alias_for: "user-select",
subproperties: ["user-select"], subproperties: ["user-select"],
}, },
"user-find": {
domProp: "userFind",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: ["auto"],
other_values: ["none"],
invalid_values: [],
},
"user-select": { "user-select": {
domProp: "userSelect", domProp: "userSelect",
inherited: false, inherited: false,

View file

@ -8823,13 +8823,6 @@
mirror: always mirror: always
rust: true rust: true
# Whether user-find CSS property is enabled.
- name: layout.css.user-find.enabled
type: RelaxedAtomicBool
value: @IS_NIGHTLY_BUILD@
mirror: always
rust: true
# Should the :visited selector ever match (otherwise :link matches instead)? # Should the :visited selector ever match (otherwise :link matches instead)?
- name: layout.css.visited_links_enabled - name: layout.css.visited_links_enabled
type: bool type: bool

View file

@ -78,19 +78,6 @@ ${helpers.single_keyword(
affects="", affects="",
)} )}
${helpers.single_keyword(
"user-find",
"auto none",
engines="gecko",
gecko_ffi_name="mUserFind",
gecko_enum_prefix="StyleUserFind",
animation_value_type="discrete",
gecko_pref="layout.css.user-find.enabled",
spec="Prototype of solution proposed in https://github.com/w3c/csswg-drafts/issues/3460",
has_effect_on_gecko_scrollbars=False,
affects="",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"caret-color", "caret-color",
"color::CaretColor", "color::CaretColor",

View file

@ -1 +1 @@
prefs: [intl.icu4x.segmenter.enabled:true,layout.css.user-find.enabled:true] prefs: [intl.icu4x.segmenter.enabled:true]

View file

@ -37,9 +37,6 @@ assert_not_inherited('appearance', 'none', 'auto');
assert_inherited('caret-color', currentColor, 'rgba(42, 53, 64, 0.75)'); assert_inherited('caret-color', currentColor, 'rgba(42, 53, 64, 0.75)');
assert_inherited('caret-shape', 'auto', 'bar'); assert_inherited('caret-shape', 'auto', 'bar');
assert_inherited('cursor', 'auto', 'pointer'); assert_inherited('cursor', 'auto', 'pointer');
if (CSS.supports('user-find', 'auto')) {
assert_inherited('user-find', 'auto', 'none');
}
assert_not_inherited('nav-down', 'auto', '#foo'); assert_not_inherited('nav-down', 'auto', '#foo');
assert_not_inherited('nav-left', 'auto', '#foo'); assert_not_inherited('nav-left', 'auto', '#foo');
assert_not_inherited('nav-right', 'auto', '#foo'); assert_not_inherited('nav-right', 'auto', '#foo');

View file

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS UI Level 4: getComputedStyle().userFind</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3460">
<meta name="assert" content="user-find computed value is as specified.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("user-find", "auto");
test_computed_value("user-find", "none");
</script>
</body>
</html>

View file

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS UI Level 4: parsing user-find with invalid values</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3460">
<meta name="assert" content="user-find supports only the grammar 'auto | none'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("user-find", "visible");
test_invalid_value("user-find", "never");
test_invalid_value("user-find", "10px");
test_invalid_value("user-find", "'none'");
</script>
</body>
</html>

View file

@ -1,18 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS UI Level 4: parsing user-find with valid values</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3460">
<meta name="assert" content="user-find supports the grammar 'auto | none'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("user-find", "auto");
test_valid_value("user-find", "none");
</script>
</body>
</html>

View file

@ -2,11 +2,11 @@
<meta charset="utf-8"> <meta charset="utf-8">
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/3460"> <link rel="help" href="https://html.spec.whatwg.org/#inert-subtrees">
<title>Basic test for the user-find property</title> <title>Basic test for inert and find</title>
<body> <body>
<script> <script>
const t = async_test("Basic test for the user-find property"); const t = async_test("Basic test for inert and find");
function testFindable(findCount, textToFind, buildDoc, description) { function testFindable(findCount, textToFind, buildDoc, description) {
if (typeof findCount == "boolean") if (typeof findCount == "boolean")
@ -36,15 +36,11 @@ function testFindable(findCount, textToFind, buildDoc, description) {
let runTests = t.step_func_done(function() { let runTests = t.step_func_done(function() {
testFindable(true, "me", ` testFindable(true, "me", `
Find me please Find me please
`, "sanity test"); `, "basic functionality test");
testFindable(false, "me", ` testFindable(false, "me", `
<div style="user-find: none">Do not find me please</div> <div inert>Do not find me please</div>
`, "Basic use case"); `, "Basic use case");
testFindable(true, "me", `
<div style="user-find: none">Do not find me, but <span style="user-find: auto">find me please</span></div>
`, "nested");
}); });
window.onload = function() { window.onload = function() {

View file

@ -151,7 +151,7 @@ static bool IsFindableNode(const nsINode* aNode) {
return true; return true;
} }
if (frame->StyleUI()->UserFind() == StyleUserFind::None || if (frame->StyleUI()->IsInert() ||
frame->HidesContent(nsIFrame::IncludeContentVisibility::Hidden) || frame->HidesContent(nsIFrame::IncludeContentVisibility::Hidden) ||
frame->IsHiddenByContentVisibilityOnAnyAncestor( frame->IsHiddenByContentVisibilityOnAnyAncestor(
nsIFrame::IncludeContentVisibility::Hidden)) { nsIFrame::IncludeContentVisibility::Hidden)) {