Explorar o código

LibWeb: Force a relayout when scrolling to anchor

This ensures that the layout information is current, even when the
scroll request happens immediately upon page load.

This fixes an issue where reloading ACID2 wouldn't scroll down to the
"#top" anchor point.
Andreas Kling %!s(int64=3) %!d(string=hai) anos
pai
achega
4708a65160
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp

+ 1 - 1
Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp

@@ -164,7 +164,7 @@ void BrowsingContext::scroll_to_anchor(String const& fragment)
         }
     }
 
-    active_document()->update_layout();
+    active_document()->force_layout();
 
     if (!element || !element->layout_node())
         return;