Title: [284070] trunk/Source/WebCore
Revision
284070
Author
[email protected]
Date
2021-10-12 17:59:57 -0700 (Tue, 12 Oct 2021)

Log Message

Implement alternate style for textarea
https://bugs.webkit.org/show_bug.cgi?id=231560

Reviewed by Devin Rousso.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintTextFieldDecorations):
(WebCore::RenderThemeIOS::adjustTextAreaStyle const):
Do the same as r283962, but for <textarea>; give it an inner shadow and
remove its border when using the alternate appearance.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (284069 => 284070)


--- trunk/Source/WebCore/ChangeLog	2021-10-13 00:43:11 UTC (rev 284069)
+++ trunk/Source/WebCore/ChangeLog	2021-10-13 00:59:57 UTC (rev 284070)
@@ -1,3 +1,17 @@
+2021-10-12  Tim Horton  <[email protected]>
+
+        Implement alternate style for textarea
+        https://bugs.webkit.org/show_bug.cgi?id=231560
+
+        Reviewed by Devin Rousso.
+
+        * rendering/RenderThemeIOS.h:
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::paintTextFieldDecorations):
+        (WebCore::RenderThemeIOS::adjustTextAreaStyle const):
+        Do the same as r283962, but for <textarea>; give it an inner shadow and
+        remove its border when using the alternate appearance.
+
 2021-10-12  Kate Cheney  <[email protected]>
 
         CSP: Implement unsafe-hashes

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.h (284069 => 284070)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.h	2021-10-13 00:43:11 UTC (rev 284069)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h	2021-10-13 00:59:57 UTC (rev 284070)
@@ -93,6 +93,7 @@
 
     void adjustTextFieldStyle(RenderStyle&, const Element*) const final;
     void paintTextFieldDecorations(const RenderBox&, const PaintInfo&, const FloatRect&) override;
+    void adjustTextAreaStyle(RenderStyle&, const Element*) const final;
     void paintTextAreaDecorations(const RenderBox&, const PaintInfo&, const FloatRect&) override;
 
     void paintTextFieldInnerShadow(const PaintInfo&, const FloatRoundedRect&);

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (284069 => 284070)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2021-10-13 00:43:11 UTC (rev 284069)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2021-10-13 00:59:57 UTC (rev 284070)
@@ -54,6 +54,7 @@
 #import "HTMLMeterElement.h"
 #import "HTMLNames.h"
 #import "HTMLSelectElement.h"
+#import "HTMLTextAreaElement.h"
 #import "IOSurface.h"
 #import "Icon.h"
 #import "LocalCurrentTraitCollection.h"
@@ -602,7 +603,8 @@
             auto& input = downcast<HTMLInputElement>(*element);
             if (input.isTextField() && !input.isSearchField())
                 shouldPaintFillAndInnerShadow = true;
-        }
+        } else if (is<HTMLTextAreaElement>(*element))
+            shouldPaintFillAndInnerShadow = true;
 
         bool useAlternateDesign = box.settings().alternateFormControlDesignEnabled();
         if (useAlternateDesign && shouldPaintFillAndInnerShadow) {
@@ -630,6 +632,18 @@
     }
 }
 
+void RenderThemeIOS::adjustTextAreaStyle(RenderStyle& style, const Element* element) const
+{
+    if (!element)
+        return;
+
+    if (!element->document().settings().alternateFormControlDesignEnabled())
+        return;
+
+    style.setBackgroundColor(Color::transparentBlack);
+    style.resetBorderExceptRadius();
+}
+
 void RenderThemeIOS::paintTextAreaDecorations(const RenderBox& box, const PaintInfo& paintInfo, const FloatRect& rect)
 {
     paintTextFieldDecorations(box, paintInfo, rect);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to