mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
5682d40581
This patch adds a change hint to signal that one of the offsets on a frame has been changed. When processing the hint, we do one of the following things based on the position property of the frame. * For static frames, we ignore the offset changes completely, as they will not change the layout. * For relative positioned frames, this patch refactors the nsHTMLReflowState::ComputeRelativeOffsets function so that it can be used from other callers, and it uses that to compute the new relative offsets, and uses the offsets computed previously to compute the new position of the frame. * For absolute positioned frames, we set up a fake parent reflow state object, and then we create a new reflow state object for the frame in question. This setup is similar to what nsFrame::BoxReflow does. Once we have the new reflow state object, we use it to compute the absolute offsets, and then we use the computed offsets to set the new position of the frame. The offset computation is similar to what nsAbsoluteContainingBlock::ReflowAbsoluteFrame does. In some cases where it is possible for the dimensions of the frame to change based on the offset changes, we fall back to a full reflow.
24 lines
647 B
HTML
24 lines
647 B
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<body>
|
|
<style>
|
|
#a { border: 1px solid black; width: 100px; height: 100px; }
|
|
#b { border: 1px solid blue; width: 50px; height: 50px; }
|
|
div { position: absolute; }
|
|
</style>
|
|
<script>
|
|
document.addEventListener("MozReftestInvalidate", function() {
|
|
var a = document.querySelector("#a");
|
|
var b = document.querySelector("#b");
|
|
a.style.left = "10px";
|
|
b.style.left = "20px";
|
|
document.documentElement.removeAttribute("class");
|
|
}, false);
|
|
</script>
|
|
<div id="a">
|
|
<div id="b">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|