Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  ARIAGridAccessible.cpp   Sprache: C

 
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "ARIAGridAccessible.h"

#include <stdint.h>
#include "LocalAccessible-inl.h"
#include "AccAttributes.h"
#include "mozilla/a11y/TableAccessible.h"
#include "mozilla/a11y/TableCellAccessible.h"
#include "nsAccessibilityService.h"
#include "nsAccUtils.h"
#include "nsGkAtoms.h"
#include "mozilla/a11y/Role.h"
#include "States.h"

using namespace mozilla;
using namespace mozilla::a11y;

////////////////////////////////////////////////////////////////////////////////
// ARIAGridCellAccessible
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Constructor

ARIAGridCellAccessible::ARIAGridCellAccessible(nsIContent* aContent,
                                               DocAccessible* aDoc)
    : HyperTextAccessible(aContent, aDoc) {
  mGenericTypes |= eTableCell;
}

////////////////////////////////////////////////////////////////////////////////
// LocalAccessible

void ARIAGridCellAccessible::ApplyARIAState(uint64_t* aState) const {
  HyperTextAccessible::ApplyARIAState(aState);

  // Return if the gridcell has aria-selected="true".
  if (*aState & states::SELECTED) return;

  // Check aria-selected="true" on the row.
  LocalAccessible* row = LocalParent();
  if (!row || row->Role() != roles::ROW) return;

  nsIContent* rowContent = row->GetContent();
  if (nsAccUtils::HasDefinedARIAToken(rowContent, nsGkAtoms::aria_selected) &&
      !nsAccUtils::ARIAAttrValueIs(rowContent->AsElement(),
                                   nsGkAtoms::aria_selected, nsGkAtoms::_false,
                                   eCaseMatters)) {
    *aState |= states::SELECTABLE | states::SELECTED;
  }
}

already_AddRefed<AccAttributes> ARIAGridCellAccessible::NativeAttributes() {
  RefPtr<AccAttributes> attributes = HyperTextAccessible::NativeAttributes();

  // We only need to expose table-cell-index to clients. If we're in the content
  // process, we don't need this, so building a CachedTableAccessible is very
  // wasteful. This will be exposed by RemoteAccessible in the parent process
  // instead.
  if (!IPCAccessibilityActive()) {
    if (const TableCellAccessible* cell = AsTableCell()) {
      TableAccessible* table = cell->Table();
      const uint32_t row = cell->RowIdx();
      const uint32_t col = cell->ColIdx();
      const int32_t cellIdx = table->CellIndexAt(row, col);
      if (cellIdx != -1) {
        attributes->SetAttribute(nsGkAtoms::tableCellIndex, cellIdx);
      }
    }
  }

  return attributes.forget();
}

Messung V0.5
C=94 H=99 G=96

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge