Page MenuHomePhabricator

D8978.diff
No OneTemporary

D8978.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -42,6 +42,7 @@
'AphrontFormPolicyControl' => 'view/form/control/AphrontFormPolicyControl.php',
'AphrontFormRadioButtonControl' => 'view/form/control/AphrontFormRadioButtonControl.php',
'AphrontFormRecaptchaControl' => 'view/form/control/AphrontFormRecaptchaControl.php',
+ 'AphrontFormSectionControl' => 'view/form/control/AphrontFormSectionControl.php',
'AphrontFormSelectControl' => 'view/form/control/AphrontFormSelectControl.php',
'AphrontFormStaticControl' => 'view/form/control/AphrontFormStaticControl.php',
'AphrontFormSubmitControl' => 'view/form/control/AphrontFormSubmitControl.php',
@@ -2670,6 +2671,7 @@
'AphrontFormPolicyControl' => 'AphrontFormControl',
'AphrontFormRadioButtonControl' => 'AphrontFormControl',
'AphrontFormRecaptchaControl' => 'AphrontFormControl',
+ 'AphrontFormSectionControl' => 'AphrontFormControl',
'AphrontFormSelectControl' => 'AphrontFormControl',
'AphrontFormStaticControl' => 'AphrontFormControl',
'AphrontFormSubmitControl' => 'AphrontFormControl',
diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php
--- a/src/view/form/control/AphrontFormControl.php
+++ b/src/view/form/control/AphrontFormControl.php
@@ -169,21 +169,31 @@
$custom_class = $this->getCustomControlClass();
+ // If we don't have an ID yet, assign an automatic one so we can associate
+ // the label with the control. This allows assistive technologies to read
+ // form labels.
+ if (!$this->getID()) {
+ $this->setID(celerity_generate_unique_node_id());
+ }
+
+ $input = phutil_tag(
+ 'div',
+ array('class' => 'aphront-form-input'),
+ $this->renderInput());
+
if (strlen($this->getLabel())) {
$label = phutil_tag(
'label',
- array('class' => 'aphront-form-label'),
+ array(
+ 'class' => 'aphront-form-label',
+ 'for' => $this->getID(),
+ ),
$this->getLabel());
} else {
$label = null;
$custom_class .= ' aphront-form-control-nolabel';
}
- $input = phutil_tag(
- 'div',
- array('class' => 'aphront-form-input'),
- $this->renderInput());
-
if (strlen($this->getError())) {
$error = $this->getError();
if ($error === true) {
diff --git a/src/view/form/control/AphrontFormSectionControl.php b/src/view/form/control/AphrontFormSectionControl.php
new file mode 100644
--- /dev/null
+++ b/src/view/form/control/AphrontFormSectionControl.php
@@ -0,0 +1,13 @@
+<?php
+
+final class AphrontFormSectionControl extends AphrontFormControl {
+
+ protected function getCustomControlClass() {
+ return 'aphront-form-control-section';
+ }
+
+ protected function renderInput() {
+ return $this->getValue();
+ }
+
+}
diff --git a/src/view/phui/PHUIIconView.php b/src/view/phui/PHUIIconView.php
--- a/src/view/phui/PHUIIconView.php
+++ b/src/view/phui/PHUIIconView.php
@@ -101,6 +101,7 @@
return array(
'href' => $this->href,
'style' => $style,
+ 'aural' => false,
'class' => $classes,
);
}
diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php
--- a/src/view/phui/PHUITimelineEventView.php
+++ b/src/view/phui/PHUITimelineEventView.php
@@ -154,7 +154,14 @@
'sigil' => 'timeline-extra',
'class' => 'phui-timeline-extra',
),
- phutil_implode_html(self::DELIMITER, $extra));
+ phutil_implode_html(
+ javelin_tag(
+ 'span',
+ array(
+ 'aural' => false,
+ ),
+ self::DELIMITER),
+ $extra));
} else {
$extra = null;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 8:47 PM (3 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7378389
Default Alt Text
D8978.diff (3 KB)

Event Timeline