Skip to content

Commit

Permalink
Merge pull request #1498 from Floorp-Projects/upstream-esr128-2024102…
Browse files Browse the repository at this point in the history
…8035441

Pull upstream
  • Loading branch information
surapunoyousei authored Oct 29, 2024
2 parents 648f88a + 901666f commit ac9a0a7
Show file tree
Hide file tree
Showing 231 changed files with 9,450 additions and 3,231 deletions.
5 changes: 0 additions & 5 deletions .cargo/config.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ git = "https://github.com/mozilla/mp4parse-rust"
rev = "a138e40ec1c603615873e524b5b22e11c0ec4820"
replace-with = "vendored-sources"

[source."git+https://github.com/mozilla/neqo?tag=v0.7.9"]
git = "https://github.com/mozilla/neqo"
tag = "v0.7.9"
replace-with = "vendored-sources"

[source."git+https://github.com/seanmonstar/warp?rev=9d081461ae1167eb321585ce424f4fef6cf0092b"]
git = "https://github.com/seanmonstar/warp"
rev = "9d081461ae1167eb321585ce424f4fef6cf0092b"
Expand Down
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -5085,3 +5085,4 @@ e2cb3d9c8cfc18acad7f77add351416dc95b67c4 FIREFOX_128_3_0esr_BUILD1
e2cb3d9c8cfc18acad7f77add351416dc95b67c4 FIREFOX_128_3_0esr_RELEASE
e0c969a3bfc0a23219384269e5b36a589c8f6cc5 FIREFOX_128_3_1esr_BUILD1
e0c969a3bfc0a23219384269e5b36a589c8f6cc5 FIREFOX_128_3_1esr_RELEASE
c4a5d008ee64fab523384408fa2868e2d028025d FIREFOX_128_4_0esr_BUILD1
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.

