jdk icon indicating copy to clipboard operation
jdk copied to clipboard

JDK-8314731 : Add support for the alt attribute in the image type input HTML tag

Open scientificware opened this issue 2 years ago • 41 comments
trafficstars

This is referenced in Java Bug Database as

This is tracked in JBS as

According HTML 3.2 specification

alt is not an attribute of the input element.

According HTML 4.01 specifications :

... For accessibility reasons, authors should provide alternate text for the image via the alt attribute. ...

This feature is not implemented in FormView.java.

⚠️ ~~This also affects the HTML 32 DTD~~

Screenshot_20230817_025316

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="files:none_oracle_logo_50x50.jpg">
                </body>
            </html>
            """;
        Document doc = kit.createDefaultDocument();
        jEditorPane.setDocument(doc);
        jEditorPane.setText(htmlString);
        JFrame jf = new JFrame("CSS named colors Test");
        jf.getContentPane().add(scrollPane, BorderLayout.CENTER);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setSize(new Dimension(400,200));
        jf.setLocationRelativeTo(null);
        jf.setVisible(true);
      }
    });
  }
}

The image to use with the code above, save it with the name : oracle_logo_50x50.jpg oracle_logo_50x50.jpg

Designed from : ScientificWare : JDK-8314731 : Add support for the alt attribute in the image type input HTML tag


Progress

  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue
  • [ ] Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8314731: Add support for the alt attribute in the image type input HTML tag (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319
$ git checkout pull/15319

Update a local copy of the PR:
$ git checkout pull/15319
$ git pull https://git.openjdk.org/jdk.git pull/15319/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15319

View PR using the GUI difftool:
$ git pr show -t 15319

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15319.diff

Using Webrev

Link to Webrev Comment

scientificware avatar Aug 17 '23 00:08 scientificware

:wave: Welcome back scientificware! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Aug 17 '23 00:08 bridgekeeper[bot]

@scientificware The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

openjdk[bot] avatar Aug 17 '23 00:08 openjdk[bot]

https://bugs.openjdk.org/browse/JDK-8314731

victordyakov avatar Aug 22 '23 16:08 victordyakov

@scientificware This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Sep 27 '23 21:09 bridgekeeper[bot]

Waiting for a review.

scientificware avatar Sep 28 '23 06:09 scientificware

@scientificware This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8314731: Add support for the alt attribute in the image type input HTML tag

Reviewed-by: aivanov, prr, tr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 34 new commits pushed to the master branch:

  • 84aa295227749f5daf73100550355ac6d56a6eca: 8367368: Add message for verify_legal_class_modifiers for inner classes
  • 4e59c63ec5a896a09f61a019e2fc5a2ec75ec40e: 8367282: FORBID_C_FUNCTION needs exception spec consistent with library declaration
  • 850f904a84186b514a9b79fd4625b4651e73149b: 8367451: GenShen: Remove the option to compute age census during evacuation
  • ... and 31 more: https://git.openjdk.org/jdk/compare/134c3ef41e774b483bcce32ce2fe0ef416017728...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aivanov-jdk, @prrace, @TejeshR13) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

openjdk[bot] avatar Oct 18 '23 21:10 openjdk[bot]

/integrate

scientificware avatar Oct 23 '23 05:10 scientificware

@scientificware Your change (at version 0e08107b7ded3c1a8d3b7bd9dc9507ab21a559ed) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Oct 23 '23 05:10 openjdk[bot]

/reviewers 2

aivanov-jdk avatar Oct 23 '23 15:10 aivanov-jdk

@aivanov-jdk The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

openjdk[bot] avatar Oct 23 '23 15:10 openjdk[bot]

Is it possible to write a jtreg test for this feature? Do we want to test it?

aivanov-jdk avatar Oct 23 '23 15:10 aivanov-jdk

⚠️ @scientificware This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

openjdk[bot] avatar Nov 02 '23 23:11 openjdk[bot]

I wonder if it's possible to write a (unit) test which verifies the new behaviour… and whether it's worth doing.

aivanov-jdk avatar Nov 21 '23 14:11 aivanov-jdk

:warning: @scientificware the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout scientificware-patch-006-HTML-adds_input_tag_image_type_alt_attribute_support
$ git commit --author='Preferred Full Name <[email protected]>' --allow-empty -m 'Update full name'
$ git push

openjdk[bot] avatar Nov 21 '23 14:11 openjdk[bot]

@scientificware This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Jan 04 '24 18:01 bridgekeeper[bot]

@scientificware - are you still working on this ?

prrace avatar Jan 16 '24 21:01 prrace

@prrace Yes but I have to postpone this work.

scientificware avatar Jan 19 '24 19:01 scientificware

@scientificware This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Mar 12 '24 15:03 bridgekeeper[bot]

@scientificware please say when you will be getting back to this

prrace avatar May 01 '24 16:05 prrace

@prrace Sorry for the delay about all my contributions but I won a racing bib for the "Marathon Pour Tous" of Paris 2024 Olympic Games. So I have suspended all projects becauseof my training plan until september.

My intent is to deliver the unit test in december.

scientificware avatar May 01 '24 18:05 scientificware

I won a racing bib for the "Marathon Pour Tous" of Paris 2024 Olympic Games.

Congratulations! Good luck!

…I have suspended all projects becauseof my training plan until september.

My intent is to deliver the unit test in december.

@scientificware Could you please convert this PR to draft then? Click Convert to draft on the right side below the list of reviewers.

aivanov-jdk avatar May 07 '24 13:05 aivanov-jdk

@scientificware This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Jul 02 '24 22:07 bridgekeeper[bot]

@scientificware This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Aug 28 '24 02:08 bridgekeeper[bot]

/open

scientificware avatar Dec 01 '24 00:12 scientificware

@scientificware This pull request is now open

openjdk[bot] avatar Dec 01 '24 00:12 openjdk[bot]

I wonder if it's possible to write a (unit) test which verifies the new behaviour… and whether it's worth doing.

@aivanov-jdk Done.

please say when you will be getting back to this

@prrace I'm getting back to this issue.

scientificware avatar Dec 01 '24 01:12 scientificware

@scientificware This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Jan 06 '25 21:01 bridgekeeper[bot]

Awaiting review.

scientificware avatar Jan 06 '25 23:01 scientificware

@scientificware This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Feb 03 '25 23:02 bridgekeeper[bot]