Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
REGRESSION (Safari 16.4): Dynamically set
<meter>
doesn't show the …
…value https://bugs.webkit.org/show_bug.cgi?id=255914 rdar://108495001 Reviewed by Tim Horton. 257981@main began the process of refactoring form control rendering to support the GPU process on macOS. Since the refactoring, form controls are represented by various `ControlPart` subclasses, which can be drawn using a `GraphicsContext`. For the more customizable controls (such as <meter>, <progress>, <input type=range>, and Apple Pay buttons), form control state is encoded directly on the `ControlPart` subclass. The `ControlPart` is only created once per renderer in the various flavors of `RenderTheme::ensureControlPart`. Consequently, the a form control's updated state is never reflected in the `ControlPart` once it has been created. This results in dynamic changes to state not being reflected in painting. To fix, ensure the `ControlPart` is up-to-date with the latest state prior to painting. * LayoutTests/TestExpectations: * LayoutTests/fast/css/appearance-apple-pay-button-style-dynamic-update-expected.html: Added. * LayoutTests/fast/css/appearance-apple-pay-button-style-dynamic-update.html: Added. * LayoutTests/fast/forms/meter-dynamic-update-expected.html: Added. * LayoutTests/fast/forms/meter-dynamic-update.html: Added. * LayoutTests/fast/forms/progress-dynamic-update-expected.html: Added. * LayoutTests/fast/forms/progress-dynamic-update.html: Added. * LayoutTests/fast/forms/range-datalist-dynamic-update-expected.html: Added. * LayoutTests/fast/forms/range-datalist-dynamic-update.html: Added. * LayoutTests/platform/ios/TestExpectations: * LayoutTests/platform/mac/TestExpectations: * Source/WebCore/platform/graphics/controls/ApplePayButtonPart.cpp: (WebCore::ApplePayButtonPart::create): * Source/WebCore/platform/graphics/controls/ApplePayButtonPart.h: (WebCore::ApplePayButtonPart::setButtonType): (WebCore::ApplePayButtonPart::setButtonStyle): (WebCore::ApplePayButtonPart::setLocale): * Source/WebCore/platform/graphics/controls/MeterPart.cpp: (WebCore::MeterPart::create): * Source/WebCore/platform/graphics/controls/MeterPart.h: (WebCore::MeterPart::setGaugeRegion): (WebCore::MeterPart::setValue): (WebCore::MeterPart::setMinimum): (WebCore::MeterPart::setMaximum): * Source/WebCore/platform/graphics/controls/ProgressBarPart.cpp: (WebCore::ProgressBarPart::create): * Source/WebCore/platform/graphics/controls/ProgressBarPart.h: (WebCore::ProgressBarPart::setPosition): (WebCore::ProgressBarPart::setAnimationStartTime): * Source/WebCore/platform/graphics/controls/SliderTrackPart.cpp: (WebCore::SliderTrackPart::create): * Source/WebCore/platform/graphics/controls/SliderTrackPart.h: (WebCore::SliderTrackPart::setThumbSize): (WebCore::SliderTrackPart::setTrackBounds): (WebCore::SliderTrackPart::setTickRatios): * Source/WebCore/rendering/RenderTheme.cpp: (WebCore::updateApplePayButtonPartForRenderer): (WebCore::updateMeterPartForRenderer): (WebCore::updateProgressBarPartForRenderer): (WebCore::updateSliderTrackPartForRenderer): (WebCore::RenderTheme::createControlPart const): Don't capture any state on creation, it is only necessary for painting, and will be set prior to drawing. (WebCore::RenderTheme::updateControlPartForRenderer const): Update the `ControlPart` based on the latest state, only for controls that require additional state. (WebCore::RenderTheme::paint): Ensure the `ControlPart` state is up-to-date prior to painting. (WebCore::createApplePayButtonPartForRenderer): Deleted. (WebCore::createMeterPartForRenderer): Deleted. (WebCore::createProgressBarPartForRenderer): Deleted. (WebCore::createSliderTrackPartForRenderer): Deleted. * Source/WebCore/rendering/RenderTheme.h: Canonical link: https://commits.webkit.org/263473@main
- Loading branch information
Showing
21 changed files
with
208 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/css/appearance-apple-pay-button-style-dynamic-update-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<button id="button" style="-webkit-appearance: -apple-pay-button; -apple-pay-button-style: white;"></button> |
33 changes: 33 additions & 0 deletions
33
LayoutTests/fast/css/appearance-apple-pay-button-style-dynamic-update.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<style> | ||
|
||
#button { | ||
-webkit-appearance: -apple-pay-button; | ||
} | ||
|
||
.white { | ||
-apple-pay-button-style: white; | ||
} | ||
|
||
.black { | ||
-apple-pay-button-style: black; | ||
} | ||
|
||
</style> | ||
<script> | ||
|
||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
function load() | ||
{ | ||
setTimeout(() => { | ||
button.className = "white"; | ||
|
||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 0); | ||
} | ||
|
||
</script> | ||
<body onload="load()"> | ||
<button id="button" class="black"></button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<meter id="meter" max="100" low="20" high="80" optimum="90" value="18"></meter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script> | ||
|
||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
function load() | ||
{ | ||
setTimeout(() => { | ||
meter.max = 100; | ||
meter.low = 20; | ||
meter.high = 80; | ||
meter.optimum = 90; | ||
meter.value = 18; | ||
|
||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 0); | ||
} | ||
|
||
</script> | ||
<body onload="load()"> | ||
<meter id="meter"></meter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<progress id="progress" max="100" value="70"></progress> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script> | ||
|
||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
function load() | ||
{ | ||
setTimeout(() => { | ||
progress.value = 70; | ||
|
||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 0); | ||
} | ||
|
||
</script> | ||
<body onload="load()"> | ||
<progress id="progress" max="100" value="50"></progress> |
8 changes: 8 additions & 0 deletions
8
LayoutTests/fast/forms/range-datalist-dynamic-update-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<input type="range" id="range" list="markers"> | ||
<datalist id="markers"> | ||
<option value="0"></option> | ||
<option value="25"></option> | ||
<option value="50"></option> | ||
<option value="75"></option> | ||
<option value="100"></option> | ||
</datalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script> | ||
|
||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
function load() | ||
{ | ||
setTimeout(() => { | ||
range.setAttribute("list", "markers"); | ||
|
||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}, 0); | ||
} | ||
|
||
</script> | ||
<body onload="load()"> | ||
<input type="range" id="range"> | ||
<datalist id="markers"> | ||
<option value="0"></option> | ||
<option value="25"></option> | ||
<option value="50"></option> | ||
<option value="75"></option> | ||
<option value="100"></option> | ||
</datalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.