Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8223378

CSS solution for navbar problem with <a> elements is not ideal

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 7
      Firefox 66.0.3 (64-Bit)

      A DESCRIPTION OF THE PROBLEM :
      Since Java 9 the navbar for the Java docs is floating and always visible at the top. Apparently this caused problems with anchors (see also JDK-8220002) so CSS attributes were added to <a> elements to solve this. However this solution is causing two problems:
      1. These anchors now take up space; compare for example
      https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html#methods.inherited.from.class.java.lang.Object
      https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Number.html#methods.inherited.from.class.java.lang.Object
      -> White rectangle above section
      2. If scrolling to the anchor works, then it scrolls to the wrong position:
      When using Firefox I have not experienced the problem described in JDK-8220002, but what I do experience is that it always does not scroll far enough down so parts of the sections above are visible, which is irritating:
      https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Number.html#methods.inherited.from.class.java.lang.Object

      REGRESSION : Last worked in version 8u212

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Look at `stylesheet.css` and you will see the following:
      a[name]:before, a[name]:target, a[id]:before, a[id]:target {
          content:"";
          display:inline-block;
          position:relative;
          padding-top:129px;
          margin-top:-129px;
      }

      Additionally perform the steps described in the description above.


      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              jjg Jonathan Gibbons
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: