haikuwebkit/Source/WebCore/editing/ios
Darin Adler 98fcdaf5fd output element doesn't react properly to node tree mutations
https://bugs.webkit.org/show_bug.cgi?id=196532

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/custom-elements/builtin-coverage-expected.txt:
Updated since HTMLOptionElement now has a constructor. Still not passing, but closer to correct.

* web-platform-tests/custom-elements/form-associated/form-reset-callback-expected.txt:
Updated due to changes in HTMLOptionElement, but still not passing.

* web-platform-tests/html/semantics/forms/the-output-element/mutations.window-expected.txt:
Updated to reflect passing test.

* web-platform-tests/html/semantics/forms/the-output-element/mutations.window.js:
Updated to a newer version of the upstream version of this. Decided to just update this one file
rather than importing the latest version across more tests at this time.

Source/WebCore:

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::replaceAll): Refactored most of the functions
replaceAllChildren and replaceAllChildrenWithNewText into this new one,
and named it based on the name of the operation in the HTML specification.
The function is incomplete, but preserves existing behavior.
(WebCore::ContainerNode::stringReplaceAll): Refactored the rest of the
replaceAllChildrenWithNewText function and renamed to the name from the
HTML specification.
* dom/ContainerNode.h: Updated for the above changes.

* dom/Node.cpp:
(WebCore::Node::setTextContent): Updated for name change above.
* dom/Range.cpp:
(WebCore::Range::surroundContents): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAsChildOfElement): Ditto.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText): Ditto.

* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::HTMLOutputElement): Moved data member
initialization into the class definition.
(WebCore::HTMLOutputElement::create): Added an overload that takes just
a document, for use when invoked from as a constructor.
(WebCore::HTMLOutputElement::parseAttribute): Tightened the logic for the
for attribute. I decided it's better to call through to the base class, even
though we often don't do that for attributes that don't expect the base
class to pay attention to.
(WebCore::HTMLOutputElement::childrenChanged): Deleted. No need for this in
the improved HTML specification version of this element's algorithms.
(WebCore::HTMLOutputElement::reset): Updated based on the HTML specification,
using the default value algorithm rather than the default value mode flag we
were using before.
(WebCore::HTMLOutputElement::setValue): Updated based on the HTML specification,
always setting the default value override based on the current default value,
and using stringReplaceAll. There's no need for the old setTextContentInternal,
since that was all due to the need to avoid infinite recursion in childrenChanged.
(WebCore::HTMLOutputElement::defaultValue const): Updated based on the HTML
specification, deriving the default value from the default value override and
the descendant text content.
(WebCore::HTMLOutputElement::setDefaultValue): Updated based on the HTML
specification, doing a string replace all with the value if the default
value override is null, and updating the default value override otherwise.
(WebCore::HTMLOutputElement::htmlFor): Updated to rename m_tokens to m_forTokens.
(WebCore::HTMLOutputElement::setTextContentInternal): Deleted.

* html/HTMLOutputElement.h: Moved DOMTokenList to be a forward declaration
instead of an include. Adde a constructor that takes only a document to be used
from JavaScript. Made the canContainRangeEndPoint override be private like the
other overrides. Removed the childrenChange override and the
setTextContentInternal function. Removed m_isDefaultValueMode,
m_isSetTextContentInProgress, and m_defaultValue. Added m_defaultValueOverride.
Renamed m_tokens to m_forTokens.

* html/HTMLOutputElement.idl: Updated to match the HTML specification. This
involved adding a constructor, adding SameObject for the htmlFor attribute,
making the form attribute nullable, and removing [LegacyNullToEmptyString]
from the defaultValue and value attributes.

LayoutTests:

* TestExpectations: Removed an expectation for a directory that no longer exists.
* platform/mac-wk2/TestExpectations: Removed an expectation for a test that no longer exists.
* platform/mac/TestExpectations: Removed an expectation for a directory that no longer exists.

* platform/gtk/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/custom-elements/builtin-coverage-expected.txt:
Updated since HTMLOptionElement now has a constructor. Still not passing, but closer to correct.


Canonical link: https://commits.webkit.org/237755@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-15 02:05:22 +00:00
..
DictationCommandIOS.cpp
DictationCommandIOS.h
EditorIOS.mm output element doesn't react properly to node tree mutations 2021-05-15 02:05:22 +00:00