Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_description.js

  Sprache: JAVA
 

/* 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/. */


"use strict";

/**
 * Test aria-describedby
 */

addAccessibleTask(
  `<div id="hint">This is a hint</div><button id="btn" aria-describedby="hint">Hello</button>`,
  async (browser, accDoc) => {
    let btn = getNativeInterface(accDoc, "btn");
    let customContent = btn.getAttributeValue("AXCustomContent");
    is(customContent[0].description, "This is a hint");
    ok(!btn.getAttributeValue("AXHelp"), "No AXHelp expected");
  },
  { chrome: true, topLevel: true }
);

/**
 * Test aria-description
 */

addAccessibleTask(
  `<button id="btn" aria-description="This is a hint too">Hello</button>`,
  async (browser, accDoc) => {
    let btn = getNativeInterface(accDoc, "btn");
    let customContent = btn.getAttributeValue("AXCustomContent");
    is(customContent[0].description, "This is a hint too");
    ok(!btn.getAttributeValue("AXHelp"), "No AXHelp expected");
  },
  { chrome: true, topLevel: true }
);

/**
 * Test link title
 */

addAccessibleTask(
  `<a href="#" id="lnk" title="This is a link title">Hello</button>`,
  async (browser, accDoc) => {
    let lnk = getNativeInterface(accDoc, "lnk");
    is(lnk.getAttributeValue("AXHelp"), "This is a link title");
    ok(!lnk.getAttributeValue("AXCustomContent"), "No custom content expected");
  },
  { chrome: true, topLevel: true }
);

/**
 * Verify fieldset and radio group with aria-describedby
 * expose description via AXCustomContent, not AXHelp.
 */

addAccessibleTask(
  `
<fieldset id="fieldset" aria-describedby="testHint">
  <button>Button</button>
</fieldset>

<div id="radiogroup" role="radiogroup" aria-describedby="testHint">
  <input type="radio" id="radio1" name="group" value="1">
  <label for="radio1">Radio 1</label>
  <input type="radio" id="radio2" name="group" value="2">
  <label for="radio2">Radio 2</label>
</div>

<div id="testHint">
  This is a hinto
</div>
`,
  async (browser, accDoc) => {
    let getHelp = id =>
      getNativeInterface(accDoc, id).getAttributeValue("AXHelp");
    let getCustomDescription = id =>
      getNativeInterface(accDoc, id).getAttributeValue("AXCustomContent")[0]
        .description;

    is(
      getHelp("fieldset"),
      null,
      "No AXHelp for fieldset with aria-describedby"
    );
    is(
      getCustomDescription("fieldset"),
      "This is a hinto",
      "Custom description for fieldset"
    );

    is(
      getHelp("radiogroup"),
      null,
      "No AXHelp for radiogroup with aria-describedby"
    );
    is(
      getCustomDescription("radiogroup"),
      "This is a hinto",
      "Custom description for radiogroup"
    );
  }
);

Messung V0.5 in Prozent
C=95 H=96 G=95

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=655579