Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Swap check for Widget and WebElement - Allows Widget extensions to im… #2277

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iFatRain
Copy link

Change list

  • Swaps the order of decoration checking from WebElement first to Widget first.

Types of changes

Changes Widget init. to enable a little more flexibility in use cases.

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

  • Currently, if an user wishes for their Widget extension to implement the WebElement interface and thus be used interchangeably as a WebElement (removing the need to always call getWrappedElement() when you wish to do so). However current order of operations will always check for WebElement first (Which works when WebElement is implemented) and thus prevents correct Widget decoration from happening. This change, which may come at a slight performance cost when normal WebElements are used, should enable Widget extensions to implement the WebElement interface.

Copy link

linux-foundation-easycla bot commented Mar 10, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@iFatRain iFatRain changed the title Swap check for Widget and WebElement - Allows Widget extensions to im… feat: Swap check for Widget and WebElement - Allows Widget extensions to im… Mar 10, 2025
@@ -193,8 +193,8 @@ protected boolean isDecoratableList(Field field) {
* @return a field value or null.
*/
public Object decorate(ClassLoader ignored, Field field) {
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be also possible to add a test which verifies this behavior?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do so yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants