haikuwebkit/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-...

56 lines
1.2 KiB
HTML
Raw Permalink Normal View History

Subpixel rendering: Clipping on text areas when shifted by one device pixel. https://bugs.webkit.org/show_bug.cgi?id=132008 Reviewed by Darin Adler. Make RenderTheme paint* functions LayoutRect aware. Textarea is device pixel snapped, while other theme controls are still on integral size/positions. Source/WebCore: Test: fast/forms/hidpi-textarea-on-subpixel-position.html * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): (WebCore::RenderTheme::paintBorderOnly): (WebCore::RenderTheme::paintDecorations): * rendering/RenderTheme.h: (WebCore::RenderTheme::paintTextField): (WebCore::RenderTheme::paintTextFieldDecorations): (WebCore::RenderTheme::paintTextArea): (WebCore::RenderTheme::paintTextAreaDecorations): * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintTextFieldDecorations): (WebCore::RenderThemeIOS::paintTextAreaDecorations): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): (WebCore::RenderThemeMac::paintTextArea): LayoutTests: * fast/forms/hidpi-textarea-on-subpixel-position-expected.html: Added. * fast/forms/hidpi-textarea-on-subpixel-position.html: Added. * platform/mac-wk2/TestExpectations: Due to defective RenderLayer cliprect calculation (WK2 only): webkit.org/b/132100 Canonical link: https://commits.webkit.org/150185@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-24 20:46:26 +00:00
<!DOCTYPE html>
<html>
<head>
<title>This tests that we can subpixel position textareas properly.</title>
<style>
div {
position: fixed;
}
.outer {
border: 0.5px solid black;
}
.cover {
width: 5px;
height: 5px;
position: fixed;
background: green;
}
</style>
</head>
<body>
<p id="container"></p>
<script>
var container = document.getElementById("container");
adjustment = 0.2;
w=20; h=20;
for (i = 0; i < 15; ++i) {
adjustment+=0.1;
for (j = 0; j < 15; ++j) {
var e = document.createElement("div");
var topLeftY = ((w + 10) * i + j * adjustment);
var topLeftX = ((w + 10) * j + i * adjustment);
e.style.top = topLeftY + "px";
e.style.left = topLeftX + "px";
e.style.width = w + "px";
e.style.height = h + "px";
e.className = "outer";
container.appendChild(e);
var cover = document.createElement("div");
cover.style.top = (topLeftY + h - h/2 + 1) + "px";
cover.style.left = (topLeftX + w - w/2 + 1) + "px";
cover.style.width = w/2 + "px";
cover.style.height = h/2 + "px";
cover.className = "cover";
container.appendChild(cover);
w+=0.1;
h+=0.1;
}
}
</script>
</body>
</html>