WebKit Bugzilla
Attachment 362311 Details for
Bug 193599
: [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch and mismatch ref tests
bug-193599-20190218121229.patch (text/plain), 22.85 KB, created by
Daniel Bates
on 2019-02-18 12:12:29 PST
(
hide
)
Description:
Patch and mismatch ref tests
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-02-18 12:12:29 PST
Size:
22.85 KB
patch
obsolete
>Subversion Revision: 241299 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3de6940cb1f1cfd8713f59902f82b7c852e6efc3..3df42d2998747067660c653fee8e5816cca42d24 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2019-02-18 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour >+ https://bugs.webkit.org/show_bug.cgi?id=193599 >+ <rdar://problem/47399602> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS >+ for text fields, textareas, keygens, and selects so as to match the visual appearance of all >+ the other controls. >+ >+ Tests: fast/forms/focus-button.html >+ fast/forms/focus-checkbox.html >+ fast/forms/focus-checked-checkbox.html >+ fast/forms/focus-checked-radio.html >+ fast/forms/focus-radio.html >+ fast/forms/focus-reset-button.html >+ fast/forms/focus-search-field.html >+ fast/forms/focus-submit-button.html >+ fast/forms/focus-text-field.html >+ fast/forms/focus-textarea.html >+ >+ * css/html.css: >+ (:focus): Use 3px outline width. >+ (input:focus, textarea:focus, keygen:focus, select:focus): Do not include when building for iOS. >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::paintBoxDecorations): Write in terms of RenderTheme::adjustPaintRect(). >+ * rendering/RenderElement.cpp: >+ (WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect. >+ Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug. >+ * rendering/RenderTheme.h: >+ (WebCore::RenderTheme::adjustPaintRect const): Added. >+ * rendering/RenderThemeIOS.h: >+ * rendering/RenderThemeIOS.mm: >+ (WebCore::RenderThemeIOS::adjustPaintRect const): Added. Move iOS paint rect workaround from >+ RenderBox::paintBoxDecorations() to here. >+ > 2019-02-12 Andy Estes <aestes@apple.com> > > [iOSMac] Enable Parental Controls Content Filtering >diff --git a/Source/WebCore/css/html.css b/Source/WebCore/css/html.css >index 4c25559b02c40c385592e5ae808ba6cf45551d25..6992145fe4df91debe6d1f754080469dafcbe86c 100644 >--- a/Source/WebCore/css/html.css >+++ b/Source/WebCore/css/html.css >@@ -1162,7 +1162,11 @@ nobr { > /* states */ > > :focus { >+#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY >+ outline: auto 3px -webkit-focus-ring-color; >+#else > outline: auto 5px -webkit-focus-ring-color; >+#endif > } > > /* Read-only text fields do not show a focus ring but do still receive focus */ >@@ -1170,9 +1174,11 @@ html:focus, body:focus, input[readonly]:focus, applet:focus, embed:focus, iframe > outline: none; > } > >+#if !defined(WTF_PLATFORM_IOS_FAMILY) || !WTF_PLATFORM_IOS_FAMILY > input:focus, textarea:focus, keygen:focus, select:focus { > outline-offset: -2px; > } >+#endif > > input:matches([type="button"], [type="checkbox"], [type="file"], [type="hidden"], [type="image"], [type="radio"], [type="reset"], [type="search"], [type="submit"]):focus, > input[type="file"]:focus::-webkit-file-upload-button { >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index 7bd279b06dd0d46e8a2ff91dee68fca3b938cfc4..79e413efb153877e25427eb29d2711b0282889d4 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -1299,15 +1299,8 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai > LayoutRect paintRect = borderBoxRectInFragment(nullptr); > paintRect.moveBy(paintOffset); > adjustBorderBoxRectForPainting(paintRect); >+ theme().adjustPaintRect(*this, paintRect); > >-#if PLATFORM(IOS_FAMILY) >- // Workaround for <rdar://problem/6209763>. Force the painting bounds of checkboxes and radio controls to be square. >- if (style().appearance() == CheckboxPart || style().appearance() == RadioPart) { >- int width = std::min(paintRect.width(), paintRect.height()); >- int height = width; >- paintRect = IntRect(paintRect.x(), paintRect.y() + (this->height() - height) / 2, width, height); // Vertically center the checkbox, like on desktop >- } >-#endif > BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(paintInfo.context()); > > // FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have >diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp >index 96d4a3c2abfc1562aaf023f2d47d05fa66ef6a3c..a98f64542a968a3b644429084501823cb7cd9099 100644 >--- a/Source/WebCore/rendering/RenderElement.cpp >+++ b/Source/WebCore/rendering/RenderElement.cpp >@@ -1896,7 +1896,9 @@ void RenderElement::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRe > // Only paint the focus ring by hand if the theme isn't able to draw it. > if (styleToUse.outlineStyleIsAuto() == OutlineIsAuto::On && !theme().supportsFocusRing(styleToUse)) { > Vector<LayoutRect> focusRingRects; >- addFocusRingRects(focusRingRects, paintRect.location(), paintInfo.paintContainer); >+ LayoutRect paintRectToUse { paintRect }; >+ theme().adjustPaintRect(*this, paintRectToUse); >+ addFocusRingRects(focusRingRects, paintRectToUse.location(), paintInfo.paintContainer); > paintFocusRing(paintInfo, styleToUse, focusRingRects); > } > >diff --git a/Source/WebCore/rendering/RenderTheme.h b/Source/WebCore/rendering/RenderTheme.h >index 471a9a3a4b53caf929464b8664075a10c19f20d6..f988fe2ee93682612c8eee42a4b3ad3322feb04d 100644 >--- a/Source/WebCore/rendering/RenderTheme.h >+++ b/Source/WebCore/rendering/RenderTheme.h >@@ -121,6 +121,9 @@ public: > // A general method asking if any control tinting is supported at all. > virtual bool supportsControlTints() const { return false; } > >+ // Some controls want to adjust where they are painted for centering purposes. >+ virtual void adjustPaintRect(const RenderObject&, LayoutRect&) const { } >+ > // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint, > // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control. > virtual void adjustRepaintRect(const RenderObject&, FloatRect&); >diff --git a/Source/WebCore/rendering/RenderThemeIOS.h b/Source/WebCore/rendering/RenderThemeIOS.h >index ed8927fc4bdca0f53a8ccf49cf4466797c03adef..a463478fd1b69783bb465f30147cc9e5ae5ebb12 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.h >+++ b/Source/WebCore/rendering/RenderThemeIOS.h >@@ -68,6 +68,8 @@ protected: > > bool isControlStyled(const RenderStyle&, const BorderData&, const FillLayer& background, const Color& backgroundColor) const override; > >+ void adjustPaintRect(const RenderObject&, LayoutRect&) const final; >+ > // Methods for each appearance value. > void adjustCheckboxStyle(StyleResolver&, RenderStyle&, const Element*) const override; > bool paintCheckboxDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override; >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index 1493496823c265892cbd194e2063fa31bab5718b..5a679d4dfd44120d824f150ca1febc7a7de7f3b0 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -375,6 +375,16 @@ static void drawJoinedLines(CGContextRef context, const Vector<CGPoint>& points, > CGContextStrokePath(context); > } > >+void RenderThemeIOS::adjustPaintRect(const RenderObject& renderer, LayoutRect& paintRect) const >+{ >+ if (renderer.style().appearance() != CheckboxPart && renderer.style().appearance() != RadioPart) >+ return; >+ // Workaround for <rdar://problem/6209763>. Force the painting bounds of checkboxes and radio controls to be square. >+ int width = std::min(paintRect.width(), paintRect.height()); >+ int height = width; >+ paintRect = IntRect { paintRect.x(), paintRect.y() + (downcast<RenderBox>(renderer).height() - height) / 2, width, height }; // Vertically center the checkbox, like on desktop. >+} >+ > bool RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect) > { > GraphicsContextStateSaver stateSaver(paintInfo.context()); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2de7ea2b521d28137bdac6c7cdc758d43d3d32aa..753d1a8b0f83c6d2020948e075b25f56bd19778a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,39 @@ >+2019-02-18 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour >+ https://bugs.webkit.org/show_bug.cgi?id=193599 >+ <rdar://problem/47399602> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Ideally we should find a way to write non-pixel tests for focus rings. For now, add some mismatch ref >+ tests. >+ >+ We cannot write a "good" mismatch ref test for <select> at the moment since there is no way to defocus >+ a <select> without closing its popup. We also cannot change outline-color when outline-style: auto is >+ used and outline-style: auto is needed to get shrink-wrapped focus rings :( >+ >+ * fast/forms/focus-button-expected-mismatch.html: Added. >+ * fast/forms/focus-button.html: Added. >+ * fast/forms/focus-checkbox-expected-mismatch.html: Added. >+ * fast/forms/focus-checkbox.html: Added. >+ * fast/forms/focus-checked-checkbox-expected-mismatch.html: Added. >+ * fast/forms/focus-checked-checkbox.html: Added. >+ * fast/forms/focus-checked-radio-expected-mismatch.html: Added. >+ * fast/forms/focus-checked-radio.html: Added. >+ * fast/forms/focus-radio-expected-mismatch.html: Added. >+ * fast/forms/focus-radio.html: Added. >+ * fast/forms/focus-reset-button-expected-mismatch.html: Added. >+ * fast/forms/focus-reset-button.html: Added. >+ * fast/forms/focus-search-field-expected-mismatch.html: Added. >+ * fast/forms/focus-search-field.html: Added. >+ * fast/forms/focus-submit-button-expected-mismatch.html: Added. >+ * fast/forms/focus-submit-button.html: Added. >+ * fast/forms/focus-text-field-expected-mismatch.html: Added. >+ * fast/forms/focus-text-field.html: Added. >+ * fast/forms/focus-textarea-expected-mismatch.html: Added. >+ * fast/forms/focus-textarea.html: Added. >+ > 2018-12-05 Daniel Bates <dabates@apple.com> > > [iOS] Add test to ensure that a web page can prevent the default for Command + A >diff --git a/LayoutTests/fast/forms/focus-button-expected-mismatch.html b/LayoutTests/fast/forms/focus-button-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d9363b0fded7add2bf4a3653e350ee78cf6ea558 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-button-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<button>Button</button> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-button.html b/LayoutTests/fast/forms/focus-button.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2bb0a85c6fdeff7b9ec98a41d18d82649a3c6f0b >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-button.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+</head> >+<body> >+<button id="test">Button</button> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-checkbox-expected-mismatch.html b/LayoutTests/fast/forms/focus-checkbox-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..441ee3c035e265056117666d2713842a58c8156b >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-checkbox-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="checkbox"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-checkbox.html b/LayoutTests/fast/forms/focus-checkbox.html >new file mode 100644 >index 0000000000000000000000000000000000000000..baee64f4dbacab1bf574d8bf065dbe2fbe09bfa1 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-checkbox.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<input id="test" type="checkbox"> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-checked-checkbox-expected-mismatch.html b/LayoutTests/fast/forms/focus-checked-checkbox-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8a4383df9758c0c310a5989f2ff237449eb8a4b3 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-checked-checkbox-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="checkbox" checked> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-checked-checkbox.html b/LayoutTests/fast/forms/focus-checked-checkbox.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9cd6a0bcea996ce1658dfb1d6d6694c8bf609da3 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-checked-checkbox.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<input id="test" type="checkbox" checked> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-checked-radio-expected-mismatch.html b/LayoutTests/fast/forms/focus-checked-radio-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..00766deb1431a398eed1c55c455b288bb71b395c >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-checked-radio-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="radio" checked> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-checked-radio.html b/LayoutTests/fast/forms/focus-checked-radio.html >new file mode 100644 >index 0000000000000000000000000000000000000000..91154e484cefe23a5595b55cf229ffa2ccfa94bf >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-checked-radio.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<input id="test" type="radio" checked> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-radio-expected-mismatch.html b/LayoutTests/fast/forms/focus-radio-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4f07a7797a8696539d06942b654475a081f1aa96 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-radio-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="radio"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-radio.html b/LayoutTests/fast/forms/focus-radio.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ca98d21809c01a19809d100c915f7a5bfa174973 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-radio.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<input id="test" type="radio"> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-reset-button-expected-mismatch.html b/LayoutTests/fast/forms/focus-reset-button-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..871d2fc242c1fe1cfb6519a47d8238151d232718 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-reset-button-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="reset"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-reset-button.html b/LayoutTests/fast/forms/focus-reset-button.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6aac0abf1e53c99176ab47ad6e1ba3683bfff941 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-reset-button.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+</head> >+<body> >+<input id="test" type="reset"> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-search-field-expected-mismatch.html b/LayoutTests/fast/forms/focus-search-field-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..934722bc03bbb327b8ac063028855d1d955f4b4e >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-search-field-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="search"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-search-field.html b/LayoutTests/fast/forms/focus-search-field.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c2cc669a507f8bc3f5b0992c61392e5c4ab971b9 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-search-field.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<input id="test" type="search"> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-submit-button-expected-mismatch.html b/LayoutTests/fast/forms/focus-submit-button-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e648275d6542f88a6c7d23f36e737b29c2f9c0cb >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-submit-button-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="submit"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-submit-button.html b/LayoutTests/fast/forms/focus-submit-button.html >new file mode 100644 >index 0000000000000000000000000000000000000000..70fd07565d6636b49ae0d30818f771bdc4c1024e >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-submit-button.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+</head> >+<body> >+<input id="test" type="submit"> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-text-field-expected-mismatch.html b/LayoutTests/fast/forms/focus-text-field-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5008bfbeed9533278e9d960525276b8c8968f939 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-text-field-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<input type="text"> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-text-field.html b/LayoutTests/fast/forms/focus-text-field.html >new file mode 100644 >index 0000000000000000000000000000000000000000..1de76e4c9a4baad09bb9f68963befc25c93930b1 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-text-field.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<input id="test" type="text"> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-textarea-expected-mismatch.html b/LayoutTests/fast/forms/focus-textarea-expected-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0d83e68c2d21525a92db68f27a3f20ca866228c3 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-textarea-expected-mismatch.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<textarea></textarea> >+</body> >+</html> >diff --git a/LayoutTests/fast/forms/focus-textarea.html b/LayoutTests/fast/forms/focus-textarea.html >new file mode 100644 >index 0000000000000000000000000000000000000000..013c6fe3da09cee305f4c176ea38da61561d9098 >--- /dev/null >+++ b/LayoutTests/fast/forms/focus-textarea.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+input { >+ caret-color: transparent; >+} >+</style> >+</head> >+<body> >+<textarea id="test"></textarea> <!-- Test PASSED if there is a focus ring --> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ let testElement = document.getElementById("test"); >+ testElement.addEventListener("focus", () => testRunner.notifyDone(), { once: true }); >+ UIHelper.keyDown("\t", ["altKey"]); >+} >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193599
:
362302
|
362307
|
362311
|
362312
|
362330
|
362333
|
362344
|
362347