Reviewed by Darin.
Fix for <rdar://problem/
5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges
* rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::setStyle):
Adjust outline-offset so it doesn't extend beyond the border to interfere with typing
LayoutTests:
Reviewed by Darin.
Test for <rdar://problem/
5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges
* fast/forms/textfield-outline.html: Added.
* platform/mac/fast/forms/textfield-outline-expected.checksum: Added.
* platform/mac/fast/forms/textfield-outline-expected.png: Added.
* platform/mac/fast/forms/textfield-outline-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28423
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-04 Adele Peterson <adele@apple.com>
+
+ Reviewed by Darin.
+
+ Test for <rdar://problem/5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges
+
+ * fast/forms/textfield-outline.html: Added.
+ * platform/mac/fast/forms/textfield-outline-expected.checksum: Added.
+ * platform/mac/fast/forms/textfield-outline-expected.png: Added.
+ * platform/mac/fast/forms/textfield-outline-expected.txt: Added.
+
2007-12-04 Sam Weinig <sam@webkit.org>
Reviewed by Adam Roben.
--- /dev/null
+<html>
+ <head>
+ <script>
+ function test()
+ {
+ var tf = document.getElementById('tf');
+ tf.focus();
+ if (window.layoutTestController) {
+ eventSender.keyDown("a");
+ eventSender.keyDown("b");
+ eventSender.keyDown("c");
+ }
+ }
+ </script>
+ </head>
+ <body onload="test()">
+ This tests that a negative outline-offset won't get in the way of a cursor in a text control.<br>
+ <input id="tf" style="font-size: 20px; border: solid thin black;" value="This tests that typing doesn't cut holes in the focus outline"></input>
+ </body>
+</html>
--- /dev/null
+a4130e3ca141dfe0181212ace7c1f1bf
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderText {#text} at (0,0) size 550x18
+ text run at (0,0) width 550: "This tests that a negative outline-offset won't get in the way of a cursor in a text control."
+ RenderBR {BR} at (550,14) size 0x0
+ RenderTextControl {INPUT} at (2,20) size 259x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+layer at (12,30) size 255x23
+ RenderBlock {DIV} at (2,2) size 255x23
+ RenderText {#text} at (1,0) size 34x23
+ text run at (1,0) width 34: "abc"
+caret: position 3 of child 0 {#text} of child 0 {DIV} of child 3 {INPUT} of child 1 {BODY} of child 0 {HTML} of document
+2007-12-04 Adele Peterson <adele@apple.com>
+
+ Reviewed by Darin.
+
+ Fix for <rdar://problem/5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges
+
+ * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::setStyle):
+ Adjust outline-offset so it doesn't extend beyond the border to interfere with typing
+
2007-12-04 Anders Carlsson <andersca@apple.com>
Reviewed by Jon.
if (m_cancelButton)
m_cancelButton->renderer()->setStyle(createCancelButtonStyle(style));
+ // Adjust outline-offset so it doesn't extend beyond the border to interfere with typing
+ int maxBorderWidth = max(style->borderLeftWidth(), max(style->borderRightWidth(), max(style->borderTopWidth(), style->borderBottomWidth())));
+ if (style->outlineOffset() < -maxBorderWidth)
+ style->setOutlineOffset(-maxBorderWidth);
+
setHasOverflowClip(false);
setReplaced(isInline());
}