-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
ScreenY and outerHeight ignores the title bar height #37824
Copy link
Copy link
Labels
Description
Describe the bug:
Right now, this is done in Script like following:
servo/components/script/dom/window.rs
Lines 1662 to 1666 in a13f9bc
| // https://drafts.csswg.org/cssom-view/#dom-window-screeny | |
| fn ScreenY(&self) -> i32 { | |
| let (_, origin) = self.client_window(); | |
| origin.y | |
| } |
It sends the request to compositor, who ignores the toolbar height etc., giving inaccurate result.
For details, see #37812 (review)
To Reproduce:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<button id="logButton">Log Screen Info</button>
<script>
document.getElementById('logButton').addEventListener('click', function() {
console.log('ScreenX:', window.screenX);
console.log('ScreenY:', window.screenY);
console.log('OuterWidth:', window.outerWidth);
console.log('OuterHeight:', window.outerHeight);
});
</script>
</body>
</html>Platform:
All.
Reactions are currently unavailable