Merge day clobber 2024-09-30
Merge day clobber 2024-10-28
6 changes: 0 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,11 @@ mio_0_8 = { package = "mio", git = "https://github.com/glandium/mio", rev = "9a2
# Patch `gpu-descriptor` 0.3.0 to remove unnecessary `allocator-api2` dep.:
# Still waiting for the now-merged <https://github.com/zakarumych/gpu-descriptor/pull/40> to be released.
gpu-descriptor = { git = "https://github.com/zakarumych/gpu-descriptor", rev = "7b71a4e47c81903ad75e2c53deb5ab1310f6ff4d" }

[patch."https://github.com/mozilla/neqo"]
neqo-bin = { path = "third_party/rust/neqo-bin" }
neqo-common = { path = "third_party/rust/neqo-common" }
neqo-crypto = { path = "third_party/rust/neqo-crypto" }
neqo-http3 = { path = "third_party/rust/neqo-http3" }
neqo-qpack = { path = "third_party/rust/neqo-qpack" }
neqo-transport = { path = "third_party/rust/neqo-transport" }
74 changes: 55 additions & 19 deletions accessible/base/EventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,43 @@ bool EventQueue::PushEvent(AccEvent* aEvent) {
return true;
}

bool EventQueue::PushNameOrDescriptionChangeToRelations(
LocalAccessible* aAccessible, RelationType aType) {
MOZ_ASSERT(aType == RelationType::LABEL_FOR ||
aType == RelationType::DESCRIPTION_FOR);

bool pushed = false;
uint32_t eventType = aType == RelationType::LABEL_FOR
? nsIAccessibleEvent::EVENT_NAME_CHANGE
: nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE;
Relation rel = aAccessible->RelationByType(aType);
while (LocalAccessible* relTarget = rel.LocalNext()) {
RefPtr<AccEvent> nameChangeEvent = new AccEvent(eventType, relTarget);
pushed |= PushEvent(nameChangeEvent);
}

return pushed;
}

bool EventQueue::PushNameOrDescriptionChange(AccEvent* aOrigEvent) {
// Fire name/description change event on parent or related LocalAccessible
// being labelled/described given that this event hasn't been coalesced, the
// dependent's name/description was calculated from this subtree, and the
// subtree was changed.
LocalAccessible* target = aOrigEvent->mAccessible;
// If the text of a text leaf changed without replacing the leaf, the only
// event we get is text inserted on the container. In this case, we might
// need to fire a name change event on the target itself.
// event we get is text inserted on the container. Or, a reorder event may
// change the container's name. In this case, we might need to fire a name
// change event on the target itself.
const bool maybeTargetNameChanged =
(aOrigEvent->mEventType == nsIAccessibleEvent::EVENT_TEXT_REMOVED ||
aOrigEvent->mEventType == nsIAccessibleEvent::EVENT_TEXT_INSERTED) &&
aOrigEvent->mEventType == nsIAccessibleEvent::EVENT_TEXT_INSERTED ||
aOrigEvent->mEventType == nsIAccessibleEvent::EVENT_REORDER ||
aOrigEvent->mEventType == nsIAccessibleEvent::EVENT_INNER_REORDER) &&
nsTextEquivUtils::HasNameRule(target, eNameFromSubtreeRule);
const bool doName = target->HasNameDependent() || maybeTargetNameChanged;
const bool doDesc = target->HasDescriptionDependent();

if (!doName && !doDesc) {
return false;
}
Expand All @@ -80,34 +102,48 @@ bool EventQueue::PushNameOrDescriptionChange(AccEvent* aOrigEvent) {
if (doName) {
if (nameCheckAncestor && (maybeTargetNameChanged || parent != target) &&
nsTextEquivUtils::HasNameRule(parent, eNameFromSubtreeRule)) {
nsAutoString name;
ENameValueFlag nameFlag = parent->Name(name);
// If name is obtained from subtree, fire name change event.
// HTML file inputs always get part of their name from the subtree, even
// if the author provided a name.
if (nameFlag == eNameFromSubtree || parent->IsHTMLFileInput()) {
bool fireNameChange = parent->IsHTMLFileInput();
if (!fireNameChange) {
nsAutoString name;
ENameValueFlag nameFlag = parent->Name(name);
switch (nameFlag) {
case eNameOK:
// Descendants of subtree may have been removed, making the name
// void.
fireNameChange = name.IsVoid();
break;
case eNameFromSubtree:
// If name is obtained from subtree, fire name change event.
fireNameChange = true;
break;
case eNameFromTooltip:
// If the descendants of this accessible were removed, the name
// may be calculated using the tooltip. We can guess that the name
// was obtained from the subtree before.
fireNameChange = true;
break;
default:
MOZ_ASSERT_UNREACHABLE("All name flags not covered!");
}
}

if (fireNameChange) {
RefPtr<AccEvent> nameChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, parent);
pushed |= PushEvent(nameChangeEvent);
}
nameCheckAncestor = false;
}

Relation rel = parent->RelationByType(RelationType::LABEL_FOR);
while (LocalAccessible* relTarget = rel.LocalNext()) {
RefPtr<AccEvent> nameChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, relTarget);
pushed |= PushEvent(nameChangeEvent);
}
pushed |= PushNameOrDescriptionChangeToRelations(parent,
RelationType::LABEL_FOR);
}

if (doDesc) {
Relation rel = parent->RelationByType(RelationType::DESCRIPTION_FOR);
while (LocalAccessible* relTarget = rel.LocalNext()) {
RefPtr<AccEvent> descChangeEvent = new AccEvent(
nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE, relTarget);
pushed |= PushEvent(descChangeEvent);
}
pushed |= PushNameOrDescriptionChangeToRelations(
parent, RelationType::DESCRIPTION_FOR);
}

if (parent->IsDoc()) {
Expand Down
3 changes: 3 additions & 0 deletions accessible/base/EventQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class EventQueue {
*/
bool PushEvent(AccEvent* aEvent);

bool PushNameOrDescriptionChangeToRelations(LocalAccessible* aAccessible,
RelationType aType);

/**
* Puts name and/or description change events into the queue, if needed.
*/
Expand Down
27 changes: 21 additions & 6 deletions accessible/base/NotificationController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,20 @@ bool NotificationController::QueueMutationEvent(AccTreeMutationEvent* aEvent) {
}
}

if (aEvent->GetEventType() == nsIAccessibleEvent::EVENT_HIDE ||
aEvent->GetEventType() == nsIAccessibleEvent::EVENT_SHOW) {
LocalAccessible* target = aEvent->GetAccessible();
// We need to do this here while the relation is still intact. During the
// tick, where we we call PushNameOrDescriptionChange, it will be too late
// since we will already have unparented the label and severed the relation.
if (PushNameOrDescriptionChangeToRelations(target,
RelationType::LABEL_FOR) ||
PushNameOrDescriptionChangeToRelations(target,
RelationType::DESCRIPTION_FOR)) {
ScheduleProcessing();
}
}

// We need to fire a reorder event after all of the events targeted at shown
// or hidden children of a container. So either queue a new one, or move an
// existing one to the end of the queue if the container already has a
Expand All @@ -213,12 +227,6 @@ bool NotificationController::QueueMutationEvent(AccTreeMutationEvent* aEvent) {
reorder = new AccReorderEvent(container);
container->SetReorderEventTarget(true);
mMutationMap.PutEvent(reorder);

// Since this is the first child of container that is changing, the name
// and/or description of dependent Accessibles may be changing.
if (PushNameOrDescriptionChange(aEvent)) {
ScheduleProcessing();
}
} else {
AccReorderEvent* event = downcast_accEvent(
mMutationMap.GetEvent(container, EventMap::ReorderEvent));
Expand Down Expand Up @@ -651,6 +659,13 @@ void NotificationController::ProcessMutationEvents() {
return;
}

// The mutation in the container can change its name, or an ancestor's
// name. A labelled/described by relation would also need to be notified
// if this is the case.
if (PushNameOrDescriptionChange(event)) {
ScheduleProcessing();
}

LocalAccessible* target = event->GetAccessible();
target->Document()->MaybeNotifyOfValueChange(target);
if (!mDocument) {
Expand Down
2 changes: 1 addition & 1 deletion accessible/tests/mochitest/name/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function testNameForSubtreeRule(aElm) {

if (gDumpToConsole) {
dump(
"\nProcessed from subtree rule. Wait for reorder event on " +
"\nProcessed from subtree rule. Wait for name change event on " +
prettyName(aElm) +
"\n"
);
Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/test/captivePortal/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ skip-if = ["os == 'win'"] # Bug 1313894
["browser_captivePortal_https_only.js"]

["browser_closeCapPortalTabCanonicalURL.js"]

["browser_captivePortal_trr_mode3.js"]
Loading

0 comments on commit ac9a0a7

Please sign in to comment.