We already excluded most nodes in a visibility: hidden or inert subtree.
However, we previously checked this only on the frame of the node itself, and since display: contents nodes don't have a frame, they weren't excluded.
We now check ancestor frames of display: contents nodes for visibility: hidden and inert, just as we already did for content-visibility: hidden.
Differential Revision: https://phabricator.services.mozilla.com/D301484
The current mozilla::ScrollAxis struct in PresShellForwards.h isn't a simple
axis enum. It carries information about where to scroll to along a specific
axis, and under what conditions that should happen. So 'ScrollAxis' isn't the
best name.
Now we're introducing WebIDL 'ScrollAxis' in bug 1350457:
https://drafts.csswg.org/scroll-animations-1/#scrolltimeline-interface
The extensive use of PresShellForwards.h's ScrollAxis in DOM code makes it
conflict with this new DOM enum. Rather than try to fix this through lots of
explitic namespacing, this patch renames PresShellForwards.h's ScrollAxis.
Differential Revision: https://phabricator.services.mozilla.com/D293485
There's still a ton of things that can be cleaned up after this, but
this setup is nicer.
For now, editor keeps getting set-up / torn down on BindToFrame. Seems
all that could be untangled, but step by step.
The preview stuff and placeholder can just be created on demand now,
rather than requiring frame reconstruction.
Also, nsSearchControlFrame and co no longer do anything of interest, so
move the still relevant bits elsewhere and remove them.
test_bug1248459.html is removed because it messes with the editor
selection using SpecialPowers, in a way such that it crosses shadow
boundaries, and messes up the selected state triggering debug asserts.
test_focus_docnav.xhtml now triggers a different code-path because of
the shadow root (rather than the frame tree traversal). Keep it working
for now by replacing it with something that isn't a shadow root.
Differential Revision: https://phabricator.services.mozilla.com/D282953
For now, replicate the label + icon structure.
Use pseudo-elements for them. We could use select.css instead, but we
need a way to to prevent the display fix-up from applying (this is
needed because otherwise <select style=display:flex> starts getting the
label and button on different lines), and pseudo-elements is easier.
Use a <span> for the icon since we basically otherwise have a hidden,
unfocusable button and it simplifies the styling that way.
Use the same for the input file content since it simplifies the logic on
the frame constructor.
nsListControlFrame gets some clean-up as well since I was trying to make
sense of nsISelectFrame, but I could split that out if needed.
Tests for bug 323656 fail now because it tests explicit inheritance from
the <select> to the <option>, and now that goes through a <slot>.
Other elements have the same issue, see
https://github.com/whatwg/html/issues/3748. So for now remove those
tests.
Differential Revision: https://phabricator.services.mozilla.com/D280041
This reverts commit 03c0249d4e.
Revert "Bug 2006964: Fix test for :host anchor scopes. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"
This reverts commit 8f2b951776.
Revert "Bug 2006964: Augment AnchorScopes with tree scopes. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin"
This reverts commit 001b1a4c23.
Revert "Bug 2006964: Introduce logic to match tree-scoped references and names of anchors. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"
This reverts commit 40d8475186.
Revert "Bug 2006964: Switch ResolutionMap to use scoped atom as hash key. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"
This reverts commit 8ccd0275d0.
Revert "Bug 2006964: Use tree-scoped anchor names in Gecko code. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin"
This reverts commit 6c2e9d558b.
Revert "Bug 2006964: Augment AnchorFunctions with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"
This reverts commit db32e12aa8.
Revert "Bug 2006964: Augment PositionAnchors with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"
This reverts commit b57c7e63b2.
Revert "Bug 2006964: Augment AnchorNames with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio,dshin"
This reverts commit 13144de3e9.
Revert "Bug 2006964: Add default factory method to generated StyleCascadeLevel. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio"
This reverts commit e5d2a17140.
Revert "Bug 2006964: Add TreeScoped type to attach CascadeLevel to AnchorNames. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio"
This reverts commit 71138d7866.
This makes significant changes to RelatedAccIterator, nsLabelsNodeList and nsContentList:
- RelatedAccIterator is now able to walk up shadow roots where appropriate.
- HTMLLabelsIterator now eagerly constructs a TreeOrderedArray of related elements, walking up shadow roots while the shadow root's reference target is either mAcc's content or a host of one of its ancestor shadow roots.
- nsLabelsNodeList now has an array of roots as well as mRootNode in the superclass nsContentList. This list is reset under certain conditions, adding each shadow root found by walking up from the labeled element until one is found which doesn't have either the labeled element or the host of one of its ancestor shadow roots as a reference target. The last element in this list is set as mRootNode in the superclass, and is either the containing document, or the subtree root of either the labeled element or the host element whose containing shadow root doesn't have it as a reference target. Each root has a mutation observer added to ensure that the list is marked dirty when necessary, and also that roots are removed from `mRoots` when they are destroyed.
- In order to enable nsLabelsNodeList to be a mutation observer for each root, nsContentList now inherits from nsStubMultiMutationObserver instead of nsStubMutationObserver.
This change also moves the ReferenceTargetChangeObserver-related methods from DocumentOrShadowRoot on to Element, and the related data structures on to nsExtendedDOMSlots.
It also introduces a distinction between GetControlForBindings, which returns an element in the same scope as the label element it's called on, and GetLabeledElementInternal, which returns the element which actually has the label element as its label.
Differential Revision: https://phabricator.services.mozilla.com/D261368
This reverts commit d46abe6d76.
Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"
This reverts commit df11a4666d.
Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"
This reverts commit 89cc779f5e.
Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"
This reverts commit 33130e712d.
Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"
This reverts commit d6440c4cae.
Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"
This reverts commit 83b70e0645.
Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"
This reverts commit 3a0b29121e.
This makes significant changes to RelatedAccIterator, nsLabelsNodeList and nsContentList:
- RelatedAccIterator now eagerly constructs a TreeOrderedArray of related elements, walking up shadow roots from mDependentContent while the shadow root's reference target is either mDependentContent or a host of one of its ancestor shadow roots.
- nsLabelsNodeList now has an array of roots as well as mRootNode in the superclass nsContentList. This list is reset under certain conditions, adding each shadow root found by walking up from the labeled element until one is found which doesn't have either the labeled element or the host of one of its ancestor shadow roots as a reference target. The last element in this list is set as mRootNode in the superclass, and is either the containing document, or the subtree root of either the labeled element or the host element whose containing shadow root doesn't have it as a reference target. Each root has a mutation observer added to ensure that the list is marked dirty when necessary, and also that roots are removed from `mRoots` when they are destroyed.
- In order to enable nsLabelsNodeList to be a mutation observer for each root, nsContentList now inherits from nsStubMultiMutationObserver instead of nsStubMutationObserver.
This change also moves the ReferenceTargetChangeObserver-related methods from DocumentOrShadowRoot on to Element, and the related data structures on to nsExtendedDOMSlots.
It also introduces a distinction between GetControlForBindings, which returns an element in the same scope as the label element it's called on, and GetLabeledElementInternal, which returns the element which actually has the label element as its label.
Differential Revision: https://phabricator.services.mozilla.com/D261368
This reverts commit 1b5cf4cdf8.
Revert "Bug 1981346 - Add referenceTarget support for the form attribute. r=credential-management-reviewers,webidl,dimi,Jamie,smaug"
This reverts commit 2394d9205a.
Revert "Bug 1981345 - Implement referenceTarget support for multiple element attributes. r=dom-core,Jamie,smaug"
This reverts commit 571a17ff82.
Revert "Bug 1984685 - Refactor: consistently return Maybe<nsTArray<RefPtr<Element>>> when getting attr-associated elements, and key AttrRelProviders on nsAtom rather than nsString. r=dom-core,morgan,Jamie,smaug"
This reverts commit 3b389fdd62.
Revert "Bug 1981344 - Implement referenceTarget support for single-element attributes. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,emilio,keithamus,smaug,mtigley"
This reverts commit 5cc2a12756.
Revert "Bug 1983766 - Split single element attribute getters into bindings/internals versions. r=dom-core,credential-management-reviewers,webidl,layout-reviewers,smaug,keithamus,jwatt,mtigley"
This reverts commit 68e2d26aa9.
Revert "Bug 1989323 - Make `referenceTarget` IDL attributes on ShadowRoot, HTMLTemplateElement and ShadowRootInit nullable. r=dom-core,webidl,saschanaz,smaug"
This reverts commit 1234b31599.
This makes significant changes to RelatedAccIterator, nsLabelsNodeList and nsContentList:
- RelatedAccIterator now eagerly constructs a TreeOrderedArray of related elements, walking up shadow roots from mDependentContent while the shadow root's reference target is either mDependentContent or a host of one of its ancestor shadow roots.
- nsLabelsNodeList now has an array of roots as well as mRootNode in the superclass nsContentList. This list is reset under certain conditions, adding each shadow root found by walking up from the labeled element until one is found which doesn't have either the labeled element or the host of one of its ancestor shadow roots as a reference target. The last element in this list is set as mRootNode in the superclass, and is either the containing document, or the subtree root of either the labeled element or the host element whose containing shadow root doesn't have it as a reference target. Each root has a mutation observer added to ensure that the list is marked dirty when necessary, and also that roots are removed from `mRoots` when they are destroyed.
- In order to enable nsLabelsNodeList to be a mutation observer for each root, nsContentList now inherits from nsStubMultiMutationObserver instead of nsStubMutationObserver.
This change also moves the ReferenceTargetChangeObserver-related methods from DocumentOrShadowRoot on to Element, and the related data structures on to nsExtendedDOMSlots.
It also introduces a distinction between GetControlForBindings, which returns an element in the same scope as the label element it's called on, and GetLabeledElementInternal, which returns the element which actually has the label element as its label.
Differential Revision: https://phabricator.services.mozilla.com/D261368
It returns `nsresult` and has out-param for returning
`nsISelectionController*`. However, no caller of it handles differently
when this returns error vs. `nullptr` for `nsISelectionController*`.
Therefore, this should return `nsISelectionController*` simply.
Then, we don't need the same name method in the derived class,
`nsTextControlFrame`.
Differential Revision: https://phabricator.services.mozilla.com/D274880
This reverts commit 63d8614128.
Revert "Bug 1987963: Ensure that we can roll back to previous normal position when we give up on finding fallbacks. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"
This reverts commit 0685b925e3.
Revert "Bug 1987963: Find and reflow affected positioned frames when a frame becomes/stops being a scroll container. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"
This reverts commit 9b3130e442.
Revert "Bug 1987963: Apply default scroll offset on scroll. r=layout-reviewers,tnikkel,jwatt"
This reverts commit 878edfaa95.
Revert "Bug 1987963: Compute and cache compensating for scroll state of anchor positioned elements. r=jwatt"
This reverts commit e83f5939e3.
Revert "Bug 1968745: Keep track of default anchor and its nearest scrollers. r=layout-anchor-positioning-reviewers,layout-reviewers,jwatt,emilio"
This reverts commit f47abb0c30.
Revert "Bug 1968745: Pass short-lived cache into anchor resolution. r=jwatt"
This reverts commit 045b5b1cb3.
Revert "Bug 1987961: Stop taking scroll offset into account during anchor positioning offset resolution. r=jwatt"
This reverts commit 11ea3d17d5.
Most callers of nsViewManager::GetRootWidget have a pres shell around
and don't need to care about views.
This is in preparation for bug 1994942, where we'll disconnect subdocs
from the view tree (and thus the view manager will not have the ability
to get a root widget).
Differential Revision: https://phabricator.services.mozilla.com/D269019
There are three functions that select and determine valid details
relationships.
1. nsCoreUtils::GetAnchorForPositionedFrame and nsCoreUtils::GetPositionedFrameForAnchor
These query layout and determine that there is only a single target
referencing and anchor and vice versa. We need to do this check in
layout because the a11y tree doesn't give us the full picture. For
example, one of two targets could be aria-hidden and it should make the
relationship with between the anchor and other target invalid.
2. LocalAccessible::GetAnchorPositionTargetDetailsRelation
This uses the functions above to get the target of an anchor, retrieve
its accessible and check that there are no explicit relationships
defined on the anchor (or details relationship for the target).
3. nsAccUtils::IsValidDetailsTargetForAnchor
This checks the a11y tree structure to make sure this is a valid
relationship. This is written to run also remotely so we don't need
to recalculate and cache relations on each tree mutation.
Differential Revision: https://phabricator.services.mozilla.com/D264635
This reverts commit 0a7b2d917f.
Revert "Bug 1987945 - P3: Support details relation in anchored targets in remote accessibles. r=Jamie,layout-anchor-positioning-reviewers,layout-reviewers,emilio,firefox-style-system-reviewers"
This reverts commit e6ae7218f8.
Revert "Bug 1987945 - P2: Cache relations using multiple attributes for same relation type. r=Jamie"
This reverts commit 77defe6ce4.
Revert "Bug 1987945 - P1: Implement details relationship for CSS anchored local accessibles. r=Jamie,emilio"
This reverts commit cd9f4b716c.
There are three functions that select and determine valid details
relationships.
1. nsCoreUtils::GetAnchorForPositionedFrame and nsCoreUtils::GetPositionedFrameForAnchor
These query layout and determine that there is only a single target
referencing and anchor and vice versa. We need to do this check in
layout because the a11y tree doesn't give us the full picture. For
example, one of two targets could be aria-hidden and it should make the
relationship with between the anchor and other target invalid.
2. LocalAccessible::GetAnchorPositionTargetDetailsRelation
This uses the functions above to get the target of an anchor, retrieve
its accessible and check that there are no explicit relationships
defined on the anchor (or details relationship for the target).
3. nsAccUtils::IsValidDetailsTargetForAnchor
This checks the a11y tree structure to make sure this is a valid
relationship. This is written to run also remotely so we don't need
to recalculate and cache relations on each tree mutation.
Differential Revision: https://phabricator.services.mozilla.com/D264635
In bug 1951067, I pruned all 0 width whitespace text nodes from the accessibility tree.
However, it turns out that whitespace text nodes at the end of wrapped lines can also be 0 width.
These have semantic importance, since otherwise, words in separate inline nodes can be merged together without a space.
To fix this, explicitly check that the node is before a hard line break, not a soft (wrapped) line break.
Differential Revision: https://phabricator.services.mozilla.com/D242290
`eContextMenu` event may be fired from `widget`. Therefore, different from
`ePointerClick` and `ePointerAuxClick`, they may cross the process boundary,
may be handled by APZ and may be dispatched into the DOM after a delay.
Therefore, this patch is complicated than the previous patch. This adds
* New IPC message handlers for sending/receiving a `WidgetPointerEvent`
* New `DelayedPointerEvent` class and templated `MouseInput::ToWidgetEvent`
* `PresShell::EventHandler` handles `eContextMenu` as same as `WidgetMouseEvent`
Differential Revision: https://phabricator.services.mozilla.com/D213003
This revision reverts the changes that trimmed non-breaking spaces from the
start and end of accessible names. The web platform group has decided that
those tests weren't valid as-is; the correct behavior is not to trim those
characters. This revision also removes expected-fail designations from
affected tests.
Differential Revision: https://phabricator.services.mozilla.com/D208687
This revision modifies LocalAccessible::Name such that the function trims
non-breaking spaces from the beginning and end of accessible names. We already
compress all ASCII whitespace and trim it from the prefixes and suffixes of
accessible names - this change just extends that trimming to non-breaking spaces
for the exterior ends of the name string only. This revision implements a new
function, TrimNonBreakingSpaces, which does the trimming. Finally, this revision
removes five expected failures from the web platform tests.
Differential Revision: https://phabricator.services.mozilla.com/D203993
As well as getting an invoker's popover target, we need to be able to do the reverse: get a popover's invokers.
We can already do this when the popovertarget content attribute is set to a string id using the dependent ids map.
However, the popover target can also be explicitly set to a DOM element using the .popoverTargetElement WebIDL attribute.
For this, we need a new map which maps from target elements instead of target ids.
RelatedAccIterator has also been updated to use this map.
DocAccessible::QueueCacheUpdateForDependentRelations had to be updated as well.
Rather than duplicating logic, RelatedAccIterator has been taught how to optionally return all relations and QueueCacheUpdateForDependentRelations now uses RelatedAccIterator.
Differential Revision: https://phabricator.services.mozilla.com/D201661
This is consistent with other browsers and thus more web compatible.
In particular, it makes infinite scroll work correctly on YouTube (e.g. when scrolling with screen readers), which didn't work previously.
Differential Revision: https://phabricator.services.mozilla.com/D185516
We have more readable and faster versions (that just omit the namespace
arg).
Mostly done via sed, with a couple helpers to use the faster lookups
where possible.
Differential Revision: https://phabricator.services.mozilla.com/D181795
There is an issue that when the element is hidden because its ancestor has 'content-visibility:hidden', it still appears in the accessibility tree.
Depending on CSS Containment Spec (https://www.w3.org/TR/css-contain-2/#cv-a11y),
it should be omitted from the accessibility tree.
This change fixes the issue above.
The approach is not to create the node in accessibility tree if the element has any ancestor specified with 'content-visibility:hidden'.
This patch can be tested such as:
(1) Check if the accessibility tree is created correctly
./mach test accessible/tests/browser/tree/browser_css_content_visibility.js
(2) Check if the accessibility tree is updated correctly
./mach test accessible/tests/browser/e10s/browser_treeupdate_csscontentvisibility.js
Differential Revision: https://phabricator.services.mozilla.com/D159879