summaryrefslogtreecommitdiff
path: root/Base/home/anon/www
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-20 09:14:12 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-20 10:07:26 +0200
commitc41bae3d54a0e88af559751b4ec8ec5e77b00069 (patch)
tree712abd4725c642c13a1ebd51d1a201b770b8084a /Base/home/anon/www
parent202dfbd6cde709633443eb075aa6631fde8c018a (diff)
downloadserenity-c41bae3d54a0e88af559751b4ec8ec5e77b00069.zip
LibHTML+Browser: Support scrolling to anchor with <a href="#foo">
This patch implements basic support for <a href="#foo"> fragment links. To figure out where we actually want to scroll to, we have to do something different based on the layout node's box type. So if it's a regular LayoutBox we can just use the LayoutBox::position(). However, if it's an inline layout node, we use the position of the first line box fragment in the containing block contributed by this layout node or one of its descendants.
Diffstat (limited to 'Base/home/anon/www')
-rw-r--r--Base/home/anon/www/afrag.html23
-rw-r--r--Base/home/anon/www/welcome.html1
2 files changed, 24 insertions, 0 deletions
diff --git a/Base/home/anon/www/afrag.html b/Base/home/anon/www/afrag.html
new file mode 100644
index 0000000000..cf60bc5b0e
--- /dev/null
+++ b/Base/home/anon/www/afrag.html
@@ -0,0 +1,23 @@
+<html>
+ <head><title>a#hash test</title></head>
+ <body>
+ <ul>
+ <li><a href="#section1">Section 1</a></li>
+ <li><a href="#section2">Section 2</a></li>
+ <li><a href="#section3">Section 3</a></li>
+ <li><a href="#section4">Section 4</a></li>
+ </ul>
+ <h1><a name="section1">Section 1</a></h1>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <h1><a name="section2">Section 2</a></h1>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <h1><a name="section3">Section 3</a></h1>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <h1><a name="section4">Section 4</a></h1>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
+ </body>
+</html>
diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html
index 7b5ddf0239..2e78818e68 100644
--- a/Base/home/anon/www/welcome.html
+++ b/Base/home/anon/www/welcome.html
@@ -33,6 +33,7 @@ h1 {
<li><a href="blink.html">blink element</a></li>
<li><a href="br.html">br element</a></li>
<li><a href="hover.html">hover element</a></li>
+ <li><a href="afrag.html">links with fragments</a></li>
<li><a href="http://www.serenityos.org/">www.serenityos.org</a></li>
</ul>
</body>