瀏覽代碼

LibWeb: Only update layout if actually needed when scrolling to anchor

Andreas Kling 3 年之前
父節點
當前提交
f9e814826f
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Userland/Libraries/LibWeb/Page/BrowsingContext.cpp

+ 1 - 2
Userland/Libraries/LibWeb/Page/BrowsingContext.cpp

@@ -158,8 +158,7 @@ void BrowsingContext::scroll_to_anchor(String const& fragment)
         }
         }
     }
     }
 
 
-    // FIXME: This is overly aggressive and should be something more like a "update_layout_if_needed()"
-    active_document()->force_layout();
+    active_document()->update_layout();
 
 
     if (!element || !element->layout_node())
     if (!element || !element->layout_node())
         return;
         return;