anewt-developers team mailing list archive
-
anewt-developers team
-
Mailing list archive
-
Message #00293
[Branch ~uws/anewt/anewt.uws] Rev 1804: [xhtml] Fix attributes parameter handling in ax_*() API
------------------------------------------------------------
revno: 1804
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt
timestamp: Wed 2010-10-27 00:08:26 +0200
message:
[xhtml] Fix attributes parameter handling in ax_*() API
Some ax_*() functions silently ignored the optional
$attributes parameter. Also updated outdated code comment.
modified:
xhtml/api.lib.php
--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws
Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription
=== modified file 'xhtml/api.lib.php'
--- xhtml/api.lib.php 2010-10-26 22:07:53 +0000
+++ xhtml/api.lib.php 2010-10-26 22:08:26 +0000
@@ -29,7 +29,6 @@
return $node;
}
-
/**
* Create a new fragment node.
*
@@ -47,7 +46,6 @@
return $node;
}
-
/**
* Format a text node using a format specifier and supplied values.
*
@@ -123,7 +121,6 @@
return ax_raw(vsprintf($format, $values));
}
-
/**
* Join array elements with a string or DOM node.
*
@@ -173,7 +170,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLStrong element.
* \param $content The content for this element
@@ -185,7 +181,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLDefinition element.
* \param $content The content for this element
@@ -197,7 +192,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLCode element.
* \param $content The content for this element
@@ -209,7 +203,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLSample element.
* \param $content The content for this element
@@ -221,7 +214,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLKeyboard element.
* \param $content The content for this element
@@ -233,7 +225,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLVariable element.
* \param $content The content for this element
@@ -245,7 +236,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLCitation element.
* \param $content The content for this element
@@ -257,7 +247,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLAbbreviation element.
* \param $content The content for this element
@@ -465,7 +454,6 @@
return $element;
}
-
/**
* Create an AnewtXHTMLHeader4 element.
* \param $content The content for this element
@@ -858,7 +846,8 @@
*/
function ax_img_src($src, $attributes=null)
{
- /* Use src for alt, since the alt attribute is required */
+ /* Use an empty value for the required alt attribute. An empty value means
+ * the image can safely be ignored for a11y. */
$element = ax_img_src_alt($src, '', $attributes);
return $element;
}
@@ -1043,7 +1032,7 @@
*/
function ax_javascript_src($src, $attributes=null)
{
- $element = ax_javascript(null);
+ $element = ax_javascript(null, $attributes);
$element->set_attribute('src', $src);
return $element;
}
@@ -1066,7 +1055,7 @@
*/
function ax_meta_name_content($name, $content, $attributes=null)
{
- $element = ax_meta();
+ $element = ax_meta($attributes);
$element->set_attribute('name', $name);
$element->set_attribute('content', $content);
return $element;
@@ -1099,7 +1088,7 @@
*/
function ax_iframe_src($src, $attributes=null)
{
- $element = new AnewtXHTMLIFrame();
+ $element = new AnewtXHTMLIFrame($attributes);
$element->set_attribute('src', $src);
return $element;
}