RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v5]
ScientificWare
duke at openjdk.org
Sun Dec 1 10:17:34 UTC 2024
> This is referenced in Java Bug Database as
> - [JDK-8314731 : Adds support for the alt attribute in the image type input HTML tag.](https://bugs.java.com/bugdatabase/view_bug?bug_id=8314731)
>
> This is tracked in JBS as
> - [JDK-8314731 : Add support for the alt attribute in the image type input HTML tag](https://bugs.openjdk.java.net/browse/JDK-8314731)
>
> According [HTML 3.2 specification](https://www.w3.org/TR/2018/SPSD-html32-20180315/#input)
>
> `alt` is not an attribute of the `input` element.
>
> According [HTML 4.01 specifications](https://www.w3.org/TR/html4/interact/forms.html#h-17.4) :
>
>> ... For accessibility reasons, authors should provide [alternate text](https://www.w3.org/TR/html4/struct/objects.html#alternate-text) for the image via the [alt](https://www.w3.org/TR/html4/struct/objects.html#adef-alt) attribute. ...
>
> This feature is not implemented in `FormView.java`.
>
> ⚠️ ~~This also affects the HTML 32 DTD~~
>
> 
>
> Left before the patch and right after the patch.
>
>
> import java.awt.BorderLayout;
> import java.awt.Dimension;
> import javax.swing.JEditorPane;
> import javax.swing.JFrame;
> import javax.swing.JScrollPane;
> import javax.swing.SwingUtilities;
> import javax.swing.text.Document;
> import javax.swing.text.html.HTMLEditorKit;
> import javax.swing.text.html.StyleSheet;
>
> public class HTMLAddsSupportAltInputTag {
> public static void main(String[] args) {
> new HTMLAddsSupportAltInputTag();
> }
>
> public HTMLAddsSupportAltInputTag() {
> SwingUtilities.invokeLater(new Runnable(){
> public void run(){
> JEditorPane jEditorPane = new JEditorPane();
> jEditorPane.setEditable(false);
> JScrollPane scrollPane = new JScrollPane(jEditorPane);
> HTMLEditorKit kit = new HTMLEditorKit();
> jEditorPane.setEditorKit(kit);
> StyleSheet styleSheet = kit.getStyleSheet();
> styleSheet.addRule("""
> body {
> color: #000;
> font-family:times;
> margin: 4px;
> }
> """);
> String htmlString = """
> <html>
> <body>
> <input type=image name=point src="file:oracle_logo_50x50.jpg" alt="Logo Oracle JPG">
> <p>
> <input type=image name=point src="file:none_oracle_logo_50x50.jpg" alt="Logo Oracle JPG">
> <p>
> <input type=image name=point src...
ScientificWare has updated the pull request incrementally with two additional commits since the last revision:
- getMaximumSpan(int axis) method
doc -> Not used
mouseReleased(MouseEvent evt) method
elem and hdoc -> not used
return -> could be removed, method returns void
loadElementDataIntoBuffer(Element elem, StringBuilder buffer) method
value != null -> name can't be null at this point
getInputElementData(AttributeSet attr) method
value = null -> Already set at null
- Removes files
make/javac.20231014_162919.args
make/javac.20231014_220237.args
make/javac.20231023_221655.args
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/15319/files
- new: https://git.openjdk.org/jdk/pull/15319/files/242bf546..3411398d
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=03-04
Stats: 175 lines in 4 files changed: 0 ins; 114 del; 61 mod
Patch: https://git.openjdk.org/jdk/pull/15319.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319
PR: https://git.openjdk.org/jdk/pull/15319
More information about the client-libs-dev
mailing list