[iOS] REGRESSION (r250398) Layout Test fast/history/page-cache-element-state-focused.html is failing
https://bugs.webkit.org/show_bug.cgi?id=202712
<rdar://problem/56082428>

Reviewed by Antti Koivisto.

The test was failing depending on the order in which the tests were executed. The reason is that
elements would either use the full UA stylesheet (html.css) or the simple one in CSSDefaultStyleSheets.cpp.
Unfortunately, the outline-width was different on iOS between the simple stylesheet and the full one, causing
the test output to look different depending on which stylesheet was used.

Address the issue by making sure that the outline-width is 3px on IOS_FAMILY in the simple stylesheet, to
be consistent with the value in the full stylesheet (html.css).

* css/CSSDefaultStyleSheets.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@250912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index f4f8be6..57ff316 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2019-10-09  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] REGRESSION (r250398) Layout Test fast/history/page-cache-element-state-focused.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=202712
+        <rdar://problem/56082428>
+
+        Reviewed by Antti Koivisto.
+
+        The test was failing depending on the order in which the tests were executed. The reason is that
+        elements would either use the full UA stylesheet (html.css) or the simple one in CSSDefaultStyleSheets.cpp.
+        Unfortunately, the outline-width was different on iOS between the simple stylesheet and the full one, causing
+        the test output to look different depending on which stylesheet was used.
+
+        Address the issue by making sure that the outline-width is 3px on IOS_FAMILY in the simple stylesheet, to
+        be consistent with the value in the full stylesheet (html.css).
+
+        * css/CSSDefaultStyleSheets.cpp:
+
 2019-10-09  Zalan Bujtas  <zalan@apple.com>
 
         [LFC][Painting] Decouple content and decoration painting
diff --git a/Source/WebCore/css/CSSDefaultStyleSheets.cpp b/Source/WebCore/css/CSSDefaultStyleSheets.cpp
index e5ae8b7..340fd9d 100644
--- a/Source/WebCore/css/CSSDefaultStyleSheets.cpp
+++ b/Source/WebCore/css/CSSDefaultStyleSheets.cpp
@@ -80,14 +80,21 @@
 StyleSheetContents* CSSDefaultStyleSheets::colorInputStyleSheet;
 #endif
 
-// FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
-#if HAVE(OS_DARK_MODE_SUPPORT)
-// The only difference in the simple style sheet for dark mode is the addition of html{color:text}.
-static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}html{color:text}head{display:none}body{margin:8px}div:focus,span:focus,a:focus{outline:auto 5px -webkit-focus-ring-color}a:any-link{color:-webkit-link;text-decoration:underline}a:any-link:active{color:-webkit-activelink}";
+#if PLATFORM(IOS_FAMILY)
+#define DEFAULT_OUTLINE_WIDTH "3px"
 #else
-static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}head{display:none}body{margin:8px}div:focus,span:focus,a:focus{outline:auto 5px -webkit-focus-ring-color}a:any-link{color:-webkit-link;text-decoration:underline}a:any-link:active{color:-webkit-activelink}";
+#define DEFAULT_OUTLINE_WIDTH "5px"
 #endif
 
+#if HAVE(OS_DARK_MODE_SUPPORT)
+#define CSS_DARK_MODE_ADDITION "html{color:text}"
+#else
+#define CSS_DARK_MODE_ADDITION ""
+#endif
+
+// FIXME: It would be nice to use some mechanism that guarantees this is in sync with the real UA stylesheet.
+static const char* simpleUserAgentStyleSheet = "html,body,div{display:block}" CSS_DARK_MODE_ADDITION "head{display:none}body{margin:8px}div:focus,span:focus,a:focus{outline:auto " DEFAULT_OUTLINE_WIDTH " -webkit-focus-ring-color}a:any-link{color:-webkit-link;text-decoration:underline}a:any-link:active{color:-webkit-activelink}";
+
 static inline bool elementCanUseSimpleDefaultStyle(const Element& element)
 {
     return is<HTMLHtmlElement>(element) || is<HTMLHeadElement>(element)