Skip to content

JDK-8292157: Incorrect error: "block element not allowed within inline element <a>" #13990

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

Closed
wants to merge 4 commits into from

Conversation

hns
Copy link
Member

@hns hns commented May 15, 2023

Please review a change to downgrade from error to warning if the label of a <a> element or reference tag contains an HTML block element. Before HTML 5, elements were clearly divided into block and inline elements, and the latter were not allowed to contain the former.

With HTML5, the division between block and inline elements is delegated to CSS, and although elements have default styles, styles can be freely customized by the author. This applies especially true for the <a> element which is commonly used both with inline and block layout. That was the rationale for downgrading from error to warning for the <a> element only. See the JBS issue comments for details and references.

The error message for the warning was enhanced to refer to the default style for the <a> element.


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-8292157: Incorrect error: "block element not allowed within inline element <a>" (Bug - "4")

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13990

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 15, 2023

👋 Welcome back hannesw! 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 May 15, 2023
@openjdk
Copy link

openjdk bot commented May 15, 2023

@hns The following labels will be automatically applied to this pull request:

  • compiler
  • javadoc

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

@openjdk openjdk bot added javadoc javadoc-dev@openjdk.org compiler compiler-dev@openjdk.org labels May 15, 2023
@mlbridge
Copy link

mlbridge bot commented May 15, 2023

Webrevs

@@ -77,8 +77,8 @@ dc.tag.nested.tag=nested tag: {0}
dc.tag.not.allowed.here = tag not allowed here: <{0}>
dc.tag.not.allowed = element not allowed in documentation comments: <{0}>
dc.tag.not.allowed.inline.element = block element not allowed within inline element <{1}>: {0}
dc.tag.not.allowed.inline.tag = block element not allowed within @{1}: {0}
dc.tag.not.allowed.inline.other = block element not allowed here: {0}
dc.tag.not.allowed.element.default.style = block element not allowed within element <{1}> with default style: {0}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to improve the wording?

As written, it is ambiguous/confusing: it seems like {0} is the default style, which I don't think is what you intend.
Also, inconsistent pointy brackets <{1}> but just {0}

Copy link
Member Author

Choose a reason for hiding this comment

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

Would the following be better?

block element <{0}> not allowed within element <{1}> with default style

I found inconsistent use of angle brackets in several other messages in that file. Attempting to fix that causes a lot of breaking doclint tests, not sure if it is worth doing that as part of this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

That looks good

Optionally, we could file a followup RFE to try and make more resources more stylistically consistent

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 changed the messages to the new format.

@openjdk
Copy link

openjdk bot commented Jun 6, 2023

@hns 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:

8292157: Incorrect error: "block element not allowed within inline element <a>"

Reviewed-by: jjg

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

  • 16ab7bf: 8309505: com/sun/jdi/MethodEntryExitEvents.java due to finding wrong main thread
  • d82436e: 8295071: Spec Clarification : ClassFileFormatVersion: System property java.class.version | Java class format version number
  • 571fbdc: 8309506: com/sun/jdi/MultiBreakpointsTest.java fails with virtual test thread factory
  • 7d1147e: 8309554: Update descriptions in SourceVersion
  • 9526190: 8307840: SequencedMap view method specification and implementation adjustments
  • 74dc50b: 8301721: lookup.findSpecial fails on Object method call from interface
  • 0f0fda7: 8309542: compiler/jvmci/TestEnableJVMCIProduct.java fails with "JVMCI compiler 'graal' specified by jvmci.Compiler not found"
  • 38cef2a: 8309413: Improve the performance of MethodTypeDesc::descriptorString
  • 7edd054: 8309501: Remove workaround in bin/idea.sh for non standard JVMCI file layout
  • 9188142: 8309216: Cast from jchar* to char* in test java/io/GetXSpace.java
  • ... and 356 more: https://git.openjdk.org/jdk/compare/4b0f4213a566c3c6d49c034ab6e022c93c4289b1...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 Jun 6, 2023
@hns
Copy link
Member Author

hns commented Jun 6, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Jun 6, 2023

Going to push as commit 0a4f9ad.
Since your change was applied there have been 366 commits pushed to the master branch:

  • 16ab7bf: 8309505: com/sun/jdi/MethodEntryExitEvents.java due to finding wrong main thread
  • d82436e: 8295071: Spec Clarification : ClassFileFormatVersion: System property java.class.version | Java class format version number
  • 571fbdc: 8309506: com/sun/jdi/MultiBreakpointsTest.java fails with virtual test thread factory
  • 7d1147e: 8309554: Update descriptions in SourceVersion
  • 9526190: 8307840: SequencedMap view method specification and implementation adjustments
  • 74dc50b: 8301721: lookup.findSpecial fails on Object method call from interface
  • 0f0fda7: 8309542: compiler/jvmci/TestEnableJVMCIProduct.java fails with "JVMCI compiler 'graal' specified by jvmci.Compiler not found"
  • 38cef2a: 8309413: Improve the performance of MethodTypeDesc::descriptorString
  • 7edd054: 8309501: Remove workaround in bin/idea.sh for non standard JVMCI file layout
  • 9188142: 8309216: Cast from jchar* to char* in test java/io/GetXSpace.java
  • ... and 356 more: https://git.openjdk.org/jdk/compare/4b0f4213a566c3c6d49c034ab6e022c93c4289b1...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 6, 2023

@hns Pushed as commit 0a4f9ad.

💡 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
compiler compiler-dev@openjdk.org integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

2 participants