jdk
jdk copied to clipboard
JDK-8314731 : Add support for the alt attribute in the image type input HTML tag
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~~
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
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
- Alexey Ivanov (@aivanov-jdk - Reviewer) 🔄 Re-review required (review applies to a3e8ce51)
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
: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.
@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.
https://bugs.openjdk.org/browse/JDK-8314731
Webrevs
- 11: Full (5e6a08bd)
- 10: Full (25965200)
- 09: Full (9b423808)
- 08: Full (7464eee4)
- 07: Full (de644539)
- 06: Full - Incremental (68b7cf2a)
- 05: Full - Incremental (528ba7b5)
- 04: Full - Incremental (3411398d)
- 03: Full (242bf546)
- 02: Full - Incremental (a3e8ce51)
- 01: Full - Incremental (0e08107b)
- 00: Full (e6308e01)
@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!
Waiting for a review.
@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).
/integrate
@scientificware Your change (at version 0e08107b7ded3c1a8d3b7bd9dc9507ab21a559ed) is now ready to be sponsored by a Committer.
/reviewers 2
@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).
Is it possible to write a jtreg test for this feature? Do we want to test it?
⚠️ @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).
I wonder if it's possible to write a (unit) test which verifies the new behaviour… and whether it's worth doing.
: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
@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!
@scientificware - are you still working on this ?
@prrace Yes but I have to postpone this work.
@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!
@scientificware please say when you will be getting back to this
@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.
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.
@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!
@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.
/open
@scientificware This pull request is now open
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 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!
Awaiting review.
@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!