0

Element::parserSetAttributes shouldn't trigger shadow tree constructi… · WebKit/...

 4 weeks ago
source link: https://github.com/WebKit/WebKit/commit/66bf68c9f4593eecb8dc370eb0761cb7a0e1ae77
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Commit

Permalink

Element::parserSetAttributes shouldn't trigger shadow tree constructi…

Browse files Browse the repository at this point in the history

…on in TextFieldInputType::attributeChanged

https://bugs.webkit.org/show_bug.cgi?id=267936

Reviewed by Aditya Keerthi and Yusuke Suzuki.

Don't construct shadow tree in TextFieldInputType::attributeChanged.

* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType): Sanitize the value before calling createShadowSubtreeIfNeeded. Otherwise,
we can assert in NumberInputType::localizeValue for example.

* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):

* Source/WebCore/html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue const): Now checks visibleValue() when the shadow tree doesn't exist yet.
(WebCore::TextFieldInputType::createShadowSubtree): Update the inner text value after creating the shadow tree.
(WebCore::TextFieldInputType::attributeChanged): Fixed the code so that it no longer constructs the shadow tree.

* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::visiblePlaceholder): Update the style / layout so that the shadow tree will get created.

Canonical link: https://commits.webkit.org/273461@main
rniwa committed Jan 25, 2024
1 parent 22343e6 commit 66bf68c

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK