Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8323801: <s> tag doesn't strikethrough the text #17659

Closed
wants to merge 5 commits into from

Conversation

aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Jan 31, 2024

When <s> tag is used inside <u>, the line-through style is lost, and the text is rendered with underline only. However, if <strike> is used, the text is rendered with both underline and line-through styles.

Both <s> and <strike> should render the text the same way.


Progress

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

Issue

  • JDK-8323801: <s> tag doesn't strikethrough the text (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17659

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

Using diff file

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

Webrev

Link to Webrev Comment

If <s> is inside <u>, line-through is lost, yet it's preserved
if <strike> is used. Ensure both elements are handled similarly.
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2024

👋 Welcome back aivanov! 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 added the rfr Pull request is ready for review label Jan 31, 2024
@openjdk
Copy link

openjdk bot commented Jan 31, 2024

@aivanov-jdk 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 openjdk bot added the client client-libs-dev@openjdk.org label Jan 31, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 31, 2024

Webrevs

Copy link
Contributor

@honkar-jdk honkar-jdk left a comment

Choose a reason for hiding this comment

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

Changes looks good. The <s> tag works as expected as in the case of standard HTML with the fix.

Copy link
Contributor

@DamonGuy DamonGuy left a comment

Choose a reason for hiding this comment

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

Tested changes and checked results myself locally. Looks good. Only comment is to possibly rename the test to HTMLUnderlineAndStrike or something similar just to be more clear about what it tests, just in case underline needs to be tested too. I'm fine with it as is though if that's preferred.

@@ -2473,7 +2501,7 @@ public HTMLReader(int offset, int popDepth, int pushDepth,
tagMap.put(HTML.Tag.SMALL, ca);
tagMap.put(HTML.Tag.SPAN, ca);
tagMap.put(HTML.Tag.STRIKE, conv);
tagMap.put(HTML.Tag.S, ca);
tagMap.put(HTML.Tag.S, conv);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we not update the spec

* <th scope="row">{@code HTML.Tag.STRIKE}
* <td>CharacterAction
* <tr>
* <th scope="row">{@code HTML.Tag.S}
* <td>CharacterAction
* <tr>

to mention that it is now ConvertAction and not CharacterAction

Copy link
Member Author

@aivanov-jdk aivanov-jdk Feb 9, 2024

Choose a reason for hiding this comment

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

It's a good question.

We can't do it because ConvertAction is not public. In fact, B, FONT, I, STRIKE, SUB, SUP, U use ConvertAction instead of the specified CharacterAction.

The bigger problem is that ConvertAction does not extend CharacterAction, which means the implementation is different from what is specified. It is the result of JDK-4171509.

There are a few more inconsistencies between the table and the real implementation. There are also references to non-public action classes, such as TitleAction, LinkAction

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably we can do away with those tags which mention internal class OR mention the public action instead, like TagAction instead of ConvertAction
HiddenAction instead of TitleAction etc

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree we should do something about it. I think ConvertAction can be subclass of CharacterAction, then the listed actions in the table will be more inline with the implementation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've submitted JDK-8325620: HTMLReader uses ConvertAction instead of specified CharacterAction for <b>, <i>, <u>

Copy link
Member Author

Choose a reason for hiding this comment

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

HiddenAction instead of TitleAction etc

I've submitted JDK-8325623: HTMLReader refers to non-public classes as tag handlers

I decided to submit separate bugs because ConvertAction would likely have some source code changes. However, both bugs can be addressed as one changeset.


if (!errors.isEmpty()) {
errors.delete(errors.length() - 2, errors.length());
throw new Error(errors + " must have both "
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be RuntimeException inline with other tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Error is shorter and conveys the reason better.

If you insist, I can use RuntimeException.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's about consistency...majority client tests uses RE while handful uses Error...not sure if there is any consensus on it..

@openjdk
Copy link

openjdk bot commented Feb 13, 2024

@aivanov-jdk 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:

8323801: <s> tag doesn't strikethrough the text

Reviewed-by: honkar, dnguyen, psadhukhan

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 256 new commits pushed to the master branch:

  • 8765b17: 8325800: Drop unused cups declaration from Oracle build configuration
  • 628cd8a: 8303866: Allow ZipInputStream.readEnd to parse small Zip64 ZIP files
  • 842b895: 8303891: Speed up Zip64SizeTest using a small ZIP64 file
  • 243fb46: 8325750: Fix spelling of ForceTranslateFailure help message
  • 74b90aa: 8325672: C2: allocate PhaseIdealLoop::_loop_or_ctrl from C->comp_arena()
  • 6dfa7f3: 8325541: C2 SuperWord: refactor filter / split
  • 6b7c971: 8325382: (fc) FileChannel.transferTo throws IOException when position equals size
  • 13d9e8f: 8325590: Regression in round-tripping UTF-16 strings after JDK-8311906
  • 57b04e1: 8325748: Serial: Move Generation::promote to TenuredGeneration
  • 7cd25ed: 8322854: Incorrect rematerialization of scalar replaced objects in C2
  • ... and 246 more: https://git.openjdk.org/jdk/compare/fbaaac63d4ae8d7cc0ec02ab4b5a934824d1fec1...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 13, 2024
Copy link
Contributor

@DamonGuy DamonGuy left a comment

Choose a reason for hiding this comment

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

Updates look good

@aivanov-jdk
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 16, 2024

Going to push as commit 80b63b6.
Since your change was applied there have been 295 commits pushed to the master branch:

  • 9f4ec21: 8325862: set -XX:+ErrorFileToStderr when executing java in containers for some container related jtreg tests
  • 0aaec97: 8325763: Revert properties: vm.opt.x.*
  • 4018b2b: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin
  • 2705ed0: 8325074: ZGC fails assert(index == 0 || is_power_of_2(index)) failed: Incorrect load shift: 11
  • 3d85103: 8316813: NMT: Using WhiteBox API, virtual memory tracking should also be stressed in JMH tests
  • ba8db1f: 8325876: crashes in docker container tests on Linuxppc64le Power8 machines
  • 18cea82: 8319801: Recursive lightweight locking: aarch64 implementation
  • 9029bf6: 8316451: 6 java/lang/instrument/PremainClass tests ignore VM flags
  • 99c9ae1: 8323664: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java still fails with JNI warning on some Windows configurations
  • 0fdfdf7: 8325983: Build failure after JDK-8324580
  • ... and 285 more: https://git.openjdk.org/jdk/compare/fbaaac63d4ae8d7cc0ec02ab4b5a934824d1fec1...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 16, 2024
@openjdk openjdk bot closed this Feb 16, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 16, 2024
@openjdk
Copy link

openjdk bot commented Feb 16, 2024

@aivanov-jdk Pushed as commit 80b63b6.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants