mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 686400 - Add function to nsCoreUtils for display: contents. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D40131 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
fb55d9f3fa
commit
aeb736599d
@ -919,7 +919,7 @@ Accessible* nsAccessibilityService::CreateAccessible(nsINode* aNode,
|
||||
if (!frame || !frame->StyleVisibility()->IsVisible()) {
|
||||
// display:contents element doesn't have a frame, but retains the semantics.
|
||||
// All its children are unaffected.
|
||||
if (content->IsElement() && content->AsElement()->IsDisplayContents()) {
|
||||
if (nsCoreUtils::IsDisplayContents(content)) {
|
||||
const HTMLMarkupMapInfo* markupMap =
|
||||
mHTMLMarkupMap.Get(content->NodeInfo()->NameAtom());
|
||||
if (markupMap && markupMap->new_func) {
|
||||
|
@ -545,3 +545,8 @@ void nsCoreUtils::DispatchAccEvent(RefPtr<nsIAccessibleEvent> event) {
|
||||
|
||||
obsService->NotifyObservers(event, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
|
||||
}
|
||||
|
||||
bool nsCoreUtils::IsDisplayContents(nsIContent* aContent) {
|
||||
return aContent && aContent->IsElement() &&
|
||||
aContent->AsElement()->IsDisplayContents();
|
||||
}
|
||||
|
@ -323,6 +323,8 @@ class nsCoreUtils {
|
||||
* Notify accessible event observers of an event.
|
||||
*/
|
||||
static void DispatchAccEvent(RefPtr<nsIAccessibleEvent> aEvent);
|
||||
|
||||
static bool IsDisplayContents(nsIContent* aContent);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -310,7 +310,7 @@ uint64_t Accessible::VisibilityState() const {
|
||||
if (!frame) {
|
||||
// Element having display:contents is considered visible semantically,
|
||||
// despite it doesn't have a visually visible box.
|
||||
if (mContent->IsElement() && mContent->AsElement()->IsDisplayContents()) {
|
||||
if (nsCoreUtils::IsDisplayContents(mContent)) {
|
||||
return states::OFFSCREEN;
|
||||
}
|
||||
return states::INVISIBLE;
|
||||
@ -1918,7 +1918,7 @@ void Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
|
||||
|
||||
nsIFrame* frame = GetFrame();
|
||||
if (!frame) {
|
||||
if (mContent->IsElement() && mContent->AsElement()->IsDisplayContents()) {
|
||||
if (nsCoreUtils::IsDisplayContents(mContent)) {
|
||||
aText += kEmbeddedObjectChar;
|
||||
}
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user