Skip to content

8367348: Enhance PassFailJFrame to support links in HTML#3147

Open
TheMangovnik wants to merge 1 commit into
openjdk:masterfrom
TheMangovnik:backport/JDK-8367348
Open

8367348: Enhance PassFailJFrame to support links in HTML#3147
TheMangovnik wants to merge 1 commit into
openjdk:masterfrom
TheMangovnik:backport/JDK-8367348

Conversation

@TheMangovnik

@TheMangovnik TheMangovnik commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Backport of JDK-8367348 - Enhance PassFailJFrame to support links in HTML. Tests become more interactive if users can click links in the instructions and handle them with their own HyperlinkListener.

This backport is in follow up to the backport of JDK-8213781 (this PR).

There are two differences compared to the corresponding backport to jdk17

  • The change to comment block was omitted because the comment block differ quite a bit between current jdk11 and jdk17 versions, hence it is not clear if and where this change should be integrated.
  • This if uses pattern matching for instanceof, which is a feature that is not supported by jdk11, hence I edited this to be jdk11 compatible.
// version in jdk17
if (hyperlinkListener != null && text instanceof JEditorPane ep) {
    ep.addHyperlinkListener(hyperlinkListener);
}

// version in this backport
if (hyperlinkListener != null && text instanceof JEditorPane) {
    ((JEditorPane) text).addHyperlinkListener(hyperlinkListener);
}

Tests

Testing was done on Fedora 43.

Tier 1 - PASSES

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR
   jtreg:test/hotspot/jtreg:tier1                     1497  1497     0     0
   jtreg:test/jdk:tier1                               1900  1900     0     0
   jtreg:test/langtools:tier1                         3940  3940     0     0
   jtreg:test/nashorn:tier1                              0     0     0     0
   jtreg:test/jaxp:tier1                                 0     0     0     0
==============================
TEST SUCCESS

GTest - PASSES

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR
   gtest:all/server                                    504   504     0     0
==============================
TEST SUCCESS

GHA - PASSES

macos-x64 hs/tier1 serviceability is failing, but this seems to be common over other unrelated PRs too -> not relevant to this backport.

Bonus tests - PASSES

I identified following interactive tests that are affected by this backport that seems to be behaving the same way before and after this backport:

  • test/jdk/java/awt/font/TextLayout/ArabicBox.java
  • test/jdk/java/awt/font/TextLayout/TestJustification.java
  • test/jdk/java/awt/Frame/ALTTABIconBeingErased/ALTTABIconBeingErased.java
  • test/jdk/java/awt/Frame/DefaultSizeTest.java
  • test/jdk/java/awt/Frame/GetBoundsResizeTest.java
  • test/jdk/java/awt/geom/HitTest/PathHitTest.java
  • test/jdk/java/awt/Icon/IconChangingTest/IconChangingTest.java
  • test/jdk/java/awt/Icon/IconShowingTest/IconShowingTest.java
  • test/jdk/java/awt/Icon/IconTransparencyTest/IconTransparencyTest.java
  • test/jdk/java/awt/Icon/SetLargeIconTest/SetLargeIconTest.java
  • test/jdk/java/awt/LightweightComponent/LightweightCliprect.java
  • test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_1.java
  • test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_2.java
  • test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_3.java
  • test/jdk/java/awt/MenuBar/AddRemoveMenuBarTests/AddRemoveMenuBarTest_4.java
  • test/jdk/java/awt/PopupMenu/TruncatedPopupMenuTest.java
  • test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
  • test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java
  • test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java
  • test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java
  • test/jdk/java/awt/print/PrinterJob/PrintLatinCJKTest.java
  • test/jdk/java/awt/TrayIcon/TrayIconScalingTest.java
  • test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java
  • test/jdk/javax/swing/JComboBox/JComboBoxActionEvent.java
  • test/jdk/javax/swing/JComboBox/JComboBoxBorderTest.java
  • test/jdk/javax/swing/JFrame/bug4419914.java
  • test/jdk/javax/swing/JFrame/DefaultCloseOperation.java
  • test/jdk/javax/swing/JMenuItem/TestRadioAndCheckMenuItemWithIcon.java
  • test/jdk/javax/swing/JRadioButton/bug4380543.java
  • test/jdk/javax/swing/JTabbedPane/4209065/bug4209065.java
  • test/jdk/javax/swing/JToolBar/bug4203039.java
  • test/jdk/javax/swing/MultiMonitor/MultimonVImage.java
  • test/jdk/javax/swing/ProgressMonitor/ProgressTest.java
  • test/jdk/javax/swing/text/bug4148489.java
  • test/jdk/javax/swing/text/html/StyleSheet/bug4803145.java
  • test/jdk/javax/swing/text/PaintTest.java
  • test/jdk/sun/awt/PaletteTester.java

Bonus info

This PR may not be the best place to mention this, but since I have no idea where other place to bring this up:

While trying to run the interactive tests mentioned above I find out that few of them are unable to compile, since they make use of """ for string block, which is a feature that is not supported by jdk11. The tests that this applies to:

  • GetBoundsResizeTest.java
  • AddRemoveMenuBarTest_1.java
  • AddRemoveMenuBarTest_2.java
  • AddRemoveMenuBarTest_3.java
  • AddRemoveMenuBarTest_4.java

Out of curiosity I searched the jdk11 repo and found one more test that also uses """:

  • test/jdk/sun/awt/PaletteTester.java

Looking into other tests from above that also failed:

  • JComboBoxBorderTest.java -> seems to be macos specific test that is being executed on Linux too, because it misses corresponding annotation to be run only on mac.
  • TestJustification.java also seems to be failing on Linux, but in test/jdk/ProblemList.txt it is mention only as mac specific.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • JDK-8367348 needs maintainer approval
  • Commit message must refer to an issue

Issue

  • JDK-8367348: Enhance PassFailJFrame to support links in HTML (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3147/head:pull/3147
$ git checkout pull/3147

Update a local copy of the PR:
$ git checkout pull/3147
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3147/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3147

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3147.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Feb 9, 2026

Copy link
Copy Markdown

👋 Welcome back TheMangovnik! 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.

@openjdk

openjdk Bot commented Feb 9, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot changed the title backport 9e1a6bef2ac7f0c7615d153672a296847f09240a 8367348: Enhance PassFailJFrame to support links in HTML Feb 9, 2026
@openjdk

openjdk Bot commented Feb 9, 2026

Copy link
Copy Markdown

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Feb 9, 2026
@mlbridge

mlbridge Bot commented Feb 9, 2026

Copy link
Copy Markdown

Webrevs

@gnu-andrew gnu-andrew left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we should backport the resolved subtasks of JDK-8318688 first before this change, particularly 8340785: Update description of PassFailJFrame and samples and 8350260: Improve HTML instruction formatting in PassFailJFrame. The former adds in the documentation you couldn't find and the latter resolves the difference in the styles.addRule line. With those, it would leave the only difference as the instanceof change (which looks correct)

@TheMangovnik

Copy link
Copy Markdown
Contributor Author

So:

  • All of the resolved subtasks from JDK-8318688 before this one?
  • Or only the two you pointed out before this one and the remaining from JDK-8318688 at any unrelated point?

However, this is for after CPU neither way, since all of them have P4, right?

@gnu-andrew

Copy link
Copy Markdown
Member

So:

* All of the resolved subtasks from [JDK-8318688](https://bugs.openjdk.org/browse/JDK-8318688) before this one?

* Or only the two you pointed out before this one and the remaining from [JDK-8318688](https://bugs.openjdk.org/browse/JDK-8318688) at any unrelated point?

Only the two are prerequisites for this change, as that should mean the hunk doesn't need to be dropped and this should be close to clean. The others I'll leave to you to pursue if you wish.

However, this is for after CPU neither way, since all of them have P4, right?

Yeah. 11u-dev is now taking changes for July.

@bridgekeeper

bridgekeeper Bot commented Apr 12, 2026

Copy link
Copy Markdown

@TheMangovnik 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 issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheMangovnik

Copy link
Copy Markdown
Contributor Author

/touch

@openjdk

openjdk Bot commented Apr 13, 2026

Copy link
Copy Markdown

@TheMangovnik The pull request is being re-evaluated and the inactivity timeout has been reset.

@openjdk openjdk Bot removed the rfr Pull request is ready for review label Apr 13, 2026
@bridgekeeper

bridgekeeper Bot commented May 11, 2026

Copy link
Copy Markdown

@TheMangovnik 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 issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheMangovnik

Copy link
Copy Markdown
Contributor Author

/touch

@TheMangovnik

Copy link
Copy Markdown
Contributor Author

/template append

@openjdk

openjdk Bot commented May 13, 2026

Copy link
Copy Markdown

@TheMangovnik The pull request is being re-evaluated and the inactivity timeout has been reset.

@openjdk

openjdk Bot commented May 13, 2026

Copy link
Copy Markdown

@TheMangovnik The pull request template has been appended to the pull request body

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 14, 2026
@bridgekeeper

bridgekeeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

@TheMangovnik 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 issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants