scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Scaladoc in-page links don't work #6466

Open scabug opened 12 years ago

scabug commented 12 years ago

[scaladoc interface bug, we should have a look at this during the Monday docspree]

to reproduce:

$ cat a.scala 
/** See [[foo]].
 *  @group hello
 */
class C {
  def foo = 1
}
$ scaladoc-2.10.0-wip -groups a.scala
model contains 2 documentable templates

Now open index.html in the browser. You'll get the root package with class C as a member. Click the link to foo in C's description. You'll get to class C and foo will be highlighted. So far so good.

Now, you're in class C's page, click again on the link to foo from the class description in the upper side of the main panel -- it should scroll to foo and highlight it. It doesn't do either of these. (you may need to resize the window to something smaller to check it's not scrolling)

Another example can be seen on: http://chara.epfl.ch/~ureche/scaladoc/library/scala/language$.html#higherKinds:languageFeature.higherKinds

1) The highlighting persists even though it should fade out 2) Clicking on any of the links in object language's description doesn't do anything

scabug commented 12 years ago

Imported From: https://issues.scala-lang.org/browse/SI-6466?orig=1 Reporter: @VladUreche Affected Versions: 2.10.0

scabug commented 12 years ago

@ingoem said: Taking this, since I have a fix.

scabug commented 11 years ago

@kzys said: It does scroll (in Chrome, at least) but it would be better to have highlight.

scabug commented 11 years ago

@adriaanm said: what's the status of this?

scabug commented 11 years ago

@ingoem said: IIRC, the problem was that the generated html can contain multiple elements with the same id (one in each div for orderings grouped, alphabetic and by inheritance). This has undefined behavior. Most browsers seem to remember just the first or last encountered element with a given id, which might in a hidden div. In that case the browser scrolls to the hidden div, but it won't highlight it, because it is not visible. I guess that's what Kato observes.

Fixing all this was more complicated than I thought. Instead of simply copying the docs for each ordering group, one has to either move things around dynamically or change the ids. Feel free to reassign to someone from the doc team (if such thing still exists).

scabug commented 11 years ago

@JamesIry said: 2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

scabug commented 11 years ago

@JamesIry said: 2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

SethTisue commented 6 years ago

is this bug still present in Scala 2.13.0-M5?