1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Unprefix -moz-read-write / -moz-read-only

This commit is contained in:
Andy
2025-06-29 02:10:26 -07:00
committed by roytam1
parent e4630ce481
commit 4cc014cb6b
25 changed files with 75 additions and 75 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ HyperTextAccessible::NativeState()
{
uint64_t states = AccessibleWrap::NativeState();
if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
if (mContent->AsElement()->State().HasState(NS_EVENT_STATE_READWRITE)) {
states |= states::EDITABLE;
} else if (mContent->IsHTMLElement(nsGkAtoms::article)) {
+2
View File
@@ -118,6 +118,8 @@ const PSEUDO_SELECTORS = [
[":target", 0],
[":enabled", 0],
[":disabled", 0],
[":read-only", 1],
[":read-write", 1],
[":checked", 1],
["::selection", 0]
];
+5 -6
View File
@@ -201,8 +201,7 @@ Element::QueryInterface(REFNSIID aIID, void** aInstancePtr)
EventStates
Element::IntrinsicState() const
{
return IsEditable() ? NS_EVENT_STATE_MOZ_READWRITE :
NS_EVENT_STATE_MOZ_READONLY;
return IsEditable() ? NS_EVENT_STATE_READWRITE : NS_EVENT_STATE_READONLY;
}
void
@@ -288,11 +287,11 @@ Element::UpdateEditableState(bool aNotify)
// insertion into the document and UpdateState can be slow for
// some kinds of elements even when not notifying.
if (IsEditable()) {
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
AddStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
RemoveStatesSilently(NS_EVENT_STATE_READONLY);
AddStatesSilently(NS_EVENT_STATE_READWRITE);
} else {
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
AddStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
RemoveStatesSilently(NS_EVENT_STATE_READWRITE);
AddStatesSilently(NS_EVENT_STATE_READONLY);
}
}
}
+1 -1
View File
@@ -158,7 +158,7 @@ public:
#ifdef MOZILLA_INTERNAL_API
explicit Element(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) :
FragmentOrElement(aNodeInfo),
mState(NS_EVENT_STATE_MOZ_READONLY)
mState(NS_EVENT_STATE_READONLY)
{
MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::ELEMENT_NODE,
"Bad NodeType in aNodeInfo");
+1 -1
View File
@@ -277,7 +277,7 @@ nsIContent::GetDesiredIMEState()
// Check for the special case where we're dealing with elements which don't
// have the editable flag set, but are readwrite (such as text controls).
if (!IsElement() ||
!AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
!AsElement()->State().HasState(NS_EVENT_STATE_READWRITE)) {
return IMEState(IMEState::DISABLED);
}
}
+2 -3
View File
@@ -205,11 +205,10 @@ private:
#define NS_EVENT_STATE_INRANGE NS_DEFINE_EVENT_STATE_MACRO(15)
// Content value is out-of-range.
#define NS_EVENT_STATE_OUTOFRANGE NS_DEFINE_EVENT_STATE_MACRO(16)
// These two are temporary (see bug 302188)
// Content is read-only.
#define NS_EVENT_STATE_MOZ_READONLY NS_DEFINE_EVENT_STATE_MACRO(17)
#define NS_EVENT_STATE_READONLY NS_DEFINE_EVENT_STATE_MACRO(17)
// Content is editable.
#define NS_EVENT_STATE_MOZ_READWRITE NS_DEFINE_EVENT_STATE_MACRO(18)
#define NS_EVENT_STATE_READWRITE NS_DEFINE_EVENT_STATE_MACRO(18)
// Content is the default one (meaning depends of the context).
#define NS_EVENT_STATE_DEFAULT NS_DEFINE_EVENT_STATE_MACRO(19)
// Content could not be rendered (image/object/etc).
+1 -1
View File
@@ -1608,7 +1608,7 @@ IMEStateManager::IsEditable(nsINode* node)
}
// |node| might be readwrite (for example, a text control)
if (node->IsElement() &&
node->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
node->AsElement()->State().HasState(NS_EVENT_STATE_READWRITE)) {
return true;
}
return false;
+3 -3
View File
@@ -2198,13 +2198,13 @@ nsGenericHTMLFormElement::IntrinsicState() const
}
// Make the text controls read-write
if (!state.HasState(NS_EVENT_STATE_MOZ_READWRITE) &&
if (!state.HasState(NS_EVENT_STATE_READWRITE) &&
IsTextOrNumberControl(/*aExcludePassword*/ false)) {
bool roState = GetBoolAttr(nsGkAtoms::readonly);
if (!roState) {
state |= NS_EVENT_STATE_MOZ_READWRITE;
state &= ~NS_EVENT_STATE_MOZ_READONLY;
state |= NS_EVENT_STATE_READWRITE;
state &= ~NS_EVENT_STATE_READONLY;
}
}
+2 -2
View File
@@ -45,9 +45,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=535043
/** Test for Bug 1264157 **/
SimpleTest.waitForFocus(function() {
// Check the initial values.
let active = [].slice.call(document.querySelectorAll("input:not(:disabled):not(:-moz-read-only)"));
let active = [].slice.call(document.querySelectorAll("input:not(:disabled):not(:read-only)"));
let disabled = [].slice.call(document.querySelectorAll("input:disabled"));
let readonly = [].slice.call(document.querySelectorAll("input:-moz-read-only"));
let readonly = [].slice.call(document.querySelectorAll("input:read-only"));
ok(active.length == 2, "Test is messed up: missing non-disabled/non-readonly inputs");
ok(disabled.length == 2, "Test is messed up: missing disabled inputs");
ok(readonly.length == 2, "Test is messed up: missing readonly inputs");
+4 -4
View File
@@ -156,8 +156,8 @@ nsXULElement::nsXULElement(already_AddRefed<mozilla::dom::NodeInfo> aNodeInfo)
// We may be READWRITE by default; check.
if (IsReadWriteTextElement()) {
AddStatesSilently(NS_EVENT_STATE_MOZ_READWRITE);
RemoveStatesSilently(NS_EVENT_STATE_MOZ_READONLY);
AddStatesSilently(NS_EVENT_STATE_READWRITE);
RemoveStatesSilently(NS_EVENT_STATE_READONLY);
}
}
@@ -1855,8 +1855,8 @@ nsXULElement::IntrinsicState() const
EventStates state = nsStyledElement::IntrinsicState();
if (IsReadWriteTextElement()) {
state |= NS_EVENT_STATE_MOZ_READWRITE;
state &= ~NS_EVENT_STATE_MOZ_READONLY;
state |= NS_EVENT_STATE_READWRITE;
state &= ~NS_EVENT_STATE_READONLY;
}
return state;
+1 -1
View File
@@ -406,7 +406,7 @@ HTMLEditor::FindSelectionRoot(nsINode* aNode)
// If the content is in read-write state but is not editable itself,
// return it as the selection root.
if (content->IsElement() &&
content->AsElement()->State().HasState(NS_EVENT_STATE_MOZ_READWRITE)) {
content->AsElement()->State().HasState(NS_EVENT_STATE_READWRITE)) {
return content.forget();
}
return nullptr;
+2 -2
View File
@@ -2,8 +2,8 @@
<html class="reftest-wait">
<body>
<style>
:-moz-read-only { color: red; }
:-moz-read-write { color: green; }
:read-only { color: red; }
:read-write { color: green; }
</style>
<script>
onload = function() {
+2 -2
View File
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<style>
:-moz-read-only { color: green; }
:-moz-read-write { color: red; }
:read-only { color: green; }
:read-write { color: red; }
</style>
<body onload="document.designMode='on';document.designMode='off'">
<div>test</div>
+2 -2
View File
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<style>
:-moz-read-only { color: green; }
:-moz-read-write { color: red; }
:read-only { color: green; }
:read-write { color: red; }
</style>
<body onload="document.designMode='on';document.designMode='off'">
<div>test</div>
+2 -2
View File
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<style>
:-moz-read-only { color: red; }
:-moz-read-write { color: green; }
:read-only { color: red; }
:read-write { color: green; }
</style>
<body onload="document.designMode='on';document.designMode='off'">
<div contenteditable>test</div>
+1 -1
View File
@@ -2,7 +2,7 @@
<html>
<head>
<style>
:-moz-read-write + span {
:read-write + span {
display: none;
}
span {
+1 -1
View File
@@ -2,7 +2,7 @@
<html>
<head>
<style>
:-moz-read-only + span {
:read-only + span {
display: none;
}
span {
+1 -1
View File
@@ -2,7 +2,7 @@
<html>
<head>
<style>
:-moz-read-write + span {
:read-write + span {
display: none;
}
span {
+1 -1
View File
@@ -2,7 +2,7 @@
<html>
<head>
<style>
:-moz-read-write + span {
:read-write + span {
display: none;
}
span {
+2 -2
View File
@@ -1,6 +1,6 @@
<html class="reftest-wait"><style>
.c12:-moz-read-write, *|* { vertical-align: -moz-calc(30060px 36%); display: inline; -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight; border-collapse: collapse; speak: normal; width: 2.88999223464x+18mozmm; -moz-outline-radius: -219px/6827px; }
.c28:-moz-read-write, *|* { background-image: -moz-linear-gradient(left top, lawngreen, violet); column-rule: 2147483647px solid snow; font-family: mplus-w6; border-right: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px solid hsla(56224, 127%, 11074%, 3.1529590536x+18); font: Arial, sans-serif; -moz-transform: matrix(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 54, 70.084369622, 2600244143.97, 225, 200); animation: step-right 7.82973832672x+18s forwards;.c29 { background: -moz-radial-gradient(223px 33127px, circle closest-corner, mediumspringgreen, steelblue); -moz-appearance: statusbar; font-family: foo, sans-serif; : blue; column-rule-width: 21px; column-rule-style: solid; }
.c12:read-write, *|* { vertical-align: -moz-calc(30060px 36%); display: inline; -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight; border-collapse: collapse; speak: normal; width: 2.88999223464x+18mozmm; -moz-outline-radius: -219px/6827px; }
.c28:read-write, *|* { background-image: -moz-linear-gradient(left top, lawngreen, violet); column-rule: 2147483647px solid snow; font-family: mplus-w6; border-right: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999px solid hsla(56224, 127%, 11074%, 3.1529590536x+18); font: Arial, sans-serif; -moz-transform: matrix(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, 54, 70.084369622, 2600244143.97, 225, 200); animation: step-right 7.82973832672x+18s forwards;.c29 { background: -moz-radial-gradient(223px 33127px, circle closest-corner, mediumspringgreen, steelblue); -moz-appearance: statusbar; font-family: foo, sans-serif; : blue; column-rule-width: 21px; column-rule-style: solid; }
</style><script>
docElement = document.documentElement;
docElement.contentEditable = "true";
+1 -1
View File
@@ -992,7 +992,7 @@ nsFrameSelection::MoveCaret(nsDirection aDirection,
(focusNode->IsEditable() ||
(focusNode->IsElement() &&
focusNode->AsElement()->State().
HasState(NS_EVENT_STATE_MOZ_READWRITE)))) {
HasState(NS_EVENT_STATE_READWRITE)))) {
// If caret moves in editor, it should cause scrolling even if it's in
// overflow: hidden;.
scrollFlags |= Selection::SCROLL_OVERFLOW_HIDDEN;
@@ -12,11 +12,11 @@
<style type="text/css">
body,html { color:black; background:white; font-size:16px; padding:0; margin:0; }
#t1:-moz-read-only { display:none; }
#t1:-moz-read-write { display:block; }
#t1:read-only { display:none; }
#t1:read-write { display:block; }
#t2:-moz-read-write { display:none; }
#t2:-moz-read-only { display:block; }
#t2:read-write { display:none; }
#t2:read-only { display:block; }
#t3:disabled { display:none; }
#t3:enabled { display:block; }
+27 -27
View File
@@ -9,17 +9,17 @@
cursor: text;
}
*|*:-moz-read-write :-moz-read-only {
*|*:read-write :read-only {
-moz-user-select: all;
}
*|*:-moz-read-only > :-moz-read-write {
*|*:read-only > :read-write {
/* override the above -moz-user-select: all rule. */
-moz-user-select: -moz-text;
}
input:-moz-read-write > .anonymous-div:-moz-read-only,
textarea:-moz-read-write > .anonymous-div:-moz-read-only {
input:read-write > .anonymous-div:read-only,
textarea:read-write > .anonymous-div:read-only {
-moz-user-select: text;
}
@@ -28,49 +28,49 @@ textarea:-moz-read-write > .anonymous-div:-moz-read-only {
Override the browser's pointer cursor over links
*/
img:-moz-read-write, img:-moz-read-write[usemap], area:-moz-read-write,
object:-moz-read-write, object:-moz-read-write[usemap],
applet:-moz-read-write, hr:-moz-read-write, button:-moz-read-write,
select:-moz-read-write,
a:-moz-read-write:link img, a:-moz-read-write:visited img,
a:-moz-read-write:active img, a:-moz-read-write:-moz-only-whitespace[name] {
img:read-write, img:read-write[usemap], area:read-write,
object:read-write, object:read-write[usemap],
applet:read-write, hr:read-write, button:read-write,
select:read-write,
a:read-write:link img, a:read-write:visited img,
a:read-write:active img, a:read-write:-moz-only-whitespace[name] {
cursor: default;
}
*|*:any-link:-moz-read-write {
*|*:any-link:read-write {
cursor: text;
}
/* Prevent clicking on links from going to link */
a:link:-moz-read-write img, a:visited:-moz-read-write img,
a:active:-moz-read-write img {
a:link:read-write img, a:visited:read-write img,
a:active:read-write img {
-moz-user-input: none;
}
/* We suppress user/author's prefs for link underline,
so we must set explicitly. This isn't good!
*/
a:link:-moz-read-write {
a:link:read-write {
text-decoration: underline -moz-anchor-decoration;
color: -moz-hyperlinktext;
}
/* Allow double-clicks on these widgets to open properties dialogs
XXX except when the widget has disabled attribute */
*|*:-moz-read-write > input:-moz-read-only,
*|*:-moz-read-write > button:-moz-read-only,
*|*:-moz-read-write > textarea:-moz-read-only {
*|*:read-write > input:read-only,
*|*:read-write > button:read-only,
*|*:read-write > textarea:read-only {
-moz-user-select: all;
-moz-user-input: auto !important;
-moz-user-focus: none !important;
}
/* XXX Still need a better way of blocking other events to these widgets */
select:-moz-read-write,
*|*:-moz-read-write > input:disabled,
*|*:-moz-read-write > input[type="checkbox"],
*|*:-moz-read-write > input[type="radio"],
*|*:-moz-read-write > input[type="file"],
select:read-write,
*|*:read-write > input:disabled,
*|*:read-write > input[type="checkbox"],
*|*:read-write > input[type="radio"],
*|*:read-write > input[type="file"],
input[contenteditable="true"]:disabled,
input[contenteditable="true"][type="checkbox"],
input[contenteditable="true"][type="radio"],
@@ -81,21 +81,21 @@ input[contenteditable="true"][type="file"] {
}
/* emulation of non-standard HTML <marquee> tag */
marquee:-moz-read-write {
marquee:read-write {
-moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal-editable');
}
marquee[direction="up"]:-moz-read-write, marquee[direction="down"]:-moz-read-write {
marquee[direction="up"]:read-write, marquee[direction="down"]:read-write {
-moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-vertical-editable');
}
*|*:-moz-read-write > input[type="hidden"],
*|*:read-write > input[type="hidden"],
input[contenteditable="true"][type="hidden"] {
border: 1px solid black !important;
visibility: visible !important;
}
label:-moz-read-write {
label:read-write {
-moz-user-select: all;
}
@@ -103,7 +103,7 @@ label:-moz-read-write {
-moz-user-select: text;
}
option:-moz-read-write {
option:read-write {
-moz-user-select: text;
}
+4 -4
View File
@@ -254,10 +254,10 @@ CSS_STATE_PSEUDO_CLASS(outOfRange, ":out-of-range", 0, "", NS_EVENT_STATE_OUTOFR
CSS_STATE_PSEUDO_CLASS(defaultPseudo, ":default", 0, "", NS_EVENT_STATE_DEFAULT)
CSS_STATE_PSEUDO_CLASS(placeholderShown, ":placeholder-shown", 0, "",
NS_EVENT_STATE_PLACEHOLDERSHOWN)
CSS_STATE_PSEUDO_CLASS(mozReadOnly, ":-moz-read-only", 0, "",
NS_EVENT_STATE_MOZ_READONLY)
CSS_STATE_PSEUDO_CLASS(mozReadWrite, ":-moz-read-write", 0, "",
NS_EVENT_STATE_MOZ_READWRITE)
CSS_STATE_PSEUDO_CLASS(readOnly, ":read-only", 0, "",
NS_EVENT_STATE_READONLY)
CSS_STATE_PSEUDO_CLASS(readWrite, ":read-write", 0, "",
NS_EVENT_STATE_READWRITE)
CSS_STATE_PSEUDO_CLASS(mozSubmitInvalid, ":-moz-submit-invalid", 0, "",
NS_EVENT_STATE_MOZ_SUBMITINVALID)
CSS_STATE_PSEUDO_CLASS(mozUIInvalid, ":-moz-ui-invalid", 0, "",
+2 -2
View File
@@ -217,8 +217,8 @@ textarea::placeholder {
white-space: pre-wrap !important;
}
input:-moz-read-write,
textarea:-moz-read-write {
input:read-write,
textarea:read-write {
-moz-user-modify: read-write !important;
}