Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e9a6fa1fde2f2e0f229e2216a2292af5c40fa977
      
https://github.com/WebKit/WebKit/commit/e9a6fa1fde2f2e0f229e2216a2292af5c40fa977
  Author: Aditya Keerthi <akeer...@apple.com>
  Date:   2025-04-28 (Mon, 28 Apr 2025)

  Changed paths:
    A LayoutTests/fast/forms/input-text-padding-expected.txt
    A LayoutTests/fast/forms/input-text-padding.html
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/rendering/style/RenderStyleSetters.h
    M Source/WebCore/rendering/style/StyleSurroundData.cpp
    M Source/WebCore/rendering/style/StyleSurroundData.h
    M Source/WebCore/style/StyleBuilderCustom.h

  Log Message:
  -----------
  Add a mechanism to detect when authors have specified their own padding on 
form controls
https://bugs.webkit.org/show_bug.cgi?id=292186
rdar://148454896

Reviewed by Richard Robinson.

Introduce `RenderStyle::hasExplicitlySetPadding` to detect when authors have
specified padding.

Add a test that verifies that padding can be customized on text inputs.

* LayoutTests/fast/forms/input-text-padding-expected.txt: Added.
* LayoutTests/fast/forms/input-text-padding.html: Added.
* Source/WebCore/css/CSSProperties.json:

The code generator does not yet handle the "has explicitly set" pattern,
so opt in to custom code.

* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::hasExplicitlySetPadding const):
(WebCore::RenderStyle::hasExplicitlySetPaddingBottom const):
(WebCore::RenderStyle::hasExplicitlySetPaddingLeft const):
(WebCore::RenderStyle::hasExplicitlySetPaddingRight const):
(WebCore::RenderStyle::hasExplicitlySetPaddingTop const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setHasExplicitlySetPaddingBottom):
(WebCore::RenderStyle::setHasExplicitlySetPaddingLeft):
(WebCore::RenderStyle::setHasExplicitlySetPaddingRight):
(WebCore::RenderStyle::setHasExplicitlySetPaddingTop):
* Source/WebCore/rendering/style/StyleSurroundData.cpp:
(WebCore::StyleSurroundData::StyleSurroundData):
(WebCore::StyleSurroundData::operator== const):
(WebCore::StyleSurroundData::dumpDifferences const):
* Source/WebCore/rendering/style/StyleSurroundData.h:

The 4 newly added bits fit in unused bits, and the size of `StyleSurroundData`
remains the same.

* Source/WebCore/style/StyleBuilderCustom.h:

Set the "has explicitly set" flag when the value is applied from the
author-origin.

(WebCore::Style::BuilderCustom::applyInitialPaddingBottom):
(WebCore::Style::BuilderCustom::applyInheritPaddingBottom):
(WebCore::Style::BuilderCustom::applyValuePaddingBottom):
(WebCore::Style::BuilderCustom::applyInitialPaddingLeft):
(WebCore::Style::BuilderCustom::applyInheritPaddingLeft):
(WebCore::Style::BuilderCustom::applyValuePaddingLeft):
(WebCore::Style::BuilderCustom::applyInitialPaddingRight):
(WebCore::Style::BuilderCustom::applyInheritPaddingRight):
(WebCore::Style::BuilderCustom::applyValuePaddingRight):
(WebCore::Style::BuilderCustom::applyInitialPaddingTop):
(WebCore::Style::BuilderCustom::applyInheritPaddingTop):
(WebCore::Style::BuilderCustom::applyValuePaddingTop):

Canonical link: https://commits.webkit.org/294232@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to