https://bugs.webkit.org/show_bug.cgi?id=149843
<rdar://problem/
22896977>
Reviewed by Darin Adler.
Source/WebCore:
When natively rendering a text field with a background on Mac, the background bleeds out
of the text field's border when the graphics context is scaled (as a result of a retina
display or zoom/scale effects). This is because when we render the text field in bezeled
style within a certain frame, AppKit adds 1 device pixel insets on all sides of the frame,
which renders a text field that is slightly smaller than the frame. To adjust for this, we
inflate the paint rect.
Test: fast/forms/hidpi-textfield-background-bleeding.html
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextField):
LayoutTests:
Add a layout test to check that the background of a natively rendered text field
cell does not bleed.
* TestExpectations:
* fast/forms/hidpi-textfield-background-bleeding-expected.html: Added.
* fast/forms/hidpi-textfield-background-bleeding.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190800
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Backgrounds bleed out of natively rendered text fields
+ https://bugs.webkit.org/show_bug.cgi?id=149843
+ <rdar://problem/22896977>
+
+ Reviewed by Darin Adler.
+
+ Add a layout test to check that the background of a natively rendered text field
+ cell does not bleed.
+
+ * TestExpectations:
+ * fast/forms/hidpi-textfield-background-bleeding-expected.html: Added.
+ * fast/forms/hidpi-textfield-background-bleeding.html: Added.
+
2015-10-08 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Stack trace view doesn't properly display lines without function names
--- /dev/null
+<html>
+<head>
+ <style>
+ body {
+ margin: 0;
+ }
+
+ div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ border: 0.5px black solid;
+ width: 99px;
+ height: 99px;
+ background-color: yellow;
+ }
+ </style>
+</head>
+
+<body>
+ <div />
+</body>
+
+</html>
--- /dev/null
+<html>
+<head>
+ <style>
+ div, input {
+ position: absolute;
+ top: 0;
+ left: 0;
+ }
+
+ input {
+ background-color: yellow;
+ width: 100px;
+ height: 100px;
+ }
+
+ div {
+ border: 0.5px black solid;
+ width: 99px;
+ height: 99px;
+ }
+ </style>
+</head>
+
+<body>
+ <input /><div />
+</body>
+
+</html>
fast/forms/focus-change-on-keypress.html [ Failure ]
fast/forms/focus-selection-input.html [ Failure ]
fast/forms/hidpi-textarea-on-subpixel-position.html [ ImageOnlyFailure ]
+fast/forms/hidpi-textfield-background-bleeding.html [ ImageOnlyFailure ]
fast/forms/implicit-submission.html [ Failure ]
fast/forms/input-baseline.html [ Failure ]
fast/forms/input-first-letter-edit.html [ ImageOnlyFailure ]
webkit.org/b/147254 media/restore-from-page-cache.html [ Pass Failure ]
+# After Mavericks, native text fields are rendered slightly smaller, causing backgrounds to bleed on platforms.
+[ Mavericks ] fast/forms/hidpi-textfield-background-bleeding.html [ ImageOnlyFailure ]
+
# These fast/forms/select tests open a pop-up menu (visible on screen even when using run-webkit-tests), and get stuck in its nested event loop.
webkit.org/b/87748 fast/forms/select/optgroup-clicking.html [ Skip ]
webkit.org/b/73304 fast/forms/select/menulist-popup-crash.html [ Skip ]
+2015-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Backgrounds bleed out of natively rendered text fields
+ https://bugs.webkit.org/show_bug.cgi?id=149843
+ <rdar://problem/22896977>
+
+ Reviewed by Darin Adler.
+
+ When natively rendering a text field with a background on Mac, the background bleeds out
+ of the text field's border when the graphics context is scaled (as a result of a retina
+ display or zoom/scale effects). This is because when we render the text field in bezeled
+ style within a certain frame, AppKit adds 1 device pixel insets on all sides of the frame,
+ which renders a text field that is slightly smaller than the frame. To adjust for this, we
+ inflate the paint rect.
+
+ Test: fast/forms/hidpi-textfield-background-bleeding.html
+
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::paintTextField):
+
2015-10-09 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
Refactor WebCore JS builtins to prepare for automatic generation
{
LocalCurrentGraphicsContext localContext(paintInfo.context());
+ // <rdar://problem/22896977> We adjust the paint rect here to account for how AppKit draws the text
+ // field cell slightly smaller than the rect we pass to drawWithFrame.
+ FloatRect adjustedPaintRect(r);
+ AffineTransform transform = paintInfo.context().getCTM();
+ if (transform.xScale() > 1 || transform.yScale() > 1) {
+ adjustedPaintRect.inflateX(1 / transform.xScale());
+ adjustedPaintRect.inflateY(1 / transform.yScale());
+ }
NSTextFieldCell *textField = this->textField();
GraphicsContextStateSaver stateSaver(paintInfo.context());
[textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))];
- [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)];
+ [textField drawWithFrame:NSRect(adjustedPaintRect) inView:documentViewFor(o)];
[textField setControlView:nil];